king
2023-01-17 474c68f0fea10cc62977c67d186732b3346cdd53
src/tabviews/custom/index.jsx
@@ -197,9 +197,10 @@
        popview = 'popview'
      }
      config.interfaces = this.formatInterSetting(config.interfaces, regs)
      config.$cache = config.cacheLocal === 'true'
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview)
      config.interfaces = this.formatInterSetting(config.interfaces, regs)
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache)
      
      // 获取主搜索条件
      let mainSearch = []
@@ -307,9 +308,10 @@
    }
  }
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview) => {
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) => {
    return components.filter(item => {
      item.$pageId = pageId
      item.$cache = cache
      
      if (item.style && item.style.boxShadow) {
        delete item.style.hShadow
@@ -393,7 +395,7 @@
        item.subtabs = item.subtabs.map(tab => {
          tab.$pageId = pageId
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview)
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
          return tab
        })
@@ -406,7 +408,7 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview)
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
        return true
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
@@ -988,7 +990,8 @@
   * @description 主表数据加载
   */ 
  loadmaindata = (params) => {
    let param = getStructuredParams(params, this.state.config, this.state.BID || '')
    const { config } = this.state
    let param = getStructuredParams(params, config, this.state.BID || '')
    this.setState({loading: true, loadingview: false})
@@ -998,6 +1001,16 @@
        delete result.message
        delete result.ErrMesg
        delete result.ErrCode
        if (config.$cache) {
          params.forEach((item) => {
            let _data = result[item.name] || ''
            if (_data && !Array.isArray(_data)) {
              _data = [_data]
            }
            Api.writeCacheConfig(item.uuid, _data)
          })
        }
        this.setState({
          data: result,
@@ -1300,7 +1313,7 @@
    return (
      <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}>
        {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null}
        {(loadingview || (loading && !config.$cache)) ? <Spin className="view-spin" size="large" /> : null}
        <Row className="component-wrap">{this.getComponents()}</Row>
        {config && config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null}
        {config && window.GLOB.breakpoint ? <DebugTable /> : null}