From 41c55c1f103658b997f7a828a7067bdb228f1df0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 十月 2022 23:35:10 +0800 Subject: [PATCH] 2022-10-04 --- src/menu/components/share/actioncomponent/formconfig.jsx | 103 ++++++++++++++++++++++++++++++--------------------- 1 files changed, 60 insertions(+), 43 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 789803c..970a91a 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -12,7 +12,7 @@ * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 */ -export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = [], anchors = []) { +export function getActionForm (card, functip, config, usefulFields, menulist = [], modules = [], anchors = []) { let appType = sessionStorage.getItem('appType') let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview let printTemps = sessionStorage.getItem('printTemps') @@ -20,34 +20,44 @@ let setting = config.setting || {} let columns = config.columns || [] let appMenus = [] + let type = '' + + if (card.eleType === 'button') { + type = 'card' + } else if (config.subtype === 'datacard' || config.subtype === 'tablecard') { + type = 'datacard' + } else if (config.type === 'line' || config.type === 'bar' || config.type === 'scatter') { + type = 'chart' + } + let opentypes = [ { value: 'pop', - text: Formdict['model.form.popform'] + text: '寮圭獥锛堣〃鍗曪級' }, { value: 'prompt', - text: Formdict['model.form.prompt'] + text: '鎻愮ず妗�' }, { value: 'exec', - text: Formdict['model.form.exec'] + text: '鐩存帴鎵ц' }, { value: 'excelIn', - text: Formdict['model.form.excelIn'] + text: '瀵煎叆Excel' }, { value: 'excelOut', - text: Formdict['model.form.excelOut'] + text: '瀵煎嚭Excel' }, { value: 'popview', - text: Formdict['model.form.popview'] + text: '寮圭獥锛堟爣绛撅級' }, { value: 'tab', - text: Formdict['model.form.tab'] + text: '鏍囩椤�' }, { value: 'innerpage', - text: Formdict['model.form.newpage'] + text: '鏂伴〉闈�' }, { value: 'funcbutton', - text: Formdict['model.form.funcbutton'] + text: '鍔熻兘鎸夐挳' } ] @@ -76,17 +86,6 @@ return _list } - // 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(window.GLOB.customMenu.components))) let pageTemps = [ @@ -152,6 +151,10 @@ if (type === 'chart' && appType !== 'mob') { opentypes = opentypes.filter(item => item.value === 'excelIn' || item.value === 'excelOut') + + if (card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut') { // 鎷栨嫿娣诲姞绫诲瀷杞崲 + card.OpenType = 'excelOut' + } } let refresh = [] @@ -170,8 +173,10 @@ if (type === 'card') { opentypes.push({ value: 'form', - text: '琛ㄥ崟锛堝紑鍏虫垨鍕鹃�夋锛�' + text: '琛ㄥ崟' }) + } else if (card.OpenType === 'form') { // 鎷栨嫿娣诲姞绫诲瀷杞崲 + card.OpenType = 'pop' } if (!card.control && card.controlField) { @@ -192,6 +197,16 @@ value: 'closetab', text: '鍏抽棴鏍囩' }] + } + + let formTypes = [] + if (appType === 'mob') { + formTypes = [{ + value: 'scan', + text: '鎵弿' + }] + } else if (card.formType === 'scan') { + card.formType = 'switch' } let forms = [ @@ -240,7 +255,8 @@ }, { value: 'radio', text: '鍕鹃�夋' - }] + }, + ...formTypes] }, { type: 'select', @@ -276,9 +292,9 @@ options: [{ value: 'wxpay', text: '寰俊' - }, { - value: 'alipay', - text: '鏀粯瀹�' + // }, { + // value: 'alipay', + // text: '鏀粯瀹�' }] }, { @@ -309,7 +325,7 @@ { type: 'text', key: 'sql', - label: Formdict['model.form.tablename'], + label: '琛ㄥ悕', initVal: card.sql || setting.tableName || '', required: true }, @@ -732,6 +748,7 @@ tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��', initVal: card.openmenu || (!appType ? [] : ''), help: appType === 'mob' || appType === 'pc' ? '鍙繑鍥炰笂涓�椤点��' : null, + extendName: 'MenuNo', required: false, allowClear: true, options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'}] : menulist, @@ -741,7 +758,7 @@ type: 'text', key: 'output', label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝濡侤id锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��', + tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝杩斿洖id鏃跺彲浣跨敤@id@锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��', initVal: card.output || '', required: false, forbid: viewType === 'popview' @@ -902,6 +919,21 @@ required: false }, { + type: 'radio', + key: 'hidden', + label: '闅愯棌', + initVal: card.hidden || 'false', + tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��', + required: false, + options: [{ + value: 'false', + text: '鍚�' + }, { + value: 'true', + text: '鏄�' + }] + }, + { type: 'splitLine', key: 'title', label: '琛ㄥ崟', @@ -960,21 +992,6 @@ label: '鍏抽棴鎻愮ず', initVal: card.closeText || '', required: false, - }, - { - type: 'radio', - key: 'hidden', - label: '闅愯棌', - initVal: card.hidden || 'false', - tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��', - required: false, - options: [{ - value: 'false', - text: '鍚�' - }, { - value: 'true', - text: '鏄�' - }] }, { type: 'radio', -- Gitblit v1.8.0