From 4141e18a9aee7c2a3887ff99bf0b1343d5771b79 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 十一月 2023 15:25:57 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/custom/components/table/normal-table/index.jsx |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index 63b75d4..136a42c 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -38,7 +38,8 @@
     pageSize: 10,         // 姣忛〉鏁版嵁鏉℃暟
     orderBy: '',          // 鎺掑簭
     search: '',           // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞�
-    statFValue: []        // 鍚堣鍊�
+    statFValue: [],       // 鍚堣鍊�
+    allSearch: null
   }
 
   loaded = false
@@ -138,6 +139,18 @@
 
     _config.style = _config.style || {}
 
+    let allSearch = null
+    if (_config.colsCtrls && _config.colsCtrls.length > 0) {
+      allSearch = [{key: 'BID', value: BID || ''}]
+      allSearch.push(..._config.$searches)
+      if (_config.setting.useMSearch) {
+        let mainSearch = window.GLOB.SearchBox.get(_config.$searchId) || []
+        allSearch.push(...mainSearch)
+      }
+    } else {
+      _config.colsCtrls = null
+    }
+
     this.setState({
       pageSize: setting.pageSize || 10,
       BID: BID || '',
@@ -148,7 +161,8 @@
       setting: setting,
       actions: _config.action,
       columns: _config.cols,
-      search: _config.$searches
+      search: _config.$searches,
+      allSearch
     })
   }
 
@@ -467,9 +481,16 @@
         total = data[data.length - 1].mk_total || 0
       }
 
+      let allSearch = null
+      if (config.colsCtrls) {
+        allSearch = [{key: 'BID', value: BID || ''}]
+        allSearch.push(...searches)
+      }
+
       this.setState({
         data: data,
         selectedData: [],
+        allSearch: allSearch,
         total: total,
         loading: false
       })
@@ -518,7 +539,7 @@
   /**
    * @description 鑾峰彇鍗曡鏁版嵁
    */ 
-  async loadmainLinedata (id) {
+  async loadLinedata (id, position) {
     const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
 
     if (config.forbidLine) {
@@ -546,6 +567,11 @@
 
     let result = await Api.genericInterface(param)
     if (result.status) {
+      if (position === 'line_grid' && (!result.data || !result.data[0])) {
+        this.loadmaindata(true, 'false')
+        return
+      }
+      
       let data = fromJS(this.state.data).toJS()
       let selectedData = fromJS(this.state.selectedData).toJS()
 
@@ -722,7 +748,7 @@
     if (!id) {
       this.reloadtable()
     } else {
-      this.loadmainLinedata(id)
+      this.loadLinedata(id)
     }
   }
 
@@ -753,9 +779,9 @@
 
     if (config.uuid !== menuId) return
 
-    if (position === 'line') {
+    if (position === 'line' || position === 'line_grid') {
       if (lines && lines.length === 1) {
-        this.loadmainLinedata(lines[0].$$uuid)
+        this.loadLinedata(lines[0].$$uuid, position)
       } else {
         this.reloadtable(btn, id)
       }
@@ -801,7 +827,7 @@
   }
 
   render() {
-    const { BID, setting, actions, config, columns, selectedData, BData, data } = this.state
+    const { BID, setting, actions, config, columns, selectedData, BData, data, allSearch } = this.state
 
     let style = {...config.style}
     if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) {
@@ -825,9 +851,11 @@
           setting={setting}
           columns={columns}
           MenuID={config.uuid}
+          allSearch={allSearch}
           data={this.state.data}
           fields={config.columns}
           total={this.state.total}
+          colsCtrls={config.colsCtrls}
           lineMarks={config.lineMarks}
           loading={this.state.loading}
           refreshdata={this.refreshbytable}

--
Gitblit v1.8.0