From 0eb129a9beddbb86ae74d7106a8e60823206b8d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 14 十二月 2023 11:29:15 +0800 Subject: [PATCH] 2023-12-14 --- src/menu/components/form/formaction/formconfig.jsx | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 97 insertions(+), 1 deletions(-) diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx index e90047a..f6800ae 100644 --- a/src/menu/components/form/formaction/formconfig.jsx +++ b/src/menu/components/form/formaction/formconfig.jsx @@ -4,7 +4,7 @@ * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 */ -export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) { +export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid, fields) { const appType = sessionStorage.getItem('appType') let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview let _type = '鎻愪氦' @@ -45,6 +45,72 @@ } } + let linkButtons = [] + let filterComponent = (components) => { + components.forEach(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + filterComponent(tab.components) + }) + } else if (item.type === 'group') { + filterComponent(item.components) + } else { + item.action && item.action.forEach(cell => { + if (cell.hidden === 'true' || cell.uuid === uuid) return + if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return + + linkButtons.push({ + value: cell.uuid, + label: cell.label + '锛�' + item.name + '锛�' + }) + }) + + if (item.type === 'card' && item.subcards) { + item.subcards.forEach(m => { + if ((item.subtype === 'datacard' || item.subtype === 'dualdatacard') && m.$cardType !== 'extendCard') return + m.elements.forEach(cell => { + if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.uuid === uuid) return + if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return + + linkButtons.push({ + value: cell.uuid, + label: cell.label + '锛�' + item.name + '锛�' + }) + }) + }) + } else if (item.type === 'balcony') { + item.elements.forEach(cell => { + if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.uuid === uuid) return + if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return + + linkButtons.push({ + value: cell.uuid, + label: cell.label + '锛�' + item.name + '锛�' + }) + }) + } else if (item.type === 'form') { + item.subcards.forEach(group => { + if(group.uuid === uuid) return + + if (item.subcards.length > 1) { + linkButtons.push({ + value: group.uuid, + label: group.subButton.label + '锛�' + item.name + '-' + group.setting.title + '锛�' + }) + } else { + linkButtons.push({ + value: group.uuid, + label: group.subButton.label + '锛�' + item.name + '锛�' + }) + } + }) + } + } + }) + } + + filterComponent(window.GLOB.customMenu.components) + let refresh = [] if (viewType === 'popview') { // 寮圭獥鏍囩 refresh.push({ @@ -56,6 +122,16 @@ text: '鍒锋柊婧愮粍浠�' }) } + + let resets = [] + fields.forEach(item => { + if (item.type !== 'text' && item.type !== 'number') return + + resets.push({ + value: item.field, + text: item.label + }) + }) return [ { @@ -400,6 +476,26 @@ options: anchors }, { + type: 'select', + key: 'preButton', + label: '鍓嶇疆鎸夐挳', + tooltip: '褰撳墠鎸夐挳鎵ц鍓嶏紝闇�瑕佹墽琛岀殑鎸夐挳銆�', + initVal: card.preButton || '', + required: false, + allowClear: true, + options: linkButtons + }, + { + type: 'select', + key: 'resetForms', + label: '閲嶇疆琛ㄥ崟', + tooltip: '鎸夐挳鎵ц鎴愬姛鍚庨渶瑕侀噸缃殑琛ㄥ崟锛岃〃鍗曚細鎭㈠榛樿鍊煎苟鑱氱劍銆�', + initVal: card.resetForms || [], + required: false, + mode: 'multiple', + options: resets + }, + { type: 'radio', key: 'reload', label: '涓婁竴椤�', -- Gitblit v1.8.0