From 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 12 十二月 2023 21:05:37 +0800
Subject: [PATCH] 2023-12-12

---
 src/menu/components/editor/braft-editor/options.jsx |   86 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx
index 0cf69e3..922cc66 100644
--- a/src/menu/components/editor/braft-editor/options.jsx
+++ b/src/menu/components/editor/braft-editor/options.jsx
@@ -4,6 +4,21 @@
 export default function (wrap, columns) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
+  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
+  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
+  let menu = window.GLOB.customMenu
+
+  let interfaces = []
+  if (menu.interfaces) {
+    menu.interfaces.forEach(item => {
+      if (item.status === 'true') {
+        interfaces.push({
+          value: item.uuid,
+          label: item.name
+        })
+      }
+    })
+  }
 
   if (roleList) {
     try {
@@ -52,18 +67,48 @@
       options: [
         {value: 'dynamic', label: '鍔ㄦ��'},
         {value: 'static', label: '闈欐��'},
+        {value: 'public', label: '鍏叡鏁版嵁婧�'},
       ],
       controlFields: [
-        {field: 'field', values: ['dynamic']},
-        {field: 'encryption', values: ['dynamic']},
+        {field: 'field', values: ['dynamic', 'public']},
+        {field: 'empty', values: ['dynamic', 'public']},
+        {field: 'publicId', values: ['public']},
+        {field: 'encryption', values: ['dynamic', 'public']},
       ]
+    },
+    {
+      type: 'select',
+      field: 'publicId',
+      label: '鏁版嵁婧�',
+      initval: wrap.publicId || '',
+      required: true,
+      options: interfaces,
+      reset_source: true,
+      callback: (map, record) => {
+        if (!record.publicId) return
+
+        let interfaces = window.GLOB.customMenu.interfaces || []
+
+        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
+
+        if (!d || !d.columns) return
+
+        let columns = JSON.parse(JSON.stringify(d.columns))
+
+        let _field = map.get('field')
+
+        if (_field) {
+          _field.options = columns
+          _field.oriOptions = columns
+          map.set('field', _field)
+        }
+      }
     },
     {
       type: 'select',
       field: 'field',
       label: '鏂囨湰瀛楁',
       initval: wrap.field || '',
-      tooltip: '閫夋嫨鍔ㄦ�佸�兼椂锛岄渶璁剧疆鏂囨湰瀛楁鎵嶅彲鐢熸晥銆�',
       required: false,
       options: columns
     },
@@ -80,14 +125,29 @@
       ]
     },
     {
-      type: 'number',
-      field: 'minHeight',
-      label: '鏈�灏忛珮搴�',
-      initval: wrap.minHeight || '',
-      min: 0,
-      max: 3000,
-      precision: 0,
-      required: false
+      type: 'radio',
+      field: 'empty',
+      label: '绌哄�奸殣钘�',
+      initval: wrap.empty || 'show',
+      tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
+      required: false,
+      skip: true,
+      options: [
+        {value: 'show', label: '鍚�'},
+        {value: 'hidden', label: '鏄�'},
+      ],
+    },
+    {
+      type: 'radio',
+      field: 'firstTr',
+      label: '琛ㄦ牸棣栬',
+      initval: wrap.firstTr || 'deep',
+      tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��',
+      required: false,
+      options: [
+        {value: 'deep', label: '娣辫壊'},
+        {value: 'light', label: '娴呰壊'},
+      ]
     },
     {
       type: 'radio',
@@ -99,7 +159,7 @@
         {value: 'true', label: '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
-      forbid: !appType
+      forbid: !appType || ispop || isprint
     },
     {
       type: 'multiselect',
@@ -108,7 +168,7 @@
       initval: wrap.blacklist || [],
       required: false,
       options: roleList,
-      forbid: !!appType
+      forbid: !!appType || isprint
     },
   ]
 

--
Gitblit v1.8.0