From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 四月 2025 12:18:03 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/editor/braft-editor/options.jsx | 141 ++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 128 insertions(+), 13 deletions(-) diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx index 9e7094f..91f403e 100644 --- a/src/menu/components/editor/braft-editor/options.jsx +++ b/src/menu/components/editor/braft-editor/options.jsx @@ -4,6 +4,22 @@ 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, + columns: JSON.parse(JSON.stringify(item.columns)) + }) + } + }) + } if (roleList) { try { @@ -13,6 +29,20 @@ } } 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' + } + let loads = [] + if (wrap.loaded === 'true') { + loads.push('loaded') + } + if (wrap.preload === 'true') { + loads.push('preload') } const cardWrapForm = [ @@ -52,18 +82,41 @@ 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: (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 }, @@ -80,14 +133,76 @@ ] }, { - 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, + 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: 'checkbox', + field: 'loads', + label: '甯冨眬璋冩暣', + initval: loads, + required: false, + tooltip: '棰勫鐞嗗叆鍙俬tml銆乨ata锛岃繑鍥炰慨鏀瑰悗鐨刪tml锛涘悗澶勭悊鍏ュ弬涓篽tml锛屽彲閫氳繃椤甸潰鍏冪礌鐨勬牱寮忚皟鏁村苟杩斿洖澶勭悊鍚庣殑html銆�', + options: [ + {value: 'preload', label: '棰勫鐞�'}, + {value: 'loaded', label: '鍚庡鐞�'}, + ], + controlFields: [ + {field: 'prefunc', values: ['preload']}, + {field: 'loadedfunc', values: ['loaded']}, + ] + }, + { + type: 'codemirror', + field: 'prefunc', + label: '棰勫鐞嗚剼鏈�', + initval: wrap.prefunc || '', + required: true, + span: 24 + }, + { + type: 'codemirror', + field: 'loadedfunc', + label: '鍚庡鐞嗚剼鏈�', + initval: wrap.loadedfunc || '', + required: true, + span: 24 }, { type: 'radio', @@ -99,7 +214,7 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' + forbid: !appType || ispop || isprint }, { type: 'multiselect', @@ -108,7 +223,7 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, ] -- Gitblit v1.8.0