From d49124329b0119ba0ce7c69afbe2b864209e2495 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 25 十月 2023 11:58:11 +0800
Subject: [PATCH] 2023-10-25

---
 src/tabviews/custom/components/table/edit-table/index.jsx |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx
index 495a171..359886a 100644
--- a/src/tabviews/custom/components/table/edit-table/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/index.jsx
@@ -35,7 +35,8 @@
     pageIndex: 1,         // 椤电爜
     pageSize: 10,         // 姣忛〉鏁版嵁鏉℃暟
     orderBy: '',          // 鎺掑簭
-    search: ''            // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞�
+    search: '',           // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞�
+    allSearch: null
   }
 
   /**
@@ -163,6 +164,22 @@
       _config.lineMarks = null
     }
 
+    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
+    }
+
+    if (setting.commit === 'blur') {
+      setting.hasSubmit = false
+    }
+
     this.setState({
       pageSize: setting.pageSize || 10,
       BID: BID || '',
@@ -172,7 +189,8 @@
       setting: setting,
       actions: _config.action,
       columns: _columns,
-      search: _config.$searches
+      search: _config.$searches,
+      allSearch
     }, () => {
       if (_config.setting.onload === 'true') {
         setTimeout(() => {
@@ -255,9 +273,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
       })
@@ -303,6 +328,11 @@
   async loadmainLinedata (id) {
     const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
 
+    if (config.forbidLine) {
+      this.reloadtable()
+      return
+    }
+    
     let searches = fromJS(search).toJS()
     if (config.setting.useMSearch) { // 涓昏〃鎼滅储鏉′欢
       let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -580,7 +610,7 @@
   }
 
   render() {
-    const { BID, setting, actions, config, columns, BData, data, selectedData } = this.state
+    const { BID, setting, actions, config, columns, BData, data, selectedData, allSearch } = this.state
 
     let style = {...config.style}
     if (config.wrap.empty === 'hidden' && data.length === 0) {
@@ -606,9 +636,11 @@
           setting={setting}
           columns={columns}
           MenuID={config.uuid}
+          allSearch={allSearch}
           submit={config.submit}
           fields={config.columns}
           total={this.state.total}
+          colsCtrls={config.colsCtrls}
           lineMarks={config.lineMarks}
           loading={this.state.loading}
           refreshdata={this.refreshbytable}

--
Gitblit v1.8.0