From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 14 六月 2023 09:55:50 +0800 Subject: [PATCH] 2023-06-14 --- src/menu/components/card/cardcellcomponent/formconfig.jsx | 175 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 144 insertions(+), 31 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 859dc58..76dc518 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -43,6 +43,71 @@ tooltip = '鍦ㄦ墿灞曞崱鐗囦腑锛屽姩鎬佹暟鎹樉绀哄�间负鑾峰彇鍒扮殑绗竴琛屾暟鎹��' } + let isHeader = false + if (cardCell.$cardType === 'extendCard' && cardCell.setting.cardRole === 'header') { + isHeader = true + anchors = null + card.link = '' + _options = [{ value: 'text', text: '鏂囨湰'}] + } + + let width = card.width || 12 + if (/x/.test(card.width)) { + width = +width.replace(/x/, '.5') + } + + let linkTypes = [ + { value: 'tel', text: '鐢佃瘽' }, + { value: 'email', text: '閭' }, + { value: 'other', text: '鍏朵粬' } + ] + + if (appType === 'mob') { + linkTypes = [ + { value: 'tel', text: '鐢佃瘽' }, + { value: 'email', text: '閭' }, + { value: 'qywx', text: '浼佷笟寰俊' }, + { value: 'linkmenu', text: '鍏宠仈鑿滃崟' }, + { value: 'other', text: '鍏朵粬' } + ] + } else if (appType === 'pc') { + linkTypes = [ + { value: 'tel', text: '鐢佃瘽' }, + { value: 'email', text: '閭' }, + { value: 'linkmenu', text: '鍏宠仈鑿滃崟' }, + { value: 'other', text: '鍏朵粬' } + ] + } + + if (card.linkType === 'qywx') { + if (appType !== 'mob') { + card.link = '' + card.linkType = '' + card.linkurl = '' + } + } else if (card.linkType === 'linkmenu') { + if (appType !== 'mob' && appType !== 'pc') { + card.link = '' + card.linkType = '' + card.linkurl = '' + card.linkmenu = '' + } + } + + let appMenus = sessionStorage.getItem('appMenus') + if (['pc', 'mob'].includes(appType)) { + if (appMenus) { + try { + appMenus = JSON.parse(appMenus) + } catch (e) { + appMenus = [] + } + } else { + appMenus = [] + } + appMenus.push({value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'}) + } + let forms = [ { type: 'select', @@ -85,7 +150,7 @@ min: 0, label: '鍐呭', initVal: card.value || '', - tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂mk_city@銆丂appname@銆丂bid@銆�', + tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂mk_city@銆丂appname@銆丂bid@銆丂month@銆丂week@銆丂day@', required: true }, { @@ -156,6 +221,21 @@ required: true }, { + type: 'radio', + key: 'eval', + label: '瑙f瀽', + initVal: card.eval || 'false', + tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', + required: false, + options: [{ + value: 'true', + text: '鏄�' + }, { + value: 'false', + text: '鍚�' + }] + }, + { type: 'number', key: 'decimal', min: 0, @@ -188,7 +268,8 @@ { value: 'MM鏈圖D鏃� ahh:mm', text: '鑷畾涔�2锛堜緥锛�12鏈�17鏃� 涓婂崍10:57锛�' }, { value: 'calendar1', text: '鑷畾涔�3锛堜緥锛氫粖澶� 涓婂崍10:57锛�' }, { value: 'calendar2', text: '鑷畾涔�4锛堜緥锛氬垰鍒氥�佹槰澶┿��5澶╁墠锛�' }, - ] + ], + forbid: isHeader }, { type: 'select', @@ -328,12 +409,12 @@ { type: 'number', key: 'width', - min: 1, + min: 0.5, max: 24, - precision: 0, + precision: 1, label: '鍏冪礌瀹藉害', - initVal: card.width || 12, - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + initVal: width, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鍙缃崐鍒楀嵆.5銆�', required: true }, { @@ -354,7 +435,8 @@ tooltip: '缁戝畾鏁版嵁婧愬瓧娈碉紝鍙牴鎹繑鍥炲�兼敼鍙樿儗鏅浘銆�', required: false, allowClear: true, - options: [] + options: [], + forbid: isHeader }, { type: 'cascader', @@ -485,19 +567,16 @@ { value: '', text: '鏃�' }, { value: 'dynamic', text: '鍔ㄦ��' }, { value: 'static', text: '闈欐��' } - ] + ], + forbid: isHeader }, { - type: 'radio', + type: linkTypes.length > 4 ? 'select' : 'radio', key: 'linkType', label: '閾炬帴绫诲瀷', initVal: card.linkType || 'other', required: false, - options: [ - { value: 'tel', text: '鐢佃瘽' }, - { value: 'email', text: '閭' }, - { value: 'other', text: '鍏朵粬' } - ] + options: linkTypes }, { type: 'radio', @@ -512,32 +591,40 @@ }, { type: 'select', + key: 'linkmenu', + label: '鍏宠仈鑿滃崟', + initVal: card.linkmenu || '', + required: true, + options: appMenus || [], + forbid: !['pc', 'mob'].includes(appType) + }, + { + type: 'select', key: 'linkurl', label: '閾炬帴鍦板潃', initVal: card.linkurl || '', + tooltip: ['pc', 'mob'].includes(appType) ? '褰撻摼鎺ョ被鍨嬩负鈥滃叾浠栤�濓紝涓旈摼鎺ュ湴鍧�浠menuid@寮�澶存椂锛屽叾鍚庡唴瀹瑰皢琚涓鸿彍鍗旾D銆�' : '', required: true, options: [] + }, + { + type: 'radio', + key: 'open', + label: '鎵撳紑鏂瑰紡', + initVal: card.open || 'blank', + tooltip: '鑿滃崟鎵撳紑鏂瑰紡锛岄摼鎺ユ棤鏁堛��', + required: true, + forbid: !['pc', 'mob'].includes(appType), + options: [ + {value: 'blank', text: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'}, + {value: 'self', text: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'}, + ] }, { type: 'radio', key: 'joint', label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', - required: false, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'eval', - label: '瑙f瀽', - initVal: card.eval || 'true', - tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', required: false, options: [{ value: 'true', @@ -570,6 +657,20 @@ }, { type: 'radio', + key: 'alignItems', + label: '鍨傜洿瀵归綈', + initVal: card.alignItems || '', + tooltip: '鍨傜洿鏂瑰悜鐨勫榻愭柟寮忋�傛敞锛氶珮搴︼紙琛岋級澶т簬1鏃舵湁鏁堛��', + required: false, + options: [ + { value: '', text: '灞呬笂' }, + { value: 'center', text: '灞呬腑' }, + { value: 'end', text: '灞呬笅' } + ], + forbid: isHeader + }, + { + type: 'radio', key: 'fixStyle', label: '鍓嶅悗缂�', initVal: card.fixStyle || '', @@ -578,7 +679,8 @@ options: [ { value: '', text: '缁熶竴鏍峰紡' }, { value: 'alone', text: '鐙珛鏍峰紡' } - ] + ], + forbid: isHeader }, { type: 'radio', @@ -590,7 +692,8 @@ options: [ { value: 'true', text: '鏄�' }, { value: 'false', text: '鍚�' } - ] + ], + forbid: isHeader }, { type: 'number', @@ -630,6 +733,16 @@ tooltip: '鍓嶇紑銆佸悗缂�鐨勫彸杈硅窛銆�', required: false }, + { + type: 'select', + key: 'sortField', + label: '鎺掑簭瀛楁', + initVal: card.sortField || '', + required: false, + allowClear: true, + options: [], + forbid: !isHeader + }, ] return forms -- Gitblit v1.8.0