king
2021-01-15 76a4300654a18d228838c3f27455dc8e7a8cd616
src/templates/treepageconfig/index.jsx
@@ -164,30 +164,6 @@
    })
  }
  getFuncNames = (data, funcNames, tableNames) => {
    data.forEach(item => {
      // if (item.subfuncs) {
      //   this.getFuncNames(item.subfuncs, funcNames, tableNames)
      //   return
      // }
      if (item.tableName) {
        tableNames.push(item.tableName)
      }
      if (item.innerFunc) {
        funcNames.push({func: item.innerFunc, label: item.label || ''})
      }
      if (item.callbackFunc) {
        funcNames.push({func: item.callbackFunc, label: item.label || ''})
      }
    })
    return {
      func: funcNames,
      table: tableNames
    }
  }
  /**
   * @description 三级菜单保存
   */
@@ -231,31 +207,6 @@
      _config.enabled = false
    }
    _config.funcs = [] // 页面及子页面存储过程集
    _config.funcs.push({
      type: 'view',
      subtype: 'view',
      uuid: menu.MenuID,
      intertype: _config.setting.interType || 'inner',
      interface: _config.setting.interface || '',
      tableName: _config.setting.tableName || '',
      innerFunc: _config.setting.innerFunc || '',
      outerFunc: _config.setting.outerFunc || ''
    })
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(tab => {
        _config.funcs.push({
          type: 'tab',
          subtype: 'tab',
          uuid: tab.uuid,
          label: tab.label,
          linkTab: tab.linkTab
        })
      })
    })
    if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
      this.setState({
        menucloseloading: true
@@ -266,49 +217,6 @@
      })
    }
    new Promise(resolve => {
      // let deffers = []
      // _config.funcs.forEach(item => {
      //   if (item.type === 'tab') {
      //     let deffer = new Promise(resolve => {
      //       Api.getSystemConfig({
      //         func: 'sPC_Get_LongParam',
      //         MenuID: item.linkTab
      //       }).then(result => {
      //         if (result.status && result.LongParam) {
      //           let _LongParam = ''
      //           if (result.LongParam) {
      //             try {
      //               _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
      //             } catch (e) {
      //               console.warn('Parse Failure')
      //               _LongParam = ''
      //             }
      //           }
      //           if (_LongParam) {
      //             item.menuNo = _LongParam.tabNo || ''
      //             item.subfuncs = _LongParam.funcs || []
      //           }
      //         }
      //         resolve()
      //       })
      //     })
      //     deffers.push(deffer)
      //   }
      // })
      // if (deffers.length === 0) {
      //   resolve()
      // } else {
      //   Promise.all(deffers).then(() => {
      //     resolve()
      //   })
      // }
      resolve()
    }).then(() => {
      // 保存时删除配置类型,system 、user
      delete _config.type
      delete _config.isAdd
@@ -356,8 +264,18 @@
      tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
      let _vals = this.getFuncNames(_config.funcs, [], [])
      let _tables = Array.from(new Set(_vals.table))
    let _funcs = []
    let _tables = []
    if (_config.setting.tableName) {
      _tables.push(_config.setting.tableName)
    }
    if (_config.setting.innerFunc) {
      _funcs.push({func: _config.setting.innerFunc, label: _config.MenuName || ''})
    }
    if (_config.setting.outerFunc) {
      _funcs.push({func: _config.setting.outerFunc, label: _config.MenuName || ''})
    }
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
@@ -371,7 +289,7 @@
        MenuName: _config.MenuName,
        PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}),
        LongParam: _LongParam,
        LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
      LText: _funcs.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
        LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
      }
@@ -517,7 +435,6 @@
              duration: 5
            })
          }
        })
      })
    })
  }