From 8a1ee7d651500f848a3c2f05c7fe3be2b7114a43 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 10 四月 2024 00:47:56 +0800 Subject: [PATCH] 2024-04-10 --- src/menu/components/card/cardcellcomponent/formconfig.jsx | 30 ++++++++++++++++++++++-------- 1 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 7599bad..61c27e7 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -127,6 +127,18 @@ appMenus.push({value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'}) } + let fields = [] + if (cards.subtype === 'propcard' && cards.wrap.datatype === 'static') { + if (cards.wrap.supModule && cards.wrap.supModule.length) { + let cell = MenuUtils.getComponent(cards.wrap.supModule[cards.wrap.supModule.length - 1]) + if (cell && cell.columns) { + fields = cell.columns.map(col => ({ value: col.field })) + } + } else { + fields = cards.columns.map(col => ({ value: col.field })) + } + } + let forms = [ { type: 'select', @@ -160,12 +172,12 @@ ] }, { - type: 'select', + type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', key: 'field', label: '瀛楁', initVal: card.field || '', required: true, - options: [] + options: fields }, { type: 'icon', @@ -244,11 +256,12 @@ required: true }, { - type: 'select', + type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', key: 'posterField', label: '棰勮鍦板潃', initVal: card.posterField || '', - required: true + required: true, + options: fields }, { type: 'radio', @@ -462,14 +475,14 @@ required: false }, { - type: 'select', + type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', key: 'bgImage', label: '鍔ㄦ�佽儗鏅�', initVal: card.bgImage || '', tooltip: '缁戝畾鏁版嵁婧愬瓧娈碉紝鍙牴鎹繑鍥炲�兼敼鍙樿儗鏅浘銆�', required: false, allowClear: true, - options: [], + options: fields, forbid: isHeader }, { @@ -642,13 +655,14 @@ forbid: ['pc', 'mob'].includes(appType) }, { - type: 'select', + type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', + defType: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', key: 'linkurl', label: '閾炬帴鍦板潃', initVal: card.linkurl || '', tooltip: ['pc', 'mob'].includes(appType) ? '褰撻摼鎺ョ被鍨嬩负鈥滃叾浠栤�濓紝涓旈摼鎺ュ湴鍧�浠menuid@寮�澶存椂锛屽叾鍚庡唴瀹瑰皢琚涓鸿彍鍗旾D銆�' : '', required: true, - options: [] + options: fields }, { type: 'radio', -- Gitblit v1.8.0