Sfoglia il codice sorgente

关联元素修改

duy 1 mese fa
parent
commit
568e3a79f0

+ 22 - 11
src/views/codeRule/ConditionsSet.vue

@@ -217,18 +217,22 @@ export default {
            
       ], // 关联关系数据
       id:'', // 传入的ID规范文件id
+      jId:''//技术指标Id
+
 
     }
   },
   methods: {
-    show(val,id) {
+    show(val,id,Jid) {
+      console.log(id,'id');
+      this.jId = Jid
       this.id = id
       this.getSampleOptions(id)
       this.visible = true
       if(val.length > 0&&val[0].symbolName) {
        this.paramList=val
        val.forEach((item,index)=>{
-          this.handleSelect(index)
+          this.handleSelect(index,item)
        })
        this.activeIndex = 0
 
@@ -239,7 +243,7 @@ export default {
       }
       //获取关联关系数据
 
-      this.getLinkSetData(this.id);
+      this.getLinkSetData(this.id, this.jId);
     },
     //获取样品信息列表
      getSampleOptions(id){
@@ -299,7 +303,7 @@ export default {
                 this.$message.success(res.data.msg);
               
                 this.linkListData.splice(index, 1);
-                this.getLinkSetData(this.id);
+                this.getLinkSetData(this.id, this.jId);
               }else{
                 this.$message.error(res.data.msg);
               }
@@ -319,10 +323,15 @@ export default {
     addOperation() {
       // 添加操作逻辑
     },
-  async handleSelect(index) {
+  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,leftId)
+     let arr= await this.getConditionSetData(this.id,this.jId,leftId)
+     console.log(arr,'arr');
+
      
       if(arr.length>0){
           this.$nextTick(()=>{
@@ -335,8 +344,10 @@ export default {
       }
       
     },
-    async handleSelect1(index) {
+    async handleSelect1(index,item) {
       this.activeIndex = index
+      console.log(item,'item');
+      
  
       
     },
@@ -415,9 +426,9 @@ export default {
         
       },
     // 获取条件设置
-      async getConditionSetData(id, leftId) {
+      async getConditionSetData(id, groupId, leftId) {
         try {
-          const res = await getConditionSet({ id, leftId });
+          const res = await getConditionSet({ id, groupId,leftId });
           if (res.data.code === 200) {
             console.log(res.data.data, '获取的条件设置数据');
             return res.data.data; // 直接返回数据
@@ -432,9 +443,9 @@ export default {
       },
       //获取关联关系数据
      
-      async getLinkSetData(id, leftId) {
+      async getLinkSetData(id, groupId) {
         try {
-          const res = await getConditionSet({ id, leftId });
+          const res = await getConditionSet({ id, groupId });
           if (res.data.code === 200) {
             console.log(res.data.data, '获取的关系数据');
             this.linkListData = res.data.data; // 直接返回数据

+ 10 - 8
src/views/codeRule/LinkEle.vue

@@ -228,6 +228,8 @@ export default {
       treeId: '', // 树节点pid
       treePid: '', // 树节点父id
       deatailId: '', // 详情ID
+      jId: '', // 技术指标ID
+
 
       paramList: [
         {
@@ -262,9 +264,9 @@ export default {
     }
   },
   methods: {
-    show(val,treeId,id,projectid,deatailId,tid) {
+    show(val,treeId,id,projectid,deatailId,tid,Jid) {
 
-      
+      this.jId = Jid;
       this.getTableTypelist();
       this.visible = true
       if(val.length > 0&&val[0].name) {
@@ -283,11 +285,11 @@ export default {
           this.treeId = ''
       }
       
-      this.getLinkSetData(this.deatailId);
+      this.getLinkSetData(this.deatailId,this.jId);
     },
-     async getLinkSetData(id, leftId) {
+     async getLinkSetData(id, groupId) {
         try {
-          const res = await getElementJoin({ id, leftId });
+          const res = await getElementJoin({ id, groupId });
           if (res.data.code === 200) {
             console.log(res.data.data, '获取的关系数据');
             this.linkListData = res.data.data; // 直接返回数据
@@ -305,7 +307,7 @@ export default {
     async handleSelect(index) {
       this.activeIndex = index
       let leftId = this.paramList[index].id
-     let arr= await this.getRelationData(this.deatailId,leftId)
+     let arr= await this.getRelationData(this.deatailId,this.Jid,leftId)
      
       if(arr.length>0){
           this.$nextTick(()=>{
@@ -318,9 +320,9 @@ export default {
       }
       
     },
-   async getRelationData(id,leftId){
+   async getRelationData(id, groupId,leftId){
           try {
-          const res = await getElementJoin({ id, leftId });
+          const res = await getElementJoin({ id, groupId, leftId });
           if (res.data.code === 200) {
             console.log(res.data.data, '获取的条件设置数据');
             return res.data.data; // 直接返回数据

+ 5 - 2
src/views/codeRule/ruleManage.vue

@@ -1220,6 +1220,8 @@ import { getStore, setStore } from "@/util/store";
       handleEditJs1(item, index) {
         // 处理编辑逻辑
         this.jsDetail = JSON.parse(JSON.stringify(item));
+        console.log(        this.jsDetail,'        this.jsDetail');
+        
         this.isEditJs = true;
           this.isShowJsList = true;
          this.isShowYpList = false;
@@ -1313,6 +1315,7 @@ import { getStore, setStore } from "@/util/store";
     },
     //条件设置
     conditionsSet(){
+    
       
         if(!this.jsDetail.id){
           this.$message.error('请先保存技术指标信息');
@@ -1322,7 +1325,7 @@ import { getStore, setStore } from "@/util/store";
         this.$message.error('请先添加技术指标内容');
         return;
       }
-      this.$refs.conditionsSetRef.show(this.jsDetail.info,this.ruleItemDetail.id);
+      this.$refs.conditionsSetRef.show(this.jsDetail.info,this.ruleItemDetail.id,this.jsDetail.id);
 
     },
     // 添加确认取消处理方法
@@ -1344,7 +1347,7 @@ import { getStore, setStore } from "@/util/store";
       }
       console.log(this.treePid,'this.treePid)');
       
-        this.$refs.linkEleRef.show(this.jsDetail.info, this.treeId,this.id,  this.projectid,this.ruleItemDetail.id,this.treePid);
+        this.$refs.linkEleRef.show(this.jsDetail.info, this.treeId,this.id,  this.projectid,this.ruleItemDetail.id,this.treePid,this.jsDetail.id);
     },
     confirmLinkEle() {
       console.log('确认关联元素')