From fb3ec146a9e1444ece749d0bcf232a554e933fb0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 17 五月 2022 22:56:16 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/menu/popview/index.jsx |   47 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/src/menu/popview/index.jsx b/src/menu/popview/index.jsx
index e820385..ff72ac6 100644
--- a/src/menu/popview/index.jsx
+++ b/src/menu/popview/index.jsx
@@ -5,6 +5,7 @@
 import moment from 'moment'
 import HTML5Backend from 'react-dnd-html5-backend'
 import { notification, Modal, Collapse, Card, Switch, Button } from 'antd'
+import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
@@ -47,7 +48,8 @@
     oriConfig: null,
     config: null,
     customComponents: [],
-    comloading: false
+    comloading: false,
+    eyeopen: false
   }
 
   UNSAFE_componentWillMount() {
@@ -237,7 +239,7 @@
     })
   }
 
-  getMenuMessage = () => {
+  getMenuMessage = (delButtons) => {
     const { config } = this.state
     let buttons = []
     let _sort = 1
@@ -252,6 +254,10 @@
           traversal(item.components)
         } else if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) {
           item.action && item.action.forEach(btn => {
+            if (btn.hidden === 'true') {
+              delButtons.push(btn.uuid)
+              return
+            }
             this.checkBtn(btn)
             buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
             _sort++
@@ -259,12 +265,20 @@
           item.subcards && item.subcards.forEach(card => {
             card.elements && card.elements.forEach(cell => {
               if (cell.eleType !== 'button') return
+              if (cell.hidden === 'true') {
+                delButtons.push(cell.uuid)
+                return
+              }
               this.checkBtn(cell)
               buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`)
               _sort++
             })
             card.backElements && card.backElements.forEach(cell => {
               if (cell.eleType !== 'button') return
+              if (cell.hidden === 'true') {
+                delButtons.push(cell.uuid)
+                return
+              }
               this.checkBtn(cell)
               buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`)
               _sort++
@@ -274,6 +288,10 @@
           item.subcards.forEach(card => {
             card.elements && card.elements.forEach(cell => {
               if (cell.eleType !== 'button') return
+              if (cell.hidden === 'true') {
+                delButtons.push(cell.uuid)
+                return
+              }
               this.checkBtn(cell)
               buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`)
               _sort++
@@ -282,18 +300,30 @@
         } else if (item.type === 'balcony') {
           item.elements && item.elements.forEach(cell => {
             if (cell.eleType !== 'button') return
+            if (cell.hidden === 'true') {
+              delButtons.push(cell.uuid)
+              return
+            }
             this.checkBtn(cell)
             buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`)
             _sort++
           })
         } else if (item.type === 'line' || item.type === 'bar' || item.type === 'chart') {
           item.action && item.action.forEach(btn => {
+            if (btn.hidden === 'true') {
+              delButtons.push(btn.uuid)
+              return
+            }
             this.checkBtn(btn)
             buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
             _sort++
           })
         } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
           item.action && item.action.forEach(btn => {
+            if (btn.hidden === 'true') {
+              delButtons.push(btn.uuid)
+              return
+            }
             this.checkBtn(btn)
             buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
             _sort++
@@ -301,6 +331,10 @@
           item.cols && item.cols.forEach(col => {
             if (col.type !== 'action') return
             col.elements.forEach(btn => {
+              if (btn.hidden === 'true') {
+                delButtons.push(btn.uuid)
+                return
+              }
               this.checkBtn(btn)
               buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
               _sort++
@@ -354,7 +388,6 @@
 
   submitConfig = () => {
     const { btn } = this.props
-    const { delButtons } = this.state
     let config = fromJS(this.state.config).toJS()
 
     if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) {
@@ -402,13 +435,14 @@
         LText: []
       }
 
+      let delButtons = fromJS(this.state.delButtons).toJS()
       if (sessionStorage.getItem('appType') === 'pc') {
         param.TypeCharOne = sessionStorage.getItem('kei_no')
         param.Typename = 'pc'
 
         btnParam.LText = ''
       } else {
-        btnParam.LText = this.getMenuMessage()
+        btnParam.LText = this.getMenuMessage(delButtons)
         btnParam.LText = btnParam.LText.join(' union all ')
         btnParam.LText = Utils.formatOptions(btnParam.LText)
         btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -628,7 +662,7 @@
 
   render () {
     const { btn } = this.props
-    const { activeKey, comloading, dict, config, menuloading, customComponents, MenuId } = this.state
+    const { activeKey, comloading, dict, config, menuloading, customComponents, MenuId, eyeopen } = this.state
 
     return (
       <div className="pc-poper-view">
@@ -659,11 +693,12 @@
                 </Panel>
               </Collapse>
             </div>
-            <div className={'menu-view ' + (menuloading ? 'saving' : '')}>
+            <div className={'menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}>
               <Card title={
                 <div> {config && config.MenuName} </div>
               } bordered={false} extra={
                 <div>
+                  <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 缁勪欢鍚�</Button>
                   <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''} updateConfig={this.refreshConfig}/>
                   <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/>
                   <StyleCombControlButton menu={config} />

--
Gitblit v1.8.0