Commit 94c54e928adafc245e50889a4bb6ef99d0220258
1 parent
46c73197
1
Showing
8 changed files
with
301 additions
and
57 deletions
src/api/QuestionBank.js
| @@ -39,6 +39,20 @@ export function DelQuestionBankEvent(id) { | @@ -39,6 +39,20 @@ export function DelQuestionBankEvent(id) { | ||
| 39 | method: 'post', | 39 | method: 'post', |
| 40 | }) | 40 | }) |
| 41 | } | 41 | } |
| 42 | +//删除题目,标记删除 | ||
| 43 | +export function ChangeQuestionBankClass(id,type) { | ||
| 44 | + return request({ | ||
| 45 | + url: `/QuestionBank/ChangeQuestionBankClass?id=${id}&type=${type}`, | ||
| 46 | + method: 'post', | ||
| 47 | + }) | ||
| 48 | +} | ||
| 49 | +//删除题目,标记删除 | ||
| 50 | +export function ChangeQuestionBankType(id,type) { | ||
| 51 | + return request({ | ||
| 52 | + url: `/QuestionBank/ChangeQuestionBankType?id=${id}&type=${type}`, | ||
| 53 | + method: 'post', | ||
| 54 | + }) | ||
| 55 | +} | ||
| 42 | //读取题目信息 | 56 | //读取题目信息 |
| 43 | export function GetQuestionBankById(id) { | 57 | export function GetQuestionBankById(id) { |
| 44 | return request({ | 58 | return request({ |
src/views/QuestionBank/QuestionDimension.vue
| @@ -142,14 +142,14 @@ | @@ -142,14 +142,14 @@ | ||
| 142 | > | 142 | > |
| 143 | </el-cascader> | 143 | </el-cascader> |
| 144 | </el-form-item> | 144 | </el-form-item> |
| 145 | - <el-form-item label="板块分类" class="el-form-item-custom"> | 145 | + <!-- <el-form-item label="板块分类" class="el-form-item-custom"> |
| 146 | <el-select | 146 | <el-select |
| 147 | v-model="TestPaper.PlateClass" | 147 | v-model="TestPaper.PlateClass" |
| 148 | placeholder="请选择板块分类" | 148 | placeholder="请选择板块分类" |
| 149 | > | 149 | > |
| 150 | <el-option label="面试题" value="4"></el-option> | 150 | <el-option label="面试题" value="4"></el-option> |
| 151 | </el-select> | 151 | </el-select> |
| 152 | - </el-form-item> | 152 | + </el-form-item> --> |
| 153 | <el-form-item label="试卷原价:" prop="OriginalPrice" v-show="false"> | 153 | <el-form-item label="试卷原价:" prop="OriginalPrice" v-show="false"> |
| 154 | <el-input | 154 | <el-input |
| 155 | class="testpaper-input" | 155 | class="testpaper-input" |
src/views/QuestionBank/components/EditDimension.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-dialog title="维度编辑" :visible.sync="dialogFormVisible" @closed="dialogFormVisible = false" width="75%"> | 2 | + <el-dialog title="维度编辑" :visible.sync="dialogFormVisible" @closed="handleclose" width="75%"> |
| 3 | <el-form :model="data"> | 3 | <el-form :model="data"> |
| 4 | <el-form-item label="名称"> | 4 | <el-form-item label="名称"> |
| 5 | <el-input v-model="data.ClassificationName"></el-input> | 5 | <el-input v-model="data.ClassificationName"></el-input> |
| @@ -158,6 +158,10 @@ | @@ -158,6 +158,10 @@ | ||
| 158 | // this.show(); | 158 | // this.show(); |
| 159 | }, | 159 | }, |
| 160 | methods: { | 160 | methods: { |
| 161 | + handleclose(){ | ||
| 162 | + this.dialogFormVisible = false; | ||
| 163 | + this.$emit('close',this.data); | ||
| 164 | + }, | ||
| 161 | handleSave() { | 165 | handleSave() { |
| 162 | if (!this.data.ClassificationName) { | 166 | if (!this.data.ClassificationName) { |
| 163 | this.$message.warning('请填写名称!', "消息"); | 167 | this.$message.warning('请填写名称!', "消息"); |
| @@ -168,6 +172,7 @@ | @@ -168,6 +172,7 @@ | ||
| 168 | if (res.data.code == 200) { | 172 | if (res.data.code == 200) { |
| 169 | this.$message.success('保存成功!', "消息"); | 173 | this.$message.success('保存成功!', "消息"); |
| 170 | this.dialogFormVisible = false; | 174 | this.dialogFormVisible = false; |
| 175 | + this.$emit('save',this.data); | ||
| 171 | this.data = { | 176 | this.data = { |
| 172 | rules: [ | 177 | rules: [ |
| 173 | { | 178 | { |
src/views/QuestionBank/index.vue
| @@ -13,18 +13,22 @@ | @@ -13,18 +13,22 @@ | ||
| 13 | <el-tab-pane label="专业类" name="first"></el-tab-pane> | 13 | <el-tab-pane label="专业类" name="first"></el-tab-pane> |
| 14 | <el-tab-pane label="测评类" name="second"></el-tab-pane> | 14 | <el-tab-pane label="测评类" name="second"></el-tab-pane> |
| 15 | </el-tabs> | 15 | </el-tabs> |
| 16 | - <el-tree :data="activeTab == 'first' ? firstTreeData : secondTreeData" | 16 | + <el-button type="button" size="mini" style="width:100%;margin-bottom:10px" |
| 17 | + @click="showClassDialog(null,0,activeTab == 'first' ? 0 : 2)"> | ||
| 18 | + 添加顶级 | ||
| 19 | + </el-button> | ||
| 20 | + <el-tree :data="activeTab == 'first' ? firstTreeData : secondTreeData" :default-expanded-keys="currentExpend" | ||
| 17 | :props="activeTab == 'first' ? firstTreeData : secondTreeData" @node-click="handleNodeClick" | 21 | :props="activeTab == 'first' ? firstTreeData : secondTreeData" @node-click="handleNodeClick" |
| 18 | - class="eltree" :expand-on-click-node="false"> | 22 | + class="eltree" :expand-on-click-node="false" ref="tree"> |
| 19 | <span class="custom-tree-node" slot-scope="{ node, data }"> | 23 | <span class="custom-tree-node" slot-scope="{ node, data }"> |
| 20 | <span>{{ node.label }}</span> | 24 | <span>{{ node.label }}</span> |
| 21 | <span style=""> | 25 | <span style=""> |
| 22 | <!-- v-if="activeTab == 'first'?true:node.level<2?true:false" --> | 26 | <!-- v-if="activeTab == 'first'?true:node.level<2?true:false" --> |
| 23 | - <el-button type="text" size="mini" @click="showClassDialog(node)" | ||
| 24 | - > | 27 | + <el-button type="text" size="mini" @click="showClassDialog(node)"> |
| 25 | 添加下级 | 28 | 添加下级 |
| 26 | </el-button> | 29 | </el-button> |
| 27 | - <el-button type="text" v-if="activeTab == 'second'" @click="handleEditDimension(node, data)">编辑 | 30 | + <el-button type="text" v-if="activeTab == 'second' || 1==1" @click="handleEditDimension(node, data)"> |
| 31 | + 编辑 | ||
| 28 | </el-button> | 32 | </el-button> |
| 29 | <el-button type="text" size="mini" @click="() => handleDeleteQuestionClass(node, data)"> | 33 | <el-button type="text" size="mini" @click="() => handleDeleteQuestionClass(node, data)"> |
| 30 | 删除 | 34 | 删除 |
| @@ -38,8 +42,16 @@ | @@ -38,8 +42,16 @@ | ||
| 38 | <el-col :span="18"> | 42 | <el-col :span="18"> |
| 39 | <div class="grid-content bg-purple-light"> | 43 | <div class="grid-content bg-purple-light"> |
| 40 | <div class="seetingsDiv" style=""> | 44 | <div class="seetingsDiv" style=""> |
| 45 | + | ||
| 46 | + | ||
| 41 | <el-button type="primary" @click="AddSubject">添加题目 | 47 | <el-button type="primary" @click="AddSubject">添加题目 |
| 42 | </el-button> | 48 | </el-button> |
| 49 | + <el-button type="danger" @click="handleDelete">批量删除 | ||
| 50 | + </el-button> | ||
| 51 | + <el-button type="danger" @click="handleChangeCat">批量修改分类 | ||
| 52 | + </el-button> | ||
| 53 | + <el-button type="danger" @click="handleChangeType">批量修改题型 | ||
| 54 | + </el-button> | ||
| 43 | </div> | 55 | </div> |
| 44 | <div class="areadiv" :style="{ height: TableColHeight + 'px' }"> | 56 | <div class="areadiv" :style="{ height: TableColHeight + 'px' }"> |
| 45 | <el-table :data="QuestList" id="QuestionTable" border style=" | 57 | <el-table :data="QuestList" id="QuestionTable" border style=" |
| @@ -47,7 +59,8 @@ | @@ -47,7 +59,8 @@ | ||
| 47 | border-radius: 5px; | 59 | border-radius: 5px; |
| 48 | box-shadow: 0 0 10px #efefef; | 60 | box-shadow: 0 0 10px #efefef; |
| 49 | margin-top: 10px; | 61 | margin-top: 10px; |
| 50 | - " :header-cell-class-name="headerStyle" :stripe="true"> | 62 | + " :header-cell-class-name="headerStyle" :stripe="true" ref="table"> |
| 63 | + <el-table-column type="selection" width="55"> </el-table-column> | ||
| 51 | <el-table-column prop="date" label="ID" width="80"> | 64 | <el-table-column prop="date" label="ID" width="80"> |
| 52 | <template slot-scope="scope"> | 65 | <template slot-scope="scope"> |
| 53 | <span>{{ scope.row.id }}</span> | 66 | <span>{{ scope.row.id }}</span> |
| @@ -148,9 +161,7 @@ | @@ -148,9 +161,7 @@ | ||
| 148 | :close-on-click-modal="false"> | 161 | :close-on-click-modal="false"> |
| 149 | <el-form ref="Dataform" :model="Dataform" label-width="60px"> | 162 | <el-form ref="Dataform" :model="Dataform" label-width="60px"> |
| 150 | <div style="padding:10px"> | 163 | <div style="padding:10px"> |
| 151 | - <el-alert v-if="FormClassType==2" | ||
| 152 | - title="选项的维度分值如不设置将按照分值规则自动计算" | ||
| 153 | - type="warning"></el-alert> | 164 | + <el-alert v-if="FormClassType==2" title="选项的维度分值如不设置将按照分值规则自动计算" type="warning"></el-alert> |
| 154 | </div> | 165 | </div> |
| 155 | <el-form-item label="题目"> | 166 | <el-form-item label="题目"> |
| 156 | <el-input v-model="Dataform.subject" placeholder="请输入题目名称"></el-input> | 167 | <el-input v-model="Dataform.subject" placeholder="请输入题目名称"></el-input> |
| @@ -178,12 +189,13 @@ | @@ -178,12 +189,13 @@ | ||
| 178 | <template slot="prepend">{{ scope.row.option }}</template> | 189 | <template slot="prepend">{{ scope.row.option }}</template> |
| 179 | </el-input> | 190 | </el-input> |
| 180 | 191 | ||
| 181 | - <el-input placeholder="维度分值" v-model="scope.row.score" class="optionInput" | 192 | + <el-input placeholder="维度分值" v-model="scope.row.score" class="optionInput" |
| 182 | style="width:21% !important;margin-left:1%"> | 193 | style="width:21% !important;margin-left:1%"> |
| 183 | </el-input> | 194 | </el-input> |
| 184 | <!-- v-if="FormClassType==2" --> | 195 | <!-- v-if="FormClassType==2" --> |
| 185 | - <el-select v-model="scope.row.scorerule" class="optionInput" placeholder="分值规则" style="width:20% !important;margin-left:1%"> | ||
| 186 | - <el-option label="" >不设置</el-option> | 196 | + <el-select v-model="scope.row.scorerule" class="optionInput" placeholder="分值规则" |
| 197 | + style="width:20% !important;margin-left:1%"> | ||
| 198 | + <el-option label="">不设置</el-option> | ||
| 187 | <el-option v-for="sritem in scoreRules" :label="sritem" :value="sritem">{{sritem}}</el-option> | 199 | <el-option v-for="sritem in scoreRules" :label="sritem" :value="sritem">{{sritem}}</el-option> |
| 188 | </el-select> | 200 | </el-select> |
| 189 | <i class="el-icon-circle-plus el-icon" @click="Addlist"></i> | 201 | <i class="el-icon-circle-plus el-icon" @click="Addlist"></i> |
| @@ -220,7 +232,44 @@ | @@ -220,7 +232,44 @@ | ||
| 220 | </el-button> | 232 | </el-button> |
| 221 | <div style="clear: both"></div> | 233 | <div style="clear: both"></div> |
| 222 | </el-dialog> | 234 | </el-dialog> |
| 223 | - <EditDimension ref="editDimensionDialog" :model="currentEditDimension"></EditDimension> | 235 | + |
| 236 | + <el-dialog title="批量设置分类" :visible.sync="dialogsubjectlVisibleSetCat" @close="closeDialogCat" width="800px" | ||
| 237 | + :close-on-click-modal="false"> | ||
| 238 | + <el-form ref="Dataform" :model="Dataform" label-width="60px"> | ||
| 239 | + | ||
| 240 | + <el-form-item label="分类" style="padding-top: 5px"> | ||
| 241 | + <el-cascader v-model="QuestionClassId" style="width: 400px" :props="{ emitPath: false ,checkStrictly:true}" | ||
| 242 | + :clearable="true" :options="QuestionClass"> | ||
| 243 | + </el-cascader> | ||
| 244 | + </el-form-item> | ||
| 245 | + | ||
| 246 | + </el-form> | ||
| 247 | + <el-button @click="handleSetClass" style="margin: 10px 0 0 0; float: right" type="primary">确定 | ||
| 248 | + </el-button> | ||
| 249 | + <div style="clear: both"></div> | ||
| 250 | + </el-dialog> | ||
| 251 | + | ||
| 252 | + <el-dialog title="批量设置题型" :visible.sync="dialogsubjectlVisibleSetType" @close="closeDialogType" width="800px" | ||
| 253 | + :close-on-click-modal="false"> | ||
| 254 | + <el-form ref="Dataform" :model="Dataform" label-width="60px"> | ||
| 255 | + | ||
| 256 | + <el-form-item label="题型" style="padding-top: 5px"> | ||
| 257 | + <el-select v-model="QuestionTypeId" placeholder="请选择题型"> | ||
| 258 | + <el-option label="请选择" value=""></el-option> | ||
| 259 | + <el-option label="单选题" :value="1"></el-option> | ||
| 260 | + <el-option label="多选题" :value="2"></el-option> | ||
| 261 | + <el-option label="主观题" :value="3"></el-option> | ||
| 262 | + <el-option label="语音题" :value="4"></el-option> | ||
| 263 | + </el-select> | ||
| 264 | + </el-form-item> | ||
| 265 | + | ||
| 266 | + </el-form> | ||
| 267 | + <el-button @click="handleSetType" style="margin: 10px 0 0 0; float: right" type="primary">确定 | ||
| 268 | + </el-button> | ||
| 269 | + <div style="clear: both"></div> | ||
| 270 | + </el-dialog> | ||
| 271 | + <EditDimension ref="editDimensionDialog" :model="currentEditDimension" @close="closeEditDim" @save="saveEditDim"> | ||
| 272 | + </EditDimension> | ||
| 224 | </div> | 273 | </div> |
| 225 | </template> | 274 | </template> |
| 226 | 275 | ||
| @@ -231,7 +280,7 @@ | @@ -231,7 +280,7 @@ | ||
| 231 | getQuestionClassList, | 280 | getQuestionClassList, |
| 232 | DelQuestionBankEvent, | 281 | DelQuestionBankEvent, |
| 233 | GetQuestionBankById, | 282 | GetQuestionBankById, |
| 234 | - CreateQuestionClass, | 283 | + CreateQuestionClass, ChangeQuestionBankClass, ChangeQuestionBankType |
| 235 | } from "@/api/QuestionBank"; | 284 | } from "@/api/QuestionBank"; |
| 236 | import { parseTime } from "@/utils/index.js"; | 285 | import { parseTime } from "@/utils/index.js"; |
| 237 | import EditDimension from "./components/EditDimension.vue"; | 286 | import EditDimension from "./components/EditDimension.vue"; |
| @@ -257,6 +306,13 @@ | @@ -257,6 +306,13 @@ | ||
| 257 | }, | 306 | }, |
| 258 | Count: 0, | 307 | Count: 0, |
| 259 | QuestList: [], | 308 | QuestList: [], |
| 309 | + QuestionClassId: 0, | ||
| 310 | + dialogsubjectlVisibleSetCat: false, | ||
| 311 | + | ||
| 312 | + QuestionTypeId: '', | ||
| 313 | + dialogsubjectlVisibleSetType: false, | ||
| 314 | + | ||
| 315 | + | ||
| 260 | dialogsubjectlVisible: false, | 316 | dialogsubjectlVisible: false, |
| 261 | dialogClassIVIsible: false, | 317 | dialogClassIVIsible: false, |
| 262 | OptionVisible: true, | 318 | OptionVisible: true, |
| @@ -271,13 +327,13 @@ | @@ -271,13 +327,13 @@ | ||
| 271 | fraction: 0, | 327 | fraction: 0, |
| 272 | singleFraction: 0, | 328 | singleFraction: 0, |
| 273 | addTime: "2021-11-12", | 329 | addTime: "2021-11-12", |
| 274 | - state: 1, | 330 | + state: 1, |
| 275 | }, | 331 | }, |
| 276 | subjectContent: [ | 332 | subjectContent: [ |
| 277 | { | 333 | { |
| 278 | option: "A", | 334 | option: "A", |
| 279 | optionContent: "", | 335 | optionContent: "", |
| 280 | - scorerule:'高' | 336 | + scorerule: '高' |
| 281 | }, | 337 | }, |
| 282 | ], | 338 | ], |
| 283 | QuestionClass: [], | 339 | QuestionClass: [], |
| @@ -292,7 +348,9 @@ | @@ -292,7 +348,9 @@ | ||
| 292 | firstTreeData: [], | 348 | firstTreeData: [], |
| 293 | secondTreeData: [], | 349 | secondTreeData: [], |
| 294 | CreatClassId: 0, | 350 | CreatClassId: 0, |
| 295 | - scoreRules:['高','中','低'], | 351 | + scoreRules: ['高', '中', '低'], |
| 352 | + currentEditNode: undefined, | ||
| 353 | + currentExpend:[1] | ||
| 296 | }; | 354 | }; |
| 297 | }, | 355 | }, |
| 298 | created() { }, | 356 | created() { }, |
| @@ -309,7 +367,99 @@ | @@ -309,7 +367,99 @@ | ||
| 309 | this.getQuestionClassListHeadler(); | 367 | this.getQuestionClassListHeadler(); |
| 310 | }, | 368 | }, |
| 311 | methods: { | 369 | methods: { |
| 312 | - AddSubject() { | 370 | + closeEditDim(data) { |
| 371 | + }, | ||
| 372 | + | ||
| 373 | + saveEditDim(data) { | ||
| 374 | + // if(this.currentEditNode && this.currentEditNode.parent) | ||
| 375 | + // this.currentExpend=[this.currentEditNode.parent.data.id]; | ||
| 376 | + // { | ||
| 377 | + // this.currentEditNode.label = data.ClassificationName; | ||
| 378 | + // this.currentEditNode.data.ClassificationName = data.ClassificationName; | ||
| 379 | + // if(this.currentEditNode.parent) | ||
| 380 | + // { | ||
| 381 | + // this.currentEditNode.parent.loaded =false; | ||
| 382 | + // this.currentEditNode.parent.expand(); | ||
| 383 | + // } | ||
| 384 | + // } | ||
| 385 | + this.getQuestionClassListHeadler(); | ||
| 386 | + this.$forceUpdate(); | ||
| 387 | + }, | ||
| 388 | + handleDelete() { | ||
| 389 | + var rows = this.$refs.table.selection; | ||
| 390 | + if (!rows || rows.length < 1) { | ||
| 391 | + this.$message.warning('至少选择一项进行操作!'); | ||
| 392 | + return; | ||
| 393 | + } | ||
| 394 | + this.$confirm("确认删除选择的题目吗?", "提示", { | ||
| 395 | + confirmButtonText: "确定", | ||
| 396 | + cancelButtonText: "取消", | ||
| 397 | + type: "warning", | ||
| 398 | + }).then(() => { | ||
| 399 | + DelQuestionBankEvent(rows.map(o => o.id).join(',')).then((o) => { | ||
| 400 | + this.$message.success("删除成功"); | ||
| 401 | + this.GetList(); | ||
| 402 | + }); | ||
| 403 | + }); | ||
| 404 | + | ||
| 405 | + }, | ||
| 406 | + handleSetClass() { | ||
| 407 | + var rows = this.$refs.table.selection; | ||
| 408 | + if (!this.QuestionClassId || this.QuestionClassId < 1) { | ||
| 409 | + this.$message.warning('至少选择一个分类进行操作!'); | ||
| 410 | + return; | ||
| 411 | + } | ||
| 412 | + this.$confirm("确认批量修改题目分类吗?", "提示", { | ||
| 413 | + confirmButtonText: "确定", | ||
| 414 | + cancelButtonText: "取消", | ||
| 415 | + type: "warning", | ||
| 416 | + }).then(() => { | ||
| 417 | + ChangeQuestionBankClass(rows.map(o => o.id).join(','), this.QuestionClassId).then((o) => { | ||
| 418 | + this.$message.success("修改成功"); | ||
| 419 | + this.GetList(); | ||
| 420 | + this.dialogsubjectlVisibleSetCat = false; | ||
| 421 | + }); | ||
| 422 | + }); | ||
| 423 | + }, | ||
| 424 | + handleChangeCat() { | ||
| 425 | + var rows = this.$refs.table.selection; | ||
| 426 | + if (!rows || rows.length < 1) { | ||
| 427 | + this.$message.warning('至少选择一项进行操作!'); | ||
| 428 | + return; | ||
| 429 | + } | ||
| 430 | + this.dialogsubjectlVisibleSetCat = true; | ||
| 431 | + }, | ||
| 432 | + | ||
| 433 | + | ||
| 434 | + handleSetType() { | ||
| 435 | + var rows = this.$refs.table.selection; | ||
| 436 | + if (!this.QuestionTypeId || this.QuestionTypeId < 1) { | ||
| 437 | + this.$message.warning('至少选择一个类型进行操作!'); | ||
| 438 | + return; | ||
| 439 | + } | ||
| 440 | + this.$confirm("确认批量修改题目类型吗?", "提示", { | ||
| 441 | + confirmButtonText: "确定", | ||
| 442 | + cancelButtonText: "取消", | ||
| 443 | + type: "warning", | ||
| 444 | + }).then(() => { | ||
| 445 | + ChangeQuestionBankType(rows.map(o => o.id).join(','), this.QuestionTypeId).then((o) => { | ||
| 446 | + this.$message.success("修改成功"); | ||
| 447 | + this.GetList(); | ||
| 448 | + this.dialogsubjectlVisibleSetType = false; | ||
| 449 | + }); | ||
| 450 | + }); | ||
| 451 | + }, | ||
| 452 | + handleChangeType() { | ||
| 453 | + var rows = this.$refs.table.selection; | ||
| 454 | + if (!rows || rows.length < 1) { | ||
| 455 | + this.$message.warning('至少选择一项进行操作!'); | ||
| 456 | + return; | ||
| 457 | + } | ||
| 458 | + this.dialogsubjectlVisibleSetType = true; | ||
| 459 | + }, | ||
| 460 | + | ||
| 461 | + | ||
| 462 | + AddSubject() { | ||
| 313 | this.FormClassType = 0; | 463 | this.FormClassType = 0; |
| 314 | // if(!this.Dataform.scoperule) | 464 | // if(!this.Dataform.scoperule) |
| 315 | // this.Dataform.scoperule='高'; | 465 | // this.Dataform.scoperule='高'; |
| @@ -325,6 +475,7 @@ | @@ -325,6 +475,7 @@ | ||
| 325 | // this.$refs.editDimensionDialog.dialogFormVisible = true; | 475 | // this.$refs.editDimensionDialog.dialogFormVisible = true; |
| 326 | this.$refs.editDimensionDialog.show(data.id); | 476 | this.$refs.editDimensionDialog.show(data.id); |
| 327 | this.currentEditDimension = data; | 477 | this.currentEditDimension = data; |
| 478 | + this.currentEditNode = node; | ||
| 328 | }, | 479 | }, |
| 329 | //切换分类 | 480 | //切换分类 |
| 330 | handleTabsClick(e) { | 481 | handleTabsClick(e) { |
| @@ -386,10 +537,13 @@ | @@ -386,10 +537,13 @@ | ||
| 386 | this.dialogsubjectlVisible = true; | 537 | this.dialogsubjectlVisible = true; |
| 387 | }); | 538 | }); |
| 388 | }, | 539 | }, |
| 389 | - showClassDialog(node) { | 540 | + showClassDialog(node, parent, type) { |
| 390 | this.dialogClassIVIsible = true; | 541 | this.dialogClassIVIsible = true; |
| 391 | console.log(node); | 542 | console.log(node); |
| 392 | - this.QuestionClassInfo.ParentId = node.data.value; | 543 | + if (parent && parent == 0) this.QuestionClassInfo.ParentId = 0; |
| 544 | + if (node) | ||
| 545 | + this.QuestionClassInfo.ParentId = node.data.value; | ||
| 546 | + if (type != undefined) this.QuestionClassInfo.ClassType = type; | ||
| 393 | // alert(this.QuestionClassInfo.ParentId); | 547 | // alert(this.QuestionClassInfo.ParentId); |
| 394 | }, | 548 | }, |
| 395 | //关闭弹框的事件 | 549 | //关闭弹框的事件 |
| @@ -402,6 +556,16 @@ | @@ -402,6 +556,16 @@ | ||
| 402 | this.OptionVisible = true; | 556 | this.OptionVisible = true; |
| 403 | this.GroupVisible = true; | 557 | this.GroupVisible = true; |
| 404 | }, | 558 | }, |
| 559 | + closeDialogCat() { | ||
| 560 | + this.QuestionClassId = 0; | ||
| 561 | + this.dialogsubjectlVisibleSetCat = false; | ||
| 562 | + }, | ||
| 563 | + closeDialogType() { | ||
| 564 | + this.QuestionClassTypeId = ''; | ||
| 565 | + this.dialogsubjectlVisibleSetType = false; | ||
| 566 | + }, | ||
| 567 | + | ||
| 568 | + | ||
| 405 | //选择题目类型来判断是否显示部分表单 | 569 | //选择题目类型来判断是否显示部分表单 |
| 406 | changeQuestionType(val) { | 570 | changeQuestionType(val) { |
| 407 | if (val == 3 || val == 4) { | 571 | if (val == 3 || val == 4) { |
| @@ -513,14 +677,38 @@ | @@ -513,14 +677,38 @@ | ||
| 513 | t.label = t.ClassificationName; | 677 | t.label = t.ClassificationName; |
| 514 | return t; | 678 | return t; |
| 515 | }); | 679 | }); |
| 516 | - let firstClass = list.find((t) => t.id == 6); | ||
| 517 | - firstClass.children = this.getSubTree(6, list); | ||
| 518 | - let secondClass = list.find((t) => t.id == 1); | ||
| 519 | - secondClass.children = this.getSubTree(1, list); | 680 | + // let firstClass = list.find((t) => t.id == 6); |
| 681 | + // firstClass.children = this.getSubTree(6, list); | ||
| 682 | + // let secondClass = list.find((t) => t.id == 1); | ||
| 683 | + // secondClass.children = this.getSubTree(1, list); | ||
| 520 | this.QuestionClass = list; | 684 | this.QuestionClass = list; |
| 521 | 685 | ||
| 522 | - this.firstTreeData = [firstClass]; | ||
| 523 | - this.secondTreeData = [secondClass]; | 686 | + var firstlist = list.filter(o => o.ClassType == 0 && o.ParentId == 0).map(o => { |
| 687 | + o.children = this.getSubTree(o.id, list); | ||
| 688 | + return o; | ||
| 689 | + }); | ||
| 690 | + | ||
| 691 | + var twolist = list.filter(o => o.ClassType == 2 && o.ParentId == 0).map(o => { | ||
| 692 | + o.children = this.getSubTree(o.id, list); | ||
| 693 | + return o; | ||
| 694 | + | ||
| 695 | + }); | ||
| 696 | + | ||
| 697 | + this.firstTreeData = firstlist; | ||
| 698 | + this.secondTreeData = twolist; | ||
| 699 | + // _this.$nextTick(()=>{ | ||
| 700 | + // if(_this.currentEditNode){ | ||
| 701 | + // _this.$refs.tree.getNode(_this.currentEditNode.parent).loaded = false | ||
| 702 | + // _this.$refs.tree.getNode(_this.currentEditNode.parent).expand(); | ||
| 703 | + // _this.$refs.tree.getNode(_this.currentEditNode.parent).expanded=true; | ||
| 704 | + // _this.$forceUpdate() | ||
| 705 | + | ||
| 706 | + // } | ||
| 707 | + | ||
| 708 | + // }); | ||
| 709 | + | ||
| 710 | + // this.firstTreeData = [firstClass]; | ||
| 711 | + // this.secondTreeData = [secondClass]; | ||
| 524 | }); | 712 | }); |
| 525 | }, | 713 | }, |
| 526 | }, | 714 | }, |
src/views/TestPaper/ManualTestPaper.vue
| @@ -30,16 +30,17 @@ | @@ -30,16 +30,17 @@ | ||
| 30 | <el-col :span="10" :style="{'height':contentHeight+'px'}"> | 30 | <el-col :span="10" :style="{'height':contentHeight+'px'}"> |
| 31 | <div class="grid-content bg-purple"> | 31 | <div class="grid-content bg-purple"> |
| 32 | <div class="areahead"> | 32 | <div class="areahead"> |
| 33 | - <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span> | ||
| 34 | - <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input> | 33 | + <!-- <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span> --> |
| 34 | + <!-- <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input> | ||
| 35 | <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit" | 35 | <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit" |
| 36 | - style="margin-left: 5px;cursor: pointer;"></i> | 36 | + style="margin-left: 5px;cursor: pointer;"></i> --> |
| 37 | + 题目内容 | ||
| 37 | </div> | 38 | </div> |
| 38 | 39 | ||
| 39 | <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2" | 40 | <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2" |
| 40 | @add="ComeHere" :style="{'height':contentHeight-60+'px'}" style="overflow:auto;padding-top: 10px;"> | 41 | @add="ComeHere" :style="{'height':contentHeight-60+'px'}" style="overflow:auto;padding-top: 10px;"> |
| 41 | - <li v-for="i in arr2" class="infinite-list-item"> | ||
| 42 | - <label>[{{i.subjectName}}]{{ i.subject }}</label> | 42 | + <li v-for="(i,index) in arr2" class="infinite-list-item"> |
| 43 | + <label> {{index+1}}. [{{i.subjectName}}]{{ i.subject }}</label> | ||
| 43 | <div v-for="item in JSON.parse(i.subjectContent)"> | 44 | <div v-for="item in JSON.parse(i.subjectContent)"> |
| 44 | <p class="option-p">{{item.option}}:{{item.optionContent}}</p> | 45 | <p class="option-p">{{item.option}}:{{item.optionContent}}</p> |
| 45 | </div> | 46 | </div> |
| @@ -55,7 +56,7 @@ | @@ -55,7 +56,7 @@ | ||
| 55 | <div class="areahead">组卷基本信息</div> | 56 | <div class="areahead">组卷基本信息</div> |
| 56 | <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px"> | 57 | <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px"> |
| 57 | <el-form-item label="试卷名称:" class="el-form-item-custom"> | 58 | <el-form-item label="试卷名称:" class="el-form-item-custom"> |
| 58 | - {{TestPaper.TestPaperTitle}} | 59 | + <el-input v-model="TestPaper.TestPaperTitle"></el-input> |
| 59 | </el-form-item> | 60 | </el-form-item> |
| 60 | <el-form-item label="题目数量:" class="el-form-item-custom"> | 61 | <el-form-item label="题目数量:" class="el-form-item-custom"> |
| 61 | {{arr2.length}} | 62 | {{arr2.length}} |
| @@ -429,6 +430,7 @@ | @@ -429,6 +430,7 @@ | ||
| 429 | SubmitTestPaper() { | 430 | SubmitTestPaper() { |
| 430 | 431 | ||
| 431 | this.$refs['form'].validate((valid) => { | 432 | this.$refs['form'].validate((valid) => { |
| 433 | + | ||
| 432 | if (valid) { | 434 | if (valid) { |
| 433 | this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | 435 | this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); |
| 434 | var d = this.TestPaper; | 436 | var d = this.TestPaper; |
| @@ -436,6 +438,11 @@ | @@ -436,6 +438,11 @@ | ||
| 436 | EditTestPaper(this.TestPaper).then((res) => { | 438 | EditTestPaper(this.TestPaper).then((res) => { |
| 437 | if (res.data.code == 200) { | 439 | if (res.data.code == 200) { |
| 438 | this.$confirm("组卷成功!", "消息"); | 440 | this.$confirm("组卷成功!", "消息"); |
| 441 | + this.$router.push({ | ||
| 442 | + path: '/views/TestPaperList', | ||
| 443 | + query: { | ||
| 444 | + } | ||
| 445 | + }) | ||
| 439 | } else { | 446 | } else { |
| 440 | this.$confirm("组卷失败!", "消息"); | 447 | this.$confirm("组卷失败!", "消息"); |
| 441 | } | 448 | } |
src/views/TestPaper/TestPaperList.vue
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | <span>{{ scope.row.TotalScore }}</span> | 21 | <span>{{ scope.row.TotalScore }}</span> |
| 22 | </template> | 22 | </template> |
| 23 | </el-table-column> | 23 | </el-table-column> |
| 24 | - | 24 | + |
| 25 | <el-table-column prop="date" label="单选题数量" width="100"> | 25 | <el-table-column prop="date" label="单选题数量" width="100"> |
| 26 | <template slot-scope="scope"> | 26 | <template slot-scope="scope"> |
| 27 | <span>{{ scope.row.SingleNumber }}</span> | 27 | <span>{{ scope.row.SingleNumber }}</span> |
| @@ -94,7 +94,7 @@ | @@ -94,7 +94,7 @@ | ||
| 94 | style="position:static;bottom: 3px;text-align: center;margin-top: 5px;" :page-size="this.parameter.pageSize" | 94 | style="position:static;bottom: 3px;text-align: center;margin-top: 5px;" :page-size="this.parameter.pageSize" |
| 95 | layout="total,prev, pager, next" :total="Count"> | 95 | layout="total,prev, pager, next" :total="Count"> |
| 96 | </el-pagination> | 96 | </el-pagination> |
| 97 | - <el-dialog title="添加试卷基本信息" :visible.sync="dialogAddTestPaperVIsible" @close="closeClassDialog" width="600px" | 97 | + <el-dialog title="试卷基本信息" :visible.sync="dialogAddTestPaperVIsible" @close="closeClassDialog" width="600px" |
| 98 | :close-on-click-modal="false"> | 98 | :close-on-click-modal="false"> |
| 99 | <div class="grid-content bg-purple"> | 99 | <div class="grid-content bg-purple"> |
| 100 | <el-form ref="form" class="testPaper-manager" :model="TestPaper" label-width="100px"> | 100 | <el-form ref="form" class="testPaper-manager" :model="TestPaper" label-width="100px"> |
| @@ -106,11 +106,11 @@ | @@ -106,11 +106,11 @@ | ||
| 106 | :props="{emitPath:false}" :clearable=true :options="QuestionClass"> | 106 | :props="{emitPath:false}" :clearable=true :options="QuestionClass"> |
| 107 | </el-cascader> | 107 | </el-cascader> |
| 108 | </el-form-item> | 108 | </el-form-item> |
| 109 | - <el-form-item label="板块分类" class="el-form-item-custom"> | 109 | + <!-- <el-form-item label="板块分类" class="el-form-item-custom"> |
| 110 | <el-select v-model="TestPaper.PlateClass" placeholder="请选择板块分类"> | 110 | <el-select v-model="TestPaper.PlateClass" placeholder="请选择板块分类"> |
| 111 | <el-option label="面试题" value="4"></el-option> | 111 | <el-option label="面试题" value="4"></el-option> |
| 112 | </el-select> | 112 | </el-select> |
| 113 | - </el-form-item> | 113 | + </el-form-item> --> |
| 114 | 114 | ||
| 115 | 115 | ||
| 116 | <el-form-item label="工种" class="el-form-item-custom"> | 116 | <el-form-item label="工种" class="el-form-item-custom"> |
| @@ -176,10 +176,11 @@ | @@ -176,10 +176,11 @@ | ||
| 176 | DeleteTestPaper | 176 | DeleteTestPaper |
| 177 | } from '@/api/TestPaper' | 177 | } from '@/api/TestPaper' |
| 178 | 178 | ||
| 179 | - import { GetTypeSetting | 179 | + import { |
| 180 | + GetTypeSetting | ||
| 180 | } from '@/api/user' | 181 | } from '@/api/user' |
| 181 | import { formatTime } from '@/utils/util' | 182 | import { formatTime } from '@/utils/util' |
| 182 | - let that={}; | 183 | + let that = {}; |
| 183 | let list = []; | 184 | let list = []; |
| 184 | export default { | 185 | export default { |
| 185 | data() { | 186 | data() { |
| @@ -198,7 +199,7 @@ | @@ -198,7 +199,7 @@ | ||
| 198 | dialogAddTestPaperVIsible: false, | 199 | dialogAddTestPaperVIsible: false, |
| 199 | dialogQuestionVlsible: false, | 200 | dialogQuestionVlsible: false, |
| 200 | QuestionClass: [], | 201 | QuestionClass: [], |
| 201 | - usertypelist:[], | 202 | + usertypelist: [], |
| 202 | TestPaper: { | 203 | TestPaper: { |
| 203 | TestPaperTitle: "", | 204 | TestPaperTitle: "", |
| 204 | PlateClass: 4, | 205 | PlateClass: 4, |
| @@ -232,13 +233,13 @@ | @@ -232,13 +233,13 @@ | ||
| 232 | keyword: "" | 233 | keyword: "" |
| 233 | } | 234 | } |
| 234 | GetToplevel(parameter).then(res => { | 235 | GetToplevel(parameter).then(res => { |
| 235 | - console.log('gettoplevel',res); | 236 | + console.log('gettoplevel', res); |
| 236 | list = res.data.data; | 237 | list = res.data.data; |
| 237 | this.$forceUpdate(); | 238 | this.$forceUpdate(); |
| 238 | }); | 239 | }); |
| 239 | 240 | ||
| 240 | - GetTypeSetting({}).then(res=>{ | ||
| 241 | - if(res.data){ | 241 | + GetTypeSetting({}).then(res => { |
| 242 | + if (res.data) { | ||
| 242 | this.usertypelist = res.data || []; | 243 | this.usertypelist = res.data || []; |
| 243 | } | 244 | } |
| 244 | }); | 245 | }); |
| @@ -246,7 +247,7 @@ | @@ -246,7 +247,7 @@ | ||
| 246 | filters: { | 247 | filters: { |
| 247 | typeFilters(val) { | 248 | typeFilters(val) { |
| 248 | try { | 249 | try { |
| 249 | - return list.find(t=>t.id == val).ClassTitle || '未知'; | 250 | + return list.find(t => t.id == val).ClassTitle || '未知'; |
| 250 | } catch (e) { | 251 | } catch (e) { |
| 251 | console.log(e); | 252 | console.log(e); |
| 252 | return '未知' | 253 | return '未知' |
| @@ -367,10 +368,33 @@ | @@ -367,10 +368,33 @@ | ||
| 367 | this.TestPaper = val | 368 | this.TestPaper = val |
| 368 | } | 369 | } |
| 369 | else if (value == 'del') { | 370 | else if (value == 'del') { |
| 370 | - DeleteTestPaper(val.id).then(rs => { | ||
| 371 | - this.$message.success('删除成功!'); | ||
| 372 | - this.getTestPaperListHeadler(); | ||
| 373 | - }) | 371 | + this.$confirm( |
| 372 | + "确认删除该试卷吗?", | ||
| 373 | + "提示消息", | ||
| 374 | + { | ||
| 375 | + confirmButtonText: "确认", | ||
| 376 | + cancelButtonText: "取消", | ||
| 377 | + callback: (action) => { | ||
| 378 | + if (action == "confirm") { | ||
| 379 | + DeleteTestPaper(val.id).then(res => { | ||
| 380 | + // this.$message.success('删除成功!'); | ||
| 381 | + if (res.data.success) { | ||
| 382 | + this.$message.success("删除成功!"); | ||
| 383 | + this.getTestPaperListHeadler(); | ||
| 384 | + } else { | ||
| 385 | + | ||
| 386 | + this.$message.error(res.data.message || "发送失败"); | ||
| 387 | + } | ||
| 388 | + | ||
| 389 | + | ||
| 390 | + this.getTestPaperListHeadler(); | ||
| 391 | + }) | ||
| 392 | + } | ||
| 393 | + }, | ||
| 394 | + } | ||
| 395 | + ); | ||
| 396 | + | ||
| 397 | + | ||
| 374 | 398 | ||
| 375 | } | 399 | } |
| 376 | 400 |
src/views/user/userlist.vue
| @@ -374,7 +374,8 @@ | @@ -374,7 +374,8 @@ | ||
| 374 | <!-- <el-date-picker v-model="user.date" type="datetimerange" range-separator="至" start-placeholder="开始日期" | 374 | <!-- <el-date-picker v-model="user.date" type="datetimerange" range-separator="至" start-placeholder="开始日期" |
| 375 | end-placeholder="最后日期"> | 375 | end-placeholder="最后日期"> |
| 376 | </el-date-picker> --> | 376 | </el-date-picker> --> |
| 377 | - <el-date-picker v-model="user.startTime" type="datetime" placeholder="选择日期时间"> | 377 | + |
| 378 | + <el-date-picker v-model="user.startTime" type="datetime" placeholder="选择日期时间" :picker-options="pickerOptions"> | ||
| 378 | </el-date-picker> | 379 | </el-date-picker> |
| 379 | </el-descriptions-item> | 380 | </el-descriptions-item> |
| 380 | <el-descriptions-item> | 381 | <el-descriptions-item> |
| @@ -442,9 +443,15 @@ | @@ -442,9 +443,15 @@ | ||
| 442 | import { GetHistoryList } from "@/api/HistoryAnswer"; | 443 | import { GetHistoryList } from "@/api/HistoryAnswer"; |
| 443 | 444 | ||
| 444 | import { getTestPaperList } from "@/api/TestPaper"; | 445 | import { getTestPaperList } from "@/api/TestPaper"; |
| 446 | + import {formatTime} from '@/utils/util.js' | ||
| 445 | export default { | 447 | export default { |
| 446 | data() { | 448 | data() { |
| 447 | return { | 449 | return { |
| 450 | + pickerOptions: { | ||
| 451 | + disabledDate(time) { | ||
| 452 | + return time.getTime() < Date.now() - 8.64e7; | ||
| 453 | + } | ||
| 454 | + }, | ||
| 448 | loading: false, | 455 | loading: false, |
| 449 | dialogFormVisible: false, | 456 | dialogFormVisible: false, |
| 450 | dialogTableVisible: false, | 457 | dialogTableVisible: false, |
| @@ -637,17 +644,16 @@ | @@ -637,17 +644,16 @@ | ||
| 637 | // if(o.date){ | 644 | // if(o.date){ |
| 638 | // start = o.date[0]; | 645 | // start = o.date[0]; |
| 639 | // end = o.date[1]; | 646 | // end = o.date[1]; |
| 640 | - // } | ||
| 641 | - | 647 | + // } |
| 642 | senddata.push({ | 648 | senddata.push({ |
| 643 | userId: o.id, | 649 | userId: o.id, |
| 644 | - startTime: o.startTime, | 650 | + startTime: formatTime(o.startTime), |
| 645 | // endTime: end, | 651 | // endTime: end, |
| 646 | remark: o.remark || '', | 652 | remark: o.remark || '', |
| 647 | phone: o.phone, | 653 | phone: o.phone, |
| 648 | msgBody: o.msgBody || '' | 654 | msgBody: o.msgBody || '' |
| 649 | }); | 655 | }); |
| 650 | - }); | 656 | + }); |
| 651 | AddInvitationCompanyMultiple(senddata).then(res => { | 657 | AddInvitationCompanyMultiple(senddata).then(res => { |
| 652 | if (res.data.code == 200) { | 658 | if (res.data.code == 200) { |
| 653 | this.$message.success("邀请成功"); | 659 | this.$message.success("邀请成功"); |
vue.config.js
| @@ -38,8 +38,8 @@ module.exports = { | @@ -38,8 +38,8 @@ module.exports = { | ||
| 38 | }, | 38 | }, |
| 39 | proxy: { | 39 | proxy: { |
| 40 | '/development': { | 40 | '/development': { |
| 41 | - target: `http://inteview.t1j2.com/`, //后台服务地址 | ||
| 42 | - // target:'http://localhost:8877', | 41 | + // target: `http://inteview.t1j2.com/`, //后台服务地址 |
| 42 | + target:'http://localhost:8877', | ||
| 43 | changeOrigin: true, | 43 | changeOrigin: true, |
| 44 | pathRewrite: { | 44 | pathRewrite: { |
| 45 | '^/development': '' | 45 | '^/development': '' |