king
2023-07-25 2a3cc4e6cecfc6dab8b60adf93f7fde898ddc939
src/tabviews/custom/popview/index.jsx
@@ -131,9 +131,7 @@
      })
    }
    config.$cache = config.cacheLocal === 'true'
    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, config.$cache, Tab.uuid, Tab.uuid)
    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid)
    
    // 获取主搜索条件
    config.components.forEach(component => {
@@ -160,15 +158,8 @@
    let params = []
    let BID = param.$BID || ''
    let inherit = {}
    if (config.cacheUseful === 'true') { // 缓存继承
      inherit.cacheUseful = config.cacheUseful
      inherit.timeUnit = config.timeUnit
      inherit.cacheTime = config.cacheTime
    }
    config.components = this.formatSetting(config.components, params, inherit, regs, balMap)
    config.components = this.formatSetting(config.components, params, regs, balMap)
    if ([...balMap.keys()].length > 0) {
      config.components = this.filterBalcony(config.components, balMap)
@@ -184,10 +175,9 @@
    })
  }
  filterComponent = (components, roleId, balMap, urlparam, Tab, cache, searchId, syncId) => {
  filterComponent = (components, roleId, balMap, urlparam, Tab, searchId, syncId) => {
    return components.filter(item => {
      item.$pageId = Tab.uuid
      item.$cache = cache
      item.$searchId = searchId
      item.$syncId = syncId
      
@@ -293,7 +283,7 @@
            }
          })
          tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, cache, _searchId, tab.uuid)
          tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, _searchId, tab.uuid)
          return tab
        })
@@ -306,7 +296,7 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab, cache, searchId, syncId)
        item.components = this.filterComponent(item.components, roleId, balMap, urlparam, Tab, searchId, syncId)
        return true
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
@@ -703,18 +693,17 @@
  }
  // 格式化默认设置
  formatSetting = (components, params, inherit, regs, balMap) => {
  formatSetting = (components, params, regs, balMap) => {
    let delay = 20
    return components.map(component => {
      if (component.type === 'tabs') {
        component.subtabs = component.subtabs.map(tab => {
          tab.components = this.formatSetting(tab.components, null, null, inherit, regs, balMap)
          tab = {...tab, ...inherit}
          tab.components = this.formatSetting(tab.components, null, regs, balMap)
          return tab
        })
        return component
      } else if (component.type === 'group') {
        component.components = this.formatSetting(component.components, params, null, regs, balMap)
        component.components = this.formatSetting(component.components, params, regs, balMap)
        return component
      } else if (component.wrap && component.wrap.datatype === 'public') {
        component.setting.useMSearch = false
@@ -1135,7 +1124,7 @@
    return (
      <div className={'pop-page-wrap ' + (loading ? 'loading' : '')} style={config ? config.style : null}>
        {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null}
        {loading ? <Spin className="view-spin" size="large" /> : null}
        <Row className="component-wrap">{this.getComponents()}</Row>
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>