king
2021-09-10 c66c7b65432af8cdab430b7ac079a4fd75c3d60f
src/tabviews/custom/index.jsx
@@ -132,7 +132,8 @@
      // 权限过滤
      let roleId = sessionStorage.getItem('role_id') || '' // 角色ID
      let balMap = new Map()
      config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap)
      let skip = config.permission === 'false' || this.props.menuType === 'HS'
      config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap, skip)
      
      // 获取主搜索条件
      let mainSearch = []
@@ -445,7 +446,7 @@
    })
  }
  filterComponent = (components, roleId, permAction, permMenus, balMap) => {
  filterComponent = (components, roleId, permAction, permMenus, balMap, skip) => {
    return components.filter(item => {
      
      if (item.style && item.style.boxShadow) {
@@ -476,7 +477,7 @@
        })
        item.subtabs = item.subtabs.map(tab => {
          tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap)
          tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap, skip)
          return tab
        })
@@ -499,7 +500,7 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap)
        item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip)
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) {
        if (
          item.plot.blacklist && item.plot.blacklist.length > 0 &&
@@ -562,7 +563,6 @@
      }
      // 权限过滤
      let isHS = this.props.menuType === 'HS'
      let tabId = this.props.Tab ? this.props.Tab.uuid : '' // 弹窗标签按钮Id
      if (item.action && item.action.length > 0) {
        item.action = item.action.filter(cell => {
@@ -584,7 +584,7 @@
            cell.style = {...cell.style, ...cell.btnstyle}
          }
          return isHS || permAction[cell.uuid]
          return skip || permAction[cell.uuid]
        })
      }
@@ -622,7 +622,7 @@
              cell.innerHeight = 'auto'
            }
            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
          })
          card.backElements = card.backElements.filter(cell => {
            if (cell.eleType === 'button') {
@@ -646,7 +646,7 @@
            } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
              cell.innerHeight = 'auto'
            }
            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
          })
        })
      } else if (item.type === 'balcony') {
@@ -672,7 +672,7 @@
            cell.innerHeight = 'auto'
          }
          return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
          return cell.eleType !== 'button' || skip || permAction[cell.uuid]
        })
      } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel') {
        item.subcards && item.subcards.forEach(card => {
@@ -700,7 +700,7 @@
            } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
              cell.innerHeight = 'auto'
            }
            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
          })
        })
      } else if (item.type === 'table' && item.subtype === 'normaltable') {
@@ -726,7 +726,7 @@
              cell.style = {...cell.style, ...cell.btnstyle}
            }
            return isHS || permAction[cell.uuid]
            return skip || permAction[cell.uuid]
          })
          return col.elements.length !== 0
        })