From 0d34cffc772922c5f97885d7e684ebb88703bcb5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 九月 2024 16:47:55 +0800 Subject: [PATCH] 2024-09-26 --- src/menu/components/share/actioncomponent/formconfig.jsx | 253 ++++++++++++++++++++++++++++++++------------------ 1 files changed, 161 insertions(+), 92 deletions(-) diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index e9d1a30..e1544de 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -18,6 +18,11 @@ let type = '' let alltype = config.type + '_' + config.subtype + columns = columns.map(item => ({ + value: item.field, + text: `${item.label}锛�${item.field}锛塦 + })) + if (card.eleType === 'button') { type = 'card' } else if (config.subtype === 'datacard' || config.subtype === 'tablecard' || config.subtype === 'dualdatacard') { @@ -211,6 +216,7 @@ { value: 'copyurl', text: '澶嶅埗閾炬帴鍦板潃' }, { value: 'expPdf', text: '瀵煎嚭PDF' }, { value: 'shareLink', text: '鍒嗕韩閾炬帴' }, + { value: 'openLocation', text: '鎵撳紑鍦板浘'}, { value: 'logout', text: '閫�鍑�' }, { value: 'goBack', text: '杩斿洖' }, ] @@ -319,7 +325,7 @@ } let width = card.width || (card.width === 0 ? 0 : 12) - if (/x/.test(card.width)) { + if (card.width && /x/.test(card.width)) { width = +width.replace(/x/, '.5') } @@ -331,9 +337,21 @@ extraParam.push('dataM') } + let apps = [] + let merchs = [] if (!appType) { if (typeof(card.openmenu) === 'string') { card.openmenu = [] + } + + if (window.GLOB.WXApps) { + window.GLOB.WXApps.forEach(item => { + if (item.appType === 'merchant') { + merchs.push({value: item.appId, text: item.appName}) + } else { + apps.push({value: item.appId, text: item.appName}) + } + }) } } else { if (typeof(card.openmenu) !== 'string') { @@ -509,10 +527,20 @@ key: 'wxApp', label: '鍏宠仈搴旂敤', initVal: card.wxApp || '', - tooltip: '璇峰叧鑱旀敮浠橈紙鎴栭��娆撅級鐨勫叕浼楀彿鎴栧皬绋嬪簭銆�', + tooltip: '璇峰叧鑱旀敮浠樼殑鍏紬鍙锋垨灏忕▼搴忋��', required: true, - forbid: !!appType || !window.GLOB.WXApps, - options: window.GLOB.WXApps ? window.GLOB.WXApps.map(item => ({value: item.appId, text: item.appName})) : [] + forbid: apps.length === 0, + options: apps + }, + { + type: 'select', + key: 'wxMerch', + label: '鍏宠仈鍟嗘埛', + initVal: card.wxMerch || '', + tooltip: '璇峰叧鑱旀敮浠樼殑鍟嗘埛鍙枫��', + required: true, + forbid: merchs.length === 0, + options: merchs }, { type: 'text', @@ -775,7 +803,7 @@ key: 'execError', label: '澶辫触鍚�', initVal: card.execError || 'never', - tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳锛堝脊绐楁寜閽級涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級銆�' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂扮粍浠讹紱閫夋嫨鍒锋柊琛� / 缁勪欢鏃讹紝濡傛灉褰撳墠琛屾暟鎹笉瀛樺湪浼氬埛鏂扮粍浠躲�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級銆�', + tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳锛堝脊绐楁寜閽級涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級锛汙open_target_menu@ 鍙墽琛屾墦寮�鑿滃崟銆�' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂扮粍浠讹紱閫夋嫨鍒锋柊琛� / 缁勪欢鏃讹紝濡傛灉褰撳墠琛屾暟鎹笉瀛樺湪浼氬埛鏂扮粍浠躲�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級锛汙open_target_menu@ 鍙墽琛屾墦寮�鑿滃崟銆�', required: true, options: [{ value: 'never', @@ -833,6 +861,25 @@ value: 'false', text: '涓嶉噸缃�' }] + }, + { + type: 'select', + key: 'nameField', + label: '浣嶇疆鍚嶅瓧娈�', + initVal: card.nameField || '', + tooltip: '鎵撳紑鍦板浘鏃跺彲灞曠ず浣嶇疆鍚嶄笌璇︾粏鍦板潃锛岃缁戝畾鏁版嵁婧愬瓧娈甸泦锛岀粡绾害璇蜂娇鐢╨atitude銆乴ongitude涓旂粡绾害涓嶅彲涓虹┖銆�', + required: false, + allowClear: true, + options: columns + }, + { + type: 'select', + key: 'addressField', + label: '鍦板潃瀛楁', + initVal: card.addressField || '', + required: false, + allowClear: true, + options: columns }, { type: 'radio', @@ -1013,6 +1060,47 @@ options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : [] }, { + type: 'cascader', + key: 'refreshTab', + label: '鍒锋柊鑿滃崟', + initVal: card.refreshTab || [], + tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', + required: false, + forbid: isApp || viewType === 'popview', + options: menulist + }, + { + type: !appType ? 'cascader' : 'select', + key: 'openmenu', + label: '鎵撳紑鑿滃崟', + tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧け璐ユ椂杩斿洖@open_target_menu@锛夐渶瑕佹墦寮�鐨勮彍鍗曘��', + initVal: card.openmenu || (!appType ? [] : ''), + help: appType === 'mob' || appType === 'pc' ? '鍙繑鍥炰笂涓�椤点��' : null, + extendName: 'MenuNo', + required: false, + allowClear: true, + options: appType === 'mob' || appType === 'pc' ? appMenus : menulist, + forbid: viewType === 'popview' + }, + { + type: 'cascader', + key: 'switchTab', + label: '鍒囨崲鏍囩', + initVal: card.switchTab || [], + tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸垏鎹㈢殑鏍囩椤点��' + (appType === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : ''), + required: false, + options: tabs + }, + { + type: 'cascader', + key: 'anchors', + label: '璺宠浆閿氱偣', + initVal: card.anchors || [], + tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佽烦杞殑閿氱偣銆�' + (appType === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : ''), + required: false, + options: anchors + }, + { type: 'radio', key: 'pagination', label: '鍒嗛〉', @@ -1042,47 +1130,6 @@ text: '闈炲繀濉�' }], forbid: appType === 'mob' - }, - { - type: 'cascader', - key: 'refreshTab', - label: '鍒锋柊鑿滃崟', - initVal: card.refreshTab || [], - tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', - required: false, - forbid: isApp || viewType === 'popview', - options: menulist - }, - { - type: !appType ? 'cascader' : 'select', - key: 'openmenu', - label: '鎵撳紑鑿滃崟', - tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��', - initVal: card.openmenu || (!appType ? [] : ''), - help: appType === 'mob' || appType === 'pc' ? '鍙繑鍥炰笂涓�椤点��' : null, - extendName: 'MenuNo', - required: false, - allowClear: true, - options: appType === 'mob' || appType === 'pc' ? appMenus : menulist, - forbid: viewType === 'popview' - }, - { - type: 'cascader', - key: 'switchTab', - label: '鍒囨崲鏍囩', - initVal: card.switchTab || [], - tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸垏鎹㈢殑鏍囩椤点��' + (appType === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : ''), - required: false, - options: tabs - }, - { - type: 'cascader', - key: 'anchors', - label: '璺宠浆閿氱偣', - initVal: card.anchors || [], - tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佽烦杞殑閿氱偣銆�' + (appType === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : ''), - required: false, - options: anchors }, { type: 'select', @@ -1129,10 +1176,7 @@ required: false, allowClear: true, forbid: position !== 'line', - options: columns.map(item => ({ - value: item.field, - text: `${item.label}锛�${item.field}锛塦 - })) + options: columns }, { type: 'radio', @@ -1349,10 +1393,7 @@ initVal: card.controlField || '', required: true, allowClear: true, - options: columns.map(item => ({ - value: item.field, - text: `${item.label}锛�${item.field}锛塦 - })) + options: columns }, { type: 'text', @@ -1764,6 +1805,24 @@ extraParam.push('dataM') } + let apps = [] + let merchs = [] + + if (window.GLOB.WXApps) { + window.GLOB.WXApps.forEach(item => { + if (item.appType === 'merchant') { + merchs.push({value: item.appId, text: item.appName}) + } else { + apps.push({value: item.appId, text: item.appName}) + } + }) + } + + let width = card.width || (card.width === 0 ? 0 : 12) + if (card.width && /x/.test(card.width)) { + width = +width.replace(/x/, '.5') + } + let forms = [ { type: 'select', @@ -1911,10 +1970,20 @@ key: 'wxApp', label: '鍏宠仈搴旂敤', initVal: card.wxApp || '', - tooltip: '璇峰叧鑱旀敮浠橈紙鎴栭��娆撅級鐨勫叕浼楀彿鎴栧皬绋嬪簭銆�', + tooltip: '璇峰叧鑱旀敮浠樼殑鍏紬鍙锋垨灏忕▼搴忋��', required: true, - forbid: !window.GLOB.WXApps, - options: window.GLOB.WXApps ? window.GLOB.WXApps.map(item => ({value: item.appId, text: item.appName})) : [] + forbid: apps.length === 0, + options: apps + }, + { + type: 'select', + key: 'wxMerch', + label: '鍏宠仈鍟嗘埛', + initVal: card.wxMerch || '', + tooltip: '璇峰叧鑱旀敮浠樼殑鍟嗘埛鍙枫��', + required: true, + forbid: merchs.length === 0, + options: merchs }, { type: 'text', @@ -2166,7 +2235,7 @@ key: 'execError', label: '澶辫触鍚�', initVal: card.execError || 'never', - tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳锛堝脊绐楁寜閽級涓缃叧闂悗鍒锋柊鍝竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級銆�' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂扮粍浠讹紱閫夋嫨鍒锋柊琛� / 缁勪欢鏃讹紝濡傛灉褰撳墠琛屾暟鎹笉瀛樺湪浼氬埛鏂扮粍浠躲�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級銆�', + tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳锛堝脊绐楁寜閽級涓缃叧闂悗鍒锋柊鍝竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級锛汙open_target_menu@ 鍙墽琛屾墦寮�鑿滃崟銆�' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂扮粍浠讹紱閫夋嫨鍒锋柊琛� / 缁勪欢鏃讹紝濡傛灉褰撳墠琛屾暟鎹笉瀛樺湪浼氬埛鏂扮粍浠躲�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭紙@retmsg锛夌壒娈婃爣璇嗭細@close_tab@ 鎵ц锛堝叧闂爣绛�-绠$悊绯荤粺锛夛紱@close_popup@ 鎵ц锛堝叧闂脊绐楋級锛汙goback@ 鎵ц锛堣繑鍥炰笂涓�椤�-瀛愬簲鐢級锛汙open_target_menu@ 鍙墽琛屾墦寮�鑿滃崟銆�', required: true, options: [{ value: 'never', @@ -2275,18 +2344,18 @@ tooltip: '鍒嗕韩鏃跺鐢ㄦ埛鐨勬彁绀轰俊鎭��', required: false }, - // { - // type: 'number', - // key: 'width', - // min: 1, - // max: 24, - // precision: 0, - // label: '瀹藉害', - // initVal: card.width || 12, - // tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', - // forbid: card.eleType !== 'button', - // required: true - // }, + { + type: 'number', + key: 'width', + min: 0, + max: 24, + precision: 1, + label: '瀹藉害', + initVal: width, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼�備负 0 鏃跺搴﹁嚜閫傚簲銆傚彲璁剧疆鍗婂垪鍗�.5銆�', + forbid: position !== 'line', + required: true + }, { type: 'radio', key: 'show', @@ -2355,6 +2424,28 @@ options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : [] }, { + type: 'cascader', + key: 'refreshTab', + label: '鍒锋柊鑿滃崟', + initVal: card.refreshTab || [], + tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', + required: false, + forbid: viewType === 'popview', + options: menulist + }, + { + type: 'cascader', + key: 'openmenu', + label: '鎵撳紑鑿滃崟', + tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧け璐ユ椂杩斿洖@open_target_menu@锛夐渶瑕佹墦寮�鐨勮彍鍗曘��', + initVal: card.openmenu || [], + extendName: 'MenuNo', + required: false, + allowClear: true, + options: menulist, + forbid: viewType === 'popview' + }, + { type: 'radio', key: 'pagination', label: '鍒嗛〉', @@ -2382,28 +2473,6 @@ value: 'false', text: '闈炲繀濉�' }] - }, - { - type: 'cascader', - key: 'refreshTab', - label: '鍒锋柊鑿滃崟', - initVal: card.refreshTab || [], - tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', - required: false, - forbid: viewType === 'popview', - options: menulist - }, - { - type: 'cascader', - key: 'openmenu', - label: '鎵撳紑鑿滃崟', - tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��', - initVal: card.openmenu || [], - extendName: 'MenuNo', - required: false, - allowClear: true, - options: menulist, - forbid: viewType === 'popview' }, { type: 'text', -- Gitblit v1.8.0