From fc8c8d714687a22f711d642d192bd4149f3b7e88 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 22 四月 2024 11:15:14 +0800
Subject: [PATCH] 2024-04-22

---
 src/tabviews/zshare/settingcomponent/index.jsx |   82 ++++++++++++++++++++++------------------
 1 files changed, 45 insertions(+), 37 deletions(-)

diff --git a/src/tabviews/zshare/settingcomponent/index.jsx b/src/tabviews/zshare/settingcomponent/index.jsx
index 2f137ee..77e2230 100644
--- a/src/tabviews/zshare/settingcomponent/index.jsx
+++ b/src/tabviews/zshare/settingcomponent/index.jsx
@@ -1,12 +1,11 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Button, Modal, notification, Spin, Empty } from 'antd'
+import { Button, Modal, notification, Spin, Empty, Tooltip } from 'antd'
 
 import Api from '@/api'
 import MKEmitter from '@/utils/events.js'
 import { updateSubTable } from '@/utils/utils-update.js'
-import options from '@/store/options.js'
 import asyncComponent from '@/utils/asyncSpinComponent'
 import './index.scss'
 
@@ -14,7 +13,6 @@
 
 class CustomSetting extends Component {
   static propTpyes = {
-    dict: PropTypes.object,           // 瀛楀吀琛�
     config: PropTypes.object,         // 椤甸潰閰嶇疆淇℃伅
     shortcuts: PropTypes.any,         // 鑷畾涔夎缃�
   }
@@ -144,29 +142,36 @@
             })
           })
         } else if (item.type === 'table') {
-          item.cols && item.cols.forEach(col => {
-            if (col.type !== 'action') return
-            col.elements && col.elements.forEach(cell => {
-              cell.$expanded = false
-              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print') {
+          let loopCol = (cols) => {
+            cols.forEach(col => {
+              if (col.type === 'colspan') {
+                loopCol(col.subcols)
+              } else if (col.type === 'custom') {
+                col.elements.forEach(cell => {
+                  if (cell.eleType !== 'button') return
+                  cell.$expanded = false
+                  if (cell.OpenType === 'funcbutton' && cell.funcType === 'print') {
 
-                cell.$port = cell.verify ? cell.verify.linkUrl : ''
-                if (cell.verify && cell.verify.printerTypeList && cell.verify.printerTypeList.length > 0) {
-                  cell.verify.printerTypeList = cell.verify.printerTypeList.map(_cell => {
-                    _cell.uuid = _cell.uuid || _cell.key
-                    _cell.parentId = cell.uuid
-                    _cell.$port = cell.$port
+                    cell.$port = cell.verify ? cell.verify.linkUrl : ''
+                    if (cell.verify && cell.verify.printerTypeList && cell.verify.printerTypeList.length > 0) {
+                      cell.verify.printerTypeList = cell.verify.printerTypeList.map(_cell => {
+                        _cell.uuid = _cell.uuid || _cell.key
+                        _cell.parentId = cell.uuid
+                        _cell.$port = cell.$port
 
-                    return _cell
-                  })
-                  cell.$expanded = true
-                }
-                printbtns.push(cell)
+                        return _cell
+                      })
+                      cell.$expanded = true
+                    }
+                    printbtns.push(cell)
+                  }
+
+                  _comp.action.push({...cell, $line: true, ...(userConfig[cell.uuid] || {})})
+                })
               }
-
-              _comp.action.push({...cell, $line: true, ...(userConfig[cell.uuid] || {})})
             })
-          })
+          }
+          loopCol(item.cols)
         } 
         
         if (_comp.action.length > 0) {
@@ -405,7 +410,9 @@
         return
       }
 
-      Api.deleteMenuStorage(config.MenuID).then(() => {
+      Api.deleteMenuStorage(config.MenuID)
+
+      setTimeout(() => {
         this.setState({
           visible: false,
           revertLoading: false
@@ -413,7 +420,7 @@
           window.GLOB.CacheMap = new Map()
           MKEmitter.emit('reloadMenuView', config.MenuID)
         })
-      })
+      }, 100)
     })
   }
 
@@ -481,7 +488,9 @@
         return
       }
 
-      Api.deleteMenuStorage(config.MenuID).then(() => {
+      Api.deleteMenuStorage(config.MenuID)
+
+      setTimeout(() => {
         this.setState({
           visible: false,
           confirmLoading: false
@@ -489,7 +498,7 @@
           window.GLOB.CacheMap = new Map()
           MKEmitter.emit('reloadMenuView', config.MenuID)
         })
-      })
+      }, 100)
     })
   }
 
@@ -509,25 +518,24 @@
   render() {
     const { components, visible } = this.state
 
+    if (window.GLOB.mkHS || window.GLOB.sysType !== 'local') return null
+
     return (
-      <div className="page-setting-wrap">
-        {options.sysType === 'local' ? <Button
-          icon="setting"
-          shape="circle"
-          className="page-setting"
-          onClick={this.trigger}
-        /> : null}
+      <div className="tool-wrap">
+        <Tooltip placement="left" title="鑷畾涔夎缃�">
+          <Button icon="setting" shape="circle" onClick={this.trigger}/>
+        </Tooltip>
         <Modal
           wrapClassName="custom-setting-modal"
-          title={'鑷畾涔夎缃�'}
+          title="鑷畾涔夎缃�"
           maskClosable={false}
           width={950}
           visible={visible}
           onCancel={() => { this.setState({ visible: false }) }}
           footer={[
-            <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.props.dict['main.revert.default']}</Button>,
-            <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{this.props.dict['main.cancel']}</Button>,
-            <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.props.dict['main.submit']}</Button>
+            <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>鎭㈠榛樿璁剧疆</Button>,
+            <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>鍙栨秷</Button>,
+            <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>鎻愪氦</Button>
           ]}
           destroyOnClose
         >

--
Gitblit v1.8.0