sunlupeng 2 éve
szülő
commit
631b6538fb

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
     "axios": "0.17.1",
     "clipboard": "1.7.1",
     "echarts": "3.8.5",
-    "element-ui": "2.0.8",
+    "element-ui": "^2.15.12",
     "file-saver": "1.3.3",
     "font-awesome": "4.7.0",
     "js-cookie": "2.2.0",

+ 20 - 1
src/api/rankingList.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 
 
-
+// 积分排行
 export function list(query) {
   return request({
     url: '/mall-integral/sys/top',
@@ -9,3 +9,22 @@ export function list(query) {
     params:query
   })
 }
+
+// 答题排行
+export function answerList(query) {
+  return request({
+    url: '/answer/admin/top',
+    method: 'get',
+    params:query
+  })
+}
+
+// 游戏排行
+export function gameList(query) {
+  return request({
+    url: '/MoonFestival/admin/top',
+    method: 'get',
+    params:query
+  })
+}
+

+ 5 - 1
src/permission.js

@@ -92,7 +92,11 @@ const myRoles = [
 
   'postManage',
   'postList',
-  'postApprovalList'
+  'postApprovalList',
+
+  'rankingManage',
+  'answerRanking',
+  'gameRanking'
 ]
 
 router.beforeEach((to, from, next) => {

+ 15 - 0
src/router/index.js

@@ -314,6 +314,21 @@ export const asyncRouterMap = [
     ]
   },
 
+  {
+    path: '/rankingManage',
+    component: Layout,
+    redirect: 'noredirect',
+    name: 'rankingManage',
+    meta: {
+      title: '排行管理',
+      icon: 'zhengshu'
+    },
+    children: [
+      { path: 'answerRanking', component: _import('rankingManage/answerRanking'), name: 'answerRanking', meta: { title: '答题排行', noCache: true }},
+      { path: 'gameRanking', component: _import('rankingManage/gameRanking'), name: 'gameRanking', meta: { title: '游戏排行', noCache: true}},
+    ]
+  },
+
 
 
   {

+ 149 - 0
src/views/rankingManage/answerRanking.vue

@@ -0,0 +1,149 @@
+<template>
+    <div class="app-container calendar-list-container exchangeView">
+        <!-- 查询和其他操作 -->
+        <div class="filter-container">
+            <el-input clearable class="filter-item" style="width: 200px;" placeholder="员工名称"
+                v-model="listQuery.userName"></el-input>
+                <el-date-picker
+            class="filter-item"
+            value-format="yyyy-MM-dd"
+            v-model="listQuery.createTime"
+            type="date"
+            placeholder="创建日期">
+            </el-date-picker>
+            <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
+            <!-- <el-button class="filter-item" type="primary" v-waves icon="el-icon-download" @click="handleDownLoad">导出</el-button> -->
+
+        </div>
+
+        <!-- 查询结果 -->
+        <el-table size="small" :data="list" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit
+            highlight-current-row>
+            <el-table-column align="center" min-width="50px" label="排行" prop="rownum">
+            </el-table-column>
+            <el-table-column align="center" min-width="80px" label="员工名称" prop="userName">
+            </el-table-column>
+            <el-table-column align="center" min-width="150px" label="部门名称" prop="deptName">
+            </el-table-column>
+            <el-table-column align="center" min-width="80px" label="正确数" prop="rightQuantities">
+            </el-table-column>
+            <el-table-column align="center" min-width="80px" label="用时(毫秒)" prop="answerTime">
+            </el-table-column>
+            <el-table-column align="center" min-width="150px" label="答题时间" prop="answerDate">
+            </el-table-column>
+        </el-table>
+
+        <!-- 分页 -->
+        <div class="pagination-container">
+            <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
+                layout="total, sizes, prev, pager, next, jumper" :total="total">
+            </el-pagination>
+        </div>
+    </div>
+</template>
+  
+<style>
+.demo-table-expand {
+    font-size: 0;
+}
+
+.demo-table-expand label {
+    width: 200px;
+    color: #99a9bf;
+}
+
+.demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+}
+</style>
+  
+<script>
+import { answerList } from "@/api/rankingList";
+import waves from "@/directive/waves"; // 水波纹指令
+import Tinymce from '@/components/Tinymce'
+
+export default {
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+        return {
+            httpFile:'',
+            list: [
+            ],
+            total: 0,
+            listLoading: false,
+            listQuery: {
+                page: 1,
+                limit: 10,
+                createTime: this.getCurrentDate(),
+                userName: '',
+            },
+        }
+    },
+    created() {
+        this.getList();
+    },
+    methods: {
+        getCurrentDate() {
+            let now = new Date();
+            let year = now.getFullYear();
+            let month = now.getMonth() + 1;
+            let day = now.getDate();
+            return year + "-" + month + "-" + day;
+        },
+        handleDownLoad(){
+            window.location.href = process.env.BASE_API + '/mall-order/exportOrderLog?userName=' + this.listQuery.userName + '&orderSeq=' + this.listQuery.orderSeq + '&orderType=' + this.listQuery.orderType + '&title=' + this.listQuery.title;
+        },
+        getList() {
+            this.listLoading = true
+            answerList(this.listQuery).then(response => {
+                this.httpFile = response.data.data.httpFile
+                this.list = response.data.data.items
+                this.total = response.data.data.total
+                this.listLoading = false
+            }).catch(() => {})
+        },
+        handleFilter() {
+            this.listQuery.page = 1
+            this.getList()
+        },
+        handleSizeChange(val) {
+            this.listQuery.limit = val
+            this.getList()
+        },
+        handleCurrentChange(val) {
+            this.listQuery.page = val
+            this.getList()
+        },
+    }
+}
+</script>
+<style>
+.ad-avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+}
+
+.ad-avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+}
+
+.ad-avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+}
+
+.ad-avatar {
+    display: block;
+}
+</style>
+  

+ 145 - 0
src/views/rankingManage/gameRanking.vue

@@ -0,0 +1,145 @@
+<template>
+    <div class="app-container calendar-list-container exchangeView">
+        <!-- 查询和其他操作 -->
+        <div class="filter-container">
+            <el-input clearable class="filter-item" style="width: 200px;" placeholder="员工名称"
+                v-model="listQuery.userName"></el-input>
+                <el-date-picker
+                        style="width: 220px; margin-right: 30px;"
+                        class="filter-item"
+                        v-model="listQuery.createTime"
+                        value-format="yyyy-MM-dd"
+                        type="week"
+                        format="yyyy 第 WW 周"
+                        placeholder="选择周">
+                        </el-date-picker>
+            <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
+            <!-- <el-button class="filter-item" type="primary" v-waves icon="el-icon-download" @click="handleDownLoad">导出</el-button> -->
+
+        </div>
+
+        <!-- 查询结果 -->
+        <el-table size="small" :data="list" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit
+            highlight-current-row>
+            <el-table-column align="center" min-width="50px" label="排行" prop="rownum">
+            </el-table-column>
+            <el-table-column align="center" min-width="80px" label="员工名称" prop="userName">
+            </el-table-column>
+            <el-table-column align="center" min-width="150px" label="部门名称" prop="deptName">
+            </el-table-column>
+            <el-table-column align="center" min-width="120px" label="得分" prop="actuaMoney">
+            </el-table-column>
+            <el-table-column align="center" min-width="120px" label="游戏时间" prop="createTime">
+            </el-table-column>
+        </el-table>
+
+        <!-- 分页 -->
+        <div class="pagination-container">
+            <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
+                layout="total, sizes, prev, pager, next, jumper" :total="total">
+            </el-pagination>
+        </div>
+    </div>
+</template>
+  
+<style>
+.demo-table-expand {
+    font-size: 0;
+}
+
+.demo-table-expand label {
+    width: 200px;
+    color: #99a9bf;
+}
+
+.demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+}
+</style>
+  
+<script>
+import { gameList } from "@/api/rankingList";
+import waves from "@/directive/waves"; // 水波纹指令
+import Tinymce from '@/components/Tinymce'
+
+export default {
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+        return {
+            httpFile:'',
+            orderTypeList: [
+            ],
+            list: [
+
+            ],
+            total: 0,
+            listLoading: false,
+            listQuery: {
+                page: 1,
+                limit: 10,
+                createTime: '',
+                userName: '',
+            },
+        }
+    },
+    created() {
+        this.getList();
+    },
+    methods: {
+        handleDownLoad(){
+            window.location.href = process.env.BASE_API + '/mall-order/exportOrderLog?userName=' + this.listQuery.userName + '&orderSeq=' + this.listQuery.orderSeq + '&orderType=' + this.listQuery.orderType + '&title=' + this.listQuery.title;
+        },
+        getList() {
+            this.listLoading = true
+            gameList(this.listQuery).then(response => {
+                this.httpFile = response.data.data.httpFile
+                this.list = response.data.data.items
+                this.total = response.data.data.total
+                this.listLoading = false
+            }).catch(() => {})
+        },
+        handleFilter() {
+            this.listQuery.page = 1
+            this.getList()
+        },
+        handleSizeChange(val) {
+            this.listQuery.limit = val
+            this.getList()
+        },
+        handleCurrentChange(val) {
+            this.listQuery.page = val
+            this.getList()
+        },
+    }
+}
+</script>
+<style>
+.ad-avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+}
+
+.ad-avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+}
+
+.ad-avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+}
+
+.ad-avatar {
+    display: block;
+}
+</style>
+  

+ 16 - 4
yarn.lock

@@ -2760,14 +2760,16 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30:
   resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.30.tgz#0f75a1dce26dffbd5a0f7212e5b87fe0b61cbc76"
   integrity sha512-609z9sIMxDHg+TcR/VB3MXwH+uwtrYyeAwWc/orhnr90ixs6WVGSrt85CDLGUdNnLqCA7liv426V20EecjvflQ==
 
-element-ui@2.0.8:
-  version "2.0.8"
-  resolved "https://registry.yarnpkg.com/element-ui/-/element-ui-2.0.8.tgz#cee493530a8e7a3c69bb83dc22f252a5b9ce0a11"
-  integrity sha512-Y0eiOhJZl4lgrGaGK6z02YtLsWljochxKud6IX4q2ju/NraZfexTah3GH+6x8D0IhplVP+QxHZ1+gSqnIbnmmQ==
+element-ui@^2.15.12:
+  version "2.15.14"
+  resolved "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.14.tgz#3c34df79467636592812d720d2e6784e7a6ec2ea"
+  integrity sha512-2v9fHL0ZGINotOlRIAJD5YuVB8V7WKxrE9Qy7dXhRipa035+kF7WuU/z+tEmLVPBcJ0zt8mOu1DKpWcVzBK8IA==
   dependencies:
     async-validator "~1.8.1"
     babel-helper-vue-jsx-merge-props "^2.0.0"
     deepmerge "^1.2.0"
+    normalize-wheel "^1.0.1"
+    resize-observer-polyfill "^1.5.0"
     throttle-debounce "^1.0.1"
 
 elliptic@^6.5.3:
@@ -5678,6 +5680,11 @@ normalize-url@^1.4.0:
     query-string "^4.1.0"
     sort-keys "^1.0.0"
 
+normalize-wheel@^1.0.1:
+  version "1.0.1"
+  resolved "https://registry.npmmirror.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45"
+  integrity sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA==
+
 normalize.css@7.0.0:
   version "7.0.0"
   resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-7.0.0.tgz#abfb1dd82470674e0322b53ceb1aaf412938e4bf"
@@ -7107,6 +7114,11 @@ requires-port@^1.0.0:
   resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
   integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
 
+resize-observer-polyfill@^1.5.0:
+  version "1.5.1"
+  resolved "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
+  integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
+
 resolve-cwd@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"