소스 검색

Merge branch 'master' of http://git.ycjcjy.com/yz-question/pc-admin

Baozhangchao 3 년 전
부모
커밋
7ce782dd0d

+ 7
- 4
src/App.vue 파일 보기

@@ -11,14 +11,17 @@ export default {
11 11
 </script>
12 12
 <style>
13 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 19
 .box-card {
18
-  margin-bottom: 20px;
20
+  margin-bottom: 16px;
21
+  box-shadow: none !important;
19 22
 }
20 23
 .body {
21
-  padding: 20px;
24
+  padding: 24px;
22 25
 }
23 26
 .el-form-item__content .el-input-group{
24 27
   vertical-align: middle;

+ 47
- 37
src/components/GameCharacter/index.vue 파일 보기

@@ -1,42 +1,52 @@
1 1
 <template>
2 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 50
   </div>
41 51
 </template>
42 52
 <script>

+ 34
- 30
src/components/Question/edit.vue 파일 보기

@@ -14,7 +14,6 @@
14 14
         </el-input>
15 15
       </el-form-item>
16 16
       <el-form-item v-if="questionId!==undefined && resultMode === 'examination'" label="正确选项:">
17
-        <!-- <el-input v-model="form.option"></el-input> -->
18 17
         <!-- filterable可搜索 multiple可多选 default-first-option回车可选-->
19 18
         <el-select
20 19
           v-model="form.rightAnswer"
@@ -32,38 +31,45 @@
32 31
           />
33 32
         </el-select>
34 33
       </el-form-item>
35
-      <el-form-item style="text-align:center">
34
+      <el-form-item>
36 35
         <el-button type="primary" @click="onSubmit('form')">确定</el-button>
37 36
         <el-button @click="$router.go(-1)">返回</el-button>
38 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 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 67
     <QuestionDrawer
62 68
       :dialog="dialog"
63 69
       :question-id="questionId"
64 70
       :answer-id="answerId"
65 71
       :game-id="gameId"
66
-      :resultMode="resultMode"
72
+      :result-mode="resultMode"
67 73
       @handleCloseDrawer="handleCloseDrawer"
68 74
       @handleEditDrawer="handleEditDrawer"
69 75
     />
@@ -216,14 +222,12 @@ export default {
216 222
   display: flex;
217 223
   line-height:40px;
218 224
   background-color: white;
219
-  .deleteQuestion{
220
-    display: none;
221
-  }
225
+  border: 1px solid #f0f2f5;
222 226
 }
223 227
 .answerli:hover {
224 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 233
 </style>

+ 41
- 36
src/components/Question/index.vue 파일 보기

@@ -1,35 +1,42 @@
1 1
 <template>
2 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 40
   </div>
34 41
 </template>
35 42
 <script>
@@ -108,14 +115,12 @@ export default {
108 115
   display: flex;
109 116
   line-height:40px;
110 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 123
 .questionli:hover {
116 124
   background-color: rgb(230, 247, 255);
117 125
 }
118
-.questionli:hover .deleteQuestion{
119
-    display: block
120
-  }
121 126
 </style>

+ 1
- 1
src/views/AppController/index.vue 파일 보기

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

+ 0
- 3
src/views/WeChatConfig/Edit.vue 파일 보기

@@ -189,7 +189,4 @@ export default {
189 189
 </style>
190 190
 
191 191
 <style lang="scss" scoped>
192
-.box-card {
193
-  box-shadow: none;
194
-}
195 192
 </style>

+ 0
- 3
src/views/WeChatConfig/index.vue 파일 보기

@@ -142,7 +142,4 @@ export default {
142 142
 }
143 143
 </script>
144 144
 <style lang="scss" scoped>
145
-.box-card {
146
-  box-shadow: none;
147
-}
148 145
 </style>

+ 3
- 3
src/views/gameManage/edit.vue 파일 보기

@@ -1,9 +1,9 @@
1 1
 <template>
2 2
   <div class="body_edit">
3
+    <!-- <h3 style="width:100%; margin:auto">游戏{{ gameId ? "编辑" : "新增" }}</h3> -->
3 4
     <el-tabs v-model="activeName">
4 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 7
           <el-form-item label="游戏名称:" prop="title">
8 8
             <el-input v-model="gameForm.title" />
9 9
           </el-form-item>
@@ -18,6 +18,7 @@
18 18
             <el-select
19 19
               v-model="gameForm.resultMode"
20 20
               filterable
21
+              style="width:100%"
21 22
               default-first-option
22 23
               placeholder="请选择"
23 24
               :disabled="gameId ? true : false"
@@ -198,7 +199,6 @@ export default {
198 199
 <style scoped>
199 200
 .gameForm {
200 201
   width: 700px;
201
-  margin: auto;
202 202
 }
203 203
 .editBottomItem > div {
204 204
   margin: 0 !important;

+ 7
- 9
src/views/gameManage/index.vue 파일 보기

@@ -16,7 +16,7 @@
16 16
       <div style="float:right">
17 17
         <el-button type="primary" @click="onSearch">查询</el-button>
18 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 20
       </div>
21 21
     </el-card>
22 22
     <el-table stripe :data="tableData" border style="width: 100%">
@@ -35,14 +35,18 @@
35 35
       </el-table-column>
36 36
       <el-table-column fixed="right" label="操作">
37 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 43
           <el-popconfirm
40 44
             icon="el-icon-info"
41 45
             icon-color="red"
42 46
             title="确定删除这个游戏吗?"
43 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 50
           </el-popconfirm>
47 51
         </template>
48 52
       </el-table-column>
@@ -107,12 +111,6 @@ export default {
107 111
     handleAdd() {
108 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 114
     handleDelete(row) {
117 115
       deleteGame(row.gameId).then(() => {
118 116
         this.onSearch()