|
@@ -45,7 +45,8 @@
|
|
list: [],
|
|
list: [],
|
|
childContainer: [],
|
|
childContainer: [],
|
|
selectedIds: [],
|
|
selectedIds: [],
|
|
- currentActTabGroupId: null,
|
|
|
|
|
|
+ currentActTabGroupId: null
|
|
|
|
+ ,CheckConditionCard:[]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -92,7 +93,8 @@
|
|
...this.condition,
|
|
...this.condition,
|
|
options: [],
|
|
options: [],
|
|
conditionIds: [],
|
|
conditionIds: [],
|
|
- childContainer: []
|
|
|
|
|
|
+ childContainer: []
|
|
|
|
+ ,CheckConditionCard:[] //add by yfb 20230515
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -103,7 +105,8 @@
|
|
this.list = this.condition.options;
|
|
this.list = this.condition.options;
|
|
this.selectedIds = this.condition.conditionIds;
|
|
this.selectedIds = this.condition.conditionIds;
|
|
this.childContainer = this.condition.childContainer;
|
|
this.childContainer = this.condition.childContainer;
|
|
- this.results = this.conditionCard.checkResults;
|
|
|
|
|
|
+ this.results = this.conditionCard.checkResults;
|
|
|
|
+ this.CheckConditionCard=this.condition.CheckConditionCard;//add by yfb 20230515
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -173,12 +176,17 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
tabClickHandle(item, index, isMulti, parts, parent) {
|
|
tabClickHandle(item, index, isMulti, parts, parent) {
|
|
- // console.log({item, index, isMulti, parts,parent});
|
|
|
|
- // console.log({results:this.results});
|
|
|
|
|
|
+ // console.log({item, index, isMulti, parts,parent});
|
|
|
|
+ // console.log({results:this.results});
|
|
|
|
|
|
const needCancelActiedItems = parts.filter(a => a.id != item.id);
|
|
const needCancelActiedItems = parts.filter(a => a.id != item.id);
|
|
const needCancelActiedIds = needCancelActiedItems.map(b => b.id);
|
|
const needCancelActiedIds = needCancelActiedItems.map(b => b.id);
|
|
const needCancelActiedcardIds = needCancelActiedItems.map(i => i.subOptionId);
|
|
const needCancelActiedcardIds = needCancelActiedItems.map(i => i.subOptionId);
|
|
|
|
+
|
|
|
|
+ //筛选选项所属卡片信息,即点击选项保存当前卡片信息 add by yfb 20230515
|
|
|
|
+ const ActionParents=this.CheckConditionCard.filter(item=>(item!=parent)&&(item.id!=needCancelActiedItems[0].subOptionId));
|
|
|
|
+ this.CheckConditionCard=[...ActionParents,parent];
|
|
|
|
+ /////////////////////
|
|
|
|
|
|
if (isMulti == 1) {
|
|
if (isMulti == 1) {
|
|
//isMulti == 1 单选
|
|
//isMulti == 1 单选
|
|
@@ -186,7 +194,7 @@
|
|
const leftActivedIds = this.selectedIds.filter(c => !(needCancelActiedIds.includes(c))); //去除非选中项
|
|
const leftActivedIds = this.selectedIds.filter(c => !(needCancelActiedIds.includes(c))); //去除非选中项
|
|
|
|
|
|
this.selectedIds = [...leftActivedIds, item.id];
|
|
this.selectedIds = [...leftActivedIds, item.id];
|
|
-
|
|
|
|
|
|
+
|
|
const parentSameIdIndex = this.results.findIndex(item => item.id == parent.id);
|
|
const parentSameIdIndex = this.results.findIndex(item => item.id == parent.id);
|
|
|
|
|
|
if (parentSameIdIndex != -1) {
|
|
if (parentSameIdIndex != -1) {
|
|
@@ -215,17 +223,18 @@
|
|
|
|
|
|
this.results = [...filtedResults];
|
|
this.results = [...filtedResults];
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (isMulti == 2) {
|
|
if (isMulti == 2) {
|
|
//isMulti == 2 多选
|
|
//isMulti == 2 多选
|
|
const index = this.selectedIds.findIndex(a => a == item.id);
|
|
const index = this.selectedIds.findIndex(a => a == item.id);
|
|
-
|
|
|
|
|
|
+// console.log('index',index);
|
|
if (index != -1) {
|
|
if (index != -1) {
|
|
//已选中
|
|
//已选中
|
|
- this.selectedIds = this.selectedIds.filter(a => a != item.id);
|
|
|
|
|
|
+ this.selectedIds = this.selectedIds.filter(a => a != item.id);
|
|
|
|
+ this.CheckConditionCard=this.CheckConditionCard.filter(a=>a.id!=item.subOptionId);// 多选项判断是否有子项内容 add by yfb 20230515
|
|
} else {
|
|
} else {
|
|
this.selectedIds = [...this.selectedIds, item.id];
|
|
this.selectedIds = [...this.selectedIds, item.id];
|
|
}
|
|
}
|
|
@@ -235,7 +244,6 @@
|
|
value: item.name,
|
|
value: item.name,
|
|
id: parent.id
|
|
id: parent.id
|
|
}];
|
|
}];
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -252,9 +260,12 @@
|
|
const filtedChildContainer = this.childContainer[index].list.filter(g => !(needDeleteChildIds.includes(
|
|
const filtedChildContainer = this.childContainer[index].list.filter(g => !(needDeleteChildIds.includes(
|
|
g.id)));
|
|
g.id)));
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.CheckConditionCard=[...this.CheckConditionCard,childs[0]];//选完带子项时,加载子项卡片信息 add by yfb 20230515
|
|
|
|
+ // console.log('CheckConditionCard',this.CheckConditionCard);
|
|
const positionIndex = childs.length>0?filtedChildContainer.findIndex(a => a.id == childs[0].id):-1;
|
|
const positionIndex = childs.length>0?filtedChildContainer.findIndex(a => a.id == childs[0].id):-1;
|
|
-
|
|
|
|
|
|
+
|
|
if (isMulti == 1) {
|
|
if (isMulti == 1) {
|
|
//单选
|
|
//单选
|
|
if (positionIndex == -1) {
|
|
if (positionIndex == -1) {
|
|
@@ -307,10 +318,11 @@
|
|
key: 'condition',
|
|
key: 'condition',
|
|
data: {
|
|
data: {
|
|
...this.condition,
|
|
...this.condition,
|
|
- conditionIds: this.selectedIds
|
|
|
|
|
|
+ conditionIds: this.selectedIds,
|
|
|
|
+ CheckConditionCard:this.CheckConditionCard //保存选择数据 add by yfb 20230515
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+// console.log('data_CheckConditionCard',this.condition.CheckConditionCard);
|
|
this.childContainer = this.sortFunc(this.childContainer);
|
|
this.childContainer = this.sortFunc(this.childContainer);
|
|
|
|
|
|
//console.log('this.childContainer',this.childContainer);
|
|
//console.log('this.childContainer',this.childContainer);
|