Browse Source

添加元素修改

duy 1 month ago
parent
commit
e2fa80b680

+ 9 - 13
src/views/codeRule/LinkEle.vue

@@ -225,22 +225,15 @@ export default {
   data() {
     return {
       visible: false,
-      treeId: '', // 树节点ID
+      treeId: '', // 树节点pid
+      treePid: '', // 树节点父id
       deatailId: '', // 详情ID
 
       paramList: [
         {
-          symbolName: '<0.75',
+          symbolName: '',
           group:[
-            {name: 'C3A', 
-          
-            standardInfoGroupNameVO:{
-              name: '矿渣硅酸盐水泥'
-            }
-
-            
-          },
-            {codeName: 'C3S', codeValue: []},
+  
           ]
 
         }
@@ -269,7 +262,9 @@ export default {
     }
   },
   methods: {
-    show(val,treeId,id,projectid,deatailId) {
+    show(val,treeId,id,projectid,deatailId,tid) {
+
+      
       this.getTableTypelist();
       this.visible = true
       if(val.length > 0&&val[0].name) {
@@ -278,6 +273,7 @@ export default {
         this.deatailId = deatailId
         this.projectid = projectid
         this.paramList=val
+        this.treePid=tid
         val.forEach((item,index)=>{
           this.handleSelect(index)
        })
@@ -348,7 +344,7 @@ export default {
       });
     },
     async getTableData(){
-        const { data: res } = await selectByNodeTable( this.treeId,this.projectid, this.id);
+        const { data: res } = await selectByNodeTable( this.treePid,this.projectid, this.id);
           if (res.code === 200) {
             console.log(Array.isArray(res.data));
             if (Array.isArray(res.data)) {

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

@@ -464,6 +464,7 @@ import { getStore, setStore } from "@/util/store";
         tenant_id:'',
         projectid:'',
         treeId: '',
+        treePid: '',
 
         defaultProps: {
             children: "children",
@@ -608,6 +609,7 @@ import { getStore, setStore } from "@/util/store";
       handleNodeClick(data,node) {
        
         this.treeId = data.primaryKeyId;
+        this.treePid = data.id;
         
         this.getRuleItemOptions()
           //获取节点展开路径
@@ -836,9 +838,10 @@ import { getStore, setStore } from "@/util/store";
           //   parentId: this.ruleItem.id,
           // })
           console.log(formData,'formData');
-          
+          this.addFileRuleLoad=true
            add(formData)
           .then((res) => {
+             this.addFileRuleLoad=false
             if(res.data.code==200){
                 this.$message.success(res.data.msg)
               
@@ -1314,7 +1317,7 @@ import { getStore, setStore } from "@/util/store";
         this.$message.error('请先添加技术指标内容');
         return;
       }
-        this.$refs.linkEleRef.show(this.jsDetail.info, this.treeId,this.id,  this.projectid,this.ruleItemDetail.id);
+        this.$refs.linkEleRef.show(this.jsDetail.info, this.treeId,this.id,  this.projectid,this.ruleItemDetail.id,this.treePid);
     },
     confirmLinkEle() {
       console.log('确认关联元素')

+ 6 - 1
src/views/manager/projectinfo/codeSet.vue

@@ -366,6 +366,11 @@ export default {
  
     },
     saveCodeSet(){
+        if (this.tableData.length === 0) {
+          this.$message.warning('请至少添加一条规则!')
+          return;
+        }
+
           for (let row of this.tableData) {
             row.projectId = this.projectId;
             row.type=this.activeName;
@@ -387,7 +392,7 @@ export default {
                         this.$message.error(res.data.msg);
                       }
                     }).catch(() => {
-                      this.$message.error('操作失败');
+                      // this.$message.error('操作失败');
                     }).finally(() => {
                             this.saveCodeLoad = false;
                     });