新增界面 右侧指标设置的校验属性不存在问题

zqqdev
CherrysChang 5 years ago
parent f8b7ce3153
commit 3607676424
  1. 20
      src/views/train/case-detail.vue

@ -40,7 +40,7 @@
<el-button @click="removeToLeft" size="mini" type="primary" icon="el-icon-arrow-left" circle :disabled="isDisableToLeft" style="margin:10px 0 0 0;"></el-button> <el-button @click="removeToLeft" size="mini" type="primary" icon="el-icon-arrow-left" circle :disabled="isDisableToLeft" style="margin:10px 0 0 0;"></el-button>
</el-col> </el-col>
<el-col :span="14" class="rightTable"> <el-col :span="14" class="rightTable">
<el-table ref="rightTable" :data="rightTargetList" height="400" border highlight-current-row tooltip-effect="dark" :summary-method="getScoreSummaries" show-summary @selection-change="rightSelectionChange"> <el-table ref="rightTable" :data="dataForm.taskList" height="400" border highlight-current-row tooltip-effect="dark" :summary-method="getScoreSummaries" show-summary @selection-change="rightSelectionChange">
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column header-align="right" :label="rightSumLabel"> <el-table-column header-align="right" :label="rightSumLabel">
<el-table-column prop="name" label="名称"></el-table-column> <el-table-column prop="name" label="名称"></el-table-column>
@ -155,6 +155,8 @@
} }
}, },
created() { created() {
//
this.initTargetList();
if (this.$route.query.id) { if (this.$route.query.id) {
this.dataForm.id = this.$route.query.id; this.dataForm.id = this.$route.query.id;
Train.getCaseDetail({id: this.dataForm.id}).then((res) => { Train.getCaseDetail({id: this.dataForm.id}).then((res) => {
@ -169,9 +171,9 @@
this.formAction = 2; this.formAction = 2;
} }
}) })
}else{
this.dataForm.taskList = this.rightTargetList;//taskList rightTargetList
} }
//
this.initTargetList();
}, },
computed: { computed: {
isDisableToRight: function() { // truefalse isDisableToRight: function() { // truefalse
@ -233,14 +235,21 @@
leftSelectionChange(selection) { leftSelectionChange(selection) {
this.leftSelectedRows = selection; this.leftSelectedRows = selection;
}, },
addToRight() { addToRight() {//
//
this.leftSelectedRows.forEach(item => { this.leftSelectedRows.forEach(item => {
if (this.leftDictTargetList.indexOf(item) > -1) { if (this.leftDictTargetList.indexOf(item) > -1) {
// //
this.leftDictTargetList.splice(this.leftDictTargetList.indexOf(item), 1); this.leftDictTargetList.splice(this.leftDictTargetList.indexOf(item), 1);
} }
if(this.rightTargetList.indexOf(item) == -1){ if(this.rightTargetList.indexOf(item) == -1){
//
// this.$set(item,"taskOperate",null);
item=Object.assign({}, item, {
taskOperate: null,
taskRate: null,
score: null,
taskSeq: null
})
// //
this.rightTargetList.push(item); this.rightTargetList.push(item);
} }
@ -265,7 +274,6 @@
this.rightSelectedRows = []; this.rightSelectedRows = [];
// //
this.$refs.rightTable.clearSelection(); this.$refs.rightTable.clearSelection();
}, },
removeToLeftByRow(rowIndex,row) {// removeToLeftByRow(rowIndex,row) {//
// //

Loading…
Cancel
Save