From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 五月 2024 10:56:41 +0800 Subject: [PATCH] 2024-05-16 --- src/menu/components/form/formaction/formconfig.jsx | 195 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 190 insertions(+), 5 deletions(-) diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx index ace6550..e3bc348 100644 --- a/src/menu/components/form/formaction/formconfig.jsx +++ b/src/menu/components/form/formaction/formconfig.jsx @@ -4,8 +4,9 @@ * @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 = '鎻愪氦' if (card.type === 'prev') { _type = '涓婁竴姝�' @@ -13,6 +14,8 @@ _type = '涓嬩竴姝�' } else if (card.type === 'close') { _type = '鍏抽棴' + } else if (card.type === 'reset') { + _type = '閲嶇疆' } let menulist = [] @@ -42,10 +45,120 @@ } } + 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({ + value: 'closepoptab', // 鍏抽棴寮圭獥鏍囩 + text: '鍏抽棴寮圭獥' + }) + refresh.push({ + value: 'popclose', // 鎵ц寮圭獥鍏抽棴鏃剁殑鍒锋柊 + text: '鍒锋柊婧愮粍浠�' + }) + } + + let closetab = [] + if (!appType && viewType !== 'popview') { + closetab = [{ + value: 'closetab', + text: '鍏抽棴鏍囩' + }] + } + + let resets = [] + fields.forEach(item => { + if (item.type !== 'text' && item.type !== 'number') return + + if (item.label !== item.field) { + resets.push({ + value: item.field, + text: item.label + ' (' + item.field + ')' + }) + } else { + resets.push({ + value: item.field, + text: item.label + }) + } + }) + return [ { type: 'tip', key: 'type', + label: '鎸夐挳绫诲瀷', + initVal: card.type, + forbid: true + }, + { + type: 'tip', + key: 'typeName', label: '鎸夐挳绫诲瀷', initVal: _type }, @@ -97,7 +210,7 @@ key: 'procMode', label: '鍙傛暟澶勭悊', initVal: card.procMode || 'system', - tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆傛敞锛氬綋閫夆�滄棤鈥濇椂锛屾寜閽�夎鏃朵細浼犻�掍富閿紝瀛樺湪琛ㄥ崟鏃朵細浼犻�掕〃鍗曞瓧娈碉紝瀛樺湪BID鏃朵細浼燘ID瀛楁銆�', + tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛锛涘綋杩斿洖鍊煎瓨鍦� mk_ex_data 鏃讹紝灏嗕互姝や负鍙傛暟鍒嗘壒璇锋眰鑷畾涔夋帴鍙c�傛敞锛氬綋閫夆�滄棤鈥濇椂锛屾寜閽�夎鏃朵細浼犻�掍富閿紝瀛樺湪琛ㄥ崟鏃朵細浼犻�掕〃鍗曞瓧娈碉紝瀛樺湪BID鏃朵細浼燘ID瀛楁銆�', required: true, options: [{ value: 'system', @@ -141,7 +254,7 @@ initVal: card.innerFunc || '', tooltip: functip, fields: usefulFields, - tooltipClass: 'middle', + toolWidth: 350, required: true, readonly: false }, @@ -282,6 +395,22 @@ }] }, { + type: 'text', + key: 'ContentType', + label: 'Content-Type', + initVal: card.ContentType || '', + tooltip: '榛樿鍊硷細application/x-www-form-urlencoded;charset=UTF-8', + required: false + }, + { + type: 'text', + key: 'outerBlacklist', + label: '瀛楁榛戝悕鍗�', + initVal: card.outerBlacklist || '', + tooltip: '涓嶉渶瑕佸洖浼犵殑瀛楁鍙缃瓧娈甸粦鍚嶅崟锛屽涓�艰鐢ㄩ�楀彿鍒嗛殧銆�', + required: false + }, + { type: 'radio', key: 'Ot', label: '琛岃缃�', @@ -310,7 +439,20 @@ }, { value: 'mainline', text: '鍒锋柊涓婄骇缁勪欢 - 琛�' - }] + }, { + value: 'maingrid', + text: '鍒锋柊涓婄骇缁勪欢' + }, ...closetab, ...refresh] + }, + { + type: 'cascader', + key: 'refreshTab', + label: '鍒锋柊鑿滃崟', + initVal: card.refreshTab || [], + tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧姛鑳芥寜閽腑鏍囩鍏抽棴绫诲瀷锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', + required: false, + forbid: appType === 'pc' || appType === 'mob' || viewType === 'popview', + options: menulist }, { type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader', @@ -353,6 +495,15 @@ options: modules }, { + type: 'number', + key: 'syncDelay', + label: '鍒锋柊寤惰繜', + initVal: card.syncDelay, + tooltip: '鍚屾鍒锋柊缁勪欢鐨勫欢杩熸椂闂达紝鍗曚綅姣銆�', + // placeholder: '鍗曚綅姣', + required: false + }, + { type: 'cascader', key: 'anchors', label: '璺宠浆閿氱偣', @@ -360,6 +511,40 @@ tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佽烦杞殑閿氱偣銆�' + (appType === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : ''), required: false, 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: 'returnValue', + label: '鏇存柊琛ㄥ崟', + initVal: card.returnValue || 'false', + tooltip: '涓庨噸缃〃鍗曢厤鍚堜娇鐢紝寮�鍚椂锛屽繀椤诲湪鑷畾涔夎剼鏈腑杩斿洖鏁版嵁锛岀敤浜庢浛鎹㈠瓧娈甸泦鍜屽~鍏呰〃鍗曘��', + options: [{ + value: 'false', + text: '绂佺敤' + }, { + value: 'true', + text: '鍚敤' + }] }, { type: 'radio', @@ -375,6 +560,6 @@ value: 'true', text: '鍒锋柊' }] - }, + } ] } -- Gitblit v1.8.0