重构代码, 移除warning
This commit is contained in:
parent
185feb5d72
commit
bad0f18620
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user