From bebeca442cee4b83de0d00df29a6514b3f723c4f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 28 七月 2021 13:41:06 +0800 Subject: [PATCH] 2021-07-28 --- src/menu/components/share/actioncomponent/formconfig.jsx | 98 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 64 insertions(+), 34 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 16301bc..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 = [], columns = []) { +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 = ['pc', 'mob'].includes(sessionStorage.getItem('appType')) + const isApp = ['pc', 'mob'].includes(appType) let funTypes = [ { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, @@ -57,7 +60,6 @@ ] if (isApp) { - opentypes = opentypes.filter(item => item.value !== 'tab') pageTemps = [ // { value: 'page', text: '鑿滃崟' }, { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, @@ -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,36 +201,14 @@ options: pageTemps }, { - type: 'radio', - key: 'open', - label: '閾炬帴鏂瑰紡', - initVal: card.open || 'blank', - required: true, - forbid: sessionStorage.getItem('appType') !== 'pc', - options: [{ - value: 'blank', - text: '鏂扮獥鍙�' - }, { - value: 'self', - text: '褰撳墠绐楀彛' - }] - }, - { type: 'select', key: 'linkmenu', label: '鍏宠仈鑿滃崟', initVal: card.linkmenu || '', required: true, + forbid: !isApp, options: appMenus }, - // { - // type: 'select', - // key: 'copyMenuId', - // label: '澶嶅埗鑿滃崟', - // initVal: card.copyMenuId || '', - // required: false, - // options: appMenus - // }, { type: 'textarea', key: 'url', @@ -437,14 +423,32 @@ 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: [] }, @@ -523,8 +528,8 @@ tooltip: '绂佺敤鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鏄惁绂佺敤銆�', initVal: card.controlField || '', required: false, - // forbid: card.$type !== 'tableButton', - options: [{label: '鏃�', field: ''}, ...columns] + allowClear: true, + options: columns }, { type: 'text', @@ -532,8 +537,33 @@ label: '鎺у埗鍊�', tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細绂佺敤锛屽涓�肩敤閫楀彿鍒嗛殧銆�', initVal: card.controlVal || '', - // forbid: card.$type !== 'tableButton', 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