king
2024-04-29 6f2b0cab4c9a4dacfebb2d6fbd4ec2fdc14e22ba
src/utils/utils-custom.js
@@ -193,6 +193,42 @@
  }
  /**
   * @description 获取指定组件
   * @return {String}  组件id
   */
  static getComponent (Id) {
    let interfaces = window.GLOB.customMenu.interfaces
    let components = window.GLOB.customMenu.components
    let cell = null
    let mapComponents = (components = []) => {
      components.forEach(item => {
        if (item.uuid === Id) {
          cell = item
        }else if (item.type === 'tabs') {
          item.subtabs.forEach(f_tab => {
            mapComponents(f_tab.components)
          })
        } else if (item.type === 'group') {
          mapComponents(item.components)
        }
      })
    }
    mapComponents(components)
    if (!cell && interfaces) {
      interfaces.forEach(m => {
        if (m.uuid === Id && m.status === 'true') {
          cell = m
        }
      })
    }
    return cell
  }
  /**
   * @description 获取上级模块
   * @return {String}  selfId  当前组件id
   */
@@ -540,7 +576,16 @@
            return cell
          })
        }
      } else if (item.type === 'table' && item.cols) {
      } else if (item.type === 'table') {
        if (item.supNodes && item.supNodes.length > 0) {
          item.supNodes = item.supNodes.map(cell => {
            cell.nodes = cell.nodes.map(n => md5(commonId + n))
            cell.componentId = cell.nodes[cell.nodes.length - 1]
            return cell
          })
        }
        let loopCol = (cols) => {
          return cols.map(col => {
            if (col.type === 'action') {
@@ -578,7 +623,7 @@
          })
        }
        item.cols = loopCol(item.cols)
        item.cols = loopCol(item.cols || [])
        if (item.colsCtrls) {
          item.colsCtrls = item.colsCtrls.map(col => {
@@ -846,7 +891,7 @@
          return cell
        })
      }
    } else if (item.type === 'table' && item.cols) {
    } else if (item.type === 'table') {
      let loopCol = (cols) => {
        return cols.map(col => {
          if (col.type === 'action') {
@@ -887,7 +932,7 @@
        })
      }
      item.cols = loopCol(item.cols)
      item.cols = loopCol(item.cols || [])
      if (item.colsCtrls) {
        item.colsCtrls = item.colsCtrls.map(col => {
@@ -1675,7 +1720,7 @@
      } else if (!card.setting.supModule) {
        errors.push({ level: 0, detail: '未设置上级组件!'})
      }
    } else if (card.type === 'card' && card.subtype === 'datacard') { // 数据卡,可能有多上级
    } else if ((card.type === 'card' && card.subtype === 'datacard') || card.subtype === 'normaltable') { // 数据卡、table,可能有多上级
      if (card.wrap.supType !== 'multi' && !card.setting.supModule) {
        errors.push({ level: 0, detail: '未设置上级组件!'})
      }