From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/menu/components/share/actioncomponent/formconfig.jsx | 114 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 92 insertions(+), 22 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index ce7f6d2..6d9fab1 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -1,7 +1,7 @@ import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' -const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS +const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS /** * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅 @@ -12,6 +12,7 @@ * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 */ export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = []) { + let appMenus = [] let opentypes = [ { value: 'pop', @@ -43,6 +44,43 @@ } ] + let pageTemps = [ + { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, + { value: 'pay', text: Formdict['model.pay'] }, + { value: 'custom', text: Formdict['header.form.custom'] } + ] + const isApp = sessionStorage.getItem('appType') === 'pc' + + let funTypes = [ + { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, + { value: 'print', text: '鏍囩鎵撳嵃' } + ] + + if (isApp) { + opentypes = opentypes.filter(item => item.value !== 'tab') + pageTemps = [ + { value: 'page', text: '鑿滃崟' }, + { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, + { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, + { value: 'pay', text: Formdict['model.pay'] }, + { value: 'custom', text: '閾炬帴' } + ] + funTypes = [ + { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, + ] + appMenus = sessionStorage.getItem('appMenus') + if (appMenus) { + try { + appMenus = JSON.parse(appMenus) + appMenus = appMenus.map(item => ({value: item.MenuID, text: item.MenuName})) + } catch { + appMenus = [] + } + } else { + appMenus = [] + } + } + if (type === 'chart') { opentypes = opentypes.filter(item => item.value === 'excelIn' || item.value === 'excelOut') } @@ -69,15 +107,9 @@ type: 'radio', key: 'funcType', label: Formdict['header.form.funcType'], - initVal: card.funcType || 'print', + initVal: card.funcType || (isApp ? 'changeuser' : ''), required: true, - options: [{ - value: 'changeuser', - text: Formdict['header.form.func.changeuser'] - }, { - value: 'print', - text: '鏍囩鎵撳嵃' - }] + options: funTypes }, { type: 'select', @@ -158,21 +190,43 @@ label: Formdict['model.form.newpage.type'], initVal: card.pageTemplate || '', required: true, + options: pageTemps + }, + { + type: 'radio', + key: 'open', + label: '閾炬帴鏂瑰紡', + initVal: card.open || 'blank', + required: true, + forbid: !isApp, options: [{ - value: 'billprint', - text: '鍗曟嵁鎵撳嵃' + value: 'blank', + text: '鏂扮獥鍙�' }, { - value: 'pay', - text: Formdict['model.pay'] - }, { - value: 'custom', - text: Formdict['header.form.custom'] + value: 'self', + text: '褰撳墠绐楀彛' }] }, { - type: 'text', + type: 'select', + key: 'linkmenu', + label: '鍏宠仈鑿滃崟', + initVal: card.linkmenu || '', + required: true, + options: appMenus + }, + { + type: 'select', + key: 'copyMenuId', + label: '澶嶅埗鑿滃崟', + initVal: card.copyMenuId || '', + required: false, + options: appMenus + }, + { + type: 'textarea', key: 'url', - label: Formdict['model.form.newpage.url'], + label: Formdict['model.pageUrl'], initVal: card.url || '', required: true }, @@ -230,17 +284,32 @@ }, { type: 'radio', + key: 'cross', + label: '璺ㄥ煙璇锋眰', + initVal: card.cross || 'true', + tooltip: '濡傛灉鑷畾涔夋帴鍙d笉鏀寔璺ㄥ煙璇锋眰锛屼細閫氳繃褰撳墠绯荤粺杞彂銆�', + required: false, + options: [{ + value: 'true', + text: '鏀寔' + }, { + value: 'false', + text: '涓嶆敮鎸�' + }] + }, + { + type: 'radio', key: 'callbackType', label: '鍥炶皟鏂瑰紡', initVal: card.callbackType || 'script', - tooltip: '浣跨敤榛樿鏂瑰紡鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��', + tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��', required: true, options: [{ - value: 'default', - text: '榛樿鑴氭湰' - }, { value: 'script', text: '鑷畾涔夎剼鏈�' + }, { + value: 'default', + text: '鍚庡彴鑴氭湰' }] }, { @@ -273,6 +342,7 @@ label: Formdict['model.form.linkmenu'], initVal: card.linkmenu || [], required: true, + forbid: isApp, options: menulist }, { -- Gitblit v1.8.0