From 9e716f3bd30820a08757845b592db73363faa48c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 25 四月 2022 14:53:37 +0800 Subject: [PATCH] 2022-04-25 --- src/menu/components/card/data-card/options.jsx | 202 +++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 183 insertions(+), 19 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 6288dce..9e8f1b5 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -4,7 +4,7 @@ /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, subtype, columns = [], id = '') { +export default function (wrap, subtype, columns = [], id = '', supNodes = []) { let appType = sessionStorage.getItem('appType') let MenuType = '' let menu = fromJS(window.GLOB.customMenu).toJS() @@ -13,7 +13,7 @@ MenuType = 'billPrint' } let modules = [] - if (subtype === 'propcard') { + if (subtype === 'propcard' || subtype === 'datacard') { modules = MenuUtils.getSupModules(menu.components, id) || [] } @@ -27,6 +27,21 @@ } } else { roleList = [] + } + + let menulist = [] + + if (appType === 'mob') { + menulist = sessionStorage.getItem('appMenus') + if (menulist) { + try { + menulist = JSON.parse(menulist) + } catch (e) { + menulist = [] + } + } else { + menulist = [] + } } const cardWrapForm = [ @@ -70,9 +85,27 @@ linkFields: ['priKeyType'], controlFields: [ {field: 'goback', values: ['dynamic']}, + {field: 'empty', values: ['dynamic']}, + {field: 'jump', values: ['dynamic']}, {field: 'supModule', values: ['static']}, ], forbid: subtype !== 'propcard' + }, + { + type: 'radio', + field: 'layout', + label: '鍗$墖甯冨眬', + initval: wrap.layout || 'grid', + tooltip: appType === 'mob' ? '寮规�у竷灞�鏃讹紝婊戝姩鍔犺浇鏃犳晥' : '寮规�у竷灞�鏃讹紝宸﹀彸鍒囨崲鏃犳晥', + required: false, + options: [ + {value: 'grid', label: '鏍呮牸甯冨眬'}, + {value: 'flex', label: '寮规�у竷灞�'}, + ], + controlFields: subtype !== 'propcard' ? [ + {field: 'printHeight', values: ['flex']}, + ] : [], + forbid: subtype === 'tablecard' }, { type: 'radio', @@ -103,7 +136,7 @@ {field: 'checkAll', values: ['checkbox']}, {field: 'selected', values: ['radio', 'checkbox']}, {field: 'selStyle', values: ['radio', 'checkbox']}, - {field: 'priKeyType', values: ['radio', 'checkbox']}, + // {field: 'priKeyType', values: ['radio', 'checkbox']}, ], forbid: subtype === 'tablecard' }, @@ -128,24 +161,12 @@ field: 'selected', label: '棣栬閫変腑', initval: wrap.selected || 'false', + tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�', required: false, options: [ {value: 'false', label: '鏃�'}, {value: 'init', label: '鍒濆鍖�'}, {value: 'always', label: '鏁版嵁鍔犺浇'}, - ] - }, - { - type: 'radio', - field: 'supType', - label: '涓婄骇绫诲瀷', - initval: wrap.supType || 'single', - tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', - required: false, - forbid: subtype !== 'datacard' || appType === 'mob', - options: [ - {value: 'single', label: '鍗曠粍浠�'}, - {value: 'multi', label: '澶氱粍浠�'}, ] }, { @@ -214,7 +235,19 @@ {value: 'content', label: '鍐呭'}, {value: 'headerOrfooter', label: '椤电湁/椤佃剼'}, ], + controlFields: [ + {field: 'printHeight', values: ['content']}, + ], forbid: subtype !== 'propcard' || MenuType !== 'billPrint' + }, + { + type: 'number', + field: 'printHeight', + label: '鎹㈢畻楂樺害', + initval: wrap.printHeight || '', + tooltip: subtype !== 'propcard' ? '褰撳墠鏁版嵁鍗¢珮搴︾浉褰撲簬鍑犳潯鏁版嵁銆�' : '褰撳墠灞炴�у崱楂樺害鐩稿綋浜庡嚑鏉℃暟鎹��', + required: false, + forbid: subtype === 'tablecard' || MenuType !== 'billPrint' }, { type: 'select', @@ -224,7 +257,7 @@ tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧapp涓湁鏁堛�傛敞锛氫娇鐢ㄨ闊虫挱鎶ユ椂锛屾暟鎹簮涓嶈浣跨敤鍚屾鏌ヨ锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', required: false, options: columns, - forbid: !columns || appType !== 'mob' + forbid: !columns || appType !== 'mob' || subtype !== 'propcard' }, { type: 'radio', @@ -246,9 +279,83 @@ initval: wrap.empty || 'show', tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', required: false, + skip: true, options: [ {value: 'show', label: '鍚�'}, {value: 'hidden', label: '鏄�'}, + ], + }, + { + type: 'radio', + field: 'jump', + label: '椤甸潰璺宠浆', + initval: wrap.jump || '', + tooltip: '閫氳繃鏌ヨ杩斿洖鍊煎垽鏂〉闈㈡槸鍚﹁璺宠浆銆�', + required: false, + options: [ + {value: '', label: '鏃�'}, + {value: 'menu', label: '鑿滃崟'}, + {value: 'link', label: '閾炬帴'}, + ], + controlFields: [ + {field: 'jumpField', values: ['menu', 'link']}, + {field: 'joint', values: ['menu', 'link']}, + {field: 'menu', values: ['menu']}, + {field: 'link', values: ['link']}, + ], + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'select', + field: 'jumpField', + label: '鎺у埗瀛楁', + initval: wrap.jumpField || '', + tooltip: '褰撳瓧娈靛�间负true鏃�', + required: true, + options: columns, + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'select', + field: 'menu', + label: '鑿滃崟', + initval: wrap.menu || '', + required: true, + options: menulist, + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'select', + field: 'link', + label: '閾炬帴瀛楁', + initval: wrap.link || '', + tooltip: '璺宠浆閾炬帴涓烘煡璇㈡暟鎹殑杩斿洖鍊笺��', + required: true, + options: columns, + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'radio', + field: 'joint', + label: '鍙傛暟鎷兼帴', + initval: wrap.joint || 'true', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'radio', + field: 'supKey', + label: '涓婄骇涓婚敭', + initval: wrap.supKey || 'true', + tooltip: '褰撹缃笂绾х粍浠舵椂锛屼笂绾т富閿�间负绌烘槸鍚﹁繘琛屾暟鎹煡璇€��', + required: false, + options: [ + {value: 'true', label: '楠岃瘉'}, + {value: 'false', label: '蹇界暐'}, ], forbid: subtype !== 'datacard' }, @@ -286,6 +393,34 @@ forbid: subtype !== 'datacard' }, { + type: 'radio', + field: 'supType', + label: '涓婄骇绫诲瀷', + initval: wrap.supType || 'single', + tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', + required: false, + forbid: subtype !== 'datacard' || appType === 'mob', + options: [ + {value: 'single', label: '鍗曠粍浠�'}, + {value: 'multi', label: '澶氱粍浠�'}, + ], + controlFields: [ + {field: 'supNodes', values: ['multi']}, + ] + }, + { + type: 'radio', + field: 'permission', + label: '鏉冮檺楠岃瘉', + initval: wrap.permission || 'false', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ], + forbid: !appType + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', @@ -294,13 +429,42 @@ options: roleList, forbid: !!appType }, + { + type: 'table', + field: 'supNodes', + label: '涓婄骇缁勪欢', + initval: supNodes, + required: true, + forbid: subtype !== 'datacard' || appType === 'mob', + span: 24, + columns: [ + { + title: '搴忓彿', + dataIndex: '$index', + editable: false, + required: false, + width: '20%' + }, + { + title: '鑿滃崟', + dataIndex: 'nodes', + inputType: 'cascader', + editable: true, + required: true, + extends: [{key: 'label', value: 'label'}], + width: '50%', + render: (text, record) => record.label, + options: modules + } + ] + } ] - return cardWrapForm.map(item => { + return cardWrapForm.filter(item => { if (['pagestyle'].includes(item.field)) { item.options = item.options.filter(option => !option.forbid) } - return item + return !item.forbid }) } \ No newline at end of file -- Gitblit v1.8.0