From 39a6e2d4cbbc789955400ffd2352514a8fe4c188 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 19 八月 2024 14:05:18 +0800
Subject: [PATCH] 整合代码

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue |  122 +++++++++++++++++++++++-----------------
 1 files changed, 70 insertions(+), 52 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
index aa5e091..48bc0df 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
@@ -714,12 +714,24 @@
         this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
         return;
       }
-      deleteLink(this.nodeRow).then(res => {
-        if (res.data.code === 200) {
-          this.$message.success('鍒犻櫎鎴愬姛');
-          this.getTreeList();
-        }
-      })
+      ;
+      this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        deleteLink(this.nodeRow).then(res => {
+          if (res.data.code === 200) {
+            this.$message.success('鍒犻櫎鎴愬姛');
+            this.getTreeList();
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
     },
 
     // 鍒涘缓鎸夐挳
@@ -762,58 +774,62 @@
 
     // 涓�鑷存�ф鏌�
     checkClickHandler() {
-      this.conCheckVisible = true;
-      this.conCheckLoading = true;
       checkLinkType().then(res => {
-        if (res.data.code === 200) {
-          const data = res.data.data;
-          this.conDefaultCheckData = data; // 淇濈暀涓�浠藉師濮嬫暟鎹�
-          this.conCheckLoading = false;
+        if (res && res.data && res.data.data) {
+          this.conCheckVisible = true;
+          this.conCheckLoading = true;
+          if (res.data.code === 200) {
+            const data = res.data.data;
+            this.conDefaultCheckData = data; // 淇濈暀涓�浠藉師濮嬫暟鎹�
+            this.conCheckLoading = false;
 
-          const outputData = [];
+            const outputData = [];
 
-          data.forEach(item => {
-            Object.entries(item.btmCheckMap).forEach(([id, methodsArray]) => {
-              methodsArray.forEach(methods => {
-                // 鍒ゆ柇鍓嶇紑
-                const action = methods.startsWith('F_') ? '绉婚櫎form绔笟鍔$被鍨�' : '绉婚櫎to绔笟鍔$被鍨�';
-                const detail = methods.split('_')[1]; // 鑾峰彇 _ 鍚庨潰鐨勫唴瀹�
-                outputData.push({
-                  id: id,
-                  methods: `${action}:${detail}`,
-                  status: '鏈慨澶�'
+            data.forEach(item => {
+              Object.entries(item.btmCheckMap).forEach(([id, methodsArray]) => {
+                methodsArray.forEach(methods => {
+                  // 鍒ゆ柇鍓嶇紑
+                  const action = methods.startsWith('F_') ? '绉婚櫎form绔笟鍔$被鍨�' : '绉婚櫎to绔笟鍔$被鍨�';
+                  const detail = methods.split('_')[1]; // 鑾峰彇 _ 鍚庨潰鐨勫唴瀹�
+                  outputData.push({
+                    id: id,
+                    methods: `${action}:${detail}`,
+                    status: '鏈慨澶�'
+                  });
                 });
               });
-            });
 
-            // 澶勭悊 dbCheckMap
-            Object.entries(item.dbCheckMap).forEach(([id, methods]) => {
-              const splitMethods = methods.split('(');
-              // 鍒ゆ柇绗竴涓鍙峰墠闈㈢殑鍊�
-              if (splitMethods[0].startsWith('_ADD')) {
-                outputData.push({
-                  id: id,
-                  methods: '澧炲姞鍒�(' + splitMethods[1].slice(0, -1) + ')', // 缁撴潫浣嶇疆鍑忓幓)鐨勫瓧绗�
-                  status: '鏈慨澶�'
-                });
-              } else if (splitMethods[0].startsWith('_CREATE')) {
-                outputData.push({
-                  id: id,
-                  methods: '鍒涘缓琛�(' + splitMethods[1].slice(0, -1) + ')',
-                  status: '鏈慨澶�'
-                });
-              } else if (splitMethods[0].startsWith('_DROP')) {
-                outputData.push({
-                  id: id,
-                  methods: '绉婚櫎鍒�(' + splitMethods[1].slice(0, -1) + ')',
-                  status: '鏈慨澶�'
-                });
-              } else {
-                this.$message.error("涓嶆敮鎸佺殑 dbCheckMap 绫诲瀷锛� " + methods)
-              }
+              // 澶勭悊 dbCheckMap
+              Object.entries(item.dbCheckMap).forEach(([id, methods]) => {
+                const splitMethods = methods.split('(');
+                // 鍒ゆ柇绗竴涓鍙峰墠闈㈢殑鍊�
+                if (splitMethods[0].startsWith('_ADD')) {
+                  outputData.push({
+                    id: id,
+                    methods: '澧炲姞鍒�(' + splitMethods[0].slice(0, -1) + ')', // 缁撴潫浣嶇疆鍑忓幓)鐨勫瓧绗�
+                    status: '鏈慨澶�'
+                  });
+                } else if (splitMethods[0].startsWith('_CREATE')) {
+                  outputData.push({
+                    id: id,
+                    methods: '鍒涘缓琛�(' + splitMethods[0].slice(0, -1) + ')',
+                    status: '鏈慨澶�'
+                  });
+                } else if (splitMethods[0].startsWith('_DROP')) {
+                  outputData.push({
+                    id: id,
+                    methods: '绉婚櫎鍒�(' + splitMethods[0].slice(0, -1) + ')',
+                    status: '鏈慨澶�'
+                  });
+                } else {
+                  this.$message.error("涓嶆敮鎸佺殑 dbCheckMap 绫诲瀷锛� " + methods)
+                }
+              });
             });
-          });
-          this.conCheckData = outputData;
+            this.conCheckData = outputData;
+          }
+        } else {
+          this.$message.success(res.data.msg);
         }
       }).catch(err => {
         this.$message.error(err);
@@ -822,11 +838,11 @@
 
     // 淇涓�鑷存�ф鏌�
     repairClickHandler() {
-      console.log(this.conDefaultCheckData)
       const params = this.conDefaultCheckData[0];
       repairTable(params).then(res => {
         if (func.isEmptyObject(res.data.obj[0])) {
           this.$message.success('淇鎴愬姛');
+          this.conCheckData = [];
         } else {
           this.$message.error('淇澶辫触锛岃閲嶆柊灏濊瘯锛�');
         }
@@ -842,6 +858,8 @@
           this.createViewLoading = false;
           this.$message.success(res.data.obj);
         }
+      }).catch(err => {
+        this.createViewLoading = false;
       })
     },
 

--
Gitblit v1.9.3