king
2023-01-17 474c68f0fea10cc62977c67d186732b3346cdd53
src/tabviews/custom/popview/index.jsx
@@ -129,7 +129,9 @@
      })
    }
    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab)
    config.$cache = config.cacheLocal === 'true'
    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, config.$cache)
    
    // 获取主搜索条件
    let mainSearch = []
@@ -175,9 +177,10 @@
    })
  }
  filterComponent = (components, roleId, balMap, urlparam, Tab) => {
  filterComponent = (components, roleId, balMap, urlparam, Tab, cache) => {
    return components.filter(item => {
      item.$pageId = Tab.uuid
      item.$cache = cache
      
      if (item.style && item.style.boxShadow) {
        delete item.style.hShadow
@@ -261,7 +264,7 @@
        item.subtabs = item.subtabs.map(tab => {
          tab.$pageId = Tab.uuid
          tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab)
          tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, cache)
          return tab
        })
@@ -274,7 +277,7 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab)
        item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab, cache)
        return true
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
@@ -754,7 +757,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})
@@ -764,6 +768,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,
@@ -1011,7 +1025,7 @@
    return (
      <div className={'pop-page-wrap ' + (loading ? 'loading' : '')} style={config ? config.style : null}>
        {loading ? <Spin className="view-spin" size="large" /> : null}
        {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null}
        <Row className="component-wrap">{this.getComponents()}</Row>
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>