Browse Source

代码暂停维护 我这边尽快更新要大改

李志伟 3 years ago
parent
commit
30a5c135a3

+ 2
- 3
src/App.vue View File

@@ -12,8 +12,7 @@ export default {
12 12
 <style>
13 13
 .body_edit {
14 14
   padding: 20px;
15
-  width: 1500px;
16
-  margin: auto;
15
+  font-size: 14px
17 16
 }
18 17
 .box-card {
19 18
   margin-bottom: 20px;
@@ -21,4 +20,4 @@ export default {
21 20
 .body {
22 21
   padding: 20px;
23 22
 }
24
-</style>
23
+</style>

+ 26
- 26
src/api/question.js View File

@@ -1,46 +1,46 @@
1 1
 import request from '@/utils/request'
2 2
 
3 3
 /**
4
-* 保存应用
5
-* @param {*} data 
6
-* @returns 
4
+* 保存游戏题库
5
+* @param {*} data
6
+* @returns
7 7
 */
8
-export const saveApp = (data) => request({
9
-  url: '/admin/App',
8
+export const saveQuestion = (data) => request({
9
+  url: '/admin/question',
10 10
   method: 'post',
11 11
   data
12 12
 })
13 13
 
14 14
 /**
15
- * 应用列表
16
- * @param {*} params 
17
- * @returns 
15
+ * 游戏题库列表
16
+ * @param {*} params
17
+ * @returns
18 18
  */
19
-export const getAppList = (params) => request({
20
-  url: '/admin/App', params
19
+export const getQuestionList = (params) => request({
20
+  url: '/admin/question', params
21 21
 })
22 22
 
23 23
 /**
24
- * 删除应用
25
- * @param {*} data 
26
- * @returns 
24
+ * 删除游戏题库
25
+ * @param {*} data
26
+ * @returns
27 27
  */
28
-export const deleteApp = (id) => request({
29
-  url: `/admin/App/${id}`, method: 'delete'
28
+export const deleteQuestion = (id) => request({
29
+  url: `/admin/question/${id}`, method: 'delete'
30 30
 })
31 31
 /**
32
- * 更新应用
33
- * @param {*} data 
34
- * @returns 
32
+ * 更新游戏题库
33
+ * @param {*} data
34
+ * @returns
35 35
  */
36
-export const UpdateApp = (data, id) => request({
37
-  url: `/admin/App/${id}`, method: 'put', data
36
+export const UpdateQuestion = (data, id) => request({
37
+  url: `/admin/question/${id}`, method: 'put', data
38 38
 })
39 39
 /**
40
- * 查询应用详情
41
- * @param {*} params 
42
- * @returns 
40
+ * 查询游戏题库详情
41
+ * @param {*} params
42
+ * @returns
43 43
  */
44
-export const getAppDetail = (id) => request({
45
-  url: `/admin/App/${id}`
46
-})
44
+export const getQuestionDetail = (id) => request({
45
+  url: `/admin/question/${id}`
46
+})

+ 24
- 25
src/components/AddAnswer/index.vue View File

@@ -14,8 +14,7 @@
14 14
             :key="item.value"
15 15
             :label="item.label"
16 16
             :value="item.value"
17
-          >
18
-          </el-option>
17
+          />
19 18
         </el-select>
20 19
       </el-col>
21 20
       <el-col :span="17">
@@ -29,53 +28,53 @@
29 28
 </template>
30 29
 <script>
31 30
 export default {
32
-  name: "answer",
31
+  name: 'Answer',
33 32
   props: {
34 33
     value: {
35 34
       type: Object,
36
-      default: () => ({}),
37
-    },
35
+      default: () => ({})
36
+    }
38 37
   },
39 38
   data() {
40 39
     return {
41 40
       options: [
42 41
         {
43
-          value: "A",
44
-          label: "A",
42
+          value: 'A',
43
+          label: 'A'
45 44
         },
46 45
         {
47
-          value: "B",
48
-          label: "B",
46
+          value: 'B',
47
+          label: 'B'
49 48
         },
50 49
         {
51
-          value: "C",
52
-          label: "C",
50
+          value: 'C',
51
+          label: 'C'
53 52
         },
54 53
         {
55
-          value: "D",
56
-          label: "D",
54
+          value: 'D',
55
+          label: 'D'
57 56
         },
58 57
         {
59
-          value: "对",
60
-          label: "对",
58
+          value: '对',
59
+          label: '对'
61 60
         },
62 61
         {
63
-          value: "错",
64
-          label: "错",
65
-        },
66
-      ],
67
-    };
62
+          value: '错',
63
+          label: '错'
64
+        }
65
+      ]
66
+    }
68 67
   },
69 68
   methods: {
70 69
     handleDelete() {
71
-      this.$emit("handleDelete", this.value);
72
-    },
73
-  },
74
-};
70
+      this.$emit('handleDelete', this.value)
71
+    }
72
+  }
73
+}
75 74
 </script>
76 75
 <style>
77 76
 .answer {
78 77
   margin: 10px 0;
79 78
   width: 500px;
80 79
 }
81
-</style>
80
+</style>

+ 111
- 0
src/components/AddAnswerMatching/index.vue View File

@@ -0,0 +1,111 @@
1
+<template>
2
+  <div class="answer">
3
+    <el-row :gutter="20">
4
+      <el-col :span="5">
5
+        <el-select
6
+          v-model="value.option"
7
+          filterable
8
+          allow-create
9
+          default-first-option
10
+          placeholder="请选择"
11
+        >
12
+          <el-option
13
+            v-for="item in options"
14
+            :key="item.value"
15
+            :label="item.label"
16
+            :value="item.value"
17
+          />
18
+        </el-select>
19
+      </el-col>
20
+      <el-col :span="17">
21
+        <el-input v-model="value.content" />
22
+      </el-col>
23
+    </el-row>
24
+    <el-row>
25
+      <el-col :span="20">
26
+        <el-select
27
+          v-model="nowlist"
28
+          filterable
29
+          multiple
30
+          default-first-option
31
+          placeholder="请选择特征词"
32
+        >
33
+          <el-option
34
+            v-for="item in wordList"
35
+            :key="item.wordId"
36
+            :label="item.wordId"
37
+            :value="item.word"
38
+          />
39
+        </el-select>
40
+      </el-col>
41
+      <el-col :span="1">
42
+        <el-button type="danger" @click="handleDelete">X</el-button>
43
+      </el-col>
44
+    </el-row>
45
+  </div>
46
+</template>
47
+<script>
48
+export default {
49
+  name: 'Answer',
50
+  props: {
51
+    libId: String,
52
+    value: {
53
+      type: Object,
54
+      default: () => ({})
55
+    },
56
+    wordList: Array
57
+  },
58
+  data() {
59
+    return {
60
+      options: [
61
+        {
62
+          value: 'A',
63
+          label: 'A'
64
+        },
65
+        {
66
+          value: 'B',
67
+          label: 'B'
68
+        },
69
+        {
70
+          value: 'C',
71
+          label: 'C'
72
+        },
73
+        {
74
+          value: 'D',
75
+          label: 'D'
76
+        },
77
+        {
78
+          value: '对',
79
+          label: '对'
80
+        },
81
+        {
82
+          value: '错',
83
+          label: '错'
84
+        }
85
+      ],
86
+      nowlist: []
87
+    }
88
+  },
89
+  watch: {
90
+    value() {
91
+      this.value.characterWordList.map(item => {
92
+        this.nowlist.push(item.wordId)
93
+      })
94
+    },
95
+    nowlist() {
96
+      this.$emit('handleWordListChange', this.value, this.nowlist)
97
+    }
98
+  },
99
+  methods: {
100
+    handleDelete() {
101
+      this.$emit('handleDelete', this.value)
102
+    }
103
+  }
104
+}
105
+</script>
106
+<style>
107
+.answer {
108
+  margin: 10px 0;
109
+  width: 500px;
110
+}
111
+</style>

+ 1
- 0
src/components/CharacterResult/edit.vue View File

@@ -115,6 +115,7 @@ export default {
115 115
             this.$message('添加实例成功')
116 116
             // 告诉父页面实例表需要刷新并且关闭当前组件
117 117
             this.$emit('handleRefresh', true)
118
+            this.$emit('handleEdit', res.data.resultId)
118 119
           })
119 120
         }
120 121
       } else {

+ 177
- 0
src/components/Question/edit.vue View File

@@ -0,0 +1,177 @@
1
+<template>
2
+  <div style="padding: 20px">
3
+    <h2 style="text-align: center">
4
+      游戏题目{{ questionId ? "编辑" : "添加" }}
5
+    </h2>
6
+    <el-form ref="form" :model="form" label-width="150px" size="mini">
7
+      <el-form-item label="题目:">
8
+        <el-input
9
+          v-model="form.title"
10
+          placeholder="请输入实例名(必填)"
11
+          type="textarea"
12
+        />
13
+      </el-form-item>
14
+      <el-form-item label="题目类型:">
15
+        <el-select v-model="form.optType" placeholder="请选择">
16
+          <el-option label="单选题" value="1" />
17
+          <el-option label="多选题" value="2" />
18
+          <el-option label="判断题" value="3" />
19
+        </el-select>
20
+      </el-form-item>
21
+      <el-form-item label="答案:">
22
+        <el-button type="primary" @click="onAddAnswer">添加答案</el-button>
23
+
24
+        <div v-for="(answer, index) in form.answerList" :key="index">
25
+          <AddAnswerMatching
26
+            :libId="libId"
27
+            :value="answer"
28
+            :wordList="wordList"
29
+            @change="handleChange"
30
+            @handleDelete="() => handleDelete(answer)"
31
+            @handleWordListChange="handleWordListChange"
32
+          />
33
+        </div>
34
+      </el-form-item>
35
+      <el-form-item label="正确选项:">
36
+        <!-- <el-input v-model="form.option"></el-input> -->
37
+        <!-- filterable可搜索 multiple可多选 default-first-option回车可选-->
38
+        <el-select
39
+          v-model="rightList"
40
+          multiple
41
+          filterable
42
+          default-first-option
43
+          placeholder="请选择"
44
+        >
45
+          <el-option
46
+            v-for="item in form.answerList"
47
+            :key="item.option"
48
+            :label="item.option"
49
+            :value="item.option"
50
+          />
51
+        </el-select>
52
+      </el-form-item>
53
+      <el-form-item>
54
+        <el-button type="primary" @click="onSubmit">确定</el-button>
55
+        <el-button @click="$router.go(-1)">返回</el-button>
56
+      </el-form-item>
57
+    </el-form>
58
+  </div>
59
+</template>
60
+<script>
61
+
62
+import { saveQuestion, updateQuestion, getQuestionDetail } from '@/api/question'
63
+import AddAnswerMatching from '@/components/AddAnswerMatching/index.vue'
64
+import { getCharacterLibDetail } from '@/api/characterLib'
65
+
66
+export default {
67
+  components: {
68
+    AddAnswerMatching
69
+  },
70
+  props: {
71
+    gameId: String,
72
+    libId: String,
73
+    questionId: String
74
+  },
75
+  data() {
76
+    return {
77
+      form: {
78
+        title: undefined,
79
+        optType: undefined,
80
+        rightAnswer: undefined,
81
+        gameId: undefined,
82
+        questionId: undefined,
83
+        // 答案列表(包括选项 内容 特征词列表)
84
+        answerList: []
85
+      },
86
+      // 正确答案数组
87
+      rightList: [],
88
+      // 修饰词数据源
89
+      wordList: []
90
+    }
91
+  },
92
+  watch: {
93
+    // 用于点击左边改变右边的页面
94
+    questionId: function() {
95
+      if (this.questionId) {
96
+        this.rightList = []
97
+        getQuestionDetail(this.questionId).then((res) => {
98
+          this.form = res.data
99
+          const list = res.data.answerList
100
+          list.map((item) => {
101
+            this.rightList.push(item.wordId)
102
+          })
103
+        })
104
+      } else {
105
+        this.form = {
106
+          title: undefined,
107
+          optType: undefined,
108
+          gameId: undefined,
109
+          rightAnswer: undefined,
110
+          questionId: undefined,
111
+          answerList: []
112
+        }
113
+        this.rightList = []
114
+      }
115
+    },
116
+    gameId() {
117
+      this.form.gameId = this.gameId
118
+    }
119
+  },
120
+  methods: {
121
+    onAddAnswer() {
122
+      this.form.answerList.push({
123
+        answerId: undefined,
124
+        questionId: undefined,
125
+        contentType: undefined,
126
+        option: undefined,
127
+        content: undefined,
128
+        characterWordList: [],
129
+        word: undefined,
130
+        wordId: undefined
131
+      })
132
+    },
133
+    onSubmit() {
134
+      if (this.form.name) {
135
+        if (this.questionId) {
136
+          updateQuestion(this.form, this.questionId).then((res) => {
137
+            this.$message('修改问题成功')
138
+            // 告诉父页面实例表需要刷新并且关闭当前组件
139
+            this.$emit('handleRefresh', true)
140
+          })
141
+        } else {
142
+          saveQuestion(this.form).then((res) => {
143
+            this.$message('添加问题成功')
144
+            // 告诉父页面实例表需要刷新并且关闭当前组件
145
+            this.$emit('handleRefresh', true)
146
+          })
147
+        }
148
+      } else {
149
+        this.$message('请输入问题名称')
150
+      }
151
+    },
152
+    handleChange(answer) {
153
+      const index = this.form.answerList.indexOf(answer)
154
+      this.$set(this.form.answerList, index, answer)
155
+    },
156
+
157
+    handleWordListChange(val, list) {
158
+      getCharacterLibDetail(this.libId).then((res) => {
159
+        this.wordList = res.data.wordList
160
+      })
161
+      const index = this.form.answerList.indexOf(val)
162
+      val.characterWordList = this.wordList.filter((item) =>
163
+        list.some((v) => v === item.wordId)
164
+      )
165
+      val.characterWordList.map(item => {
166
+        item = { ...item, libId: this.libId }
167
+      })
168
+      this.$set(this.form.answerList, index, val)
169
+    },
170
+    handleDelete(answer) {
171
+      this.form.answerList.splice(this.form.answerList.indexOf(answer), 1)
172
+    }
173
+  }
174
+}
175
+</script>
176
+<style>
177
+</style>

+ 14
- 23
src/components/Question/index.vue View File

@@ -22,11 +22,11 @@
22 22
 
23 23
         <el-button type="primary" size="mini" @click="onSearch">查询</el-button>
24 24
         <el-button size="mini" @click="onReset">重置</el-button>
25
-        <el-button type="primary" size="mini" @click="handleAddRusult">添加问题</el-button>
25
+        <el-button type="primary" size="mini" @click="handleAdd">添加问题</el-button>
26 26
       </el-card>
27 27
     </div>
28 28
     <el-table stripe :data="tableData" border style="width: 100%">
29
-      <el-table-column prop="name" label="问题名称" />
29
+      <el-table-column prop="title" label="问题名称" />
30 30
       <el-table-column prop="createDate" label="创建时间">
31 31
         <template slot-scope="scope">{{
32 32
           scope.row.createDate.substr(0, 10)
@@ -49,15 +49,11 @@
49 49
   </div>
50 50
 </template>
51 51
 <script>
52
-import {
53
-  getCharacterResultList,
54
-  deleteCharacterResult
55
-} from '@/api/characterLib'
52
+import { getQuestionList, deleteQuestion } from '@/api/question'
56 53
 
57 54
 export default {
58 55
   props: {
59
-    gameId: String,
60
-    libId: String
56
+    gameId: String
61 57
   },
62 58
   data() {
63 59
     return {
@@ -69,37 +65,32 @@ export default {
69 65
       startDate: undefined
70 66
     }
71 67
   },
72
-  watch: {
73
-    gameId: function() {
74
-      this.onSearch()
75
-    }
76
-  },
77 68
   methods: {
78
-    // 添加实例
79
-    handleAddRusult() {
80
-      this.$emit('handleAddRusult', true)
69
+    // 添加问题
70
+    handleAdd() {
71
+      this.$emit('handleAdd', true)
81 72
     },
82 73
     handleEdit(row) {
83
-      // 向外传送数据row.resultId
84
-      this.$emit('handleEdit', row.resultId)
74
+      // 向外传送数据row.questionId
75
+      this.$emit('handleEdit', row.questionId)
85 76
     },
86 77
     handleDelete(row) {
87
-      deleteCharacterResult(row.resultId).then(() => {
88
-        this.$message('删除实例成功')
78
+      deleteQuestion(row.questionId).then(() => {
79
+        this.$message('删除问题成功')
89 80
         this.onSearch()
90
-        // 关闭编辑实例页面防止编辑页面还没关闭就删除当前实例
81
+        // 关闭编辑问题页面防止编辑页面还没关闭就删除当前问题
91 82
         this.$emit('handleClose', true)
92 83
       })
93 84
     },
94 85
     onSearch() {
95
-      getCharacterResultList({ libId: this.libId, name: this.name, startDate: this.startDate, endDate: this.endDate }).then(
86
+      getQuestionList({ gameId: this.gameId, title: this.title, startDate: this.startDate, endDate: this.endDate }).then(
96 87
         (res) => {
97 88
           this.tableData = res.data.records
98 89
         }
99 90
       )
100 91
     },
101 92
     onReset() {
102
-      this.name = ''
93
+      this.title = ''
103 94
       this.daterange = ''
104 95
       this.startDate = ''
105 96
       this.endDate = ''

+ 6
- 11
src/views/characterLibManage/edit.vue View File

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div style="padding: 20px; font-size: 14px">
2
+  <div class="body_edit">
3 3
     <el-tabs v-model="activeName">
4 4
       <el-tab-pane label="特征库" name="characterLib">
5 5
         <el-row :gutter="20">
@@ -40,7 +40,7 @@
40 40
           <el-col :span="13">
41 41
             <CharacterResult
42 42
               ref="CharacterResult"
43
-              :lib-id="characterLib.libId"
43
+              :libId="characterLib.libId"
44 44
               @handleEdit="handleEdit"
45 45
               @handleClose="handleClose"
46 46
               @handleAddRusult="resultId = undefined"
@@ -50,7 +50,7 @@
50 50
             <CharacterResultEdit
51 51
               :result-id="resultId"
52 52
               :lib-id="characterLib.libId"
53
-              :word-list="characterLib.wordList"
53
+              :wordList="characterLib.wordList"
54 54
               @handleRefresh="handleRefresh"
55 55
             />
56 56
           </el-col>
@@ -191,20 +191,15 @@ export default {
191 191
     },
192 192
 
193 193
     // 实例列表的方法
194
-    // 添加实例
195
-    handleAddRusult() {
196
-      this.resultId = undefined
197
-    },
198 194
     handleEdit(val) {
199 195
       this.resultId = val
200 196
     },
201
-
197
+    handleClose() {
198
+      this.resultId = undefined
199
+    },
202 200
     // 实例编辑页面调用实例列表的刷新方法 兄弟组件调用方法
203 201
     handleRefresh() {
204 202
       this.$refs.CharacterResult.onSearch()
205
-    },
206
-    handleClose() {
207
-      this.resultId = undefined
208 203
     }
209 204
   }
210 205
 }

+ 35
- 5
src/views/gameManage/edit.vue View File

@@ -3,7 +3,7 @@
3 3
     <el-tabs v-model="activeName">
4 4
       <el-tab-pane label="游戏详情" name="game">
5 5
         <h2 style="text-align: center">游戏{{ gameId ? "编辑" : "新增" }}</h2>
6
-        <el-form ref="form" :model="gameForm" label-width="150px" size="mini">
6
+        <el-form ref="form" class="gameForm" :model="gameForm" label-width="150px" size="mini">
7 7
           <el-form-item label="游戏名称:">
8 8
             <el-input v-model="gameForm.title" />
9 9
           </el-form-item>
@@ -16,7 +16,6 @@
16 16
               filterable
17 17
               default-first-option
18 18
               placeholder="请选择"
19
-              style="width: 200px; margin-right: 20px"
20 19
               :disabled="gameId ? true : false"
21 20
             >
22 21
               <el-option
@@ -39,7 +38,20 @@
39 38
         name="question"
40 39
         :disabled="gameId ? false : true"
41 40
       >
42
-        问题列表
41
+        <el-row :gutter="20" style="padding-top: 20px">
42
+          <el-col :span="13">
43
+            <QuestionList
44
+              ref="questionList"
45
+              :gameId="gameId"
46
+              @handleEdit="handleEdit"
47
+              @handleClose="handleClose"
48
+              @handleAdd="questionId = undefined"
49
+            />
50
+          </el-col>
51
+          <el-col :span="11">
52
+            <QuestionDetail :gameId="gameId" :libId="gameForm.libId" :questionId="questionId" @handleRefresh="handleRefresh" />
53
+          </el-col>
54
+        </el-row>
43 55
       </el-tab-pane>
44 56
     </el-tabs>
45 57
   </div>
@@ -48,9 +60,13 @@
48 60
 import { saveGame, UpdateGame, getGameDetail } from '@/api/game'
49 61
 import { getCharacterLibList } from '@/api/characterLib'
50 62
 import UploadImage from '@/components/UploadImage/index.vue'
63
+import QuestionList from '@/components/Question/index.vue'
64
+import QuestionDetail from '@/components/Question/edit.vue'
51 65
 export default {
52 66
   components: {
53
-    UploadImage
67
+    UploadImage,
68
+    QuestionList,
69
+    QuestionDetail
54 70
   },
55 71
   data() {
56 72
     return {
@@ -61,7 +77,8 @@ export default {
61 77
       },
62 78
       libList: [],
63 79
       gameId: undefined,
64
-      activeName: 'game'
80
+      activeName: 'game',
81
+      questionId: undefined
65 82
     }
66 83
   },
67 84
   watch: {
@@ -114,11 +131,24 @@ export default {
114 131
     },
115 132
     handleDeleteIcon() {
116 133
       this.gameForm.gameImage = ''
134
+    },
135
+    handleEdit(val) {
136
+      this.questionId = val
137
+    },
138
+    handleClose() {
139
+      this.questionId = undefined
140
+    },
141
+    handleRefresh() {
142
+      this.$refs.questionList.onSearch()
117 143
     }
118 144
   }
119 145
 }
120 146
 </script>
121 147
 <style>
148
+.gameForm{
149
+  width: 700px;
150
+  margin: auto;
151
+}
122 152
 .editBottomItem > div {
123 153
   margin: 0 !important;
124 154
   text-align: center;

+ 1
- 1
src/views/gameManage/index.vue View File

@@ -45,7 +45,7 @@
45 45
           <el-image :src="scope.row.gameImage" style="width: 100px; height: 100px" />
46 46
         </template>
47 47
       </el-table-column>
48
-      <el-table-column prop="libName" label="特征库名称" />
48
+      <el-table-column prop="characterName" label="特征库名称" />
49 49
       <el-table-column prop="createDate" label="创建时间">
50 50
         <template slot-scope="scope">{{
51 51
           scope.row.createDate.substr(0, 10)

+ 34
- 36
src/views/questionList/index.vue View File

@@ -17,8 +17,7 @@
17 17
           :key="item.key"
18 18
           :label="item.value"
19 19
           :value="item.key"
20
-        >
21
-        </el-option>
20
+        />
22 21
       </el-select>
23 22
       状态:
24 23
       <el-select
@@ -32,8 +31,7 @@
32 31
           :key="item.key"
33 32
           :label="item.value"
34 33
           :value="item.key"
35
-        >
36
-        </el-option>
34
+        />
37 35
       </el-select>
38 36
       <el-button type="primary" @click="onSearch">查询</el-button>
39 37
       <el-button @click="onReset">重置</el-button>
@@ -43,7 +41,7 @@
43 41
       <el-table-column prop="title" label="题目内容" />
44 42
       <el-table-column prop="optType" label="题目类型">
45 43
         <template slot-scope="scope">
46
-          {{scope.row.optType===1?'单选题':scope.row.optType===2?'多选题':'判断题'}}
44
+          {{ scope.row.optType===1?'单选题':scope.row.optType===2?'多选题':'判断题' }}
47 45
         </template>
48 46
       </el-table-column>
49 47
       <el-table-column prop="status" label="状态" />
@@ -62,76 +60,76 @@
62 60
 export default {
63 61
   data() {
64 62
     return {
65
-      title: "",
63
+      title: '',
66 64
       typeOptions: [
67 65
         {
68 66
           key: 1,
69
-          value: "单选题",
67
+          value: '单选题'
70 68
         },
71 69
         {
72 70
           key: 2,
73
-          value: "多选题",
71
+          value: '多选题'
74 72
         },
75 73
         {
76 74
           key: 3,
77
-          value: "判断题",
78
-        },
75
+          value: '判断题'
76
+        }
79 77
       ],
80 78
       statusOptions: [
81 79
         {
82 80
           key: 1,
83
-          value: "已发布",
81
+          value: '已发布'
84 82
         },
85 83
         {
86 84
           key: 0,
87
-          value: "未发布",
88
-        },
85
+          value: '未发布'
86
+        }
89 87
       ],
90
-      typeName: "",
91
-      status: "",
88
+      typeName: '',
89
+      status: '',
92 90
       tableData: [
93 91
         {
94
-          title: "李寻欢是那部小说里的人物",
92
+          title: '李寻欢是那部小说里的人物',
95 93
           optType: 2,
96
-          status: "未发布",
94
+          status: '未发布'
97 95
         },
98 96
         {
99
-          title: "圆周率小数点后第六位是",
97
+          title: '圆周率小数点后第六位是',
100 98
           optType: 1,
101
-          status: "未发布",
99
+          status: '未发布'
102 100
         },
103 101
         {
104
-          title: "我们现在吃的大米是杂交水稻吗",
102
+          title: '我们现在吃的大米是杂交水稻吗',
105 103
           optType: 3,
106
-          status: "未发布",
104
+          status: '未发布'
107 105
         },
108 106
         {
109
-          title: "西游记里孙悟空号称齐天大圣那牛魔王称号是什么",
107
+          title: '西游记里孙悟空号称齐天大圣那牛魔王称号是什么',
110 108
           optType: 1,
111
-          status: "未发布",
112
-        },
113
-      ],
114
-    };
109
+          status: '未发布'
110
+        }
111
+      ]
112
+    }
113
+  },
114
+  mounted() {
115 115
   },
116 116
   methods: {
117 117
     handleAdd() {
118
-      this.$router.push({ path: "questionList/edit" });
118
+      this.$router.push({ path: 'questionList/edit' })
119 119
     },
120 120
     handleEdit(row) {
121
-      this.$router.push({ path: "questionList/edit", query: { row: row } });
121
+      this.$router.push({ path: 'questionList/edit', query: { row: row }})
122 122
     },
123 123
     onSearch() {
124
-      console.log(this.title, this.typeName, this.status);
124
+      console.log(this.title, this.typeName, this.status)
125 125
     },
126 126
     onReset() {
127
-      this.title = "";
128
-      this.typeName = "";
129
-      this.status = "";
130
-    },
131
-  },
132
-  mounted(){
127
+      this.title = ''
128
+      this.typeName = ''
129
+      this.status = ''
130
+    }
133 131
   }
134
-};
132
+}
135 133
 </script>
136 134
 
137 135
 <style>