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 | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx index c746b12..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)) }) } }) @@ -80,14 +83,26 @@ label: '鏁版嵁婧�', initval: wrap.publicId || '', required: true, - options: interfaces + options: interfaces, + reset_source: true, + callback: (record) => { + if (!record.publicId) return + + let d = interfaces.filter(m => m.value === record.publicId)[0] + + if (!d || !d.columns) return + + return { + field: d.columns + } + } }, { type: 'select', field: 'field', label: '鏂囨湰瀛楁', initval: wrap.field || '', - tooltip: '閫夋嫨鍔ㄦ�佸�兼椂锛岄渶璁剧疆鏂囨湰瀛楁鎵嶅彲鐢熸晥锛屼娇鐢ㄥ叕鍏辨暟鎹簮鏃讹紝闇�鍏堜繚瀛樻暟鎹簮鍚庡啀閫夊彇鏂囨湰瀛楁銆�', + timestamp: new Date().getTime(), required: false, options: columns }, @@ -138,7 +153,7 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' + forbid: !appType || ispop || isprint }, { type: 'multiselect', @@ -147,7 +162,7 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, ] -- Gitblit v1.8.0