From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 十月 2021 23:17:08 +0800 Subject: [PATCH] 2021-10-21 --- src/menu/components/card/data-card/options.jsx | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index c02de20..6907ff4 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') @@ -14,7 +22,7 @@ if (roleList) { try { roleList = JSON.parse(roleList) - } catch { + } catch (e) { roleList = [] } } else { @@ -59,6 +67,10 @@ {value: 'dynamic', label: '鍔ㄦ��'}, {value: 'static', label: '闈欐��'}, ], + controlFields: [ + {field: 'goback', values: ['dynamic']}, + {field: 'supModule', values: ['static']}, + ], forbid: subtype !== 'propcard' }, { @@ -84,12 +96,25 @@ 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']}, ], forbid: subtype === 'tablecard' + }, + { + type: 'radio', + field: 'selected', + label: '棣栬閫変腑', + initval: wrap.selected || 'false', + required: false, + options: [ + {value: 'false', label: '鏃�'}, + {value: 'init', label: '鍒濆鍖�'}, + {value: 'always', label: '鏁版嵁鍔犺浇', disabled: subtype === 'propcard'}, + ] }, { type: 'radio', @@ -154,6 +179,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 +213,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