From 3b1c5118e37500a26021adb8a6c1c11b741d7bbc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 03 七月 2023 17:37:52 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/templates/zshare/editTable/index.jsx |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx
index ad29e43..36ab937 100644
--- a/src/templates/zshare/editTable/index.jsx
+++ b/src/templates/zshare/editTable/index.jsx
@@ -180,6 +180,15 @@
     const { data, actions } = this.props
     let columns = fromJS(this.props.columns).toJS()
     let operation = null
+    let extra = null
+    
+    if (actions) {
+      actions.forEach(item => {
+        if (/^extra/.test(item)) {
+          extra = item.split(':')
+        }
+      })
+    }
 
     if (actions && (actions.includes('edit') || actions.includes('copy') || actions.includes('del'))) {
       let _operation = null
@@ -217,9 +226,10 @@
             </div>
           ) : (
             <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px', whiteSpace: 'nowrap'}}>
-              {actions.includes('edit') ? <span className="primary" onClick={() => {editingKey === '' && this.edit(record.uuid)}}><EditOutlined /></span> : null}
-              {actions.includes('copy') ? <span className="copy" onClick={() => {editingKey === '' && this.copy(record)}}><CopyOutlined /></span> : null}
-              {actions.includes('status') ? <span className="status" onClick={() => {editingKey === '' && this.handleStatus(record)}}><SwapOutlined /></span> : null}
+              {actions.includes('edit') ? <span className="primary" title="缂栬緫" onClick={() => {editingKey === '' && this.edit(record.uuid)}}><EditOutlined /></span> : null}
+              {extra ? <span className="status" title={extra[2]} onClick={() => {editingKey === '' && this.handleStatus(record, extra[1])}}><SwapOutlined /></span> : null}
+              {actions.includes('status') ? <span className="status" title="鏄惁鍚敤" onClick={() => {editingKey === '' && this.handleStatus(record, 'status')}}><SwapOutlined /></span> : null}
+              {actions.includes('copy') ? <span className="copy" title="澶嶅埗" onClick={() => {editingKey === '' && this.copy(record)}}><CopyOutlined /></span> : null}
               {actions.includes('del') && editingKey === '' ? <Popconfirm
                 overlayClassName="popover-confirm"
                 title="纭畾鍒犻櫎鍚�?"
@@ -474,10 +484,10 @@
     message.success('绮樿创鎴愬姛銆�')
   }
 
-  handleStatus = (record) => {
+  handleStatus = (record, type) => {
     const { data } = this.state
 
-    record.status = record.status === 'false' ? 'true' : 'false'
+    record[type] = record[type] === 'false' ? 'true' : 'false'
 
     let newData = data.map(item => {
       if (record.uuid === item.uuid) return record

--
Gitblit v1.8.0