From 3607676424f8a6cc95c42e512d9a7481f5f27d8f Mon Sep 17 00:00:00 2001
From: CherrysChang <1935003650@qq.com>
Date: Sun, 26 Apr 2020 15:58:06 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=95=8C=E9=9D=A2=20?=
=?UTF-8?q?=E5=8F=B3=E4=BE=A7=E6=8C=87=E6=A0=87=E8=AE=BE=E7=BD=AE=E7=9A=84?=
=?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=B1=9E=E6=80=A7=E4=B8=8D=E5=AD=98=E5=9C=A8?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/train/case-detail.vue | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/views/train/case-detail.vue b/src/views/train/case-detail.vue
index 6539da7..cf26c53 100644
--- a/src/views/train/case-detail.vue
+++ b/src/views/train/case-detail.vue
@@ -40,7 +40,7 @@
-
+
@@ -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) {//单个移除右侧选中的指标数据,左侧添加对应的数据(位置为初始位置)
//获取当前移除项的信息