From f59df05bd0f1cccbecfb0ba978b66dd19563bb36 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 23 三月 2022 22:40:51 +0800 Subject: [PATCH] 2022-03-23 --- src/tabviews/custom/components/group/normal-group/index.jsx | 3 ++- src/views/menudesign/index.jsx | 36 +++++++++++++++++++++++++++++++++++- src/menu/components/group/normal-group/options.jsx | 14 ++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/menu/components/group/normal-group/options.jsx b/src/menu/components/group/normal-group/options.jsx index fcaca1a..bd3bb75 100644 --- a/src/menu/components/group/normal-group/options.jsx +++ b/src/menu/components/group/normal-group/options.jsx @@ -50,6 +50,7 @@ {field: 'pageLayout', values: ['true']}, {field: 'syncModule', values: ['true']}, {field: 'checkAll', values: ['true']}, + {field: 'hide', values: ['true']}, ], forbid: appType === 'mob' }, @@ -79,6 +80,19 @@ 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: '榛戝悕鍗�', diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 99486fe..f6ac9cd 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -266,6 +266,7 @@ 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: { @@ -301,7 +302,7 @@ 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>') } diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index dcc8745..c914a8e 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -917,7 +917,7 @@ } verifyConfig = (show) => { - const { config } = this.state + const { config, MenuType } = this.state let error = '' let check = (components) => { @@ -984,6 +984,40 @@ }) } + 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 } -- Gitblit v1.8.0