From 48dd654ce742a1af88ef06b5124e5b6c7f2f84fd Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Fri, 28 Feb 2020 12:39:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=9C=A8=E8=A3=81=E5=89=AA?= =?UTF-8?q?=E4=B8=AD=E8=A1=A8=E5=8D=95=E6=8F=90=E4=BA=A4,=E5=88=99?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8A=8A=E5=86=85=E5=AE=B9=E8=A3=81=E5=89=AA?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Image.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderers/Form/Image.tsx b/src/renderers/Form/Image.tsx index 8a49344a..255e618b 100644 --- a/src/renderers/Form/Image.tsx +++ b/src/renderers/Form/Image.tsx @@ -569,8 +569,6 @@ export default class ImageControl extends React.Component< } return this.setState({ - locked: true, - lockedReason: '请选择放弃或者应用', cropFile: file }); } @@ -853,6 +851,11 @@ export default class ImageControl extends React.Component< validate(): any { if (this.state.locked && this.state.lockedReason) { return this.state.lockedReason; + } else if (this.state.cropFile) { + return new Promise(resolve => { + this.resolve = resolve; + this.handleCrop(); + }); } else if ( this.state.uploading || this.files.some(item => item.state === 'pending')