From 137fb8ea6af2789b3238b22bac31d80bced41dfe Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 28 七月 2021 11:39:39 +0800 Subject: [PATCH] 2021-07-28 --- src/menu/components/share/actioncomponent/formconfig.jsx | 115 +++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 82 insertions(+), 33 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 6d9fab1..b038d5c 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -11,7 +11,10 @@ * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 */ -export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = []) { +export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) { + let appType = sessionStorage.getItem('appType') + let setting = config.setting || {} + let columns = config.columns || [] let appMenus = [] let opentypes = [ { @@ -49,7 +52,7 @@ { value: 'pay', text: Formdict['model.pay'] }, { value: 'custom', text: Formdict['header.form.custom'] } ] - const isApp = sessionStorage.getItem('appType') === 'pc' + const isApp = ['pc', 'mob'].includes(appType) let funTypes = [ { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, @@ -57,9 +60,8 @@ ] if (isApp) { - opentypes = opentypes.filter(item => item.value !== 'tab') pageTemps = [ - { value: 'page', text: '鑿滃崟' }, + // { value: 'page', text: '鑿滃崟' }, { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, { value: 'pay', text: Formdict['model.pay'] }, @@ -79,9 +81,15 @@ } else { appMenus = [] } + + if (appType === 'mob') { + opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage'].includes(item.value)) + } else { + opentypes = opentypes.filter(item => item.value !== 'tab') + } } - if (type === 'chart') { + if (type === 'chart' && appType !== 'mob') { opentypes = opentypes.filter(item => item.value === 'excelIn' || item.value === 'excelOut') } @@ -107,7 +115,7 @@ type: 'radio', key: 'funcType', label: Formdict['header.form.funcType'], - initVal: card.funcType || (isApp ? 'changeuser' : ''), + initVal: card.funcType || '', required: true, options: funTypes }, @@ -193,34 +201,12 @@ options: pageTemps }, { - type: 'radio', - key: 'open', - label: '閾炬帴鏂瑰紡', - initVal: card.open || 'blank', - required: true, - forbid: !isApp, - options: [{ - value: 'blank', - text: '鏂扮獥鍙�' - }, { - value: 'self', - text: '褰撳墠绐楀彛' - }] - }, - { type: 'select', key: 'linkmenu', label: '鍏宠仈鑿滃崟', initVal: card.linkmenu || '', required: true, - options: appMenus - }, - { - type: 'select', - key: 'copyMenuId', - label: '澶嶅埗鑿滃崟', - initVal: card.copyMenuId || '', - required: false, + forbid: !isApp, options: appMenus }, { @@ -430,21 +416,39 @@ type: 'radio', key: 'show', label: "鏄剧ず涓�", - initVal: card.show || 'icon', + initVal: card.show || 'button', required: true, options: [{ value: 'icon', text: '鍥炬爣' }, { value: 'button', - text: '鎸夐挳' + text: '鍥炬爣+鏂囧瓧' }, { value: 'link', - text: '閾炬帴' + text: '鏂囧瓧+鍥炬爣' }] }, { - type: 'select', + type: 'radio', + key: 'swipe', + label: "婊戝姩鏄剧ず", + initVal: card.swipe || 'false', + required: false, + forbid: (type !== 'datacard' || appType !== 'mob'), + options: [{ + value: 'false', + text: '鍚�' + }, { + value: 'left', + text: '宸︽粦' + }, { + value: 'right', + text: '鍙虫粦' + }] + }, + { + type: 'icon', key: 'icon', label: Formdict['model.icon'], initVal: card.icon, @@ -456,6 +460,7 @@ key: 'class', label: Formdict['model.form.color'], initVal: card.class, + tooltip: '姝ら鑹蹭负鎸夐挳鍒濆鍖栭鑹诧紝鍙湪鏍峰紡璋冩暣涓慨鏀广��', required: false, options: [] }, @@ -515,6 +520,50 @@ initVal: card.syncComponent || [], required: false, options: modules + }, + { + type: 'select', + key: 'controlField', + label: '鎺у埗瀛楁', + tooltip: '绂佺敤鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鏄惁绂佺敤銆�', + initVal: card.controlField || '', + required: false, + allowClear: true, + options: columns + }, + { + type: 'text', + key: 'controlVal', + label: '鎺у埗鍊�', + tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細绂佺敤锛屽涓�肩敤閫楀彿鍒嗛殧銆�', + initVal: card.controlVal || '', + required: false + }, + { + type: 'select', + key: 'openmenu', + label: '鎵撳紑鑿滃崟', + tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��', + initVal: card.openmenu || '', + forbid: appType !== 'pc' && appType !== 'mob', + required: false, + allowClear: true, + options: appMenus + }, + { + type: 'radio', + key: 'open', + label: '鎵撳紑鏂瑰紡', + initVal: card.open || 'blank', + required: true, + forbid: appType !== 'pc', + options: [{ + value: 'blank', + text: '鏂扮獥鍙�' + }, { + value: 'self', + text: '褰撳墠绐楀彛' + }] } ] -- Gitblit v1.8.0