From 363e75eed9b5ac96f47ca4093d08eda97a1c134a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 29 八月 2022 22:51:34 +0800 Subject: [PATCH] 2022-08-29 --- src/tabviews/zshare/actionList/printbutton/index.jsx | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 4ee758b..d2bfa95 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -940,6 +940,16 @@ error = '鎵撳嵃妯℃澘瑙f瀽閿欒锛�' } else { let control = [] + let rotate = configParam.rotate || 0 + let offsetTop = 0 + let offsetLeft = 0 + + if (rotate === 90) { + offsetTop = configParam.width - configParam.height + } else if (rotate === 270) { + offsetLeft = configParam.height - configParam.width + } + configParam.elements.forEach(element => { let _field = element.field @@ -952,11 +962,11 @@ Type: element.type, Value: element.value || '', Field: _field, - Left: element.left, - Top: element.top, + Left: element.left + offsetLeft, + Top: element.top + offsetTop, Width: element.width, Height: element.height, - Rotate: configParam.rotate || 0, + Rotate: rotate, // Rotate: element.rotate, BorderSize: element.borderSize / 10, BorderColor: element.borderColor, @@ -1025,6 +1035,12 @@ control.push(item) }) + let down = false + + if (rotate === 90 || rotate === 270) { + down = true + } + _configparam = { Version: '', Title: configParam.name, @@ -1032,8 +1048,8 @@ Description: configParam.remark, PrintTempNO: configParam.PrintTempNO, PageSetting: { - Width: configParam.width, - Height: configParam.height, + Width: down ? configParam.height : configParam.width, + Height: down ? configParam.width : configParam.height, Left: '0', Right: '0', Top: '0', @@ -1163,12 +1179,21 @@ }) if (list.length === 0) { - this.execError({ - ErrCode: btn.verify.emptyTip === 'false' ? '-1' : 'N', - message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�', - ErrMesg: '', - status: false - }) + if (btn.verify.emptyTip === 'false') { + this.execSuccess({ + ErrCode: '-1', + message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�', + ErrMesg: '', + status: true + }) + } else { + this.execError({ + ErrCode: 'N', + message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�', + ErrMesg: '', + status: false + }) + } return } else if (_errors.length > 0) { let lackerror = [] @@ -1324,17 +1349,17 @@ const { btn } = this.props const { autoMatic } = this.state - if ((res && (res.ErrCode === 'S' || !res.ErrCode)) || autoMatic) { // 鎵ц鎴愬姛 + if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 鎵ц鎴愬姛 notification.success({ top: 92, message: res.ErrMesg || this.state.dict['main.action.confirm.success'], duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 }) - } else if (res && res.ErrCode === 'Y') { // 鎵ц鎴愬姛 + } else if (res.ErrCode === 'Y') { // 鎵ц鎴愬姛 Modal.success({ title: res.ErrMesg || this.state.dict['main.action.confirm.success'] }) - } else if (res && res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず + } else if (res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず } -- Gitblit v1.8.0