From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/menu/tablenodes/index.jsx |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/src/menu/tablenodes/index.jsx b/src/menu/tablenodes/index.jsx
index 8f31c88..2b5eed1 100644
--- a/src/menu/tablenodes/index.jsx
+++ b/src/menu/tablenodes/index.jsx
@@ -55,7 +55,56 @@
       })
     }
 
-    traversal(config.components)
+    if (config.Template === 'BaseTable') {
+      config.components.forEach(item => {
+        if (item.type === 'tabs') {
+          item.subtabs.forEach(tab => {
+            if (tab.components[0].$tables) {
+              ptbs.push(...tab.components[0].$tables)
+              tab.components[0].$tables.forEach(tb => {
+                tbs.push({
+                  label: tab.label,
+                  table: tb,
+                  color: '#5AD8A6',
+                  id: Utils.getuuid(),
+                  direction: 'left'
+                })
+              })
+            }
+          })
+        } else if (item.$tables) {
+          ptbs.push(...item.$tables)
+          item.$tables.forEach(tb => {
+            tbs.push({
+              label: '涓昏〃',
+              table: tb,
+              color: '#5AD8A6',
+              id: Utils.getuuid(),
+              direction: 'left'
+            })
+          })
+        }
+      })
+    } else {
+      traversal(config.components)
+
+      if (config.interfaces) {
+        config.interfaces.forEach(item => {
+          if (item.$tables) {
+            ptbs.push(...item.$tables)
+            item.$tables.forEach(tb => {
+              tbs.push({
+                label: item.name,
+                table: tb,
+                color: '#5AD8A6',
+                id: Utils.getuuid(),
+                direction: 'left'
+              })
+            })
+          }
+        })
+      }
+    }
 
     return {tbs, ptbs}
   }
@@ -181,6 +230,12 @@
           delete _param.type
           _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
           window.open(`#/menudesign/${_param}`)
+        } else if (menu.param.MenuType === 'BaseTable') {
+          let _param = {...menu.param}
+          delete _param.type
+          delete _param.MenuType
+          _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
+          window.open(`#/tabledesign/${_param}`)
         }
       } else if (menu.param.type === 'app') {
         if (menu.param.typename !== 'pc') {
@@ -279,6 +334,18 @@
       editNode(evt) {
         const item = evt.item;
         const model = item.get('model');
+
+        // 閫変腑鑺傜偣
+        this.graph.getNodes().forEach(node => {
+          let _model = node.get('model')
+          if (_model.fontcolor === '#1890ff') {
+            _model.fontcolor = ''
+            this.graph.updateItem(node, _model, false)
+          }
+        })
+
+        model.fontcolor = '#1890ff'
+        this.graph.updateItem(item, model, false)
         
         that.changeMenu(model)
       }

--
Gitblit v1.8.0