king
2021-01-15 76a4300654a18d228838c3f27455dc8e7a8cd616
src/tabviews/scriptmanage/index.jsx
@@ -12,11 +12,12 @@
import { scriptMainTable, buttonConfig } from './config'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import asyncSpinComponent from '@/utils/asyncSpinComponent'
import TopSearch from './topSearch'
import MainAction from './actionList'
import './index.scss'
const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch'))
const MainTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable'))
class ScriptTable extends Component {
@@ -85,8 +86,10 @@
            subcols.push(colMap.get(sub))
          }
        })
        _col.subcols = subcols
        _columns.push(_col)
        if (subcols.length > 0) {
          _col.subcols = subcols
          _columns.push(_col)
        }
      } else {
        _columns.push(col)
      }
@@ -283,9 +286,21 @@
    })
  }
  reloadMenuView = (menuId) => {
    const { MenuID } = this.props
    if (MenuID !== menuId) return
    this.reloadview()
  }
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
    this.loadconfig()
  }
  componentDidMount () {
    MKEmitter.addListener('reloadMenuView', this.reloadMenuView)
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -299,18 +314,15 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('reloadMenuView', this.reloadMenuView)
  }
  render() {
    const { dict, searchlist, setting, actions, columns, pickup, selectedData } = this.state
    const { searchlist, setting, actions, columns, pickup, selectedData } = this.state
    return (
      <div className="script-manage-table" id={this.state.ContainerId}>
        <TopSearch
          dict={dict}
          searchlist={searchlist}
          refreshdata={this.refreshbysearch}
        />
        <MainSearch searchlist={searchlist} menuType="HS" refreshdata={this.refreshbysearch}/>
        <MainAction
          BID=""
          type="main"