b89c8760
wangming
项目初始化
|
1
|
<template>
|
f6d2db76
yangzhi
超哥牛皮皮
|
2
3
4
5
6
7
8
|
<div class="app-container">
<el-row id="elRow">
<el-col :span="6" :style="{ height: TreeColHeight + 'px' }">
<div style="margin-right: 10px; height: 100%">
<div class="TreeHeader">
<label style="font-size: 18px">题目分类</label>
</div>
|
4ee13894
周超
给大志哥
|
9
|
|
e011bf15
周超
我先走一步
|
10
11
12
|
<div :style="{ height: TableColHeight + 'px' }" class="areadiv"
style="margin: 10px 0 0 0; padding: 5px 0 0 0">
<el-tabs v-model="activeTab" @tab-click="handleTabsClick" style="padding: 0 20px" :stretch="true">
|
f6d2db76
yangzhi
超哥牛皮皮
|
13
14
15
|
<el-tab-pane label="专业类" name="first"></el-tab-pane>
<el-tab-pane label="测评类" name="second"></el-tab-pane>
</el-tabs>
|
e011bf15
周超
我先走一步
|
16
17
18
|
<el-tree :data="activeTab == 'first' ? firstTreeData : secondTreeData"
:props="activeTab == 'first' ? firstTreeData : secondTreeData" @node-click="handleNodeClick"
class="eltree" :expand-on-click-node="false">
|
f6d2db76
yangzhi
超哥牛皮皮
|
19
20
21
|
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span style="">
|
52e3f6e1
周超
微调题目维护
|
22
|
<!-- v-if="activeTab == 'first'?true:node.level<2?true:false" -->
|
4ee13894
周超
给大志哥
|
23
|
<el-button type="text" size="mini" @click="showClassDialog(node)"
|
52e3f6e1
周超
微调题目维护
|
24
|
>
|
f6d2db76
yangzhi
超哥牛皮皮
|
25
26
|
添加下级
</el-button>
|
e011bf15
周超
我先走一步
|
27
28
29
|
<el-button type="text" v-if="activeTab == 'second'" @click="handleEditDimension(node, data)">编辑
</el-button>
<el-button type="text" size="mini" @click="() => handleDeleteQuestionClass(node, data)">
|
f6d2db76
yangzhi
超哥牛皮皮
|
30
31
32
33
34
35
36
37
38
39
40
|
删除
</el-button>
</span>
</span>
</el-tree>
</div>
</div>
</el-col>
<el-col :span="18">
<div class="grid-content bg-purple-light">
<div class="seetingsDiv" style="">
|
e011bf15
周超
我先走一步
|
41
|
<el-button type="primary" @click="AddSubject">添加题目
|
f6d2db76
yangzhi
超哥牛皮皮
|
42
43
44
|
</el-button>
</div>
<div class="areadiv" :style="{ height: TableColHeight + 'px' }">
|
e011bf15
周超
我先走一步
|
45
|
<el-table :data="QuestList" id="QuestionTable" border style="
|
f6d2db76
yangzhi
超哥牛皮皮
|
46
47
48
49
|
width: 100%;
border-radius: 5px;
box-shadow: 0 0 10px #efefef;
margin-top: 10px;
|
e011bf15
周超
我先走一步
|
50
|
" :header-cell-class-name="headerStyle" :stripe="true">
|
4ee13894
周超
给大志哥
|
51
|
<el-table-column prop="date" label="ID" width="80">
|
f6d2db76
yangzhi
超哥牛皮皮
|
52
53
54
55
56
57
58
59
|
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="题目类型" width="100">
<template slot-scope="scope">
<span style="padding-left: 10px">{{
scope.row.subjectName
|
e011bf15
周超
我先走一步
|
60
|
}}</span>
|
f6d2db76
yangzhi
超哥牛皮皮
|
61
62
|
</template>
</el-table-column>
|
e011bf15
周超
我先走一步
|
63
|
<el-table-column prop="QuestionClassName" label="分类" width="100">
|
f6d2db76
yangzhi
超哥牛皮皮
|
64
65
66
|
<template slot-scope="scope">
<span style="padding-left: 10px">{{
scope.row.QuestionClassName
|
e011bf15
周超
我先走一步
|
67
|
}}</span>
|
f6d2db76
yangzhi
超哥牛皮皮
|
68
69
70
71
72
73
|
</template>
</el-table-column>
<el-table-column prop="name" label="分数" width="80">
<template slot-scope="scope">
<span style="padding-left: 10px">{{
scope.row.fraction
|
e011bf15
周超
我先走一步
|
74
|
}}</span>
|
f6d2db76
yangzhi
超哥牛皮皮
|
75
76
77
78
79
80
|
</template>
</el-table-column>
<el-table-column prop="name" label="单项分数" width="80">
<template slot-scope="scope">
<span style="padding-left: 10px">{{
scope.row.singleFraction
|
e011bf15
周超
我先走一步
|
81
|
}}</span>
|
f6d2db76
yangzhi
超哥牛皮皮
|
82
83
84
85
86
87
88
|
</template>
</el-table-column>
<el-table-column prop="name" label="正确答案" width="80">
<template slot-scope="scope">
<span style="padding-left: 10px">{{ scope.row.answer }}</span>
</template>
</el-table-column>
|
e011bf15
周超
我先走一步
|
89
|
<el-table-column prop="name" label="题目" :show-overflow-tooltip="true">
|
f6d2db76
yangzhi
超哥牛皮皮
|
90
91
92
|
<template slot-scope="scope">
<span style="padding-left: 10px">{{
scope.row.subject
|
e011bf15
周超
我先走一步
|
93
|
}}</span>
|
f6d2db76
yangzhi
超哥牛皮皮
|
94
95
|
</template>
</el-table-column>
|
e011bf15
周超
我先走一步
|
96
|
<el-table-column prop="name" label="解析" :show-overflow-tooltip="true">
|
f6d2db76
yangzhi
超哥牛皮皮
|
97
98
99
|
<template slot-scope="scope">
<span style="padding-left: 10px">{{
scope.row.analysis
|
e011bf15
周超
我先走一步
|
100
|
}}</span>
|
f6d2db76
yangzhi
超哥牛皮皮
|
101
102
103
104
|
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="150">
<template slot-scope="scope">
|
e011bf15
周超
我先走一步
|
105
|
<el-dropdown @command="
|
f6d2db76
yangzhi
超哥牛皮皮
|
106
107
108
|
(e) => {
handleCommand(e, scope.row.id);
}
|
e011bf15
周超
我先走一步
|
109
|
" style="padding-left: 10px">
|
f6d2db76
yangzhi
超哥牛皮皮
|
110
111
112
113
114
|
<span class="el-dropdown-link">
操作<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<template #dropdown>
<el-dropdown-menu>
|
e011bf15
周超
我先走一步
|
115
|
<el-dropdown-item command="update">编辑</el-dropdown-item>
|
f6d2db76
yangzhi
超哥牛皮皮
|
116
117
118
119
120
121
122
123
|
<!-- <el-dropdown-item command="b">锁定</el-dropdown-item> -->
<el-dropdown-item command="del">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</el-table>
|
e011bf15
周超
我先走一步
|
124
|
<el-pagination background @current-change="currentchange" style="
|
f6d2db76
yangzhi
超哥牛皮皮
|
125
126
127
128
|
position: static;
bottom: 3px;
text-align: center;
margin-top: 5px;
|
e011bf15
周超
我先走一步
|
129
|
" :page-size="this.parameter.pageSize" layout="total,prev, pager, next" :total="Count">
|
f6d2db76
yangzhi
超哥牛皮皮
|
130
131
132
133
134
135
|
</el-pagination>
<div style="clear: both"></div>
</div>
</div>
</el-col>
</el-row>
|
e011bf15
周超
我先走一步
|
136
137
138
|
<el-dialog title="分类维护" :visible.sync="dialogClassIVIsible" @close="closeClassDialog" width="400px"
:close-on-click-modal="false">
<el-form ref="QuestionClassInfo" :model="QuestionClassInfo" label-width="70px">
|
f6d2db76
yangzhi
超哥牛皮皮
|
139
|
<el-form-item label="分类名称">
|
e011bf15
周超
我先走一步
|
140
|
<el-input v-model="QuestionClassInfo.ClassificationName" placeholder="请输入分类名称"></el-input>
|
f6d2db76
yangzhi
超哥牛皮皮
|
141
142
|
</el-form-item>
</el-form>
|
e011bf15
周超
我先走一步
|
143
|
<el-button @click="CreateQuestionClassHealder" style="margin: 10px 0 0 0; float: right" type="primary">确定
|
f6d2db76
yangzhi
超哥牛皮皮
|
144
145
146
|
</el-button>
<div style="clear: both"></div>
</el-dialog>
|
e011bf15
周超
我先走一步
|
147
148
|
<el-dialog title="编辑题目" :visible.sync="dialogsubjectlVisible" @close="closeDialog" width="800px"
:close-on-click-modal="false">
|
f6d2db76
yangzhi
超哥牛皮皮
|
149
|
<el-form ref="Dataform" :model="Dataform" label-width="60px">
|
4ee13894
周超
给大志哥
|
150
151
152
153
154
|
<div style="padding:10px">
<el-alert v-if="FormClassType==2"
title="选项的维度分值如不设置将按照分值规则自动计算"
type="warning"></el-alert>
</div>
|
f6d2db76
yangzhi
超哥牛皮皮
|
155
|
<el-form-item label="题目">
|
e011bf15
周超
我先走一步
|
156
|
<el-input v-model="Dataform.subject" placeholder="请输入题目名称"></el-input>
|
f6d2db76
yangzhi
超哥牛皮皮
|
157
158
|
</el-form-item>
<el-form-item label="分类" style="padding-top: 5px">
|
4ee13894
周超
给大志哥
|
159
|
<el-cascader @change="changequestionclass" v-model="Dataform.QuestionClassId" style="width: 400px"
|
52e3f6e1
周超
微调题目维护
|
160
|
:props="{ emitPath: false ,checkStrictly:true}" :clearable="true" :options="QuestionClass">
|
f6d2db76
yangzhi
超哥牛皮皮
|
161
162
163
|
</el-cascader>
</el-form-item>
<el-form-item label="题型" style="padding-top: 5px">
|
e011bf15
周超
我先走一步
|
164
165
|
<el-select v-model="Dataform.subjectType" value-key="Dataform.subjectType" @change="changeQuestionType"
placeholder="请选择题型">
|
f6d2db76
yangzhi
超哥牛皮皮
|
166
167
168
|
<el-option label="单选题" :value="1"></el-option>
<el-option label="多选题" :value="2"></el-option>
<el-option label="主观题" :value="3"></el-option>
|
e1644c39
yangzhi
王哥起来屙尿了
|
169
|
<el-option label="语音题" :value="4"></el-option>
|
f6d2db76
yangzhi
超哥牛皮皮
|
170
171
172
173
174
175
|
</el-select>
</el-form-item>
<el-form-item label="选项" v-show="OptionVisible">
<el-table :data="subjectContent" :show-header="false">
<el-table-column>
<template slot-scope="scope">
|
e011bf15
周超
我先走一步
|
176
|
<el-input placeholder="请输入答案" v-model="scope.row.optionContent" class="optionInput"
|
4ee13894
周超
给大志哥
|
177
|
style="width:47% !important">
|
f6d2db76
yangzhi
超哥牛皮皮
|
178
179
|
<template slot="prepend">{{ scope.row.option }}</template>
</el-input>
|
cac28d75
周超
问卷 用户 维度
|
180
|
|
52e3f6e1
周超
微调题目维护
|
181
|
<el-input placeholder="维度分值" v-model="scope.row.score" class="optionInput"
|
e011bf15
周超
我先走一步
|
182
183
|
style="width:21% !important;margin-left:1%">
</el-input>
|
52e3f6e1
周超
微调题目维护
|
184
185
|
<!-- v-if="FormClassType==2" -->
<el-select v-model="scope.row.scorerule" class="optionInput" placeholder="分值规则" style="width:20% !important;margin-left:1%">
|
4ee13894
周超
给大志哥
|
186
187
188
|
<el-option label="" >不设置</el-option>
<el-option v-for="sritem in scoreRules" :label="sritem" :value="sritem">{{sritem}}</el-option>
</el-select>
|
f6d2db76
yangzhi
超哥牛皮皮
|
189
|
<i class="el-icon-circle-plus el-icon" @click="Addlist"></i>
|
e011bf15
周超
我先走一步
|
190
|
<i class="el-icon-remove el-icon" @click="RemoveList(scope)" v-if="scope.$index != 0"></i>
|
f6d2db76
yangzhi
超哥牛皮皮
|
191
192
|
</template>
</el-table-column>
|
e011bf15
周超
我先走一步
|
193
|
|
f6d2db76
yangzhi
超哥牛皮皮
|
194
195
|
</el-table>
</el-form-item>
|
4ee13894
周超
给大志哥
|
196
|
<el-form-item label="答案" v-show="OptionVisible" class="subjectContentClass" v-if="FormClassType!=2">
|
e011bf15
周超
我先走一步
|
197
|
<el-radio-group v-for="(item, i) in subjectContent" v-model="Dataform.answer" v-if="GroupVisible">
|
f6d2db76
yangzhi
超哥牛皮皮
|
198
199
|
<el-radio :label="item.option">{{ item.option }}</el-radio>
</el-radio-group>
|
e011bf15
周超
我先走一步
|
200
|
<el-checkbox-group v-for="(item, i) in subjectContent" v-model="Dataform.answer" v-if="!GroupVisible">
|
f6d2db76
yangzhi
超哥牛皮皮
|
201
202
|
<el-checkbox style="float: left" :label="item.option">{{
item.option
|
e011bf15
周超
我先走一步
|
203
|
}}</el-checkbox>
|
f6d2db76
yangzhi
超哥牛皮皮
|
204
205
|
</el-checkbox-group>
</el-form-item>
|
e011bf15
周超
我先走一步
|
206
207
|
<el-form-item label="分数" v-show="OptionVisible && FormClassType !=2">
<el-input-number :step="1" style="float: left" :min="0" v-model="Dataform.fraction">
|
f6d2db76
yangzhi
超哥牛皮皮
|
208
209
210
|
</el-input-number>
<div style="float: left; margin-left: 20px" v-if="!GroupVisible">
<lable style="font-weight: bold">单项分数:</lable>
|
e011bf15
周超
我先走一步
|
211
|
<el-input-number :step="0.5" :max="Dataform.fraction / 2" :min="0" v-model="Dataform.singleFraction">
|
f6d2db76
yangzhi
超哥牛皮皮
|
212
213
214
215
|
</el-input-number>
</div>
</el-form-item>
<el-form-item label="解析" style="margin-top: 10px">
|
e011bf15
周超
我先走一步
|
216
|
<el-input v-model="Dataform.analysis" :rows="10" type="textarea" placeholder="请输入答案解析" />
|
f6d2db76
yangzhi
超哥牛皮皮
|
217
218
|
</el-form-item>
</el-form>
|
e011bf15
周超
我先走一步
|
219
|
<el-button @click="EditQuestionHeadler" style="margin: 10px 0 0 0; float: right" type="primary">确定
|
f6d2db76
yangzhi
超哥牛皮皮
|
220
221
222
|
</el-button>
<div style="clear: both"></div>
</el-dialog>
|
e011bf15
周超
我先走一步
|
223
|
<EditDimension ref="editDimensionDialog" :model="currentEditDimension"></EditDimension>
|
f6d2db76
yangzhi
超哥牛皮皮
|
224
|
</div>
|
b89c8760
wangming
项目初始化
|
225
226
227
|
</template>
<script lang="ts">
|
e011bf15
周超
我先走一步
|
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
import {
getQuestionList,
EditQuestion,
getQuestionClassList,
DelQuestionBankEvent,
GetQuestionBankById,
CreateQuestionClass,
} from "@/api/QuestionBank";
import { parseTime } from "@/utils/index.js";
import EditDimension from "./components/EditDimension.vue";
export default {
filters: {},
components: {
EditDimension,
|
f6d2db76
yangzhi
超哥牛皮皮
|
242
|
},
|
e011bf15
周超
我先走一步
|
243
244
|
data() {
return {
|
4ee13894
周超
给大志哥
|
245
|
FormClassType: 0,
|
e011bf15
周超
我先走一步
|
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
loading: false,
currentEditDimension: {},
activeTab: "first",
parameter: {
pageIndex: 1,
pageSize: 12,
sort: "id",
sortOrder: 1,
keyword: "",
QuestionClassId: 0,
status: 1,
},
Count: 0,
QuestList: [],
dialogsubjectlVisible: false,
dialogClassIVIsible: false,
OptionVisible: true,
GroupVisible: true,
Dataform: {
subject: "",
subjectType: 1,
subjectContent: "",
QuestionClassId: 0,
answer: [],
analysis: "",
fraction: 0,
singleFraction: 0,
addTime: "2021-11-12",
|
4ee13894
周超
给大志哥
|
274
|
state: 1,
|
e011bf15
周超
我先走一步
|
275
276
277
278
279
|
},
subjectContent: [
{
option: "A",
optionContent: "",
|
4ee13894
周超
给大志哥
|
280
|
scorerule:'高'
|
e011bf15
周超
我先走一步
|
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
},
],
QuestionClass: [],
QuestionClassInfo: {
ParentId: 0,
ClassificationName: "",
Addtime: "",
},
TreeColHeight: 0,
TableColHeight: 0,
treeData: [],
firstTreeData: [],
secondTreeData: [],
CreatClassId: 0,
|
4ee13894
周超
给大志哥
|
295
|
scoreRules:['高','中','低'],
|
e011bf15
周超
我先走一步
|
296
|
};
|
f6d2db76
yangzhi
超哥牛皮皮
|
297
|
},
|
52e3f6e1
周超
微调题目维护
|
298
|
created() { },
|
e011bf15
周超
我先走一步
|
299
300
301
302
303
304
305
306
307
308
309
|
mounted() {
let ContentAreaHight =
window.innerHeight - document.getElementById("elRow").offsetTop - 70;
this.TableColHeight =
ContentAreaHight - document.getElementById("QuestionTable").offsetTop;
let lineNumber = this.TableColHeight - 50 - 20; //减去表头来计算
this.TreeColHeight = ContentAreaHight;
lineNumber = Math.floor(lineNumber / 49);
this.parameter.pageSize = lineNumber;
this.GetList();
this.getQuestionClassListHeadler();
|
f6d2db76
yangzhi
超哥牛皮皮
|
310
|
},
|
e011bf15
周超
我先走一步
|
311
|
methods: {
|
4ee13894
周超
给大志哥
|
312
|
AddSubject() {
|
e011bf15
周超
我先走一步
|
313
|
this.FormClassType = 0;
|
4ee13894
周超
给大志哥
|
314
315
|
// if(!this.Dataform.scoperule)
// this.Dataform.scoperule='高';
|
e011bf15
周超
我先走一步
|
316
317
|
this.dialogsubjectlVisible = true
},
|
4ee13894
周超
给大志哥
|
318
319
320
|
changequestionclass(a, b, c) {
var item = this.QuestionClass.find(o => o.id == a);
if (item) this.FormClassType = item.ClassType;
|
e011bf15
周超
我先走一步
|
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
},
//维度编辑
handleEditDimension(node, data) {
console.log(data);
// this.$refs.editDimensionDialog.dialogFormVisible = true;
this.$refs.editDimensionDialog.show(data.id);
this.currentEditDimension = data;
},
//切换分类
handleTabsClick(e) {
console.log(e.name);
},
//删除分类
handleDeleteQuestionClass(node, data) {
this.loading = true;
// console.log(node, data);
// console.log(this.API);
this.API.deleteQuestionClass(data.value).then((res) => {
|
4ee13894
周超
给大志哥
|
339
|
|
e011bf15
周超
我先走一步
|
340
341
|
this.getQuestionClassListHeadler();
|
4ee13894
周超
给大志哥
|
342
|
this.loading = false;
|
e011bf15
周超
我先走一步
|
343
344
345
346
347
348
349
350
351
352
|
this.$message.success('操作成功!');
});
},
closeClassDialog() {
this.dialogClassIVIsible = false;
},
//表格右边的操作按钮
handleCommand(value, val) {
if (value == "update") {
this.GetQuestionBankByIdHeadler(val);
|
f6d2db76
yangzhi
超哥牛皮皮
|
353
|
}
|
e011bf15
周超
我先走一步
|
354
355
356
357
358
359
|
if (value == "del") {
this.DelQuestionBankEventHeadler(val);
}
},
//添加分类
CreateQuestionClassHealder() {
|
4ee13894
周超
给大志哥
|
360
361
362
|
if (this.loading) return;
this.loading = true;
|
e011bf15
周超
我先走一步
|
363
364
365
366
|
this.QuestionClassInfo.Addtime = parseTime(new Date(), "");
CreateQuestionClass(this.QuestionClassInfo).then((res) => {
this.getQuestionClassListHeadler();
this.dialogClassIVIsible = false;
|
4ee13894
周超
给大志哥
|
367
368
369
|
setTimeout(() => {
this.loading = false;
}, 1000);
|
e011bf15
周超
我先走一步
|
370
371
372
373
374
|
});
},
//获取选择的题目详细信息
GetQuestionBankByIdHeadler(id) {
GetQuestionBankById(id).then((res) => {
|
4ee13894
周超
给大志哥
|
375
376
377
|
var d = this.QuestionClass.find(o => o.id == res.data.data.QuestionClassId);
if (d) this.FormClassType = d.ClassType;
|
e011bf15
周超
我先走一步
|
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
this.changeQuestionType(res.data.data.subjectType); //这里先初始化编辑显示内容
this.Dataform = res.data.data; //内容赋值
this.subjectContent = JSON.parse(res.data.data.subjectContent); //赋值选项
if (res.data.data.subjectType == 1) {
this.Dataform.answer = res.data.data.answer.split(",")[0]; //赋值答案
} else {
this.Dataform.answer = res.data.data.answer.split(","); //赋值答案
}
this.dialogsubjectlVisible = true;
});
},
showClassDialog(node) {
this.dialogClassIVIsible = true;
console.log(node);
this.QuestionClassInfo.ParentId = node.data.value;
// alert(this.QuestionClassInfo.ParentId);
},
//关闭弹框的事件
closeDialog() {
//初始化数据
this.Dataform = this.$options.data().Dataform;
this.subjectContent = this.$options.data().subjectContent;
//所有文本框恢复到初始化状态
|
f6d2db76
yangzhi
超哥牛皮皮
|
401
402
403
|
this.Dataform.answer = [];
this.OptionVisible = true;
this.GroupVisible = true;
|
e011bf15
周超
我先走一步
|
404
405
|
},
//选择题目类型来判断是否显示部分表单
|
4ee13894
周超
给大志哥
|
406
|
changeQuestionType(val) {
|
e1644c39
yangzhi
王哥起来屙尿了
|
407
|
if (val == 3 || val == 4) {
|
e011bf15
周超
我先走一步
|
408
409
410
411
412
413
|
this.OptionVisible = false;
}
if (val == 2) {
this.OptionVisible = true;
this.Dataform.answer = [];
this.GroupVisible = false;
|
4ee13894
周超
给大志哥
|
414
|
|
e011bf15
周超
我先走一步
|
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
|
}
if (val == 1) {
this.Dataform.answer = [];
this.OptionVisible = true;
this.GroupVisible = true;
}
},
headerStyle({ row, column, rowIndex, columnIndex }) {
return "tableStyle";
},
Addlist() {
if (this.subjectContent.length < 4) {
var alphabet = String.fromCharCode(
64 + parseInt(this.subjectContent.length + 1)
);
this.subjectContent.push({
option: alphabet,
title: "",
});
} else {
this.$confirm("系统暂时只支持4个答案!", "消息");
}
},
RemoveList(val) {
this.subjectContent.splice(val.$index, 1);
this.subjectContent.forEach((item, index) => {
item.option = String.fromCharCode(64 + parseInt(index + 1));
|
f6d2db76
yangzhi
超哥牛皮皮
|
442
|
});
|
e011bf15
周超
我先走一步
|
443
444
|
},
handleNodeClick(val) {
|
4ee13894
周超
给大志哥
|
445
|
if (this.loading) return;
|
e011bf15
周超
我先走一步
|
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
|
this.parameter.QuestionClassId = val.value;
this.parameter.pageIndex = 1;
this.GetList();
},
DelQuestionBankEventHeadler(id) {
this.$confirm("确定删除该试题?", "消息", {
confirmButtonText: "确认",
cancelButtonText: "取消",
callback: (action) => {
if (action == "confirm") {
DelQuestionBankEvent(id).then((res) => {
if (res.data.code == 200) {
this.$confirm(res.data.message, "消息");
this.GetList();
}
});
}
},
});
},
EditQuestionHeadler() {
let reg = new RegExp('"', "g");
//this.Dataform.subjectContent = JSON.stringify(this.subjectContent).replace(reg, "\"");
this.Dataform.subjectContent = this.subjectContent;
if (typeof this.Dataform.answer != "string")
//判断是否为字符串
this.Dataform.answer = this.Dataform.answer.join(",");
var _this = this;
EditQuestion(this.Dataform).then((res) => {
if (res.data.code == 200) {
_this.GetList();
this.$message(res.data.message);
setTimeout(function () {
_this.dialogsubjectlVisible = false;
}, 10);
|
f6d2db76
yangzhi
超哥牛皮皮
|
481
|
}
|
f6d2db76
yangzhi
超哥牛皮皮
|
482
|
});
|
e011bf15
周超
我先走一步
|
483
484
485
486
487
488
489
|
},
GetList() {
let _this = this;
getQuestionList(_this.parameter).then((res) => {
_this.QuestList = res.data.data.rows;
_this.Count = res.data.data.total;
_this.$forceUpdate();
|
f6d2db76
yangzhi
超哥牛皮皮
|
490
|
});
|
e011bf15
周超
我先走一步
|
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
|
},
currentchange(page) {
this.parameter.pageIndex = page;
this.GetList();
},
getSubTree(id, list) {
let result = [];
result = list.filter((t) => t.ParentId == id);
if (result.length) {
result = result.map((item) => {
item.children = this.getSubTree(item.id, list);
return item;
});
}
return result;
},
getQuestionClassListHeadler() {
let _this = this;
getQuestionClassList().then((res) => {
let list = res.data.data;
list = list.map((t) => {
t.value = t.id;
t.label = t.ClassificationName;
return t;
});
let firstClass = list.find((t) => t.id == 6);
firstClass.children = this.getSubTree(6, list);
let secondClass = list.find((t) => t.id == 1);
secondClass.children = this.getSubTree(1, list);
this.QuestionClass = list;
|
b89c8760
wangming
项目初始化
|
521
|
|
e011bf15
周超
我先走一步
|
522
523
524
525
|
this.firstTreeData = [firstClass];
this.secondTreeData = [secondClass];
});
},
|
f6d2db76
yangzhi
超哥牛皮皮
|
526
|
},
|
e011bf15
周超
我先走一步
|
527
|
};
|
b89c8760
wangming
项目初始化
|
528
529
|
</script>
<style scoped="scoped">
|
e011bf15
周超
我先走一步
|
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
|
/deep/.cell {
padding-left: 0px;
}
/deep/.el-form-item {
margin-bottom: 5px;
}
/deep/.el-radio {
margin-right: 10px;
}
/deep/.el-radio__input.is-checked .el-radio__inner {
border-color: #409eff;
background-color: #409eff;
}
/deep/.el-radio__input.is-checked+.el-radio__label {
color: #409eff;
font-weight: bold;
}
/deep/.tableStyle {
background-color: #304156 !important;
color: #fff;
font-weight: 400;
}
.QuestDiv {
width: 24%;
float: left;
min-height: 50px;
border: 1px solid #cdcdcd;
margin-right: 10px;
box-shadow: 0 0 10px #808080;
border-radius: 8px;
min-height: 100px;
background-color: #fff;
opacity: 0.8;
margin-bottom: 10px;
height: 313px;
}
.clear {
clear: both;
margin-bottom: 10px;
}
.font-color {
background-color: #ae1e15 !important;
color: #fff;
box-shadow: 0 0 5px #ae1e15;
}
/deep/.el-input-group__prepend {
font-weight: bold;
width: 30px;
text-align: center;
background: #409eff;
color: #fff;
}
.optionInput {
float: left;
width: 620px !important;
}
.el-icon {
font-size: 20px;
line-height: 40px;
margin: 0 5px;
cursor: pointer;
color: #409eff !important;
}
>>>.subjectContentClass .el-checkbox__label {
padding-right: 10px !important;
}
.seetingsDiv {
width: 100%;
height: 60px;
background: #efefef;
line-height: 60px;
border-radius: 5px;
box-shadow: 0 0 5px #cdcdcd;
}
.seetingsDiv button {
background-color: #304156;
border: 0px;
margin-left: 10px;
box-shadow: 0 0 5px #cdcdcd;
float: right;
margin-top: 12px;
margin-right: 10px;
}
.areadiv {
background-color: #efefef;
border-radius: 5px;
box-shadow: 0 0 5px #efefef;
}
.TreeHeader {
background-color: #304156;
height: 60px;
border-radius: 5px;
box-shadow: 0 0 10px #efefef;
line-height: 60px;
color: #fff;
padding-left: 10px;
}
.classbtn {
float: right;
margin: 11px 10px 0 0;
height: 35px;
line-height: 12px;
}
.eltree {
background-color: #efefef;
}
/deep/.el-tree-node__content {
min-height: 40px;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>
|