From 46f79b491173d284a4900d19e7aecf7509481438 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 一月 2022 17:21:25 +0800 Subject: [PATCH] 2022-01-21 --- src/menu/components/card/data-card/options.jsx | 154 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 134 insertions(+), 20 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index b449ed9..33b8ebc 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) || [] } @@ -64,9 +64,10 @@ tooltip: '閫夋嫨闈欐�佸�硷紝鏃犻渶閰嶇疆鏁版嵁婧愩��', required: false, options: [ - {value: 'dynamic', label: '鍔ㄦ��'}, - {value: 'static', label: '闈欐��'}, + {value: 'dynamic', label: '鍔ㄦ��', priKeyType: 'static'}, + {value: 'static', label: '闈欐��', priKeyType: 'static'}, ], + linkFields: ['priKeyType'], controlFields: [ {field: 'goback', values: ['dynamic']}, {field: 'supModule', values: ['static']}, @@ -102,8 +103,25 @@ {field: 'checkAll', values: ['checkbox']}, {field: 'selected', values: ['radio', 'checkbox']}, {field: 'selStyle', values: ['radio', 'checkbox']}, + // {field: 'priKeyType', values: ['radio', 'checkbox']}, ], forbid: subtype === 'tablecard' + }, + { + type: 'radio', + field: 'priKeyType', + label: '涓婚敭', + initval: wrap.priKeyType || 'static', + tooltip: '鎷兼帴鍊间负鍔ㄦ�佷富閿笌鐢ㄦ埛鑷畾涔夌殑闈欐�佷富閿娇鐢ㄩ�楀彿鎷兼帴銆�', + required: false, + linkField: 'datatype', + options: [ + {ParentID: 'static', value: 'static', label: '闈欐�佸��'}, + {ParentID: 'dynamic', value: 'static', label: '闈欐�佸��'}, + {ParentID: 'dynamic', value: 'dynamic', label: '鍔ㄦ�佸��'}, + {ParentID: 'dynamic', value: 'joint', label: '鎷兼帴鍊�'}, + ], + forbid: subtype !== 'propcard' }, { type: 'radio', @@ -114,35 +132,37 @@ options: [ {value: 'false', label: '鏃�'}, {value: 'init', label: '鍒濆鍖�'}, - {value: 'always', label: '鏁版嵁鍔犺浇', disabled: subtype === 'propcard'}, + {value: 'always', label: '鏁版嵁鍔犺浇'}, ] }, { - type: 'radio', + type: 'select', field: 'selStyle', label: '閫変腑椋庢牸', initval: wrap.selStyle || 'active', tooltip: '瀛樺湪杈规鏃讹紝杈规浼氫娇鐢ㄧ郴缁熻壊銆�', required: false, options: [ + {value: 'none', label: '鏃�'}, {value: 'active', label: '澶栭槾褰�'}, {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'}, {value: 'font', label: '鏂囧瓧'}, - ], - forbid: subtype !== 'propcard' + ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '鍕鹃��'}] : []) + ] + // forbid: subtype !== 'propcard' }, - { - type: 'radio', - field: 'checkAll', - label: '鍏ㄩ��', - initval: wrap.checkAll || 'hidden', - required: false, - options: [ - {value: 'hidden', label: '闅愯棌'}, - {value: 'show', label: '鏄剧ず'}, - ], - forbid: subtype !== 'datacard' || appType !== 'mob' - }, + // { + // type: 'radio', + // field: 'checkAll', + // label: '鍏ㄩ��', + // initval: wrap.checkAll || 'hidden', + // required: false, + // options: [ + // {value: 'hidden', label: '闅愯棌'}, + // {value: 'show', label: '鏄剧ず'}, + // ], + // forbid: subtype !== 'datacard' || appType !== 'mob' + // }, { type: 'radio', field: 'cardFloat', @@ -207,6 +227,32 @@ forbid: subtype !== 'propcard' || appType !== 'mob' }, { + type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + forbid: subtype !== 'datacard' + }, + { + type: 'radio', + field: 'supKey', + label: '涓婄骇涓婚敭', + initval: wrap.supKey || 'true', + tooltip: '褰撹缃笂绾х粍浠舵椂锛屼笂绾т富閿�间负绌烘槸鍚﹁繘琛屾暟鎹煡璇€��', + required: false, + options: [ + {value: 'true', label: '楠岃瘉'}, + {value: 'false', label: '蹇界暐'}, + ], + forbid: subtype !== 'datacard' + }, + { type: 'cascader', field: 'supModule', label: '涓婄骇缁勪欢', @@ -217,6 +263,45 @@ forbid: subtype !== 'propcard' }, { + type: 'select', + field: 'controlField', + label: '绂佺敤瀛楁', + initval: wrap.controlField || '', + tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�', + required: false, + allowClear: true, + options: columns, + controlFields: [ + {field: 'controlVal', notNull: true}, + ], + forbid: subtype !== 'datacard' + }, + { + type: 'text', + field: 'controlVal', + label: '鎺у埗鍊�', + initval: wrap.controlVal || '', + tooltip: '褰撳瓧娈靛�间笌鎺у埗鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + required: false, + 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: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', @@ -225,6 +310,35 @@ 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 => { -- Gitblit v1.8.0