From 75f3fd6e67851b9079e0b82c8cd94bf7649fe8bd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 08 三月 2021 18:53:44 +0800 Subject: [PATCH] 2021-03-08 --- src/menu/components/share/actioncomponent/formconfig.jsx | 89 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 72 insertions(+), 17 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index f5941c6..8043242 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -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 }, @@ -273,6 +327,7 @@ label: Formdict['model.form.linkmenu'], initVal: card.linkmenu || [], required: true, + forbid: isApp, options: menulist }, { -- Gitblit v1.8.0