From 175ebe59e5dbe9659f6f042a0ea01193ad6006a2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 八月 2023 15:54:06 +0800
Subject: [PATCH] 2023-08-24

---
 src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx |   16 -----
 src/tabviews/custom/popview/index.jsx                                    |   14 +++-
 src/tabviews/custom/components/table/edit-table/index.jsx                |    5 +
 src/tabviews/basetable/index.jsx                                         |    4 +
 src/tabviews/custom/components/table/base-table/index.jsx                |    5 +
 src/menu/components/card/cardcellcomponent/dragaction/index.scss         |    1 
 src/tabviews/custom/index.jsx                                            |   14 +++-
 src/views/billprint/index.jsx                                            |    5 +
 src/tabviews/custom/components/card/double-data-card/index.jsx           |    9 +++
 src/tabviews/custom/components/table/normal-table/index.jsx              |   78 +------------------------
 src/menu/components/table/normal-table/columns/index.jsx                 |    1 
 src/tabviews/custom/components/card/data-card/index.jsx                  |    9 +++
 12 files changed, 61 insertions(+), 100 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.scss b/src/menu/components/card/cardcellcomponent/dragaction/index.scss
index 56d6af8..a492bac 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/index.scss
+++ b/src/menu/components/card/cardcellcomponent/dragaction/index.scss
@@ -214,6 +214,7 @@
     background-repeat: no-repeat;
     background-size: cover;
     position: unset!important;
+    vertical-align: top;
   }
   .sort-wrap {
     position: relative;
diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
index e39e5b7..f915309 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -224,22 +224,6 @@
       }]
     },
     {
-      type: 'radio',
-      key: 'sum',
-      label: '鏄剧ず鍚堣',
-      initVal: card.sum || 'false',
-      tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愭椂鏈夋晥銆�',
-      required: false,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }],
-      forbid: card.isSub || card.sum !== 'true'
-    },
-    {
       type: 'number',
       key: 'decimal',
       min: 0,
diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx
index 1713c3c..00f61c5 100644
--- a/src/menu/components/table/normal-table/columns/index.jsx
+++ b/src/menu/components/table/normal-table/columns/index.jsx
@@ -563,7 +563,6 @@
       } else {
         cell.type = 'number'
         cell.format = 'none'
-        cell.sum = 'false'
         cell.decimal = item.decimal || 0
         cell.Width = 80
       }
diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index 82a0fe4..4f0028e 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -551,6 +551,10 @@
 
       component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
 
+      if (!component.setting.execute || component.setting.custompage) {
+        component.forbidLine = true
+      }
+      
       component.setting.delay = delay
       delay += 20
 
diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 3258dde..96e55f2 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -871,6 +871,15 @@
   async loadLinedata (id) {
     const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
 
+    if (config.forbidLine) {
+      this.setState({
+        pageIndex: 1
+      }, () => {
+        this.loadData()
+      })
+      return
+    }
+
     let searches = fromJS(search).toJS()
     if (config.setting.useMSearch) { // 涓昏〃鎼滅储鏉′欢
       let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx
index 8d1d2d2..53048cb 100644
--- a/src/tabviews/custom/components/card/double-data-card/index.jsx
+++ b/src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -772,6 +772,15 @@
   async loadLinedata (id) {
     const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
 
+    if (config.forbidLine) {
+      this.setState({
+        pageIndex: 1
+      }, () => {
+        this.loadData()
+      })
+      return
+    }
+
     let searches = fromJS(search).toJS()
     if (config.setting.useMSearch) { // 涓昏〃鎼滅储鏉′欢
       let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx
index 2fd32cd..4f1d0fd 100644
--- a/src/tabviews/custom/components/table/base-table/index.jsx
+++ b/src/tabviews/custom/components/table/base-table/index.jsx
@@ -264,6 +264,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) || []
diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx
index 495a171..fd88ed1 100644
--- a/src/tabviews/custom/components/table/edit-table/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/index.jsx
@@ -303,6 +303,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) || []
diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index 9ce05a8..63b75d4 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -180,7 +180,6 @@
           pageIndex: 1
         }, () => {
           this.loadmaindata(true, 'true', '', 'timer')
-          this.getStatFieldsValue()
         })
       })
     }
@@ -278,14 +277,12 @@
         if (config.setting.onload === 'true') {
           setTimeout(() => {
             this.loadmaindata(false, 'true', '', 'init')
-            this.getStatFieldsValue()
           }, config.setting.delay || 0)
         }
       }
     } else if (config.setting.onload === 'true') {
       setTimeout(() => {
         this.loadmaindata()
-        this.getStatFieldsValue()
       }, config.setting.delay || 0)
     }
   }
@@ -524,6 +521,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) || []
@@ -639,72 +641,6 @@
   }
 
   /**
-   * @description 鑾峰彇鍚堣瀛楁鍊�
-   */
-  getStatFieldsValue = () => {
-    const { setting, config, search, BID, orderBy } = this.state
-
-    if (setting.supModule && !BID && setting.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇�
-      this.setState({
-        statFValue: []
-      })
-      return
-    }
-
-    if (config.statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return
-
-    let searches = fromJS(search).toJS()
-    if (config.setting.useMSearch) { // 涓昏〃鎼滅储鏉′欢
-      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
-      let keys = config.$s_keys || []
-      mainSearch.forEach(item => {
-        if (keys.includes(item.key.toLowerCase())) return
-
-        searches.push(item)
-      })
-    }
-
-    if (config.$s_req && searches.filter(item => item.required && item.value === '').length > 0) {
-      return
-    }
-
-    let _orderBy = orderBy || setting.order
-    let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID)
-
-    Api.genericInterface(param).then(res => {
-      if (res.status) {
-        let _data = res.data[0]
-        let values = []
-
-        if (_data) {
-          config.statFields.forEach(item => {
-            if (_data[item.field] || _data[item.field] === 0) {
-              let val = +_data[item.field]
-              if (isNaN(val)) {
-                val = 0
-              }
-              val = val.toFixed(item.decimal)
-              values.push({label: item.label, value: val})
-            }
-          })
-        }
-        this.setState({
-          statFValue: values
-        })
-      } else {
-        this.setState({
-          statFValue: []
-        })
-        notification.error({
-          top: 92,
-          message: res.message,
-          duration: 10
-        })
-      }
-    })
-  }
-
-  /**
    * @description 鎼滅储鏉′欢鏀瑰彉鏃讹紝閲嶇疆琛ㄦ牸鏁版嵁
    * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃�
    */
@@ -714,7 +650,6 @@
       search: searches
     }, () => {
       this.loadmaindata(true, 'true')
-      this.getStatFieldsValue()
     })
   }
 
@@ -748,11 +683,9 @@
         pageIndex: 1
       }, () => {
         this.loadmaindata(true, 'true', id)
-        this.getStatFieldsValue()
       })
     } else {
       this.loadmaindata(true, 'false', id)
-      this.getStatFieldsValue()
     }
   }
 
@@ -805,7 +738,6 @@
         BData: data
       }, () => {
         this.loadmaindata(true, 'true')
-        this.getStatFieldsValue()
       })
     }
   }
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 195ad72..c9c6a73 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -530,7 +530,6 @@
       }
 
       if (item.type === 'table') {
-        let statFields = []
         let getCols = (cols) => {
           return cols.filter(col => {
             if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
@@ -542,9 +541,6 @@
             }
             
             if (col.type === 'number') {
-              if (col.sum === 'true' && !statFields.includes(col.field)) {
-                statFields.push(col)
-              }
               if (typeof(col.decimal) === 'number') {
                 col.round = Math.pow(10, col.decimal)
                 if (col.format === 'percent') {
@@ -595,7 +591,6 @@
         }
         
         item.cols = getCols(item.cols)
-        item.statFields = statFields
 
         if (item.subtype === 'editable') {
           item.submit.logLabel = item.$menuname + '-鎻愪氦'
@@ -868,6 +863,11 @@
 
   resetElement = (cell) => {
     cell.style = cell.style || {}
+
+    if (cell.style.display === 'inline-block') {
+      cell.style.verticalAlign = 'top'
+    }
+
     if (['text', 'number', 'formula'].includes(cell.eleType)) {
       if (!cell.height) {
         cell.innerHeight = 'auto'
@@ -1018,6 +1018,10 @@
 
       component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
 
+      if (!component.setting.execute || component.setting.custompage) {
+        component.forbidLine = true
+      }
+
       if (component.setting.sync === 'true') {
         // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ
         if ((!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true') {
diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index edc4113..7463f80 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -344,7 +344,6 @@
       }
 
       if (item.type === 'table') {
-        let statFields = []
         let getCols = (cols) => {
           return cols.filter(col => {
             if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
@@ -356,9 +355,6 @@
             }
             
             if (col.type === 'number') {
-              if (col.sum === 'true' && !statFields.includes(col.field)) {
-                statFields.push(col)
-              }
               if (typeof(col.decimal) === 'number') {
                 col.round = Math.pow(10, col.decimal)
                 if (col.format === 'percent') {
@@ -404,7 +400,6 @@
         }
         
         item.cols = getCols(item.cols)
-        item.statFields = statFields
 
         if (item.subtype === 'editable') {
           item.submit.logLabel = item.$menuname + '-鎻愪氦'
@@ -649,6 +644,11 @@
 
   resetElement = (cell) => {
     cell.style = cell.style || {}
+
+    if (cell.style.display === 'inline-block') {
+      cell.style.verticalAlign = 'top'
+    }
+
     if (['text', 'number', 'formula'].includes(cell.eleType)) {
       if (!cell.height) {
         cell.innerHeight = 'auto'
@@ -794,6 +794,10 @@
 
       component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
 
+      if (!component.setting.execute || component.setting.custompage) {
+        component.forbidLine = true
+      }
+
       if (component.setting.sync === 'true') {
         // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ
         if ((!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true') {
diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index 7779306..a245790 100644
--- a/src/views/billprint/index.jsx
+++ b/src/views/billprint/index.jsx
@@ -582,6 +582,11 @@
 
   resetElement = (cell) => {
     cell.style = cell.style || {}
+
+    if (cell.style.display === 'inline-block') {
+      cell.style.verticalAlign = 'top'
+    }
+    
     if (['text', 'number', 'formula'].includes(cell.eleType)) {
       cell.innerHeight = cell.innerHeight || 'auto'
       cell.alignItems = cell.height > 1 ? cell.alignItems : ''

--
Gitblit v1.8.0