king
2022-11-21 f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89
src/menu/tablenodes/index.jsx
@@ -55,7 +55,56 @@
      })
    }
    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') {
@@ -280,6 +335,18 @@
        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)
      }
    });