From 0472ec32cadb4f9bca6dbab82ac33a42e76f37ed Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 六月 2022 16:24:15 +0800
Subject: [PATCH] 菜单栏&时间轴

---
 src/tabviews/custom/components/table/normal-table/index.jsx |   53 +++++++++++++++++++++++++++--------------------------
 1 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index e5aff36..1fbcb48 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -67,10 +67,12 @@
       }
     }
 
-    let setting = {..._config.setting, ..._config.wrap, style: {}}
+    let setting = {..._config.setting, ..._config.wrap}
 
     if (setting.selected !== 'always' && setting.selected !== 'init') {
       setting.selected = 'false'
+    } else {
+      setting.orisel = true
     }
 
     if (_config.setting.sync === 'true' && data) {
@@ -127,12 +129,12 @@
       }
     })
 
-    if (setting.color) {
-      setting.style.color = setting.color
-    }
-    if (setting.fontSize) {
-      setting.style.fontSize = setting.fontSize
-    }
+    // if (setting.color) {
+    //   setting.style.color = setting.color
+    // }
+    // if (setting.fontSize) {
+    //   setting.style.fontSize = setting.fontSize
+    // }
 
     if (_config.wrap.collapse === 'true') {
       _config.wrap.title = _config.wrap.title || ' '
@@ -171,7 +173,7 @@
    * @param { Boolean } reset  琛ㄦ牸鏄惁閲嶇疆
    * @param { String }  repage 琛ㄦ牸鏄惁閲嶇疆椤电爜
    */
-  async loadmaindata (reset, repage) {
+  async loadmaindata (reset, repage, id) {
     const { mainSearch } = this.props
     const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
 
@@ -181,6 +183,7 @@
         selectedData: [],
         total: 0
       })
+      
       MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 骞挎挱鏁版嵁鍒囨崲
       reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆
       if (setting.$hasSyncModule) {
@@ -213,9 +216,9 @@
 
     let result = await Api.genericInterface(param)
     if (result.status) {
-      if (setting.selected !== 'false' && result.data && result.data.length > 0) {
+      if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) {
         setTimeout(() => {
-          MKEmitter.emit('mkCheckTopLine', config.uuid)
+          MKEmitter.emit('mkCheckTopLine', config.uuid, id)
         }, 200)
         if (setting.selected === 'init') {
           this.setState({setting: {...setting, selected: 'false'}})
@@ -458,16 +461,16 @@
   /**
    * @description 琛ㄦ牸鍒锋柊
    */
-  reloadtable = (btn) => {
+  reloadtable = (btn, id) => {
     if (!btn || btn.resetPageIndex !== 'false') {
       this.setState({
         pageIndex: 1
       }, () => {
-        this.loadmaindata(true, 'true')
+        this.loadmaindata(true, 'true', id)
         this.getStatFieldsValue()
       })
     } else {
-      this.loadmaindata(true, 'false')
+      this.loadmaindata(true, 'false', id)
       this.getStatFieldsValue()
     }
   }
@@ -503,7 +506,6 @@
     const { config } = this.state
 
     if (config.uuid !== menuId) return
-    if (id === 'empty') return
 
     if (!id) {
       this.reloadtable()
@@ -539,20 +541,19 @@
 
     if (config.uuid !== menuId) return
 
-    if (position === 'line' && lines && lines.length === 1) {
-      this.loadmainLinedata(lines[0].$$uuid)
+    if (position === 'line') {
+      if (lines && lines.length === 1) {
+        this.loadmainLinedata(lines[0].$$uuid)
+      } else {
+        this.reloadtable(btn, id)
+      }
+    } else if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠�
+      MKEmitter.emit('reloadData', config.setting.supModule, BID)
     } else {
-      this.reloadtable(btn)                                                    // 鏁版嵁鍒锋柊
+      this.reloadtable(btn, id)
     }
 
-    if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) {
-      MKEmitter.emit('reloadData', btn.syncComponentId)                        // 鍚岀骇鏍囩鍒锋柊
-    }
-
-    if (position === 'mainline' && config.setting.supModule) {                 // 涓昏〃琛屽埛鏂�
-      MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
-    } else if (position === 'popclose') {                                      // 鏍囩鍏抽棴鍒锋柊
-      config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
+    if (position === 'popclose') { // 鎵ц鍚姩寮圭獥鐨勬寜閽墍閫夋嫨鐨勫埛鏂伴」
       btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
     }
   }
@@ -632,7 +633,7 @@
     }
 
     return (
-      <div className="custom-normal-table" style={style}>
+      <div className="custom-normal-table" id={'anchor' + config.uuid} style={style}>
         {config.wrap.collapse === 'true' ? <Collapse bordered={false} defaultActiveKey="1" expandIconPosition="right">
           <Panel forceRender={true} header={<NormalHeader config={config}/>} key="1">
             {searchlist && searchlist.length ?

--
Gitblit v1.8.0