| | |
| | | } |
| | | |
| | | verifyConfig = (show) => { |
| | | const { config } = this.state |
| | | const { config, MenuType } = this.state |
| | | let error = '' |
| | | |
| | | let check = (components) => { |
| | |
| | | return |
| | | } |
| | | |
| | | if (['voucher'].includes(item.subtype)) return |
| | | if (['propcard', 'brafteditor', 'sandbox', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | | if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | if (MenuType === 'billPrint' && !error) { |
| | | let forbid = { |
| | | tabs: '标签页', |
| | | search: '搜索条件', |
| | | form: '表单', |
| | | carousel: '轮播', |
| | | tree: '树形列表', |
| | | chart: '自定义图表', |
| | | editor: '富文本', |
| | | group: '分组' |
| | | } |
| | | let subforbid = { |
| | | editable: '可编辑表格', |
| | | voucher: '凭证' |
| | | } |
| | | |
| | | config.components.forEach(item => { |
| | | if (!error && forbid[item.type]) { |
| | | error = '打印模板中不可使用' + forbid[item.type] |
| | | } else if (!error && subforbid[item.type]) { |
| | | error = '打印模板中不可使用' + subforbid[item.type] |
| | | } |
| | | }) |
| | | |
| | | if (show && error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | return error |
| | | } |
| | | |