From 29a6c337010198e6931b648024140a19f7a4e208 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 18 七月 2023 10:40:42 +0800
Subject: [PATCH] 2023-07-18

---
 src/tabviews/zshare/automatic/index.jsx               |   37 +++++++++++++++++++++++++++----------
 src/tabviews/basetable/index.jsx                      |    2 +-
 src/tabviews/commontable/index.jsx                    |   10 +++++-----
 src/templates/zshare/unattended/settingform/index.jsx |    1 +
 4 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index 2b93477..e62eb9e 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -682,7 +682,7 @@
         {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null}
         <Row className="component-wrap">{this.getComponents()}</Row>
         {config && window.GLOB.breakpoint ? <DebugTable /> : null}
-        {!window.GLOB.mkHS && config && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config.components[0]} /> : null}
+        {!window.GLOB.mkHS && config && autoMatic ? <AutoMatic autoMatic={autoMatic} tabId={config.MenuID} config={config.components[0]} /> : null}
         {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null}
         {!window.GLOB.mkHS && config ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts || []}/> : null}
         {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 10dcee9..6ad0a67 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -22,8 +22,8 @@
 const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
 const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
 const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
-const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
-const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic'))
+// const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
+// const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic'))
 const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
 
 const { TabPane } = Tabs
@@ -1006,7 +1006,7 @@
 
   render() {
     const { MenuID } = this.props
-    const { BID, setting, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts, autoMatic } = this.state
+    const { BID, setting, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts } = this.state
 
     return (
       <div className="commontable" id={this.state.ContainerId}>
@@ -1144,8 +1144,8 @@
           </Tabs>))
         }
         {setting && window.GLOB.breakpoint ? <DebugTable /> : null}
-        {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null}
-        {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null}
+        {/* {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null} */}
+        {/* {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null} */}
         {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null}
         {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
       </div>
diff --git a/src/tabviews/zshare/automatic/index.jsx b/src/tabviews/zshare/automatic/index.jsx
index c020117..951001a 100644
--- a/src/tabviews/zshare/automatic/index.jsx
+++ b/src/tabviews/zshare/automatic/index.jsx
@@ -9,6 +9,7 @@
 class AutoMatic extends Component {
   static propTpyes = {
     autoMatic: PropTypes.object,
+    tabId: PropTypes.string,
     config: PropTypes.object
   }
 
@@ -21,10 +22,18 @@
   timer = null
 
   UNSAFE_componentWillMount() {
-    const { autoMatic } = this.props
+    const { autoMatic, tabId } = this.props
 
     if (autoMatic.gap && autoMatic.gap >= 1) {
       this.setState({gap: autoMatic.gap * 1000})
+    }
+
+    if (tabId && tabId === sessionStorage.getItem('autoExecId')) {
+      sessionStorage.removeItem('autoExecId')
+
+      setTimeout(() => {
+        this.trigger()
+      }, 10000)
     }
   }
 
@@ -180,7 +189,7 @@
   }
 
   autoMaticOver = (MenuID) => {
-    const { config, autoMatic } = this.props
+    const { config, autoMatic, tabId } = this.props
 
     if (!this.state.running || MenuID !== config.MenuID) return
 
@@ -189,16 +198,24 @@
     if (autoMatic.onFinish !== 'over') {
       let interval = autoMatic.interval * 1000 || 10
 
-      if (autoMatic.restart === 'first') {
-        this.setState({line: 1})
+      if (autoMatic.restart === 'refresh') {
+        this.timer = setTimeout(() => {
+          sessionStorage.setItem('ThirdMenu', tabId)
+          sessionStorage.setItem('autoExecId', tabId)
+          window.location.reload()
+        }, interval)
       } else {
-        this.setState({line: this.state.line + 1})
+        if (autoMatic.restart === 'first') {
+          this.setState({line: 1})
+        } else {
+          this.setState({line: this.state.line + 1})
+        }
+  
+        this.timer = setTimeout(() => {
+          this.setState({running: true})
+          MKEmitter.emit('autoQueryData', config.MenuID, this.state.line)
+        }, interval)
       }
-
-      this.timer = setTimeout(() => {
-        this.setState({running: true})
-        MKEmitter.emit('autoQueryData', config.MenuID, this.state.line)
-      }, interval)
     }
   }
 
diff --git a/src/templates/zshare/unattended/settingform/index.jsx b/src/templates/zshare/unattended/settingform/index.jsx
index e30dd8d..4142a57 100644
--- a/src/templates/zshare/unattended/settingform/index.jsx
+++ b/src/templates/zshare/unattended/settingform/index.jsx
@@ -160,6 +160,7 @@
                 <Radio.Group>
                   <Radio value="first">绗竴琛�</Radio>
                   <Radio value="next">涓嬩竴琛�</Radio>
+                  <Radio value="refresh">鍒锋柊椤甸潰</Radio>
                 </Radio.Group>
               )}
             </Form.Item>

--
Gitblit v1.8.0