فهرست منبع

节点参数删除标识

yangyj 2 سال پیش
والد
کامیت
065b8511fc
2فایلهای تغییر یافته به همراه20 افزوده شده و 15 حذف شده
  1. 10 7
      src/views/manager/projectinfo/tree.vue
  2. 10 8
      src/views/manager/wbsinfo/edit.vue

+ 10 - 7
src/views/manager/projectinfo/tree.vue

@@ -1304,7 +1304,7 @@
                 type="text"
                 size="small"
                 class="text-icon-danger"
-                @click="delNodeInfoss(scope.$index)"
+                @click="delNodeInfoss(scope.$index,scope.row)"
                 >删除</el-button
               >
             </template>
@@ -1356,7 +1356,7 @@
                 type="text"
                 size="small"
                 class="text-icon-danger"
-                @click="delNodeInfo(scope.$index)"
+                @click="delNodeInfo(scope.$index,scope.row)"
                 >删除</el-button
               >
             </template>
@@ -1650,6 +1650,7 @@ export default {
       nodeInfoTable: [],
       namelist: [],
       namelists: [],
+      delids:[],
 
       infoNameVisible: false,
 
@@ -2641,11 +2642,13 @@ export default {
       });
       console.log(this.nodeInfoTable)
     },
-    delNodeInfo(key) {
+    delNodeInfo(key,obj) {
+      this.delids.push(obj.id)
       //设置参数名称中的删除按钮
       this.namelists.splice(key, 1);
     },
-    delNodeInfoss(key) {
+    delNodeInfoss(key,obj) {
+      this.delids.push(obj.id)
       //节点参数
       this.nodeInfoTable.splice(key, 1);
     },
@@ -2663,7 +2666,7 @@ export default {
       //节点参数弹框保存按钮
       if (this.nodeInfoTable) {
         if (this.nodeInfoTable.length == 0) {
-          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,wps:[
+          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
             {
               nodeId: this.jiedianId,
               type: -1,
@@ -2693,7 +2696,7 @@ export default {
           }
         });
         if (tag) {
-          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable,type:1});
+          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable,type:1,delIds:this.delids});
           this.nodeInfoVisible = false;
           this.$message({
             type: "success",
@@ -2722,7 +2725,7 @@ export default {
           }
         });
         if (tag) {
-          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists,type:0}); //保存设置参数
+          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists,type:0,delIds:this.delids}); //保存设置参数
           this.infoNameVisible = false;
           this.keymap();
         } else {

+ 10 - 8
src/views/manager/wbsinfo/edit.vue

@@ -1405,7 +1405,7 @@
                 type="text"
                 size="small"
                 class="text-icon-danger"
-                @click="delNodeInfoss(scope.$index)"
+                @click="delNodeInfoss(scope.$index,scope.row)"
               >删除</el-button>
             </template>
           </el-table-column>
@@ -1482,7 +1482,7 @@
                 type="text"
                 size="small"
                 class="text-icon-danger"
-                @click="delNodeInfo(scope.$index)"
+                @click="delNodeInfo(scope.$index,scope.row)"
               >删除</el-button>
             </template>
           </el-table-column>
@@ -1767,7 +1767,7 @@ export default {
       namelist: [],
       namelists: [],
       infoNameVisible: false,
-
+      delids:[],
       //数据类型的默认长度
       dataTypeDefaultMap: {
         1: 250,//字符串
@@ -2644,10 +2644,12 @@ export default {
     addNodeInfoTable () {//添加节点参数数据
       this.nodeInfoTable.unshift({ k: '', v: '', remark: '', nodeId: this.jiedianId,type: 1 })
     },
-    delNodeInfo (key) {//设置参数名称中的删除按钮
+    delNodeInfo (key,obj) {//设置参数名称中的删除按钮
+      this.delids.push(obj.id)
       this.namelists.splice(key, 1)
     },
-    delNodeInfoss (key) {//节点参数
+    delNodeInfoss (key,obj) {//节点参数
+      this.delids.push(obj.id)
       this.nodeInfoTable.splice(key, 1)
     },
     setNodeParameters () {//打开设置节点参数弹框按钮
@@ -2661,7 +2663,7 @@ export default {
     async nodeInfoSave () {//节点参数弹框保存按钮
       if (this.nodeInfoTable) {
         if(this.nodeInfoTable.length == 0){
-          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,wps:[
+          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
             {
               nodeId: this.jiedianId,
               type: -1,
@@ -2692,7 +2694,7 @@ export default {
 
         })
         if (tag) {
-          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable,type:1})
+          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable,type:1,delIds:this.delids})
           this.nodeInfoVisible = false
           this.$message({
             type: "success",
@@ -2720,7 +2722,7 @@ export default {
           }
         })
         if (tag) {
-          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists,type:0}) //保存设置参数
+          await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists,type:0,delIds:this.delids}) //保存设置参数
           this.infoNameVisible = false
           this.keymap()
         } else {