From da7068bd48791cdee966c786ce0dfd46f6e03df9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 08 一月 2021 19:02:24 +0800
Subject: [PATCH] 2021-01-08

---
 src/tabviews/scriptmanage/index.jsx |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/scriptmanage/index.jsx b/src/tabviews/scriptmanage/index.jsx
index 12d0fd9..8e48202 100644
--- a/src/tabviews/scriptmanage/index.jsx
+++ b/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"

--
Gitblit v1.8.0