Selaa lähdekoodia

游戏模块v1.4

李志伟 3 vuotta sitten
vanhempi
commit
dbbc92c093

+ 7
- 4
src/App.vue Näytä tiedosto

11
 </script>
11
 </script>
12
 <style>
12
 <style>
13
 .body_edit {
13
 .body_edit {
14
-  padding: 20px;
15
-  font-size: 14px
14
+  padding: 24px;
15
+  font-size: 14px;
16
+  background: white;
17
+  height: 100%;
16
 }
18
 }
17
 .box-card {
19
 .box-card {
18
-  margin-bottom: 20px;
20
+  margin-bottom: 16px;
21
+  box-shadow: none !important;
19
 }
22
 }
20
 .body {
23
 .body {
21
-  padding: 20px;
24
+  padding: 24px;
22
 }
25
 }
23
 .el-form-item__content .el-input-group{
26
 .el-form-item__content .el-input-group{
24
   vertical-align: middle;
27
   vertical-align: middle;

+ 47
- 37
src/components/GameCharacter/index.vue Näytä tiedosto

1
 <template>
1
 <template>
2
   <div class="body" style="font-size:14px">
2
   <div class="body" style="font-size:14px">
3
-    <el-button type="primary" style="float: right; margin-bottom: 20px;" @click="handleAdd">添加特征</el-button>
4
-    <el-table stripe :data="tableData" border style="width: 100%">
5
-      <el-table-column prop="name" label="实例名称" />
6
-      <el-table-column prop="thumb" label="实例图片">
7
-        <template slot-scope="scope">
8
-          <el-image :src="scope.row.thumb" style="width: 100px; height: 100px" />
9
-        </template>
10
-      </el-table-column>
11
-      <el-table-column prop="createDate" label="创建时间">
12
-        <template slot-scope="scope">{{
13
-          scope.row.createDate.substr(0, 10)
14
-        }}</template>
15
-      </el-table-column>
16
-      <el-table-column fixed="right" label="操作">
17
-        <template slot-scope="scope">
18
-          <el-button style="margin-right:1em" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
19
-          <el-popconfirm
20
-            icon="el-icon-info"
21
-            icon-color="red"
22
-            title="确定删除这个特征吗?"
23
-            @onConfirm="handleDelete(scope.row)"
24
-          >
25
-            <el-button slot="reference" type="danger">删除</el-button>
26
-          </el-popconfirm>
27
-        </template>
28
-      </el-table-column>
29
-    </el-table>
30
-    <el-pagination
31
-      v-show="characterTotal!==0"
32
-      style="float:right; margin:20px 0"
33
-      :total="characterTotal"
34
-      :current-page="currentPage"
35
-      :page-size="pageSize"
36
-      layout="total, prev, pager, next, sizes"
37
-      @size-change="handleSizeChange"
38
-      @current-change="handleCurrentChange"
39
-    />
3
+    <el-card class="box-card">
4
+      <div slot="header" class="clearfix">
5
+        <el-button
6
+          type="primary"
7
+          style="float: right"
8
+          icon="el-icon-plus"
9
+          @click="handleAdd"
10
+        >添加特征</el-button>
11
+      </div>
12
+      <!-- <el-button type="primary" style="float: right; margin-bottom: 20px;" icon="el-icon-plus" @click="handleAdd">添加特征</el-button> -->
13
+      <el-table stripe :data="tableData" border style="width: 100%">
14
+        <el-table-column prop="name" label="实例名称" />
15
+        <el-table-column prop="thumb" label="实例图片">
16
+          <template slot-scope="scope">
17
+            <el-image :src="scope.row.thumb" style="width: 100px; height: 100px" />
18
+          </template>
19
+        </el-table-column>
20
+        <el-table-column prop="createDate" label="创建时间">
21
+          <template slot-scope="scope">{{
22
+            scope.row.createDate.substr(0, 10)
23
+          }}</template>
24
+        </el-table-column>
25
+        <el-table-column fixed="right" label="操作">
26
+          <template slot-scope="scope">
27
+            <el-button style="margin-right:1em" type="text" @click="handleEdit(scope.row)">编辑</el-button>
28
+            <el-popconfirm
29
+              icon="el-icon-info"
30
+              icon-color="red"
31
+              title="确定删除这个特征吗?"
32
+              @onConfirm="handleDelete(scope.row)"
33
+            >
34
+              <el-button slot="reference" type="text" style="color:red">删除</el-button>
35
+            </el-popconfirm>
36
+          </template>
37
+        </el-table-column>
38
+      </el-table>
39
+      <el-pagination
40
+        v-show="characterTotal!==0"
41
+        style="float:right; margin:20px 0"
42
+        :total="characterTotal"
43
+        :current-page="currentPage"
44
+        :page-size="pageSize"
45
+        layout="total, prev, pager, next, sizes"
46
+        @size-change="handleSizeChange"
47
+        @current-change="handleCurrentChange"
48
+      />
49
+    </el-card>
40
   </div>
50
   </div>
41
 </template>
51
 </template>
42
 <script>
52
 <script>

+ 34
- 30
src/components/Question/edit.vue Näytä tiedosto

14
         </el-input>
14
         </el-input>
15
       </el-form-item>
15
       </el-form-item>
16
       <el-form-item v-if="questionId!==undefined && resultMode === 'examination'" label="正确选项:">
16
       <el-form-item v-if="questionId!==undefined && resultMode === 'examination'" label="正确选项:">
17
-        <!-- <el-input v-model="form.option"></el-input> -->
18
         <!-- filterable可搜索 multiple可多选 default-first-option回车可选-->
17
         <!-- filterable可搜索 multiple可多选 default-first-option回车可选-->
19
         <el-select
18
         <el-select
20
           v-model="form.rightAnswer"
19
           v-model="form.rightAnswer"
32
           />
31
           />
33
         </el-select>
32
         </el-select>
34
       </el-form-item>
33
       </el-form-item>
35
-      <el-form-item style="text-align:center">
34
+      <el-form-item>
36
         <el-button type="primary" @click="onSubmit('form')">确定</el-button>
35
         <el-button type="primary" @click="onSubmit('form')">确定</el-button>
37
         <el-button @click="$router.go(-1)">返回</el-button>
36
         <el-button @click="$router.go(-1)">返回</el-button>
38
       </el-form-item>
37
       </el-form-item>
39
-      <el-form-item v-if="questionId!==undefined" label="答案:">
40
-        <el-button type="primary" @click="onAddAnswer">添加答案</el-button>
41
-      </el-form-item>
42
     </el-form>
38
     </el-form>
43
-
44
-    <ul style="list-style-type: none;margin:10px 0 10px -2px">
45
-      <li v-for="answer in answerList" :key="answer.answerId" class="answerli">
46
-        <div style="flex:1;width: 100%;overflow: hidden;display: flex;" @click="handleEdit(answer)">
47
-          <span style="width:45px">{{ answer.option }}</span>
48
-          <span style="flex:1">{{ answer.content }}</span>
49
-        </div>
50
-        <el-popconfirm
51
-          style="width:15px"
52
-          icon="el-icon-info"
53
-          icon-color="red"
54
-          title="确定删除这个答案吗?"
55
-          @onConfirm="handleDelete(answer)"
56
-        >
57
-          <el-button slot="reference" type="text" class="deleteQuestion" style="color:red">×</el-button>
58
-        </el-popconfirm>
59
-      </li>
60
-    </ul>
39
+    <el-card v-if="questionId!==undefined" class="box-card">
40
+      <div slot="header" class="clearfix">
41
+        <h3 style="float:left">答案列表</h3>
42
+        <el-button
43
+          type="primary"
44
+          style="float: right"
45
+          icon="el-icon-plus"
46
+          @click="onAddAnswer"
47
+        >添加特征</el-button>
48
+      </div>
49
+      <ul style="list-style-type: none;margin:10px 0 10px -40px">
50
+        <li v-for="answer in answerList" :key="answer.answerId" class="answerli">
51
+          <div style="flex:1;width: 100%;overflow: hidden;display: flex;" @click="handleEdit(answer)">
52
+            <span style="width:45px">{{ answer.option }}</span>
53
+            <span style="flex:1">{{ answer.content }}</span>
54
+          </div>
55
+          <el-popconfirm
56
+            style="width:30px"
57
+            icon="el-icon-info"
58
+            icon-color="red"
59
+            title="确定删除这个答案吗?"
60
+            @onConfirm="handleDelete(answer)"
61
+          >
62
+            <el-button slot="reference" type="text" class="deleteQuestion" style="color:red">删除</el-button>
63
+          </el-popconfirm>
64
+        </li>
65
+      </ul>
66
+    </el-card>
61
     <QuestionDrawer
67
     <QuestionDrawer
62
       :dialog="dialog"
68
       :dialog="dialog"
63
       :question-id="questionId"
69
       :question-id="questionId"
64
       :answer-id="answerId"
70
       :answer-id="answerId"
65
       :game-id="gameId"
71
       :game-id="gameId"
66
-      :resultMode="resultMode"
72
+      :result-mode="resultMode"
67
       @handleCloseDrawer="handleCloseDrawer"
73
       @handleCloseDrawer="handleCloseDrawer"
68
       @handleEditDrawer="handleEditDrawer"
74
       @handleEditDrawer="handleEditDrawer"
69
     />
75
     />
216
   display: flex;
222
   display: flex;
217
   line-height:40px;
223
   line-height:40px;
218
   background-color: white;
224
   background-color: white;
219
-  .deleteQuestion{
220
-    display: none;
221
-  }
225
+  border: 1px solid #f0f2f5;
222
 }
226
 }
223
 .answerli:hover {
227
 .answerli:hover {
224
   background-color: rgb(230, 247, 255);
228
   background-color: rgb(230, 247, 255);
225
 }
229
 }
226
-.answerli:hover .deleteQuestion{
227
-    display: block
228
-  }
230
+.answerli:nth-of-type(even) {
231
+  background: #f0f2f5;
232
+}
229
 </style>
233
 </style>

+ 41
- 36
src/components/Question/index.vue Näytä tiedosto

1
 <template>
1
 <template>
2
   <div class="body">
2
   <div class="body">
3
-    <div style="line-height:30px; height:30px">
4
-      题库列表
5
-      <el-button type="primary" style="float: right; margin-bottom: 20px;" @click="handleAdd">添加问题</el-button>
6
-    </div>
7
-    <ul style="list-style-type: none;margin:10px 0 10px -40px">
8
-      <li v-for="item,index in tableData" :key="index" class="questionli" @click="handleEdit(item)">
9
-        <span style="width:45px">第{{ index+1 }}题</span>
10
-        <span style="width:45px">{{ item.optType === '1'?'单选题':item.optType==='2'?'多选题':'判断题' }}</span>
11
-        <span style="flex:1">{{ item.title }}</span>
12
-        <el-popconfirm
13
-          style="width:15px"
14
-          icon="el-icon-info"
15
-          icon-color="red"
16
-          title="确定删除这个问题吗?"
17
-          @onConfirm="handleDelete(item)"
18
-        >
19
-          <el-button slot="reference" type="text" class="deleteQuestion" style="color:red">×</el-button>
20
-        </el-popconfirm>
21
-      </li>
22
-    </ul>
23
-    <el-pagination
24
-      v-show="questionTotal!==0"
25
-      style="float:right; margin:20px 0"
26
-      :total="questionTotal"
27
-      :current-page="currentPage"
28
-      :page-size="pageSize"
29
-      layout="total, prev, pager, next, sizes"
30
-      @size-change="handleSizeChange"
31
-      @current-change="handleCurrentChange"
32
-    />
3
+    <el-card class="box-card">
4
+      <div slot="header" class="clearfix">
5
+        <h3 style="float:left">题库列表</h3>
6
+        <el-button
7
+          type="primary"
8
+          style="float: right"
9
+          icon="el-icon-plus"
10
+          @click="handleAdd"
11
+        >添加特征</el-button>
12
+      </div>
13
+      <ul style="list-style-type: none;margin:10px 0 10px -40px">
14
+        <li v-for="item,index in tableData" :key="index" class="questionli" @click="handleEdit(item)">
15
+          <span style="width:45px">第{{ index+1 }}题</span>
16
+          <span style="width:45px">{{ item.optType === '1'?'单选题':item.optType==='2'?'多选题':'判断题' }}</span>
17
+          <span style="flex:1">{{ item.title }}</span>
18
+          <el-popconfirm
19
+            style="width:30px"
20
+            icon="el-icon-info"
21
+            icon-color="red"
22
+            title="确定删除这个问题吗?"
23
+            @onConfirm="handleDelete(item)"
24
+          >
25
+            <el-button slot="reference" type="text" style="color:red">删除</el-button>
26
+          </el-popconfirm>
27
+        </li>
28
+      </ul>
29
+      <el-pagination
30
+        v-show="questionTotal!==0"
31
+        style="float:right; margin:20px 0"
32
+        :total="questionTotal"
33
+        :current-page="currentPage"
34
+        :page-size="pageSize"
35
+        layout="total, prev, pager, next, sizes"
36
+        @size-change="handleSizeChange"
37
+        @current-change="handleCurrentChange"
38
+      />
39
+    </el-card>
33
   </div>
40
   </div>
34
 </template>
41
 </template>
35
 <script>
42
 <script>
108
   display: flex;
115
   display: flex;
109
   line-height:40px;
116
   line-height:40px;
110
   background-color: white;
117
   background-color: white;
111
-  .deleteQuestion{
112
-    display: none;
113
-  }
118
+  border: 1px solid #f0f2f5;
119
+}
120
+.questionli:nth-of-type(even) {
121
+  background: #f0f2f5;
114
 }
122
 }
115
 .questionli:hover {
123
 .questionli:hover {
116
   background-color: rgb(230, 247, 255);
124
   background-color: rgb(230, 247, 255);
117
 }
125
 }
118
-.questionli:hover .deleteQuestion{
119
-    display: block
120
-  }
121
 </style>
126
 </style>

+ 1
- 1
src/views/AppController/index.vue Näytä tiedosto

1
 <template>
1
 <template>
2
   <div class="body">
2
   <div class="body">
3
-    <el-card class="box-card" style="box-shadow: none;">
3
+    <el-card class="box-card">
4
       <div slot="header" class="clearfix">
4
       <div slot="header" class="clearfix">
5
         <el-button
5
         <el-button
6
           type="primary"
6
           type="primary"

+ 0
- 3
src/views/WeChatConfig/Edit.vue Näytä tiedosto

189
 </style>
189
 </style>
190
 
190
 
191
 <style lang="scss" scoped>
191
 <style lang="scss" scoped>
192
-.box-card {
193
-  box-shadow: none;
194
-}
195
 </style>
192
 </style>

+ 0
- 3
src/views/WeChatConfig/index.vue Näytä tiedosto

142
 }
142
 }
143
 </script>
143
 </script>
144
 <style lang="scss" scoped>
144
 <style lang="scss" scoped>
145
-.box-card {
146
-  box-shadow: none;
147
-}
148
 </style>
145
 </style>

+ 3
- 3
src/views/gameManage/edit.vue Näytä tiedosto

1
 <template>
1
 <template>
2
   <div class="body_edit">
2
   <div class="body_edit">
3
+    <!-- <h3 style="width:100%; margin:auto">游戏{{ gameId ? "编辑" : "新增" }}</h3> -->
3
     <el-tabs v-model="activeName">
4
     <el-tabs v-model="activeName">
4
       <el-tab-pane label="游戏详情" name="game">
5
       <el-tab-pane label="游戏详情" name="game">
5
-        <h2 style="text-align: center">游戏{{ gameId ? "编辑" : "新增" }}</h2>
6
-        <el-form ref="form" :rules="rules" class="gameForm" :model="gameForm" label-width="150px">
6
+        <el-form ref="form" :rules="rules" class="gameForm" :model="gameForm" label-width="100px">
7
           <el-form-item label="游戏名称:" prop="title">
7
           <el-form-item label="游戏名称:" prop="title">
8
             <el-input v-model="gameForm.title" />
8
             <el-input v-model="gameForm.title" />
9
           </el-form-item>
9
           </el-form-item>
14
             <el-select
14
             <el-select
15
               v-model="gameForm.resultMode"
15
               v-model="gameForm.resultMode"
16
               filterable
16
               filterable
17
+              style="width:100%"
17
               default-first-option
18
               default-first-option
18
               placeholder="请选择"
19
               placeholder="请选择"
19
               :disabled="gameId ? true : false"
20
               :disabled="gameId ? true : false"
201
 <style scoped>
202
 <style scoped>
202
 .gameForm{
203
 .gameForm{
203
   width: 700px;
204
   width: 700px;
204
-  margin: auto;
205
 }
205
 }
206
 .editBottomItem > div {
206
 .editBottomItem > div {
207
   margin: 0 !important;
207
   margin: 0 !important;

+ 7
- 9
src/views/gameManage/index.vue Näytä tiedosto

16
       <div style="float:right">
16
       <div style="float:right">
17
         <el-button type="primary" @click="onSearch">查询</el-button>
17
         <el-button type="primary" @click="onSearch">查询</el-button>
18
         <el-button @click="onReset">重置</el-button>
18
         <el-button @click="onReset">重置</el-button>
19
-        <el-button type="primary" @click="handleAdd">添加游戏</el-button>
19
+        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">添加游戏</el-button>
20
       </div>
20
       </div>
21
     </el-card>
21
     </el-card>
22
     <el-table stripe :data="tableData" border style="width: 100%">
22
     <el-table stripe :data="tableData" border style="width: 100%">
35
       </el-table-column>
35
       </el-table-column>
36
       <el-table-column fixed="right" label="操作">
36
       <el-table-column fixed="right" label="操作">
37
         <template slot-scope="scope">
37
         <template slot-scope="scope">
38
-          <el-button type="primary" style="margin-right:1em" @click="handleEdit(scope.row)">编辑</el-button>
38
+          <el-link :underline="false" style="margin-right:1em" type="primary">
39
+            <router-link
40
+              :to="{name: 'gameEdit', query: { id: scope.row.gameId }}"
41
+            >编辑</router-link>
42
+          </el-link>
39
           <el-popconfirm
43
           <el-popconfirm
40
             icon="el-icon-info"
44
             icon="el-icon-info"
41
             icon-color="red"
45
             icon-color="red"
42
             title="确定删除这个游戏吗?"
46
             title="确定删除这个游戏吗?"
43
             @onConfirm="handleDelete(scope.row)"
47
             @onConfirm="handleDelete(scope.row)"
44
           >
48
           >
45
-            <el-button slot="reference" type="danger">删除</el-button>
49
+            <el-button slot="reference" type="text" style="color:red">删除</el-button>
46
           </el-popconfirm>
50
           </el-popconfirm>
47
         </template>
51
         </template>
48
       </el-table-column>
52
       </el-table-column>
107
     handleAdd() {
111
     handleAdd() {
108
       this.$router.push({ name: 'gameEdit' })
112
       this.$router.push({ name: 'gameEdit' })
109
     },
113
     },
110
-    handleEdit(row) {
111
-      this.$router.push({
112
-        name: 'gameEdit',
113
-        query: { id: row.gameId }
114
-      })
115
-    },
116
     handleDelete(row) {
114
     handleDelete(row) {
117
       deleteGame(row.gameId).then(() => {
115
       deleteGame(row.gameId).then(() => {
118
         this.onSearch()
116
         this.onSearch()