调整table移出bug

This commit is contained in:
fan 2020-05-27 15:38:40 +08:00
parent 643c5e0b9e
commit 6ebfffd36b

View File

@ -45,7 +45,7 @@
</el-table-column>
<el-table-column prop="operate" label="操作" width="100">
<template slot-scope="scope">
<el-button type="warning" size="mini" @click="removeTheoryQuestion(scope)">移出</el-button>
<el-button type="warning" size="mini" @click="removeTheoryQuestion(scope.row)">移出</el-button>
</template>
</el-table-column>
</el-table>
@ -79,7 +79,7 @@
</el-table-column>
<el-table-column prop="operate" label="操作">
<template slot-scope="scope">
<el-button type="warning" size="mini" @click="removeOperateQuestion(scope)">移出</el-button>
<el-button type="warning" size="mini" @click="removeOperateQuestion(scope.row)">移出</el-button>
</template>
</el-table-column>
</el-table>
@ -125,6 +125,7 @@ export default {
},
removeTheoryQuestion(row) {
const index = this.theoryIndexList.indexOf(row.id);
console.log(row, index);
this.theoryIndexList.splice(index, 1);
this.theoryQuestionList.splice(index, 1);
},
@ -164,7 +165,7 @@ export default {
}
},
handleRowStyle({row, rowIndex}) {
return row.isError ? {background: '#F00'} : {background: '#FFF'};
return row.isError ? {background: '#F00'} : {background: '#FFF'};
},
exportPaper() {
let flag = false;
@ -180,7 +181,6 @@ export default {
this.$set(item, 'isError', true);
}
});
console.log(this.theoryQuestionList, this.operateQuestionList);
if (flag) {
this.$message.error('试题分分值不得为0');
} else {