From b6cbfb08b51e87e6eac995be8e7751815715e6a1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 29 三月 2022 15:36:21 +0800 Subject: [PATCH] 2022-03-29 --- src/menu/components/card/data-card/options.jsx | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 206 insertions(+), 17 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 84ef971..67d8f47 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -1,12 +1,20 @@ +import { fromJS } from 'immutable' +import MenuUtils from '@/utils/utils-custom.js' + /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, subtype) { +export default function (wrap, subtype, columns = [], id = '', supNodes = []) { let appType = sessionStorage.getItem('appType') let MenuType = '' + let menu = fromJS(window.GLOB.customMenu).toJS() - if (window.GLOB.customMenu.parentId === 'BillPrintTemp') { + if (menu.parentId === 'BillPrintTemp') { MenuType = 'billPrint' + } + let modules = [] + if (subtype === 'propcard' || subtype === 'datacard') { + modules = MenuUtils.getSupModules(menu.components, id) || [] } let roleList = sessionStorage.getItem('sysRoles') @@ -14,7 +22,7 @@ if (roleList) { try { roleList = JSON.parse(roleList) - } catch { + } catch (e) { roleList = [] } } else { @@ -56,8 +64,14 @@ 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: 'empty', values: ['dynamic']}, + {field: 'supModule', values: ['static']}, ], forbid: subtype !== 'propcard' }, @@ -66,7 +80,7 @@ field: 'pagestyle', label: '鍒嗛〉椋庢牸', initval: wrap.pagestyle || 'page', - tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛��', + tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛�傛敞锛氭粦鍔ㄥ姞杞藉彧鏈夌涓�涓湁鏁�', required: false, options: [ {value: 'page', label: '椤电爜'}, @@ -84,25 +98,72 @@ options: [ {value: '', label: '涓嶅彲閫�'}, {value: 'radio', label: '鍗曢��'}, - {value: 'checkbox', label: '澶氶��', forbid: subtype === 'propcard'}, + {value: 'checkbox', label: '澶氶��', disabled: subtype === 'propcard'}, ], controlFields: [ - {field: 'checkAll', values: ['checkbox']} + {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: 'checkAll', - label: '鍏ㄩ��', - initval: wrap.checkAll || 'hidden', + 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', + field: 'selected', + label: '棣栬閫変腑', + initval: wrap.selected || 'false', required: false, options: [ - {value: 'hidden', label: '闅愯棌'}, - {value: 'show', label: '鏄剧ず'}, - ], - forbid: subtype !== 'datacard' || appType !== 'mob' + {value: 'false', label: '鏃�'}, + {value: 'init', label: '鍒濆鍖�'}, + {value: 'always', label: '鏁版嵁鍔犺浇'}, + ] }, + { + 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: '鏂囧瓧'}, + ...(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: 'cardFloat', @@ -144,17 +205,145 @@ forbid: subtype !== 'propcard' || MenuType !== 'billPrint' }, { + type: 'select', + field: 'broadcast', + label: '璇煶鎾姤', + initval: wrap.broadcast || '', + tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧapp涓湁鏁堛�傛敞锛氫娇鐢ㄨ闊虫挱鎶ユ椂锛屾暟鎹簮涓嶈浣跨敤鍚屾鏌ヨ锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', + required: false, + options: columns, + forbid: !columns || appType !== 'mob' || subtype !== 'propcard' + }, + { + type: 'radio', + field: 'goback', + label: '绌哄�艰繑鍥�', + initval: wrap.goback || 'false', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岃繑鍥炰笂涓�鐣岄潰銆�', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + skip: true, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { + 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: '涓婄骇缁勪欢', + initval: wrap.supModule || [], + required: false, + options: modules, + allowClear: true, + 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: '榛戝悕鍗�', initval: wrap.blacklist || [], required: false, - options: roleList + 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 => { - if (['pagestyle', 'cardType'].includes(item.field)) { + if (['pagestyle'].includes(item.field)) { item.options = item.options.filter(option => !option.forbid) } -- Gitblit v1.8.0