king
2021-01-08 da7068bd48791cdee966c786ce0dfd46f6e03df9
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 {
@@ -283,9 +284,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 +312,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"