|
@@ -217,7 +217,8 @@ export default {
|
|
|
|
|
|
], // 关联关系数据
|
|
|
id:'', // 传入的ID规范文件id
|
|
|
- jId:''//技术指标Id
|
|
|
+ jId:'',//技术指标Id
|
|
|
+ addObj:{}
|
|
|
|
|
|
|
|
|
}
|
|
@@ -234,7 +235,7 @@ export default {
|
|
|
val.forEach((item,index)=>{
|
|
|
this.handleSelect(index,item)
|
|
|
})
|
|
|
- this.activeIndex = 0
|
|
|
+ // this.activeIndex = 0
|
|
|
|
|
|
|
|
|
|
|
@@ -292,13 +293,18 @@ export default {
|
|
|
this.$emit('confirm')
|
|
|
},
|
|
|
handleDeleteLinkItem(item,index){
|
|
|
+ const {groupId}=item
|
|
|
+ if(!groupId){
|
|
|
+ this.linkListData.splice(index, 1);
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$confirm('删除后,数据将无法恢复,是否确认删除!', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
|
|
|
- deleteConditionSet({leftId:item.id}).then((res) => {
|
|
|
+ deleteConditionSet({leftId:item.id,groupId:item.groupId}).then((res) => {
|
|
|
if(res.data.code==200){
|
|
|
this.$message.success(res.data.msg);
|
|
|
|
|
@@ -324,30 +330,24 @@ export default {
|
|
|
// 添加操作逻辑
|
|
|
},
|
|
|
async handleSelect(index,item) {
|
|
|
- console.log(index,'index');
|
|
|
- console.log(item,'item');
|
|
|
-
|
|
|
- this.activeIndex = index
|
|
|
- let leftId = this.paramList[index].id
|
|
|
- let arr= await this.getConditionSetData(this.id,this.jId,leftId)
|
|
|
- console.log(arr,'arr');
|
|
|
|
|
|
-
|
|
|
- if(arr.length>0){
|
|
|
- this.$nextTick(()=>{
|
|
|
- // this.paramList[index].standardInfos = arr[0]['standardInfos']
|
|
|
- this.$set(this.paramList, index, { ...this.paramList[index], standardInfos: arr[0]['standardInfos'] });
|
|
|
- })
|
|
|
+
|
|
|
|
|
|
- }else{
|
|
|
- this.paramList[index].standardInfos = []
|
|
|
- }
|
|
|
-
|
|
|
+ this.paramList[index].standardInfos = []
|
|
|
},
|
|
|
async handleSelect1(index,item) {
|
|
|
this.activeIndex = index
|
|
|
- console.log(item,'item');
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ this.linkListData.forEach(ele=>{
|
|
|
+ ele.clicked = false
|
|
|
+
|
|
|
+ })
|
|
|
+ const hasClicked = this.linkListData.some(item => item.clicked === true);
|
|
|
+ console.log(hasClicked, 'hasClicked');
|
|
|
+ if(!hasClicked) {
|
|
|
+ item.standardInfos=[]
|
|
|
+ }
|
|
|
|
|
|
|
|
|
},
|
|
@@ -387,6 +387,10 @@ export default {
|
|
|
},
|
|
|
handleDeleteItem(item, index) {
|
|
|
this.paramList[this.activeIndex].standardInfos.splice(index, 1);
|
|
|
+ this.addObj={
|
|
|
+ ... this.paramList[this.activeIndex],
|
|
|
+ standardInfos:this.paramList[this.activeIndex].standardInfos
|
|
|
+ }
|
|
|
this.$forceUpdate();
|
|
|
|
|
|
},
|
|
@@ -398,6 +402,10 @@ export default {
|
|
|
{name:this.addForm.codeValueName,ids:this.addForm.codeValue}
|
|
|
},
|
|
|
)
|
|
|
+ this.addObj={
|
|
|
+ ... this.paramList[this.activeIndex],
|
|
|
+ standardInfos: this.paramList[this.activeIndex].standardInfos
|
|
|
+ }
|
|
|
this.addDialogVisible = false
|
|
|
this.addForm = {
|
|
|
codeName: '',
|
|
@@ -407,11 +415,22 @@ export default {
|
|
|
},
|
|
|
//保存条件
|
|
|
saveCondition() {
|
|
|
+ const hasClicked = this.linkListData.some(item => item.clicked === true);
|
|
|
+
|
|
|
+ if (!hasClicked) {
|
|
|
+ // 如果不存在,则将 addObj 添加到数组中
|
|
|
+ this.linkListData.push(this.addObj);
|
|
|
+ }else{
|
|
|
+ const clickedItem = this.linkListData.find(item => item.clicked === true);
|
|
|
+ if (clickedItem) {
|
|
|
+ clickedItem.standardInfos = this.addObj.standardInfos;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.paramList[this.activeIndex].standardInfos = []
|
|
|
+ this.linkListData .forEach(ele => {
|
|
|
+ ele.clicked = false;
|
|
|
|
|
|
- const filteredArr = this.paramList.filter(item => item.standardInfos.length !== 0);
|
|
|
- console.log(filteredArr,'this.linkListData');
|
|
|
-
|
|
|
- this.linkListData = JSON.parse(JSON.stringify(filteredArr));
|
|
|
+ });
|
|
|
|
|
|
|
|
|
},
|
|
@@ -423,6 +442,10 @@ export default {
|
|
|
let clickedIndex = this.paramList.findIndex(listItem => listItem.id === item.id);
|
|
|
console.log(clickedIndex, 'clickedIndex');
|
|
|
this.activeIndex = clickedIndex;
|
|
|
+ this.paramList[clickedIndex].standardInfos = JSON.parse(JSON.stringify(item.standardInfos));
|
|
|
+ this.addObj = { ...item };
|
|
|
+
|
|
|
+ console.log(item, 'item');
|
|
|
|
|
|
},
|
|
|
// 获取条件设置
|