king
2023-03-04 7ec82053855cf041ab2357a3b8c1684fcc6cc061
src/tabviews/basetable/index.jsx
@@ -17,6 +17,7 @@
const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table'))
const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent'))
const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes'))
const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic'))
const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
class BasePage extends Component {
@@ -42,7 +43,8 @@
    data: null,           // 列表数据集
    loading: false,       // 列表数据加载中
    visible: false,       // 标签页控制
    shortcuts: null       // 快捷键
    shortcuts: null,      // 快捷键
    autoMatic: null
  }
  /**
@@ -155,6 +157,20 @@
      }
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID)
      let autoMatic = null
      if (config.autoMatic && config.autoMatic.enable === 'true') {
        config.components[0].action.forEach(item => {
          if (item.uuid === config.autoMatic.action) {
            autoMatic = config.autoMatic
            autoMatic.OpenType = item.execMode || item.OpenType
            config.components[0].wrap.selected = 'false'
            config.components[0].MenuID = config.components[0].uuid
            config.components[0].autoMatic = true
            item.autoMatic = true
          }
        })
      }
      
      // 获取主搜索条件
      let mainSearch = []
@@ -181,6 +197,7 @@
        BID: BID,
        shortcuts: shortcuts.length > 0 ? shortcuts : null,
        config,
        autoMatic,
        mainSearch
      }, () => {
        setTimeout(() => { // 延时加载状态
@@ -266,11 +283,16 @@
        item.subtabs = item.subtabs.map(tab => {
          tab.components[0].name = tab.label
          if (tab.permission !== 'true') { // 权限未开启不做权限控制
            skip = true
          }
          tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId)
          return tab
        })
        return true
      } else {
        item.name = (this.props.MenuName || '')
      }
      // 搜索条件初始化
@@ -357,10 +379,21 @@
          if (cell.syncComponentId === item.setting.supModule) {
            cell.syncComponentId = ''
            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
              cell.execSuccess = 'mainline'
            }
          }
          if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
            cell = this.getPrinter(cell, item.uuid)
          }
          if (cell.controlField) {
            if (/,/ig.test(cell.controlVal)) {
              cell.controlVals = cell.controlVal.split(',')
            } else {
              cell.controlVals = [(cell.controlVal || '')]
            }
          }
          return skip || permAction[cell.uuid]
@@ -382,10 +415,21 @@
          if (cell.syncComponentId === item.setting.supModule) {
            cell.syncComponentId = ''
            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
              cell.execSuccess = 'mainline'
            }
          }
          if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
            cell = this.getPrinter(cell, item.uuid)
          }
          if (cell.controlField) {
            if (/,/ig.test(cell.controlVal)) {
              cell.controlVals = cell.controlVal.split(',')
            } else {
              cell.controlVals = [(cell.controlVal || '')]
            }
          }
          return skip || permAction[cell.uuid]
@@ -544,6 +588,11 @@
  }
  reloadview = () => {
    window.GLOB.CacheData.delete(this.props.MenuID)
    if (this.state.config) {
      this.deleteCache(this.state.config.components)
    }
    this.setState({
      BID: '',              // 页面跳转时携带ID
      loadingview: true,    // 页面加载中
@@ -586,13 +635,14 @@
  }
  render() {
    const { loadingview, viewlost, config, loading, shortcuts } = this.state
    const { loadingview, viewlost, config, loading, shortcuts, autoMatic } = this.state
    return (
      <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}>
      <div className={'custom-table-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}>
        {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null}
        <Row className="component-wrap">{this.getComponents()}</Row>
        {config && window.GLOB.breakpoint ? <DebugTable /> : null}
        {!window.GLOB.mkHS && config && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config.components[0]} /> : null}
        {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null}
        {!window.GLOB.mkHS && config ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts || []}/> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}