From 5a921a3f9e5c690908a18705ef189991fe24bd8e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 30 三月 2024 22:51:44 +0800
Subject: [PATCH] 2024-03-30

---
 src/views/tabledesign/index.jsx                                |    8 ++--
 src/menu/components/share/actioncomponent/actionform/index.jsx |    7 ++-
 src/menu/components/table/edit-table/options.jsx               |    2 
 src/tabviews/basetable/index.jsx                               |    4 +-
 src/tabviews/custom/index.jsx                                  |   10 ++--
 src/views/pcdesign/index.jsx                                   |   12 +++---
 src/menu/components/share/actioncomponent/formconfig.jsx       |   24 ++++++++++++
 src/views/mobdesign/index.jsx                                  |   12 +++---
 src/views/menudesign/index.jsx                                 |   15 +++++--
 src/tabviews/custom/components/group/normal-group/index.scss   |   14 +++++--
 10 files changed, 73 insertions(+), 35 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index 2d3dba1..f7259e5 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -558,11 +558,14 @@
         shows.push('reason')
       }
     }
-
+    
     if (shows.includes('syncComponent') && this.record.syncComponent[0] === 'multiComponent') {
       shows.push('syncComponents')
     }
-
+    
+    if (this.record.hidden !== 'true') {
+      shows.push('permission')
+    }
     if (this.record.show === 'icon') {
       reRequired.icon = true
     } else {
diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index a2c0197..5b0f0bd 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1351,6 +1351,18 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'permission',
+      label: '鏉冮檺楠岃瘉',
+      initVal: setting.permission || 'true',
+      required: false,
+      options: [
+        {value: 'true', text: '缁ф壙鑿滃崟'},
+        {value: 'false', text: '绂佺敤'},
+      ],
+      forbid: viewType === 'popview'
+    },
+    {
       type: 'splitLine',
       key: 'title',
       label: '琛ㄥ崟',
@@ -2464,6 +2476,18 @@
     },
     {
       type: 'radio',
+      key: 'permission',
+      label: '鏉冮檺楠岃瘉',
+      initVal: setting.permission || 'true',
+      required: false,
+      options: [
+        {value: 'true', text: '鍚敤'},
+        {value: 'false', text: '绂佺敤'},
+      ],
+      forbid: viewType === 'popview'
+    },
+    {
+      type: 'radio',
       key: 'execType',
       label: '璇锋眰鏂瑰紡',
       initVal: card.execType || 'multi',
diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx
index 8fefdd4..1ce116a 100644
--- a/src/menu/components/table/edit-table/options.jsx
+++ b/src/menu/components/table/edit-table/options.jsx
@@ -204,7 +204,7 @@
       initval: wrap.permission || (!appType ? 'true' : 'false'),
       required: false,
       options: [
-        {value: 'true', label: '鍚敤'},
+        {value: 'true', label: !appType ? '缁ф壙鑿滃崟' : '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
       forbid: sessionStorage.getItem('editMenuType') === 'popview'
diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index d91a6c5..51bb531 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -397,7 +397,7 @@
                   cell = this.getPrinter(cell, item.uuid)
                 }
 
-                return skip || permAction[cell.uuid]
+                return skip || permAction[cell.uuid] || cell.permission === 'false'
               } else if (['text', 'number', 'formula'].includes(cell.eleType)) {
                 if (!cell.height) {
                   cell.innerHeight = 'auto'
@@ -464,7 +464,7 @@
             cell = this.getPrinter(cell, item.uuid)
           }
 
-          return skip || permAction[cell.uuid]
+          return skip || permAction[cell.uuid] || cell.permission === 'false'
         })
       }
       
diff --git a/src/tabviews/custom/components/group/normal-group/index.scss b/src/tabviews/custom/components/group/normal-group/index.scss
index 0d6c035..8cde523 100644
--- a/src/tabviews/custom/components/group/normal-group/index.scss
+++ b/src/tabviews/custom/components/group/normal-group/index.scss
@@ -25,10 +25,11 @@
     display: none;
     position: absolute;
     top: 0px;
-    right: -24px;
+    right: 0px;
     z-index: 2;
     background: #ffffff;
     box-shadow: 0px 0px 2px #d8d8d8;
+    transition: all 0.2s;
 
     .anticon {
       padding: 5px;
@@ -59,6 +60,7 @@
 
   .normal-group-wrap {
     position: relative;
+    transition: all 0.2s;
   }
   .mk-control {
     display: inline-block;
@@ -75,12 +77,16 @@
   transition: all 0.2s;
 }
 .mk-merge-able.close {
-  width: 0px;
+  width: 25px;
   .normal-group-wrap {
-    margin: 0!important;
+    width: 0px;
+    margin: 0px!important;
+    border-width: 0px!important;
+    box-shadow: none!important;
   }
   .mk-control {
     display: inline-block;
+    right: -24px;
 
     .anticon-double-left {
       display: none;
@@ -91,5 +97,5 @@
   }
 }
 .mk-merge-able.close + .ant-col {
-  width: 100%;
+  width: calc(100% - 25px);
 }
\ No newline at end of file
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 4122cd7..c7c3bb6 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -614,7 +614,7 @@
             cell = this.getPrinter(cell, item.uuid)
           }
 
-          return pass || permAction[cell.uuid]
+          return pass || permAction[cell.uuid] || cell.permission === 'false'
         })
       }
 
@@ -656,7 +656,7 @@
                     cell = this.getPrinter(cell, item.uuid)
                   }
 
-                  return pass || permAction[cell.uuid]
+                  return pass || permAction[cell.uuid] || cell.permission === 'false'
                 } else {
                   cell = this.resetElement(cell)
                 }
@@ -719,7 +719,7 @@
               cell = this.resetElement(cell)
             }
 
-            return cell.eleType !== 'button' || pass || permAction[cell.uuid]
+            return cell.eleType !== 'button' || pass || permAction[cell.uuid] || cell.permission === 'false'
           })
 
           if (card.setting.click === 'menus') {
@@ -761,7 +761,7 @@
               cell = this.resetElement(cell)
             }
 
-            return cell.eleType !== 'button' || pass || permAction[cell.uuid]
+            return cell.eleType !== 'button' || pass || permAction[cell.uuid] || cell.permission === 'false'
           })
         })
       } else if (item.type === 'balcony') {
@@ -785,7 +785,7 @@
             cell = this.resetElement(cell)
           }
 
-          return cell.eleType !== 'button' || pass || permAction[cell.uuid]
+          return cell.eleType !== 'button' || pass || permAction[cell.uuid] || cell.permission === 'false'
         })
       } else if (item.type === 'form') {
         item.subcards = item.subcards.map(group => {
diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index f77e0a4..3f94889 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -654,7 +654,7 @@
         
         if (item.action && item.action.length > 0) {
           item.action.forEach(btn => {
-            if (btn.hidden === 'true') return
+            if (btn.hidden === 'true' || btn.permission === 'false') return
             buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
             _sort++
           })
@@ -669,13 +669,13 @@
           item.subcards.forEach(card => {
             card.elements && card.elements.forEach(cell => {
               if (cell.eleType !== 'button') return
-              if (cell.hidden === 'true') return
+              if (cell.hidden === 'true' || cell.permission === 'false') return
               buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
               _sort++
             })
             card.backElements && card.backElements.forEach(cell => {
               if (cell.eleType !== 'button') return
-              if (cell.hidden === 'true') return
+              if (cell.hidden === 'true' || cell.permission === 'false') return
               buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
               _sort++
             })
@@ -683,7 +683,7 @@
         } else if (item.type === 'balcony') {
           item.elements && item.elements.forEach(cell => {
             if (cell.eleType !== 'button') return
-            if (cell.hidden === 'true') return
+            if (cell.hidden === 'true' || cell.permission === 'false') return
             buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
             _sort++
           })
@@ -694,7 +694,7 @@
                 loopCol(col.subcols)
               } else if (col.type === 'custom') {
                 col.elements.forEach(cell => {
-                  if (cell.eleType !== 'button' || cell.hidden === 'true') return
+                  if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
                   buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
                   _sort++
                 })
@@ -799,6 +799,11 @@
 
       let tbs = []
       let btns = this.getMenuMessage(config, tbs)
+
+      if (config.permission === 'false') {
+        btns = []
+      }
+
       let arr = []
       tbs = tbs.filter(tb => {
         let _tb = tb.toLowerCase()
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index 575cb43..d6e5f24 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -1039,7 +1039,7 @@
           return
         } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') {
           item.action && item.action.forEach(btn => {
-            if (btn.hidden === 'true') return
+            if (btn.hidden === 'true' || btn.permission === 'false') return
 
             m.children.push({
               key: btn.uuid,
@@ -1048,7 +1048,7 @@
           })
           item.subcards.forEach(card => {
             card.elements && card.elements.forEach(cell => {
-              if (cell.eleType !== 'button' || cell.hidden === 'true') return
+              if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
 
               m.children.push({
                 key: cell.uuid,
@@ -1059,7 +1059,7 @@
             if (item.subtype !== 'dualdatacard') return
             
             card.backElements && card.backElements.forEach(cell => {
-              if (cell.eleType !== 'button' || cell.hidden === 'true') return
+              if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
 
               m.children.push({
                 key: cell.uuid,
@@ -1069,7 +1069,7 @@
           })
         } else if (item.type === 'balcony') {
           item.elements && item.elements.forEach(cell => {
-            if (cell.eleType !== 'button' || cell.hidden === 'true') return
+            if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
 
             m.children.push({
               key: cell.uuid,
@@ -1098,7 +1098,7 @@
           }
         } else if (item.type === 'table') {
           item.action && item.action.forEach(btn => {
-            if (btn.hidden === 'true') return
+            if (btn.hidden === 'true' || btn.permission === 'false') return
 
             m.children.push({
               key: btn.uuid,
@@ -1111,7 +1111,7 @@
                 loopCol(col.subcols)
               } else if (col.type === 'custom') {
                 col.elements.forEach(cell => {
-                  if (cell.eleType !== 'button' || cell.hidden === 'true') return
+                  if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
                   m.children.push({
                     key: cell.uuid,
                     title: cell.label,
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 4efe859..8206e33 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -877,7 +877,7 @@
           return
         } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') {
           item.action && item.action.forEach(btn => {
-            if (btn.hidden === 'true') return
+            if (btn.hidden === 'true' || btn.permission === 'false') return
 
             m.children.push({
               key: btn.uuid,
@@ -886,7 +886,7 @@
           })
           item.subcards.forEach(card => {
             card.elements && card.elements.forEach(cell => {
-              if (cell.eleType !== 'button' || cell.hidden === 'true') return
+              if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
 
               m.children.push({
                 key: cell.uuid,
@@ -895,7 +895,7 @@
             })
 
             card.backElements && card.backElements.forEach(cell => {
-              if (cell.eleType !== 'button' || cell.hidden === 'true') return
+              if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
 
               m.children.push({
                 key: cell.uuid,
@@ -905,7 +905,7 @@
           })
         } else if (item.type === 'balcony') {
           item.elements && item.elements.forEach(cell => {
-            if (cell.eleType !== 'button' || cell.hidden === 'true') return
+            if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
 
             m.children.push({
               key: cell.uuid,
@@ -923,7 +923,7 @@
           }
         } else if (item.type === 'table') {
           item.action.forEach(btn => {
-            if (btn.hidden === 'true') return
+            if (btn.hidden === 'true' || btn.permission === 'false') return
 
             m.children.push({
               key: btn.uuid,
@@ -936,7 +936,7 @@
                 loopCol(col.subcols)
               } else if (col.type === 'custom') {
                 col.elements.forEach(cell => {
-                  if (cell.eleType !== 'button' || cell.hidden === 'true') return
+                  if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
                   m.children.push({
                     key: cell.uuid,
                     title: cell.label,
diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx
index 916905e..ce28473 100644
--- a/src/views/tabledesign/index.jsx
+++ b/src/views/tabledesign/index.jsx
@@ -459,7 +459,7 @@
           let _s = 1
 
           tab.components[0].action.forEach(btn => {
-            if (btn.hidden === 'true') return
+            if (btn.hidden === 'true' || btn.permission === 'false') return
 
             buttons.push(`select '${btn.uuid}' as menuid, '${btn.label}' as menuname, '${_s * 10}' as Sort, '${tab.components[0].uuid}' as parentid, 60 as Type`)
             _s++
@@ -471,7 +471,7 @@
                 loopCol(col.subcols)
               } else if (col.type === 'custom') {
                 col.elements.forEach(cell => {
-                  if (cell.eleType !== 'button' || cell.hidden === 'true') return
+                  if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
                   buttons.push(`select '${cell.uuid}' as menuid, '${cell.label}' as menuname, '${_s * 10}' as Sort, '${tab.components[0].uuid}' as parentid, 60 as Type`)
                   _s++
                 })
@@ -486,7 +486,7 @@
           tbs.push(...item.$tables)
         }
         item.action.forEach(btn => {
-          if (btn.hidden === 'true') return
+          if (btn.hidden === 'true' || btn.permission === 'false') return
 
           buttons.push(`select '${btn.uuid}' as menuid, '${btn.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
           _sort++
@@ -498,7 +498,7 @@
               loopCol(col.subcols)
             } else if (col.type === 'custom') {
               col.elements.forEach(cell => {
-                if (cell.eleType !== 'button' || cell.hidden === 'true') return
+                if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.permission === 'false') return
                 buttons.push(`select '${cell.uuid}' as menuid,  '${cell.label}' as menuname, '${_sort * 10}' as Sort, '${config.uuid}' as parentid, 40 as Type`)
                 _sort++
               })

--
Gitblit v1.8.0