From 3c82fab41f24d346c32cc58ce0347982eb571d4c Mon Sep 17 00:00:00 2001 From: lx Date: Thu, 18 Feb 2021 17:19:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8A=A8=E6=80=81=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/printer/block.js | 39 +++++++++++++++++++++------------------ src/printer/qrcode.js | 14 +++++++++----- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/printer/block.js b/src/printer/block.js index c0b6efec..6d860319 100644 --- a/src/printer/block.js +++ b/src/printer/block.js @@ -15,7 +15,7 @@ class Block extends React.Component { this.state = { clientX: null, clientY: null, - isEdit: false + isEdit: false, } } @@ -33,7 +33,7 @@ class Block extends React.Component { ) } - handleBlockEdit = e => { + handleBlockEdit = (e) => { const { name } = this.props if (e.detail.name !== name) { @@ -42,7 +42,7 @@ class Block extends React.Component { this.setState( { - isEdit: true + isEdit: true, }, () => { this.refEdit.focus() @@ -56,10 +56,10 @@ class Block extends React.Component { this.setState({ clientX, - clientY + clientY, }) dispatchMsg('gm-printer-select', { - selected: name + selected: name, }) } @@ -71,7 +71,7 @@ class Block extends React.Component { const style = getStyleWithDiff(config.style, diffX, diffY) dispatchMsg('gm-printer-block-style-set', { - style + style, }) } @@ -79,18 +79,18 @@ class Block extends React.Component { const { name } = this.props dispatchMsg('gm-printer-select', { - selected: name + selected: name, }) } handleDoubleClick = () => { const { - config: { type } + config: { type }, } = this.props if (!type || type === 'text') { this.setState( { - isEdit: true + isEdit: true, }, () => { this.refEdit && this.refEdit.focus() @@ -101,13 +101,13 @@ class Block extends React.Component { handleEditBlur = () => { this.setState({ - isEdit: false + isEdit: false, }) } - handleText = e => { + handleText = (e) => { dispatchMsg('gm-printer-block-text-set', { - text: e.target.value + text: e.target.value, }) } @@ -135,7 +135,7 @@ class Block extends React.Component { src={src} style={{ width: '100%', - height: '100%' + height: '100%', }} alt='' data-name={name} @@ -170,7 +170,10 @@ class Block extends React.Component { } else if (type === 'qrcode') { content = ( ) @@ -182,7 +185,7 @@ class Block extends React.Component {
{(!type || type === 'text') && active && isEdit && (