| | |
| | | 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') |
| | |
| | | {value: 'dynamic', label: '动态'}, |
| | | {value: 'static', label: '静态'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'goback', values: ['dynamic']}, |
| | | {field: 'supModule', values: ['static']}, |
| | | ], |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | |
| | | field: 'pagestyle', |
| | | label: '分页风格', |
| | | initval: wrap.pagestyle || 'page', |
| | | tooltip: '数据源选择分页时有效。', |
| | | tooltip: '数据源选择分页时有效。注:滑动加载只有第一个有效', |
| | | required: false, |
| | | options: [ |
| | | {value: 'page', label: '页码'}, |
| | |
| | | options: [ |
| | | {value: '', label: '不可选'}, |
| | | {value: 'radio', label: '单选'}, |
| | | {value: 'checkbox', label: '多选', forbid: subtype === 'propcard'}, |
| | | {value: 'checkbox', label: '多选', disabled: subtype === 'propcard'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'checkAll', values: ['checkbox']}, |
| | |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载', forbid: subtype === 'propcard'}, |
| | | {value: 'always', label: '数据加载', disabled: subtype === 'propcard'}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | 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: '黑名单', |
| | |
| | | ] |
| | | |
| | | return cardWrapForm.map(item => { |
| | | if (['pagestyle', 'cardType', 'selected'].includes(item.field)) { |
| | | if (['pagestyle'].includes(item.field)) { |
| | | item.options = item.options.filter(option => !option.forbid) |
| | | } |
| | | |