king
2025-01-27 66551ce2db74ccd54226fb78a640d07f04519917
2025-01-27
4个文件已修改
149 ■■■■■ 已修改文件
src/menu/components/card/balcony/options.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/options.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.jsx 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/options.jsx
@@ -114,6 +114,7 @@
      label: '上级组件',
      initval: wrap.supModule || [],
      required: true,
      allowClear: true,
      options: supmodules,
      forbid: isprint
    },
src/menu/components/search/main-search/options.jsx
@@ -191,6 +191,7 @@
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      allowClear: true,
      options: modules,
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -231,10 +231,11 @@
          if (this.record.execType === 'single') {
            shows.push('execInterval')
          }
        } else {
          shows.push('execInterval')
        }
      }
      if (intertype === 'outer' || intertype === 'custom') {
        shows.push('execInterval')
      }
      if (this.record.openmenu && this.record.openmenu !== 'goback') {
        shows.push('open')
      }
src/menu/debug/index.jsx
@@ -27,6 +27,8 @@
  sqlList = []
  verSqls = []
  linkMain = null
  modules = null
  supError = null
  trigger = () => {
    let config = fromJS(this.props.config).toJS()
@@ -61,6 +63,30 @@
    if (error) {
      Modal.warning({
        title: error,
        okText: '知道了'
      })
      return
    }
    this.modules = {}
    this.supError = null
    this.getModules(config.components, config.interfaces)
    config.interfaces && config.interfaces.forEach(item => {
      if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') {
        let id = item.setting.supModule[item.setting.supModule.length - 1]
        if (!this.modules[id]) {
          this.supError = item.name + '(公共数据源)'
        }
      }
    })
    this.checklink(config.components)
    if (this.supError) {
      Modal.warning({
        title: this.supError + ':上级组件不存在!',
        okText: '知道了'
      })
      return
@@ -286,6 +312,122 @@
    this.sqlList = []
  }
  getModules = (components, interfaces, sups = []) => {
    components.forEach(item => {
      this.modules[item.uuid] = [...sups, item.uuid]
      if (item.type === 'tabs') {
        item.subtabs.forEach(f_tab => {
          this.getModules(f_tab.components, null, [...sups, item.uuid, f_tab.uuid])
        })
      } else if (item.type === 'group') {
        item.components.forEach(cell => {
          this.modules[cell.uuid] = [...sups, item.uuid, cell.uuid]
        })
      }
    })
    if (interfaces && interfaces.length > 0) {
      interfaces.forEach(item => {
        this.modules[item.uuid] = [item.uuid]
      })
    }
  }
  checklink = (components, suplabel = '') => {
    if (this.supError) return
    components.forEach(item => {
      if (this.supError) return
      if (item.type === 'tabs') {
        item.subtabs.forEach(f_tab => {
          this.checklink(f_tab.components, suplabel)
        })
      } else if (item.type === 'group' ) {
        item.components && this.checklink(item.components, suplabel)
      } else {
        if (item.wrap && item.wrap.supType === 'multi') {
          if (item.setting && item.setting.supModule) {
            item.setting.supModule = ''
          }
          if (item.supNodes) {
            item.supNodes.forEach(cell => {
              let id = cell.nodes[cell.nodes.length - 1]
              if (!this.modules[id]) {
                this.supError = suplabel + item.name
              }
            })
          }
        } else if ((item.wrap && item.wrap.datatype === 'static') || (['mainsearch', 'voucher'].includes(item.subtype))) {
          if (item.wrap && item.wrap.supModule && item.wrap.supModule[0]) {
            let id = item.wrap.supModule[item.wrap.supModule.length - 1]
            if (!this.modules[id]) {
              this.supError = suplabel + item.name
            }
          }
        } else if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') {
          let id = item.setting.supModule[item.setting.supModule.length - 1]
          if (!this.modules[id]) {
            this.supError = suplabel + item.name
          }
        }
        if (this.supError) return
        if (['card', 'carousel', 'timeline'].includes(item.type)) {
          item.subcards.forEach(card => {
            card.elements && card.elements.forEach(cell => {
              if (cell.eleType === 'button' && cell.OpenType === 'popview') {
                if (cell.config && cell.config.components && cell.config.enabled) {
                  this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-')
                }
              }
            })
            card.backElements && card.backElements.forEach(cell => {
              if (cell.eleType === 'button' && cell.OpenType === 'popview') {
                if (cell.config && cell.config.components && cell.config.enabled) {
                  this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-')
                }
              }
            })
          })
        } else if (item.type === 'balcony') {
          item.elements && item.elements.forEach(cell => {
            if (cell.eleType === 'button' && cell.OpenType === 'popview') {
              if (cell.config && cell.config.components && cell.config.enabled) {
                this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-')
              }
            }
          })
        } else if (item.type === 'table' && item.cols) {
          let loopCol = (cols) => {
            cols.forEach(col => {
              if (col.type === 'colspan' && col.subcols) {
                loopCol(col.subcols)
              } else if (col.type === 'custom' && col.elements) {
                col.elements.forEach(cell => {
                  if (cell.eleType === 'button' && cell.OpenType === 'popview') {
                    if (cell.config && cell.config.components && cell.config.enabled) {
                      this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-')
                    }
                  }
                })
              }
            })
          }
          loopCol(item.cols)
        }
        item.action && item.action.forEach(cell => {
          if (cell.OpenType === 'popview') {
            if (cell.config && cell.config.components && cell.config.enabled) {
              this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-')
            }
          }
        })
      }
    })
  }
  filterComponent = (components, mainSearch, regs, process, ispop = false) => {
    let appType = sessionStorage.getItem('appType')