From 4d13944afeb0e095dfedaf820a192f844f5f541a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 十月 2021 12:11:01 +0800 Subject: [PATCH] 2021-10-15 --- src/menu/components/share/actioncomponent/formconfig.jsx | 76 ++++++++++++++++++++++++++++++------- 1 files changed, 61 insertions(+), 15 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 59cc710..f7ff1d8 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -13,6 +13,7 @@ */ export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) { let appType = sessionStorage.getItem('appType') + let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview let setting = config.setting || {} let columns = config.columns || [] let appMenus = [] @@ -47,6 +48,32 @@ } ] + let getTabs = (list) => { + return list.filter(item => { + if (item.type !== 'tabs') return false + + item.children = item.children.map(cell => { + cell.children = getTabs(cell.children) + return cell + }) + return item + }) + } + + if (type === 'editable') { + opentypes = [ + { + value: 'excelIn', + text: Formdict['model.form.excelIn'] + }, { + value: 'excelOut', + text: Formdict['model.form.excelOut'] + } + ] + } + + let tabs = getTabs(JSON.parse(JSON.stringify(modules))) + let pageTemps = [ { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, { value: 'pay', text: Formdict['model.pay'] }, @@ -78,6 +105,7 @@ { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' }, { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' }, { value: 'reAuth', text: '閲嶆柊鎺堟潈' }, + { value: 'goBack', text: '杩斿洖' }, ] pageTemps = [ { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, @@ -103,7 +131,7 @@ } let refresh = [] - if (sessionStorage.getItem('editMenuType') === 'popview') { // 寮圭獥鏍囩 + if (viewType === 'popview') { // 寮圭獥鏍囩 opentypes = opentypes.filter(item => item.value !== 'popview' && item.value !== 'funcbutton') refresh.push({ value: 'popclose', @@ -357,8 +385,8 @@ value: 'mainline', text: '鍒锋柊涓婄骇缁勪欢 - 琛�' }, { - value: 'closetab', - text: '鍏抽棴鏍囩' + value: !appType ? 'closetab' : 'goback', + text: !appType ? '鍏抽棴鏍囩' : '杩斿洖锛堜笂涓�涓〉闈級' }, ...refresh] }, @@ -526,7 +554,7 @@ }] }, { - type: 'mcascader', + type: 'cascader', key: 'syncComponent', label: '鍒锋柊缁勪欢', initVal: card.syncComponent || [], @@ -536,12 +564,21 @@ }, { type: 'cascader', - key: 'refreshTab', - label: '鍒锋柊鏍囩', - initVal: card.refreshTab || [], - tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鏍囩', + key: 'switchTab', + label: '鍒囨崲鏍囩', + initVal: card.switchTab || [], + tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸垏鎹㈢殑鏍囩椤�', required: false, - forbid: isApp, + options: tabs + }, + { + type: 'cascader', + key: 'refreshTab', + label: '鍒锋柊鑿滃崟', + initVal: card.refreshTab || [], + tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', + required: false, + forbid: isApp || viewType === 'popview', options: menulist }, { @@ -563,15 +600,24 @@ required: false }, { - type: 'select', + type: 'cascader', + key: 'linkmenu', + label: Formdict['model.form.linkmenu'], + initVal: card.linkmenu || [], + required: true, + forbid: isApp, + options: menulist + }, + { + type: !appType ? 'cascader' : 'select', key: 'openmenu', label: '鎵撳紑鑿滃崟', tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��', - initVal: card.openmenu || '', - forbid: appType !== 'pc' && appType !== 'mob', + initVal: card.openmenu || (!appType ? [] : ''), required: false, allowClear: true, - options: appType !== 'mob' ? appMenus : [...appMenus, {value: 'goback', text: '杩斿洖'}] + options: appType === 'mob' ? [...appMenus, {value: 'goback', text: '杩斿洖'}] : (appType === 'pc' ? appMenus : menulist), + forbid: viewType === 'popview' }, { type: 'text', @@ -579,8 +625,8 @@ label: '杩斿洖鍊�', tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��', initVal: card.output || '', - forbid: appType !== 'pc' && appType !== 'mob', - required: false + required: false, + forbid: viewType === 'popview' }, { type: 'radio', -- Gitblit v1.8.0