瀏覽代碼

游戏结果模块v1.1

李志伟 3 年之前
父節點
當前提交
4633d216c7
共有 4 個文件被更改,包括 48 次插入42 次删除
  1. 10
    0
      src/api/gamePerson.js
  2. 0
    0
      src/icons/svg/gamePerson.svg
  3. 4
    4
      src/router/index.js
  4. 34
    38
      src/views/gamePerson/index.vue

+ 10
- 0
src/api/gamePerson.js 查看文件

@@ -0,0 +1,10 @@
1
+import request from '@/utils/request'
2
+
3
+/**
4
+ * 游戏结果列表
5
+ * @param {*} params
6
+ * @returns
7
+ */
8
+export const getGamePersonList = (params) => request({
9
+  url: '/admin/game-person', params
10
+})

src/icons/svg/gameAnswer.svg → src/icons/svg/gamePerson.svg 查看文件


+ 4
- 4
src/router/index.js 查看文件

@@ -65,15 +65,15 @@ export const constantRoutes = [
65 65
     ]
66 66
   },
67 67
   {
68
-    path: '/gameAnswer',
68
+    path: '/gamePerson',
69 69
     component: Layout,
70 70
     meta: { title: '游戏结果管理', icon: 'form' },
71 71
     children: [
72 72
       {
73
-        path: 'gameAnswer',
73
+        path: 'gamePerson',
74 74
         name: '',
75
-        component: () => import('@/views/gameAnswer/index'),
76
-        meta: { title: '游戏结果列表', icon: 'gameAnswer' }
75
+        component: () => import('@/views/gamePerson/index'),
76
+        meta: { title: '游戏结果列表', icon: 'gamePerson' }
77 77
       }
78 78
     ]
79 79
   },

src/views/gameAnswer/index.vue → src/views/gamePerson/index.vue 查看文件

@@ -2,9 +2,11 @@
2 2
   <div class="body" style="font-size:14px">
3 3
     <el-card class="box-card" shadow="never">
4 4
       游戏名称:
5
-      <el-input v-model="title" style="width: 200px; margin-right: 20px" />
5
+      <el-input v-model="gameTitle" style="width: 200px; margin-right: 20px" />
6 6
       用户昵称:
7 7
       <el-input v-model="nickName" style="width: 200px; margin-right: 20px" />
8
+      手机号:
9
+      <el-input v-model="phone" style="width: 200px; margin-right: 20px" />
8 10
       创建时间:
9 11
       <el-date-picker
10 12
         v-model="daterange"
@@ -19,37 +21,31 @@
19 21
       <div style="float:right">
20 22
         <el-button type="primary" @click="onSearch">查询</el-button>
21 23
         <el-button @click="onReset">重置</el-button>
22
-        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">添加游戏</el-button>
23 24
       </div>
24 25
     </el-card>
25 26
     <el-table stripe :data="tableData" border style="width: 100%">
26
-      <el-table-column prop="title" label="游戏名称" />
27
-      <el-table-column prop="title" label="游戏类型" />
28
-      <!-- <el-table-column prop="nickName" label="用户昵称" /> -->
29
-      <el-table-column prop="score" label="答题分数" />
30
-      <el-table-column prop="resultId" label="实例结果" />
31
-      <el-table-column prop="createDate" label="测试时间">
27
+      <el-table-column prop="gameTitle" label="游戏名称" />
28
+      <el-table-column prop="resultMode" label="游戏类型">
32 29
         <template slot-scope="scope">
33 30
           {{
34
-            scope.row.createDate.substr(0, 10)
31
+            scope.row.resultMode=='examination'?'测试':'匹配'
35 32
           }}
36 33
         </template>
37 34
       </el-table-column>
38
-      <el-table-column fixed="right" label="操作">
35
+      <el-table-column prop="nickName" label="用户昵称" />
36
+      <el-table-column prop="avatar" label="用户头像">
37
+        <template slot-scope="scope">
38
+          <el-image :src="scope.row.avatar" style="width: 100px; height: 100px" />
39
+        </template>
40
+      </el-table-column>
41
+      <el-table-column prop="phone" label="手机号" />
42
+      <el-table-column prop="score" label="答题分数" />
43
+      <el-table-column prop="characterName" label="实例结果" />
44
+      <el-table-column prop="createDate" label="参与时间">
39 45
         <template slot-scope="scope">
40
-          <el-link :underline="false" style="margin-right:1em" type="primary">
41
-            <router-link
42
-              :to="{name: 'gameEdit', query: { id: scope.row.gameId }}"
43
-            >编辑</router-link>
44
-          </el-link>
45
-          <el-popconfirm
46
-            icon="el-icon-info"
47
-            icon-color="red"
48
-            title="确定删除这个游戏吗?"
49
-            @onConfirm="handleDelete(scope.row)"
50
-          >
51
-            <el-button slot="reference" type="text" style="color:red">删除</el-button>
52
-          </el-popconfirm>
46
+          {{
47
+            scope.row.createDate.substr(0, 10)
48
+          }}
53 49
         </template>
54 50
       </el-table-column>
55 51
     </el-table>
@@ -67,13 +63,15 @@
67 63
   </div>
68 64
 </template>
69 65
 <script>
70
-import { getGameList, deleteGame } from '@/api/game'
66
+import { getGamePersonList } from '@/api/gamePerson'
71 67
 
72 68
 export default {
73 69
   data() {
74 70
     return {
75 71
       characterId: undefined,
76
-      title: undefined,
72
+      gameTitle: undefined,
73
+      nickName: undefined,
74
+      phone: undefined,
77 75
       daterange: undefined,
78 76
       tableData: [],
79 77
       endDate: undefined,
@@ -100,8 +98,10 @@ export default {
100 98
     },
101 99
     // 改变分页组件重新查询数据
102 100
     changePagination() {
103
-      getGameList({
104
-        title: this.title,
101
+      getGamePersonList({
102
+        gameTitle: this.gameTitle,
103
+        nickName: this.nickName,
104
+        phone: this.phone,
105 105
         startDate: this.startDate,
106 106
         endDate: this.endDate,
107 107
         pageNum: this.currentPage,
@@ -110,17 +110,11 @@ export default {
110 110
         this.tableData = res.data.records
111 111
       })
112 112
     },
113
-    handleAdd() {
114
-      this.$router.push({ name: 'gameEdit' })
115
-    },
116
-    handleDelete(row) {
117
-      deleteGame(row.gameId).then(() => {
118
-        this.onSearch()
119
-      })
120
-    },
121 113
     onSearch() {
122
-      getGameList({
123
-        title: this.title,
114
+      getGamePersonList({
115
+        gameTitle: this.gameTitle,
116
+        nickName: this.nickName,
117
+        phone: this.phone,
124 118
         startDate: this.startDate,
125 119
         endDate: this.endDate,
126 120
         pageSize: this.pageSize
@@ -131,7 +125,9 @@ export default {
131 125
       })
132 126
     },
133 127
     onReset() {
134
-      this.title = undefined
128
+      this.gameTitle = undefined
129
+      this.nickName = undefined
130
+      this.phone = undefined
135 131
       this.daterange = undefined
136 132
       this.startDate = undefined
137 133
       this.endDate = undefined