From e1cee96b38805bcccf48e7bcb9d296f2bc54c720 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 24 一月 2025 11:10:32 +0800 Subject: [PATCH] 2025-01-24 --- src/menu/components/editor/braft-editor/options.jsx | 97 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 91 insertions(+), 6 deletions(-) diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx index 134bf6a..bd9e84c 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)) }) } }) @@ -26,6 +29,13 @@ } } else { roleList = [] + } + + let tbStyle = wrap.tbStyle ? wrap.tbStyle.split(' ') : [] + let splitLine = 'false' + if (tbStyle.includes('deep-split')) { + tbStyle = tbStyle.filter(n => n !== 'deep-split') + splitLine = 'true' } const cardWrapForm = [ @@ -69,6 +79,7 @@ ], controlFields: [ {field: 'field', values: ['dynamic', 'public']}, + {field: 'empty', values: ['dynamic', 'public']}, {field: 'publicId', values: ['public']}, {field: 'encryption', values: ['dynamic', 'public']}, ] @@ -79,14 +90,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 }, @@ -104,6 +127,68 @@ }, { type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { + type: 'checkbox', + field: 'tbStyle', + label: '琛ㄦ牸鏍峰紡', + initval: tbStyle, + tooltip: '瀵屾枃鏈腑琛ㄦ牸鐨勬牱寮忥紝娉細閫夋嫨鈥滆竟妗嗗姞绮椻�濇垨鈥滆竟妗嗛鑹插姞娣扁�濇椂鈥滄棤杈规鈥濇棤鏁堛��', + required: false, + options: [ + {value: 'th-light', label: '琛ㄥご閫忔槑'}, + {value: 'tb-flex', label: '鍒楃瓑瀹�'}, + {value: 'no-border', label: '鏃犺竟妗�'}, + {value: 'bold-border', label: '杈规鍔犵矖'}, + {value: 'deep-border', label: '杈规棰滆壊鍔犳繁'}, + {value: 'word-break', label: '寮哄埗鎹㈣'}, + ], + span: 24 + }, + { + type: 'radio', + field: 'splitLine', + label: '鍒嗗壊绾垮姞娣�', + initval: splitLine, + required: false, + options: [ + {value: 'false', label: '鍚�'}, + {value: 'true', label: '鏄�'}, + ], + }, + { + type: 'radio', + field: 'loaded', + label: '甯冨眬璋冩暣', + initval: wrap.loaded || 'false', + required: false, + options: [ + {value: 'false', label: '鍏抽棴'}, + {value: 'true', label: '寮�鍚�'}, + ], + controlFields: [ + {field: 'loadedfunc', values: ['true']}, + ] + }, + { + type: 'codemirror', + field: 'loadedfunc', + label: '澶勭悊鑴氭湰', + initval: wrap.loadedfunc || '', + required: true, + span: 24 + }, + { + type: 'radio', field: 'permission', label: '鏉冮檺楠岃瘉', initval: wrap.permission || 'false', @@ -112,7 +197,7 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' + forbid: !appType || ispop || isprint }, { type: 'multiselect', @@ -121,7 +206,7 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, ] -- Gitblit v1.8.0