瀏覽代碼

游戏结果模块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 查看文件

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
     ]
65
     ]
66
   },
66
   },
67
   {
67
   {
68
-    path: '/gameAnswer',
68
+    path: '/gamePerson',
69
     component: Layout,
69
     component: Layout,
70
     meta: { title: '游戏结果管理', icon: 'form' },
70
     meta: { title: '游戏结果管理', icon: 'form' },
71
     children: [
71
     children: [
72
       {
72
       {
73
-        path: 'gameAnswer',
73
+        path: 'gamePerson',
74
         name: '',
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
   <div class="body" style="font-size:14px">
2
   <div class="body" style="font-size:14px">
3
     <el-card class="box-card" shadow="never">
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
       <el-input v-model="nickName" style="width: 200px; margin-right: 20px" />
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
       <el-date-picker
11
       <el-date-picker
10
         v-model="daterange"
12
         v-model="daterange"
19
       <div style="float:right">
21
       <div style="float:right">
20
         <el-button type="primary" @click="onSearch">查询</el-button>
22
         <el-button type="primary" @click="onSearch">查询</el-button>
21
         <el-button @click="onReset">重置</el-button>
23
         <el-button @click="onReset">重置</el-button>
22
-        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">添加游戏</el-button>
23
       </div>
24
       </div>
24
     </el-card>
25
     </el-card>
25
     <el-table stripe :data="tableData" border style="width: 100%">
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
         <template slot-scope="scope">
29
         <template slot-scope="scope">
33
           {{
30
           {{
34
-            scope.row.createDate.substr(0, 10)
31
+            scope.row.resultMode=='examination'?'测试':'匹配'
35
           }}
32
           }}
36
         </template>
33
         </template>
37
       </el-table-column>
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
         <template slot-scope="scope">
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
         </template>
49
         </template>
54
       </el-table-column>
50
       </el-table-column>
55
     </el-table>
51
     </el-table>
67
   </div>
63
   </div>
68
 </template>
64
 </template>
69
 <script>
65
 <script>
70
-import { getGameList, deleteGame } from '@/api/game'
66
+import { getGamePersonList } from '@/api/gamePerson'
71
 
67
 
72
 export default {
68
 export default {
73
   data() {
69
   data() {
74
     return {
70
     return {
75
       characterId: undefined,
71
       characterId: undefined,
76
-      title: undefined,
72
+      gameTitle: undefined,
73
+      nickName: undefined,
74
+      phone: undefined,
77
       daterange: undefined,
75
       daterange: undefined,
78
       tableData: [],
76
       tableData: [],
79
       endDate: undefined,
77
       endDate: undefined,
100
     },
98
     },
101
     // 改变分页组件重新查询数据
99
     // 改变分页组件重新查询数据
102
     changePagination() {
100
     changePagination() {
103
-      getGameList({
104
-        title: this.title,
101
+      getGamePersonList({
102
+        gameTitle: this.gameTitle,
103
+        nickName: this.nickName,
104
+        phone: this.phone,
105
         startDate: this.startDate,
105
         startDate: this.startDate,
106
         endDate: this.endDate,
106
         endDate: this.endDate,
107
         pageNum: this.currentPage,
107
         pageNum: this.currentPage,
110
         this.tableData = res.data.records
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
     onSearch() {
113
     onSearch() {
122
-      getGameList({
123
-        title: this.title,
114
+      getGamePersonList({
115
+        gameTitle: this.gameTitle,
116
+        nickName: this.nickName,
117
+        phone: this.phone,
124
         startDate: this.startDate,
118
         startDate: this.startDate,
125
         endDate: this.endDate,
119
         endDate: this.endDate,
126
         pageSize: this.pageSize
120
         pageSize: this.pageSize
131
       })
125
       })
132
     },
126
     },
133
     onReset() {
127
     onReset() {
134
-      this.title = undefined
128
+      this.gameTitle = undefined
129
+      this.nickName = undefined
130
+      this.phone = undefined
135
       this.daterange = undefined
131
       this.daterange = undefined
136
       this.startDate = undefined
132
       this.startDate = undefined
137
       this.endDate = undefined
133
       this.endDate = undefined