| | |
| | | {field: 'pageLayout', values: ['true']}, |
| | | {field: 'syncModule', values: ['true']}, |
| | | {field: 'checkAll', values: ['true']}, |
| | | {field: 'hide', values: ['true']}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | field: 'hide', |
| | | label: '隐藏元素', |
| | | initval: setting.hide || [], |
| | | tooltip: '执行打印时需要隐藏的页面元素。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'search', label: '搜索'}, |
| | | {value: 'button', label: '按钮'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | |
| | | let pageSize = ['A4', 'A3', 'A5'].includes(config.setting.pageSize) ? config.setting.pageSize : 'A4' |
| | | let pageLayout = config.setting.pageLayout !== 'horizontal' ? 'vertical' : 'horizontal' |
| | | let hides = config.setting.hide || [] |
| | | |
| | | let pageParam = { |
| | | A4: { |
| | |
| | | doc.write(`<LINK rel="stylesheet" type="text/css" href="${linkList[i].href}">`) |
| | | } |
| | | } |
| | | doc.write(`<style>body{width: ${width}px!important;}*{border-style: solid;border-width: 0;}.print-button, .top-search{display: none!important;}</style>`) |
| | | doc.write(`<style>body{width: ${width}px!important;} *{border-style: solid;border-width: 0;} .print-button{display: none!important;} ${hides.includes('search') ? '.top-search{display: none!important;}' : ''} ${hides.includes('button') ? '.ant-btn{opacity: 0!important;}' : ''}</style>`) |
| | | for (let i = 0;i < styleList.length;i++) { |
| | | doc.write('<style>' + styleList[i].innerHTML + '</style>') |
| | | } |
| | |
| | | } |
| | | |
| | | verifyConfig = (show) => { |
| | | const { config } = this.state |
| | | const { config, MenuType } = this.state |
| | | let error = '' |
| | | |
| | | let check = (components) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | if (MenuType === 'billPrint' && !error) { |
| | | let forbid = { |
| | | tabs: '标签页', |
| | | search: '搜索条件', |
| | | balcony: '浮动卡', |
| | | 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 |
| | | } |
| | | |