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