king
2020-02-21 063b983daaf51a7f1e8677bde1e9c0e618866c91
src/templates/formtabconfig/index.jsx
@@ -81,9 +81,11 @@
    if (!config) {
      _config = JSON.parse(JSON.stringify(Source.baseConfig))
      _config.isAdd = true
      if (menu && menu.LongParam && menu.LongParam.setting.dataresource) {
        _config.setting.dataresource = menu.LongParam.setting.dataresource
      }
    } else {
      _config = config
      // _config.action = Source.baseConfig.action
    }
    if (menu && menu.LongParam && menu.LongParam.columns) {
@@ -374,7 +376,10 @@
  handleTab = (card) => {
    const { config } = this.state
    let menus = [{value: 'mainTable', text: '主数据'}]
    let menus = [
      {value: '', text: '空'},
      {value: 'mainTable', text: '主数据'}
    ]
    let equalTabs = []
    let supMenu = card.supMenu || ''
    let equalTab = card.equalTab || []
@@ -1189,8 +1194,8 @@
      // 标签不合法时,启用状态为false
      if (_config.tabgroups.length > 1) {
        _config.tabgroups.forEach(group => {
          if (_config[group].length === 0) {
        _config.tabgroups.forEach(groupId => {
          if (_config[groupId].length === 0) {
            _config.enabled = false
          }
        })
@@ -1205,6 +1210,106 @@
        })
      }
      _config.funcs = [] // 页面及子页面存储过程集
      if (_config.setting.datatype === 'query') {
        _config.funcs.push({
          type: 'view',
          subtype: 'view',
          uuid: btnTab.uuid,
          intertype: _config.setting.interType || 'inner',
          interface: _config.setting.interface || '',
          tableName: _config.setting.tableName || '',
          innerFunc: _config.setting.innerFunc || '',
          outerFunc: _config.setting.outerFunc || ''
        })
      }
      _config.action.forEach(item => {
        if (item.btnType !== 'cancel') {
          _config.funcs.push({
            type: 'button',
            subtype: 'btn',
            uuid: item.uuid,
            label: item.label,
            tablename: item.sql || '',
            intertype: item.intertype,
            interface: item.interface || '',
            innerFunc: item.innerFunc || '',
            outerFunc: item.outerFunc || '',
            callbackFunc: item.callbackFunc || ''
          })
        }
      })
      _config.tabgroups.forEach(groupId => {
        if (_config[groupId].length === 0) return
        _config[groupId].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
        })
      } else {
        this.setState({
          menuloading: true
        })
      }
      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 = window.decodeURIComponent(window.atob(result.LongParam))
                      _LongParam = JSON.parse(_LongParam)
                    } catch (e) {
                      _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()
          })
        }
      }).then(() => {
        // 删除添加标识
      delete _config.isAdd
      try {
@@ -1214,6 +1319,11 @@
          top: 92,
          message: '编译错误',
          duration: 10
          })
          this.setState({
            menucloseloading: false,
            menuloading: false
        })
        return
      }
@@ -1257,16 +1367,6 @@
        MenuName: btnTab.label,
        PageParam: JSON.stringify({Template: 'FormTab'}),
        LongParam: _LongParam
      }
      if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
        this.setState({
          menucloseloading: true
        })
      } else {
        this.setState({
          menuloading: true
        })
      }
      // 有按钮或标签删除时,先进行删除操作
@@ -1335,6 +1435,7 @@
              duration: 10
            })
          }
          })
        })
      })
    }, () => {
@@ -2095,6 +2196,7 @@
          title={this.state.dict['header.modal.form.edit']}
          visible={modaltype === 'search'}
          width={700}
          maskClosable={false}
          onOk={this.handleSubmit}
          onCancel={this.editModalCancel}
          destroyOnClose
@@ -2111,6 +2213,7 @@
          title={this.state.dict['header.modal.action.edit']}
          visible={modaltype === 'actionEdit'}
          width={700}
          maskClosable={false}
          onCancel={this.editModalCancel}
          footer={[
            this.state.card && this.state.card.btnType !== 'cancel' ?
@@ -2133,6 +2236,7 @@
          title={this.state.dict['header.modal.tabs.edit']}
          visible={modaltype === 'tabs'}
          width={700}
          maskClosable={false}
          onOk={this.handleSubmit}
          onCancel={this.editModalCancel}
          destroyOnClose
@@ -2152,6 +2256,7 @@
          title={this.state.dict['header.edit']}
          visible={this.state.tableVisible}
          width={'65vw'}
          maskClosable={false}
          style={{minWidth: '900px', maxWidth: '1200px'}}
          cancelText={this.state.dict['header.close']}
          onOk={this.addFieldSubmit}
@@ -2175,6 +2280,7 @@
          title={'验证信息'}
          visible={this.state.profileVisible}
          width={'75vw'}
          maskClosable={false}
          style={{minWidth: '900px', maxWidth: '1200px'}}
          onOk={this.verifySubmit}
          onCancel={() => { this.setState({ profileVisible: false }) }}
@@ -2194,7 +2300,7 @@
          title={this.state.dict['header.edit']}
          visible={this.state.settingVisible}
          width={700}
          // onOk={this.settingSave}
          maskClosable={false}
          onCancel={() => { // 取消修改
            this.setState({
              settingVisible: false
@@ -2218,6 +2324,7 @@
        <Modal
          bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
          closable={false}
          maskClosable={false}
          visible={this.state.closeVisible}
          onCancel={() => { this.setState({closeVisible: false}) }}
          footer={[
@@ -2233,6 +2340,7 @@
          title={this.state.dict['header.menu.group.manage']}
          visible={this.state.groupVisible}
          width={700}
          maskClosable={false}
          onOk={this.handleGroupSave}
          onCancel={() => { this.setState({ groupVisible: false }) }}
          destroyOnClose