From bad0f18620a5f7af50eae3e8a19ba0a75b14df81 Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 18 May 2021 15:16:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81,=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exam/components/PuzzleList.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/views/exam/components/PuzzleList.vue b/src/views/exam/components/PuzzleList.vue index c12b0d7..1de9876 100644 --- a/src/views/exam/components/PuzzleList.vue +++ b/src/views/exam/components/PuzzleList.vue @@ -309,8 +309,8 @@ export default class extends Vue { private tableData: IExamQuerstion[] = [] private loading = false private downloadLoading = false - private filename = '' - private multipleSelection = [] + private filename : string | null= '' + private multipleSelection : IExamQuerstion[] = [] private deleteBtnName = '删除所有' private exportBtnName = '导出所有' private dialogVisible = false @@ -338,7 +338,6 @@ export default class extends Vue { await this.getRemoteDeptList() } else if (UserModule.department) { this.shop = UserModule.department - } } @@ -368,8 +367,12 @@ export default class extends Vue { private defaultPuzzle() { return { + _id: '', question: '', - a1: '' + a1: '', + a2: '', + a3: '', + a4: '' } } @@ -389,7 +392,6 @@ export default class extends Vue { } private handleEditQuestion(scope: any) { - const { $index, row } = scope this.dialogType = 'edit' this.dialogVisible = true this.record = cloneDeep(scope.row) @@ -408,8 +410,8 @@ export default class extends Vue { type: 'warning' }) if (this.multipleSelection.length > 0) { - this.questions = this.questions.filter(o => this.multipleSelection.indexOf(o) === -1) - this.$refs.question_table.clearSelection() + this.questions = this.questions.filter(o => this.multipleSelection.indexOf(o) === -1); + (this.$refs.question_table as any).clearSelection() } else { this.questions.length = 0 } @@ -565,7 +567,7 @@ export default class extends Vue { this.filename = parseTime(new Date(), '{y}{m}{d}{h}{i}{s}') const data = formatJson(tHeader, list) console.log('begin generate excel') - exportJson2Excel(tHeader, data, this.filename !== '' ? this.filename : undefined, undefined, undefined, true, 'xlsx') + exportJson2Excel(tHeader, data, this.filename ? this.filename : undefined, undefined, undefined, true, 'xlsx') this.downloadLoading = false } @@ -642,7 +644,8 @@ export default class extends Vue { shop: this.shop }) this.listLoading = false - this.shopExamList = data.records.filter(o => o._id !== this.examid) + const records: IExamData[] = data.records + this.shopExamList = records.filter(o => o._id !== this.examid) } private clickChange(item: any) {