king
2021-04-07 f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2
src/templates/subtableconfig/index.jsx
@@ -47,10 +47,9 @@
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,        // 字典
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,        // 字典
    config: null,            // 页面配置
    visible: false,          // 搜索条件、按钮、显示列,模态框显示控制
    tableFields: [],         // 已选表字段集
    menuloading: false,      // 菜单保存中
    menucloseloading: false, // 菜单关闭时,选择保存
    loading: false,          // 加载中,页面spin
@@ -90,6 +89,11 @@
    if (_config.type === 'user') {
      _config.action = _config.action.map(item => {
        let uuid = Utils.getuuid()
        if (item.linkTab) {
          item.linkTab = ''
        }
        if (item.OpenType === 'pop') { // 含有子配置项的按钮
          _oriActions.push({
            prebtn: fromJS(item).toJS(),
@@ -550,6 +554,7 @@
        let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 查看初始化按钮是否存在
        if (!curBtn) return
        if (curBtn.OpenType !== item.prebtn.OpenType) return
        if (curBtn.OpenType === 'funcbutton' && curBtn.execMode !== 'pop') return
        oriActions.push({
          prebtn: item.prebtn,
@@ -666,10 +671,10 @@
        let _view = ''
        let _subtab = editSubTab
        if (btn.OpenType === 'pop') {
          _view = 'Modal'             // 表单页面
        if (btn.OpenType === 'pop' || btn.execMode === 'pop') {
          _view = 'Modal'      // 表单页面
        } else if (btn.OpenType === 'popview') {
          _view = btn.tabType || 'SubTable' // 新弹窗标签模板 tabType 属性已去除
          _view = 'SubTable'   // 新弹窗标签模板 tabType 属性已去除
          _subtab = btn
          if (editSubTab) {
@@ -910,32 +915,11 @@
      chartview: _chartview
    })
  }
  /**
   * @description 更新常用表信息,快捷添加后更新配置信息
   */
  updatetable = (config, fields) => {
    const { tableFields } = this.state
    this.setState({
      config: config,
      tableFields: fields ? fields : tableFields
    })
  }
  /**
   * @description 批量添加,更新配置信息
   */
  updatefield = (config) => {
    this.setState({
      config: config
    })
  }
  render () {
    const { activeKey, config, chartview } = this.state
    const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank'].includes(_action.OpenType))
    const confActions = config.action.filter(_action => !_action.origin && (['pop', 'popview'].includes(_action.OpenType) || (_action.OpenType === 'funcbutton' && _action.execMode === 'pop')))
    return (
      <div className="model-subtable-board">
@@ -955,7 +939,7 @@
                <TableComponent
                  config={config}
                  containerId="subtable-basedata"
                  updatetable={this.updatetable}
                  updatetable={this.updateconfig}
                />
              </Panel>
              {/* 搜索条件添加 */}
@@ -968,8 +952,7 @@
                <FieldsComponent
                  config={config}
                  type="search"
                  tableFields={this.state.tableFields}
                  updatefield={this.updatefield}
                  updatefield={this.updateconfig}
                />
              </Panel>
              {/* 按钮添加 */}
@@ -1012,8 +995,7 @@
                <FieldsComponent
                  config={config}
                  type="columns"
                  tableFields={this.state.tableFields}
                  updatefield={this.updatefield}
                  updatefield={this.updateconfig}
                />
              </Panel>
            </Collapse>