From 9ee3d1f9a09a865188baffdffb85f6ad329c7b09 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 19 十二月 2021 01:09:20 +0800 Subject: [PATCH] 2021-12-19 --- src/menu/components/card/data-card/options.jsx | 106 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 93 insertions(+), 13 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 6f8db7b..1614f78 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, columns) { +export default function (wrap, subtype, columns, id) { 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') { + modules = MenuUtils.getSupModules(menu.components, id) || [] } let roleList = sessionStorage.getItem('sysRoles') @@ -59,6 +67,10 @@ {value: 'dynamic', label: '鍔ㄦ��'}, {value: 'static', label: '闈欐��'}, ], + controlFields: [ + {field: 'goback', values: ['dynamic']}, + {field: 'supModule', values: ['static']}, + ], forbid: subtype !== 'propcard' }, { @@ -66,7 +78,7 @@ field: 'pagestyle', label: '鍒嗛〉椋庢牸', initval: wrap.pagestyle || 'page', - tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛��', + tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛�傛敞锛氭粦鍔ㄥ姞杞藉彧鏈夌涓�涓湁鏁�', required: false, options: [ {value: 'page', label: '椤电爜'}, @@ -84,25 +96,70 @@ 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']}, ], forbid: subtype === 'tablecard' }, { type: 'radio', - field: 'checkAll', - label: '鍏ㄩ��', - initval: wrap.checkAll || 'hidden', + 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: '鏁版嵁鍔犺浇', disabled: subtype === 'propcard'}, + ] }, + { + type: 'radio', + field: 'supType', + label: '涓婄骇绫诲瀷', + initval: wrap.supType || 'single', + tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', + required: false, + forbid: subtype !== 'datacard' || appType === 'mob', + options: [ + {value: 'single', label: '鍗曠粍浠�'}, + {value: 'multi', label: '澶氱粍浠�'}, + ] + }, + { + type: subtype === 'propcard' ? 'select' : 'radio', + field: 'selStyle', + label: '閫変腑椋庢牸', + initval: wrap.selStyle || 'active', + tooltip: '瀛樺湪杈规鏃讹紝杈规浼氫娇鐢ㄧ郴缁熻壊銆�', + required: false, + options: subtype === 'propcard' ? [ + {value: 'none', label: '鏃�'}, + {value: 'active', label: '澶栭槾褰�'}, + {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'}, + {value: 'font', label: '鏂囧瓧'}, + ] : [ + {value: 'none', label: '鏃�'}, + {value: 'active', 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', @@ -154,6 +211,29 @@ forbid: !columns || appType !== 'mob' }, { + 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: 'cascader', + field: 'supModule', + label: '涓婄骇缁勪欢', + initval: wrap.supModule || [], + required: false, + options: modules, + allowClear: true, + forbid: subtype !== 'propcard' + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', @@ -165,7 +245,7 @@ ] 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