From 9ecbd8f279f6e0a1037e282418e8f9bfc0250769 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 25 四月 2023 17:04:11 +0800
Subject: [PATCH] 2023-04-25

---
 src/tabviews/custom/components/table/edit-table/normalTable/index.scss |    1 +
 src/tabviews/custom/components/table/edit-table/index.jsx              |    9 +++++++--
 src/menu/components/table/edit-table/options.jsx                       |   12 ++++++++++++
 src/tabviews/custom/components/module/account/index.jsx                |   19 +++++++++++++++++--
 src/tabviews/custom/components/card/double-data-card/index.jsx         |    1 +
 src/utils/utils-custom.js                                              |    7 +++++++
 src/tabviews/custom/components/card/data-card/index.jsx                |    1 +
 src/menu/components/table/edit-table/columns/index.jsx                 |    3 +--
 8 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx
index afa1eba..eb85458 100644
--- a/src/menu/components/table/edit-table/columns/index.jsx
+++ b/src/menu/components/table/edit-table/columns/index.jsx
@@ -695,8 +695,7 @@
         </DndProvider>
         <EditColumn column={card} columns={this.state.columns} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/>
         <Modal
-          wrapClassName="model-table-action-verify-modal"
-          title={'缂栬緫'}
+          wrapClassName="mk-pop-modal"
           visible={visible}
           width={'75vw'}
           maskClosable={false}
diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx
index 9e47b44..e3c2fb5 100644
--- a/src/menu/components/table/edit-table/options.jsx
+++ b/src/menu/components/table/edit-table/options.jsx
@@ -295,6 +295,18 @@
       ]
     },
     {
+      type: 'radio',
+      field: 'empty',
+      label: '绌哄�奸殣钘�',
+      initval: wrap.empty || 'show',
+      tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
+      required: false,
+      options: [
+        {value: 'show', label: '鍚�'},
+        {value: 'hidden', label: '鏄�'},
+      ],
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 98f672e..fe8bcec 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -496,6 +496,7 @@
   checkAll = () => {
     const { config, data, selectedData } = this.state
 
+    if (config.wrap.cardType !== 'checkbox') return
     if (!data || data.length === 0) return
     
     if (selectedData.length === 0 || selectedData.length < data.length) {
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 b3fc0da..e010304 100644
--- a/src/tabviews/custom/components/card/double-data-card/index.jsx
+++ b/src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -392,6 +392,7 @@
   checkAll = () => {
     const { config, data, selectedData } = this.state
 
+    if (config.wrap.cardType !== 'checkbox') return
     if (!data || data.length === 0) return
     
     if (selectedData.length === 0 || selectedData.length < data.length) {
diff --git a/src/tabviews/custom/components/module/account/index.jsx b/src/tabviews/custom/components/module/account/index.jsx
index 4ac66a4..a4f2cb1 100644
--- a/src/tabviews/custom/components/module/account/index.jsx
+++ b/src/tabviews/custom/components/module/account/index.jsx
@@ -25,6 +25,7 @@
 
   componentDidMount () {
     this.loadData()
+    MKEmitter.addListener('reloadData', this.reloadData)
   }
 
   shouldComponentUpdate (nextProps, nextState) {
@@ -37,6 +38,20 @@
   componentWillUnmount () {
     this.setState = () => {
       return
+    }
+    MKEmitter.removeListener('reloadData', this.reloadData)
+  }
+
+  reloadData = (menuId) => {
+    const { config } = this.props
+    const { activeItem } = this.state
+    
+    if (config.uuid !== menuId) return
+
+    if (activeItem) {
+      MKEmitter.emit('resetSelectLine', config.uuid, activeItem.id, activeItem)
+    } else {
+      this.loadData()
     }
   }
 
@@ -181,11 +196,11 @@
           </div>
         )}>
           {books.map(item => (
-            <Option disabled={!item.months} key={item.id}>{item.account_name}</Option>
+            <Option disabled={!item.months} title={item.account_name} key={item.id}>{item.account_name}</Option>
           ))}
         </Select> : <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} value={activeItem ? activeItem.id : ''} disabled={config.wrap.readonly === 'true'} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook}>
           {books.map(item => (
-            <Option disabled={!item.months} key={item.id}>{item.account_name}</Option>
+            <Option disabled={!item.months} title={item.account_name} key={item.id}>{item.account_name}</Option>
           ))}
         </Select>}
         {activeItem ? <span className="date">{activeItem.date}</span> : null}
diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx
index 3496def..a0568c2 100644
--- a/src/tabviews/custom/components/table/edit-table/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/index.jsx
@@ -589,10 +589,15 @@
   }
 
   render() {
-    const { BID, setting, actions, config, columns, BData, selectedData, lock } = this.state
+    const { BID, setting, actions, config, columns, BData, data, selectedData, lock } = this.state
+
+    let style = {...config.style}
+    if (config.wrap.empty === 'hidden' && data.length === 0) {
+      style.display = 'none'
+    }
 
     return (
-      <div className="custom-edit-table" id={'anchor' + config.uuid} style={config.style}>
+      <div className="custom-edit-table" id={'anchor' + config.uuid} style={style}>
         <NormalHeader config={config}/>
         {config.search && config.search.length ?
           <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss
index 6d3798c..2d34aea 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss
@@ -426,6 +426,7 @@
   .main-pickup {
     position: relative;
     z-index: 2;
+    margin-left: 10px;
   }
   .submit-table {
     position: relative;
diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index f454ef0..94e9705 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -1296,6 +1296,13 @@
   if (card.$c_ac) {
     card.action.forEach(cell => {
       if (cell.hidden === 'true' || cell.origin) return
+      // if (cell.OpenType === 'popview') {
+      //   if (!cell.config) {
+      //     errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑寮圭獥鏍囩灏氭湭璁剧疆`})
+      //   } else if (!cell.config.enabled) {
+      //     errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑寮圭獥鏍囩鏈惎鐢╜})
+      //   }
+      // }
       if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
         if (!cell.modal || cell.modal.fields.length === 0) {
           errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})

--
Gitblit v1.8.0