Commit a9f5dfcff8ff747fd0e10e34cc133373f480cf4e

Authored by 梁保满
1 parent e43b294b

修改知识点匹配,删除即时测报表

src/views/basic/test/list.vue
... ... @@ -46,10 +46,11 @@
46 46 <el-tooltip v-else effect="dark" content="答卷录分" placement="top">
47 47 <el-button type="primary" circle size="mini" @click="openScoreSet(scoped.row)">分</el-button>
48 48 </el-tooltip>
49   - <el-tooltip effect="dark" content="删除" placement="top">
50   - <el-button type="primary" circle size="mini" icon="el-icon-delete"
51   - @click="remove(scoped.row)"></el-button>·
52   - </el-tooltip>
  49 + <el-popconfirm v-if="role != 'ROLE_BANZHUREN'" title="确定删除吗?"
  50 + @confirm="removeReport(scoped.row, scoped.$index)">
  51 + <el-button class="remove-test" slot="reference" type="danger" circle size="mini" icon="el-icon-delete"
  52 + :loading="scoped.row.loading"></el-button>
  53 + </el-popconfirm>
53 54 </template>
54 55 </el-table-column>
55 56 </el-table>
... ... @@ -265,6 +266,19 @@ export default {
265 266 },
266 267 });
267 268 },
  269 + //删除即时测考试
  270 + async removeReport(obj, index) {
  271 + this.tableData[index].loading = true;
  272 + const { data, status, info } = await this.$request.deleteReport({
  273 + id: obj.id,
  274 + });
  275 + if (status === 0) {
  276 + this.$message.success("删除成功!");
  277 + this.tableData.splice(index, 1);
  278 + } else {
  279 + this.$message.error(info);
  280 + }
  281 + },
268 282  
269 283 async _QueryGdClass() {
270 284 const fetchClassList =
... ... @@ -356,6 +370,10 @@ div::-webkit-scrollbar-thumb {
356 370 }
357 371 </style>
358 372 <style lang="scss" scoped>
  373 +.remove-test {
  374 + margin-left: 10px;
  375 +}
  376 +
359 377 .page-container {
360 378 position: relative;
361 379 height: 100%;
... ...
src/views/examinationPaper/edit.vue
... ... @@ -363,6 +363,7 @@ export default {
363 363 answerScreenshot: "", //题目解析图片地址
364 364 knowledge: [], //知识点
365 365 },
  366 + gradeClassList: [] //学段列表
366 367 };
367 368 },
368 369 computed: {
... ... @@ -382,12 +383,18 @@ export default {
382 383 // 知识点列表 根据学段-科目筛选
383 384 knowledgeData: function () {
384 385 let jsons = []
385   - if (this.form.sectionName && this.form.subjectName) {
386   - let sectionName = this.form.sectionName || null
387   - let subjectName = this.form.subjectName || null
  386 + if (this.form.gradeName && this.form.subjectName) {
  387 + let sectionName = ""
  388 + this.gradeClassList?.map(item => {
  389 + if (this.form.gradeName == item.gradeName) {
  390 + sectionName = item.sectionName
  391 + }
  392 + })
  393 + console.log(this.gradeClassList)
  394 + console.log(sectionName)
388 395 if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) {
389   - if (Object.keys(this.knowledgeList[sectionName]).includes(subjectName)) {
390   - jsons = this.knowledgeList[sectionName][subjectName]
  396 + if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) {
  397 + jsons = this.knowledgeList[sectionName][this.form.subjectName]
391 398 }
392 399 }
393 400 }
... ... @@ -402,6 +409,7 @@ export default {
402 409 this.paperType = this.$route.query.paperType || 1;
403 410 this.form.title = this.$route.query.title || "";
404 411 this._QueryDetail();
  412 + this._GradeList();
405 413 },
406 414 methods: {
407 415 // v1.5
... ... @@ -444,7 +452,19 @@ export default {
444 452 this.$message.error(res.info);
445 453 }
446 454 },
  455 + async _GradeList() {
  456 + let fetchClassList =
  457 + this.role == "ROLE_PERSONAL"
  458 + ? this.$request.pClassList
  459 + : this.$request.fetchClassList;
447 460  
  461 + const { data, status, info } = await fetchClassList();
  462 + if (status == 0) {
  463 + this.gradeClassList = data.list
  464 + } else {
  465 + this.$message.error(info);
  466 + }
  467 + },
448 468 upError(res) {
449 469 this.$message.error("上传失败");
450 470 },
... ...