From eef30b23461b0a9699be48dd5aeea88fbdc703a7 Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Wed, 23 Oct 2019 10:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E6=8E=89=E5=8E=8B=E7=BC=A9=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Image.tsx | 37 +++++------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/renderers/Form/Image.tsx b/src/renderers/Form/Image.tsx index b9a12557..67da2ed2 100644 --- a/src/renderers/Form/Image.tsx +++ b/src/renderers/Form/Image.tsx @@ -7,8 +7,6 @@ import 'blueimp-canvastoblob'; import find = require('lodash/find'); import qs from 'qs'; import {Payload} from '../../types'; -import {filter} from '../../utils/tpl'; -import {Switch} from '../../components'; import {buildApi} from '../../utils/api'; import {createObject, qsstringify} from '../../utils/helper'; import {Icon} from '../../components/icons'; @@ -39,8 +37,7 @@ export interface ImageProps extends FormControlProps { [propName: string]: any; }; accept?: string; - btnUploadClassName?: string; - btnClassName?: string; + hideUploadButton?: boolean; joinValues?: boolean; extractValue?: boolean; @@ -53,11 +50,6 @@ export interface ImageState { uploading: boolean; locked: boolean; lockedReason?: string; - compress: boolean; - compressOptions: { - maxWidth?: number; - maxHeight?: number; - }; files: Array; crop?: any; error?: string; @@ -91,10 +83,7 @@ export default class ImageControl extends React.Component void, onProgress: (progress: number) => void ) { - let compressOptions = this.state.compressOptions; - - if (this.props.showCompressOptions) { - compressOptions = { - maxWidth: 800, - maxHeight: 600, - ...compressOptions - }; - } - - this._send(file, this.props.reciever as string, {compress: this.state.compress, compressOptions}, onProgress) + this._send(file, this.props.reciever as string, {}, onProgress) .then((ret: Payload) => { if (ret.status) { throw new Error(ret.msg || '上传失败, 请重试'); @@ -741,8 +716,6 @@ export default class ImageControl extends React.Component