From f4b9504cad034ddcdef21c2081d14a4984fcd2d3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 15 七月 2024 17:14:48 +0800
Subject: [PATCH] 2024-07-15

---
 src/menu/components/editor/braft-editor/options.jsx |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx
index 908efea..e0bb4a2 100644
--- a/src/menu/components/editor/braft-editor/options.jsx
+++ b/src/menu/components/editor/braft-editor/options.jsx
@@ -4,15 +4,18 @@
 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
+          label: item.name,
+          columns: JSON.parse(JSON.stringify(item.columns))
         })
       }
     })
@@ -82,23 +85,15 @@
       required: true,
       options: interfaces,
       reset_source: true,
-      callback: (map, record) => {
+      callback: (record) => {
         if (!record.publicId) return
 
-        let interfaces = window.GLOB.customMenu.interfaces || []
-
-        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
+        let d = interfaces.filter(m => m.value === record.publicId)[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)
+        return {
+          field: d.columns
         }
       }
     },
@@ -107,6 +102,7 @@
       field: 'field',
       label: '鏂囨湰瀛楁',
       initval: wrap.field || '',
+      timestamp: new Date().getTime(),
       required: false,
       options: columns
     },
@@ -157,7 +153,7 @@
         {value: 'true', label: '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
-      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
+      forbid: !appType || ispop || isprint
     },
     {
       type: 'multiselect',
@@ -166,7 +162,7 @@
       initval: wrap.blacklist || [],
       required: false,
       options: roleList,
-      forbid: !!appType
+      forbid: !!appType || isprint
     },
   ]
 

--
Gitblit v1.8.0