From a9b02f6862522b54d0824152017bf2acfec2af7b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 三月 2024 10:29:50 +0800 Subject: [PATCH] 2024-03-21 --- src/menu/components/card/cardcellcomponent/formconfig.jsx | 92 ++++++++++++++++++++++++++++++++++++--------- 1 files changed, 73 insertions(+), 19 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 603aeaf..41265db 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -6,12 +6,14 @@ * @param {*} type */ export function getCardCellForm (card, cards, cardCell) { + let appType = sessionStorage.getItem('appType') + let _options = [ { value: 'text', text: '鏂囨湰'}, { value: 'number', text: '鏁板��'}, { value: 'picture', text: '鍥剧墖'}, { value: 'video', text: '瑙嗛'}, - { value: 'icon', text: '鍥炬爣'}, + { value: 'icon', text: '鎻愮ず锛堝浘鏍囷級'}, { value: 'slider', text: '杩涘害鏉�'}, { value: 'splitline', text: '鍒嗗壊绾�'}, { value: 'barcode', text: '鏉″舰鐮�'}, @@ -36,7 +38,6 @@ if (card.eleType === 'icon' && card.datatype === 'dynamic' && !card.field) { // 鎷栨嫿娣诲姞绫诲瀷杞崲 card.datatype = 'static' } - let appType = sessionStorage.getItem('appType') let tooltip = '' if (cardCell.$cardType === 'extendCard') { @@ -59,6 +60,8 @@ let linkTypes = [ { value: 'tel', text: '鐢佃瘽' }, { value: 'email', text: '閭' }, + { value: 'linkmenu', text: '鍏宠仈鑿滃崟' }, + { value: 'download', text: '涓嬭浇' }, { value: 'other', text: '鍏朵粬' } ] @@ -68,6 +71,7 @@ { value: 'email', text: '閭' }, { value: 'qywx', text: '浼佷笟寰俊' }, { value: 'linkmenu', text: '鍏宠仈鑿滃崟' }, + { value: 'download', text: '涓嬭浇' }, { value: 'other', text: '鍏朵粬' } ] } else if (appType === 'pc') { @@ -75,6 +79,7 @@ { value: 'tel', text: '鐢佃瘽' }, { value: 'email', text: '閭' }, { value: 'linkmenu', text: '鍏宠仈鑿滃崟' }, + { value: 'download', text: '涓嬭浇' }, { value: 'other', text: '鍏朵粬' } ] } @@ -85,13 +90,25 @@ card.linkType = '' card.linkurl = '' } - } else if (card.linkType === 'linkmenu') { - if (appType !== 'mob' && appType !== 'pc') { - card.link = '' - card.linkType = '' - card.linkurl = '' - card.linkmenu = '' + // } else if (card.linkType === 'linkmenu') { + // if (appType !== 'mob' && appType !== 'pc') { + // card.link = '' + // card.linkType = '' + // card.linkurl = '' + // card.linkmenu = '' + // } + } + + let menulist = sessionStorage.getItem('fstMenuList') + + if (appType === '' && menulist) { + try { + menulist = JSON.parse(menulist) + } catch (e) { + menulist = [] } + } else { + menulist = [] } let appMenus = sessionStorage.getItem('appMenus') @@ -127,6 +144,17 @@ options: [ { value: 'dynamic', text: '鍔ㄦ��' }, { value: 'static', text: '闈欐��' } + ] + }, + { + type: 'radio', + key: 'tipType', + label: '鎻愮ず鍐呭', + initVal: card.tipType || 'icon', + required: false, + options: [ + { value: 'icon', text: '鍥炬爣' }, + { value: 'text', text: '鏂囨湰' } ] }, { @@ -223,16 +251,19 @@ { type: 'radio', key: 'eval', - label: '瑙f瀽', + label: '瑙f瀽鏂瑰紡', initVal: card.eval || 'false', - tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', + tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滆绠椻�濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃瓧娈垫浛鎹⑩�濓紝浣跨敤鍑芥暟鏃跺叆鍙備负data锛堟暟缁勶級銆�', required: false, options: [{ - value: 'true', - text: '鏄�' - }, { value: 'false', - text: '鍚�' + text: '瀛楁鏇挎崲' + }, { + value: 'true', + text: '璁$畻' + }, { + value: 'func', + text: '鍑芥暟' }] }, { @@ -283,6 +314,7 @@ { value: 'YYYY-MM', text: 'YYYY-MM' }, { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' }, { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' }, + { value: 'YYYY骞碝M鏈圖D鏃�', text: 'YYYY骞碝M鏈圖D鏃�' }, ] }, { @@ -561,7 +593,7 @@ key: 'link', label: '閾炬帴', initVal: card.link || '', - tooltip: '鍔ㄦ�佸湴鍧�涓虹粦瀹氬瓧娈靛�笺��', + tooltip: '鍔ㄦ�佸湴鍧�涓虹粦瀹氬瓧娈靛�笺�備娇鐢� 鍔ㄦ��-鍏宠仈鑿滃崟 鏃讹紝璇峰湪鈥滈摼鎺ュ湴鍧�鈥濆瓧娈佃繑鍥炶彍鍗旾D銆�', required: false, options: [ { value: '', text: '鏃�' }, @@ -571,7 +603,7 @@ forbid: isHeader }, { - type: linkTypes.length > 4 ? 'select' : 'radio', + type: 'select', key: 'linkType', label: '閾炬帴绫诲瀷', initVal: card.linkType || 'other', @@ -599,10 +631,20 @@ forbid: !['pc', 'mob'].includes(appType) }, { + type: 'cascader', + key: 'linkmenu', + label: '鍏宠仈鑿滃崟', + initVal: card.linkmenu || [], + required: true, + options: menulist, + forbid: ['pc', 'mob'].includes(appType) + }, + { type: 'select', key: 'linkurl', label: '閾炬帴鍦板潃', initVal: card.linkurl || '', + tooltip: ['pc', 'mob'].includes(appType) ? '褰撻摼鎺ョ被鍨嬩负鈥滃叾浠栤�濓紝涓旈摼鎺ュ湴鍧�浠menuid@寮�澶存椂锛屽叾鍚庡唴瀹瑰皢琚涓鸿彍鍗旾D銆�' : '', required: true, options: [] }, @@ -611,7 +653,7 @@ key: 'open', label: '鎵撳紑鏂瑰紡', initVal: card.open || 'blank', - tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆�', + tooltip: '鑿滃崟鎵撳紑鏂瑰紡锛岄摼鎺ユ棤鏁堛��', required: true, forbid: !['pc', 'mob'].includes(appType), options: [ @@ -634,11 +676,11 @@ }] }, { - type: 'textarea', + type: 'codemirror', key: 'formula', label: '鍏紡', initVal: card.formula || '', - tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋滐紝鍦ㄤ笉浣跨敤瑙f瀽鏃舵崲琛岀鎴栫┖鏍间細鏇挎崲涓洪〉闈㈠厓绱犮�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛�', + tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋滐紝鍦ㄤ笉浣跨敤瑙f瀽鏃舵崲琛岀鎴栫┖鏍间細鏇挎崲涓洪〉闈㈠厓绱犮�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛夈�傛敞锛氫細鏇挎崲鍏紡涓殑@username@銆丂fullName@銆丂bid@銆�', placeholder: '渚嬪锛欯price@ * @number@', required: true }, @@ -656,6 +698,18 @@ }, { type: 'radio', + key: 'lostTip', + label: '鍥剧墖缂哄け', + initVal: card.lostTip || 'true', + tooltip: '鍥剧墖鍦板潃涓嶅瓨鍦ㄦ椂锛屾槸鍚︽彁绀哄浘鐗囦涪澶便��', + required: false, + options: [ + { value: 'true', text: '鎻愮ず' }, + { value: 'false', text: '涓嶆彁绀�' } + ] + }, + { + type: 'radio', key: 'alignItems', label: '鍨傜洿瀵归綈', initVal: card.alignItems || '', -- Gitblit v1.8.0