|
|
|
@ -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-col> |
|
|
|
|
<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 header-align="right" :label="rightSumLabel"> |
|
|
|
|
<el-table-column prop="name" label="名称"></el-table-column> |
|
|
|
@ -155,6 +155,8 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
//获取左侧指标字典数据 |
|
|
|
|
this.initTargetList(); |
|
|
|
|
if (this.$route.query.id) { |
|
|
|
|
this.dataForm.id = this.$route.query.id; |
|
|
|
|
Train.getCaseDetail({id: this.dataForm.id}).then((res) => { |
|
|
|
@ -169,9 +171,9 @@ |
|
|
|
|
this.formAction = 2; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
this.dataForm.taskList = this.rightTargetList;//taskList 会跟着 rightTargetList 变化 |
|
|
|
|
} |
|
|
|
|
//获取左侧指标字典数据 |
|
|
|
|
this.initTargetList(); |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
isDisableToRight: function() { //是否禁用 true为禁用,false为可用 |
|
|
|
@ -233,14 +235,21 @@ |
|
|
|
|
leftSelectionChange(selection) { |
|
|
|
|
this.leftSelectedRows = selection; |
|
|
|
|
}, |
|
|
|
|
addToRight() { |
|
|
|
|
//移除左侧选中的指标数据,右侧添加对应的数据 |
|
|
|
|
addToRight() {//移除左侧选中的指标数据,右侧添加对应的数据 |
|
|
|
|
this.leftSelectedRows.forEach(item => { |
|
|
|
|
if (this.leftDictTargetList.indexOf(item) > -1) { |
|
|
|
|
// 从量化指标字典数据列表中移出选中的数据 |
|
|
|
|
this.leftDictTargetList.splice(this.leftDictTargetList.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); |
|
|
|
|
} |
|
|
|
@ -265,7 +274,6 @@ |
|
|
|
|
this.rightSelectedRows = []; |
|
|
|
|
//清空量化指标字典数据列表的选择 |
|
|
|
|
this.$refs.rightTable.clearSelection(); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
removeToLeftByRow(rowIndex,row) {//单个移除右侧选中的指标数据,左侧添加对应的数据(位置为初始位置) |
|
|
|
|
//获取当前移除项的信息 |
|
|
|
|