From 46059e342d70b51bd9775f30feb5f29304bda6ac Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 19 九月 2022 17:15:04 +0800
Subject: [PATCH] 2022-09-19
---
src/menu/components/share/actioncomponent/formconfig.jsx | 168 ++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 109 insertions(+), 59 deletions(-)
diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 8bf6e90..157db98 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,75 +20,88 @@
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: '鍔熻兘鎸夐挳'
}
]
let getTabs = (list) => {
- return list.filter(item => {
- if (item.type !== 'tabs') return false
+ let _list = []
+ list.forEach(item => {
+ if (item.type !== 'tabs') return
- item.children = item.children.map(cell => {
- cell.children = getTabs(cell.children)
- return cell
+ _list.push({
+ value: item.uuid,
+ label: item.name,
+ children: item.subtabs.map(cell => {
+ let children = getTabs(cell.components)
+
+ if (children.length === 0) {
+ children = null
+ }
+ return {
+ value: cell.uuid,
+ label: cell.label,
+ children: children
+ }
+ })
})
- return item
})
+ 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(modules)))
+ let tabs = getTabs(JSON.parse(JSON.stringify(window.GLOB.customMenu.components)))
let pageTemps = [
{ value: 'billprint', text: '鍗曟嵁鎵撳嵃' },
- { value: 'pay', text: Formdict['model.pay'] },
- { value: 'custom', text: Formdict['header.form.custom'] }
+ { value: 'pay', text: '鏀粯' },
+ { value: 'custom', text: '鑷畾涔�' }
]
const isApp = ['pc', 'mob'].includes(appType)
let funTypes = [
- { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
{ value: 'print', text: '鏍囩鎵撳嵃' },
+ { value: 'refund', text: '閫�娆�' },
{ value: 'closetab', text: '鏍囩鍏抽棴' },
+ { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
{ value: 'megvii', text: '鏃疯闈㈡澘鏈�' },
+ { value: 'filezip', text: '鏂囦欢鍘嬬缉鍖�' },
]
if (isApp) {
@@ -108,12 +121,14 @@
funTypes = [
{ value: 'scan', text: '鎵爜' },
{ value: 'pay', text: '鏀粯' },
- { value: 'logout', text: '閫�鍑�' },
+ { value: 'refund', text: '閫�娆�' },
+ { value: 'resetPwd', text: '淇敼瀵嗙爜'},
{ value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' },
{ value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' },
{ value: 'mkUnsubscribe', text: '娉ㄩ攢璐︽埛' },
{ value: 'reAuth', text: '鍒囨崲绯荤粺锛堟竻绌虹紦瀛�-灏忕▼搴忥級' },
{ value: 'copyurl', text: '澶嶅埗閾炬帴鍦板潃' },
+ { value: 'logout', text: '閫�鍑�' },
{ value: 'goBack', text: '杩斿洖' },
]
pageTemps = [
@@ -123,6 +138,7 @@
} else if (appType === 'pc') {
opentypes = opentypes.filter(item => item.value !== 'tab')
funTypes = [
+ { value: 'refund', text: '閫�娆�' },
{ value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
]
pageTemps = [
@@ -135,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 = []
@@ -155,6 +175,8 @@
value: 'form',
text: '琛ㄥ崟锛堝紑鍏虫垨鍕鹃�夋锛�'
})
+ } else if (card.OpenType === 'form') { // 鎷栨嫿娣诲姞绫诲瀷杞崲
+ card.OpenType = 'pop'
}
if (!card.control && card.controlField) {
@@ -162,6 +184,19 @@
}
if (appType === 'mob' && card.control === 'parent') {
card.control = ''
+ }
+
+ if (card.execSuccess === 'goback') {
+ card.openmenu = 'goback'
+ card.execSuccess = 'never'
+ }
+
+ let closetab = []
+ if (!appType) {
+ closetab = [{
+ value: 'closetab',
+ text: '鍏抽棴鏍囩'
+ }]
}
let forms = [
@@ -172,6 +207,13 @@
initVal: card.OpenType,
required: true,
options: opentypes
+ },
+ {
+ type: 'text',
+ key: 'label',
+ label: '鎸夐挳鍚嶇О',
+ initVal: card.label,
+ required: true,
},
{
type: 'select',
@@ -231,13 +273,6 @@
options: []
},
{
- type: 'text',
- key: 'label',
- label: '鎸夐挳鍚嶇О',
- initVal: card.label,
- required: true,
- },
- {
type: 'checkbox',
key: 'payType',
label: '鏀粯鏂瑰紡',
@@ -255,7 +290,7 @@
type: 'radio',
key: 'procMode',
label: '鍙傛暟澶勭悊',
- initVal: card.procMode || 'system',
+ initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'),
required: true,
options: [{
value: 'system',
@@ -263,6 +298,9 @@
}, {
value: 'inner',
text: '鍐呴儴鍑芥暟'
+ }, {
+ value: 'none',
+ text: '鏃�'
}]
},
{
@@ -276,7 +314,7 @@
{
type: 'text',
key: 'sql',
- label: Formdict['model.form.tablename'],
+ label: '琛ㄥ悕',
initVal: card.sql || setting.tableName || '',
required: true
},
@@ -288,6 +326,15 @@
tooltip: functip,
fields: usefulFields,
required: false,
+ },
+ {
+ type: 'text',
+ key: 'urlkey',
+ label: '鍦板潃瀛楁',
+ initVal: card.urlkey || '',
+ tooltip: '鍥剧墖锛堟枃浠讹級閾炬帴鐨勫瓧娈靛悕銆�',
+ required: false,
+ readonly: false
},
{
type: 'select',
@@ -391,7 +438,7 @@
type: 'radio',
key: 'callbackType',
label: '鍥炶皟鏂瑰紡',
- initVal: card.callbackType || 'script',
+ initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'),
tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��',
required: true,
options: [{
@@ -400,6 +447,12 @@
}, {
value: 'default',
text: '鍚庡彴鑴氭湰'
+ }, {
+ value: 'func',
+ text: '鍥炶皟鍑芥暟'
+ }, {
+ value: 'none',
+ text: '鏃�'
}]
},
{
@@ -414,7 +467,7 @@
key: 'callbackFunc',
label: Formdict['header.form.callbackFunc'],
initVal: card.callbackFunc || '',
- required: false,
+ required: true
},
{
type: 'select',
@@ -443,10 +496,8 @@
}, {
value: 'mainline',
text: '鍒锋柊涓婄骇缁勪欢 - 琛�'
- }, {
- value: !appType ? 'closetab' : 'goback',
- text: !appType ? '鍏抽棴鏍囩' : '杩斿洖锛堜笂涓�涓〉闈級'
- },
+ },
+ ...closetab,
...refresh]
},
{
@@ -647,7 +698,7 @@
key: 'syncComponent',
label: '鍒锋柊缁勪欢',
initVal: card.syncComponent || [],
- tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧脊绐楁爣绛惧叧闂椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢',
+ tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧脊绐楁爣绛惧叧闂椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢銆傛敞锛氶�夋嫨褰撳墠缁勪欢鐨勪笂绾х粍浠舵棤鏁堬紝鍒锋柊涓婄骇缁勪欢璇烽�夋嫨鎴愬姛鍚庘�滃埛鏂颁笂绾х粍浠� - 琛屸�濄��',
required: false,
options: modules
},
@@ -685,16 +736,17 @@
label: '鎵撳紑鑿滃崟',
tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��',
initVal: card.openmenu || (!appType ? [] : ''),
+ help: appType === 'mob' || appType === 'pc' ? '鍙繑鍥炰笂涓�椤点��' : null,
required: false,
allowClear: true,
- options: appType === 'mob' ? [...appMenus, {value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'}] : (appType === 'pc' ? appMenus : menulist),
+ options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'}] : menulist,
forbid: viewType === 'popview'
},
{
type: 'text',
key: 'output',
label: '杩斿洖鍊�',
- tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�備緥濡傦細@id',
+ tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝濡侤id锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��',
initVal: card.output || '',
required: false,
forbid: viewType === 'popview'
@@ -712,15 +764,13 @@
key: 'open',
label: '鎵撳紑鏂瑰紡',
initVal: card.open || 'blank',
+ tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆�',
required: true,
- forbid: appType !== 'pc',
- options: [{
- value: 'blank',
- text: '鏂扮獥鍙�'
- }, {
- value: 'self',
- text: '褰撳墠绐楀彛'
- }]
+ forbid: appType !== 'pc' && appType !== 'mob',
+ options: [
+ {value: 'blank', text: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+ {value: 'self', text: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
+ ]
},
{
type: 'radio',
--
Gitblit v1.8.0