king
2020-12-23 e9640ccdc9fe57f91919e3f51462c780e44fadb0
src/templates/comtableconfig/index.jsx
@@ -202,13 +202,11 @@
    })
  }
  getFuncNames = (data, funcNames, tableNames) => {
    data.forEach(item => {
      // if (item.subfuncs) {
      //   this.getFuncNames(item.subfuncs, funcNames, tableNames)
      //   return
      // }
  getFuncNames = (data) => {
    let funcNames = []
    let tableNames = []
      
    data.forEach(item => {
      if (item.tableName) {
        tableNames.push(item.tableName)
      }
@@ -220,6 +218,8 @@
        funcNames.push({func: item.callbackFunc, label: item.label || ''})
      }
    })
    tableNames = Array.from(new Set(tableNames))
    return {
      func: funcNames,
@@ -354,49 +354,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
@@ -479,8 +436,7 @@
      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 _vals = this.getFuncNames(_config.funcs)
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
@@ -495,7 +451,7 @@
        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`),
        LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
      LTexttb: _vals.table.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
      }
      if (menu.menuSort) { // 菜单新建时设置排序
@@ -644,7 +600,6 @@
              duration: 5
            })
          }
        })
      })
    })
  }