king
2021-09-06 d4c2669215ef211e52496e69a89010a9b545e04a
src/templates/subtableconfig/index.jsx
@@ -26,6 +26,7 @@
const { Panel } = Collapse
const { confirm } = Modal
const Versions = asyncComponent(() => import('@/menu/versions'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent'))
const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent'))
@@ -917,8 +918,65 @@
    })
  }
  refreshConfig = () => {
    const { config } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
      MenuID: config.uuid
    }
    Api.getSystemConfig(param).then(res => {
      if (res.status) {
        let _config = ''
        if (res.LongParam) {
          try {
            _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
          } catch (e) {
            console.warn('Parse Failure')
            _config = ''
          }
        }
        if (!_config) {
          notification.warning({
            top: 92,
            message: '未获取到配置信息!',
            duration: 5
          })
          return
        }
        // 版本兼容
        _config = updateSubTable(_config)
        this.setState({
          config: null
        }, () => {
          this.setState({
            chartview: _config.charts[0].uuid,
            config: _config,
            openEdition: res.open_edition || '',
            activeKey: '0',
            originActions: [],
            originConfig: fromJS(_config).toJS()
          })
        })
      } else {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
      }
    })
  }
  render () {
    const { activeKey, config, chartview } = this.state
    const { activeKey, config, chartview, openEdition } = this.state
    if (!config) return null
    const confActions = config.action.filter(_action => !_action.origin && (['pop', 'popview'].includes(_action.OpenType) || (_action.OpenType === 'funcbutton' && _action.execMode === 'pop')))
@@ -1009,6 +1067,7 @@
              </div>
            } bordered={false} extra={
              <div>
                <Versions MenuId={config.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/>
                <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/>
                <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} />