From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 十一月 2022 16:11:55 +0800 Subject: [PATCH] 2022-11-21 --- src/menu/components/card/cardcellcomponent/formconfig.jsx | 74 +++++++++++++------------------------ 1 files changed, 26 insertions(+), 48 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 02e8d29..0475028 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -1,9 +1,11 @@ +import MenuUtils from '@/utils/utils-custom.js' + /** * @description 鑾峰彇鍏冪礌閰嶇疆淇℃伅 * @param {*} card * @param {*} type */ -export function getCardCellForm (card, type, subtype, cardCell, anchors) { +export function getCardCellForm (card, cards, cardCell) { let _options = [ { value: 'text', text: '鏂囨湰'}, { value: 'number', text: '鏁板��'}, @@ -18,27 +20,22 @@ { value: 'formula', text: '鍏紡'}, ] - if (type === 'table' || (type === 'card' && subtype === 'datacard')) { + let anchors = [] + if (window.GLOB.customMenu.Template === 'BaseTable') { + anchors = null + } else { + anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || [] + } + + if (cards.type === 'table' || (cards.type === 'card' && cards.subtype === 'datacard')) { _options.push({value: 'sequence', text: '搴忓彿'}) } else if (card.eleType === 'sequence') { // 鎷栨嫿娣诲姞绫诲瀷杞崲 card.eleType = 'text' } - - let appMenus = [] - const isApp = sessionStorage.getItem('appType') === 'pc' - - if (isApp) { - appMenus = sessionStorage.getItem('appMenus') - if (appMenus) { - try { - appMenus = JSON.parse(appMenus) - } catch (e) { - appMenus = [] - } - } else { - appMenus = [] - } + if (card.eleType === 'icon' && card.datatype === 'dynamic' && !card.field) { // 鎷栨嫿娣诲姞绫诲瀷杞崲 + card.datatype = 'static' } + let appType = sessionStorage.getItem('appType') let tooltip = '' if (cardCell.$cardType === 'extendCard') { @@ -53,13 +50,6 @@ initVal: card.eleType, required: true, options: _options - }, - { - type: 'icon', - key: 'icon', - label: '鍥炬爣', - initVal: card.icon, - required: true }, { type: 'radio', @@ -80,6 +70,13 @@ initVal: card.field || '', required: true, options: [] + }, + { + type: 'icon', + key: 'icon', + label: '鍥炬爣', + initVal: card.icon, + required: true }, { type: 'text', @@ -225,7 +222,8 @@ key: 'tooltip', label: '鎻愮ず淇℃伅', initVal: card.tooltip || '', - tooltip: '榧犳爣鎮诞鏃舵樉绀恒��', + tooltip: '榧犳爣鎮诞鏃舵樉绀恒�傛敞锛氬浣跨敤鍔ㄦ�佷俊鎭紝璇峰湪姝ゅ濉啓鐩稿簲鐨勫瓧娈靛悕銆�', + forbid: appType === 'mob', required: false }, { @@ -364,7 +362,8 @@ initVal: card.anchors || [], tooltip: sessionStorage.getItem('appType') === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : '', required: false, - options: anchors + options: anchors, + forbid: !anchors }, { type: 'number', @@ -500,27 +499,6 @@ }, { type: 'select', - key: 'linkmenu', - label: '鍏宠仈鑿滃崟', - initVal: card.linkmenu || '', - required: true, - forbid: !isApp, - options: appMenus - }, - // { - // type: 'radio', - // key: 'open', - // label: '鎵撳紑鏂瑰紡', - // initVal: card.open || 'blank', - // required: false, - // forbid: !isApp, - // options: [ - // { value: 'blank', text: '鏂伴〉闈�' }, - // { value: 'self', text: '褰撳墠椤甸潰' } - // ] - // }, - { - type: 'select', key: 'linkurl', label: '閾炬帴鍦板潃', initVal: card.linkurl || '', @@ -570,7 +548,7 @@ key: 'noValue', label: '绌哄��', initVal: card.noValue || 'show', - tooltip: '褰撳厓绱犲唴瀹逛负绌烘椂锛屾槸鍚︽樉绀哄綋鍓嶅厓绱犮��', + tooltip: '褰撳厓绱犲唴瀹逛负绌烘椂锛屾槸鍚︽樉绀哄綋鍓嶅厓绱犮�傛敞锛氭暟鍊肩被鍨嬪厓绱犲寘鎷暟瀛�0锛堥潪鏂囨湰锛夈��', required: false, options: [ { value: 'show', text: '鏄剧ず' }, -- Gitblit v1.8.0