From 79e4981aa6cc9354276fc54cdf6d14eb08ab7fee Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 22 六月 2023 15:59:04 +0800
Subject: [PATCH] Merge branch 'develop' of ssh://121.36.20.145:29418/~jinfei/pc-plat into develop

---
 src/tabviews/custom/components/card/data-card/index.jsx |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index fe8bcec..1d2e850 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -81,6 +81,7 @@
     }
 
     _config.$extend = false
+    _config.$empty = true
 
     _config.subcards.forEach(item => {
       if (item.setting.click === 'button' && !item.setting.linkbtn) {
@@ -98,9 +99,13 @@
         _card = item
       } else if (!_card) {
         _config.$extend = true
+        if (item.setting.width !== 24) {
+          _config.$empty = false
+        }
         precards.push(item)
       } else {
         _config.$extend = true
+        _config.$empty = false
         nextcards.push(item)
       }
     })
@@ -134,7 +139,7 @@
         item.$Index = index + 1 + ''
 
         if (_config.wrap.controlField) {
-          if (_config.wrap.controlVal.includes(item[_config.wrap.controlField])) {
+          if (_config.wrap.controlVal.includes(item[_config.wrap.controlField] + '')) {
             item.$disabled = true
           }
         }
@@ -210,6 +215,7 @@
     MKEmitter.addListener('mkCheckAll', this.mkCheckAll)
     MKEmitter.addListener('resetSelectLine', this.resetParentParam)
     MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
+    MKEmitter.addListener('refreshLineData', this.refreshLineData)
     MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
     
     if (config.timer) {
@@ -232,7 +238,7 @@
           item.$Index = index + 1 + ''
 
           if (config.wrap.controlField) {
-            if (config.wrap.controlVal.includes(item[config.wrap.controlField])) {
+            if (config.wrap.controlVal.includes(item[config.wrap.controlField] + '')) {
               item.$disabled = true
             }
           }
@@ -264,7 +270,7 @@
           item.$Index = index + 1 + ''
 
           if (config.wrap.controlField) {
-            if (config.wrap.controlVal.includes(item[config.wrap.controlField])) {
+            if (config.wrap.controlVal.includes(item[config.wrap.controlField] + '')) {
               item.$disabled = true
             }
           }
@@ -300,6 +306,7 @@
     MKEmitter.removeListener('mkCheckAll', this.mkCheckAll)
     MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
     MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
+    MKEmitter.removeListener('refreshLineData', this.refreshLineData)
     MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
 
     this.timer && this.timer.stop()
@@ -370,6 +377,23 @@
     if (position === 'popclose') { // 鎵ц鍚姩寮圭獥鐨勬寜閽墍閫夋嫨鐨勫埛鏂伴」
       btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
     }
+  }
+
+  refreshLineData = (menuId, btn, uuid, count) => {
+    const { config, data } = this.state
+
+    if (config.uuid !== menuId) return
+    
+    let _data = fromJS(data).toJS().map(item => {
+      if (item.$$uuid === uuid) {
+        item[btn.field] = count
+      }
+      return item
+    })
+
+    this.setState({
+      data: _data
+    })
   }
 
   checkTopLine = (id) => {
@@ -706,7 +730,7 @@
           item.$Index = index + 1 + ''
 
           if (config.wrap.controlField) {
-            if (config.wrap.controlVal.includes(item[config.wrap.controlField])) {
+            if (config.wrap.controlVal.includes(item[config.wrap.controlField] + '')) {
               item.$disabled = true
             }
           }
@@ -721,7 +745,7 @@
           item.$Index = index + start + ''
 
           if (config.wrap.controlField) {
-            if (config.wrap.controlVal.includes(item[config.wrap.controlField])) {
+            if (config.wrap.controlVal.includes(item[config.wrap.controlField] + '')) {
               item.$disabled = true
             }
           }
@@ -1045,8 +1069,8 @@
             ))}
           </Row>
           {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null}
-          {!config.$extend && (!data || data.length === 0) ? <Empty description={false}/> : null}
         </div>
+        {config.$empty && (!data || data.length === 0) ? <Empty description={false}/> : null}
         {config.wrap.pagestyle === 'page' && data ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 鍏� ${total} 鏉 : `鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null}
         {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null}
       </div>

--
Gitblit v1.8.0