mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix:inputImage 裁剪模式可配置可旋转,但是功能无效 (#2310)
Co-authored-by: sqzhou <zhoushengqiang01@baidu.com>
This commit is contained in:
parent
becc257aeb
commit
1b9fe9643b
@ -200,6 +200,17 @@
|
||||
padding: 2px 5px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
|
||||
.icon-retry {
|
||||
|
||||
polygon {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
path {
|
||||
stroke: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,5 +201,6 @@ register('de-DE', {
|
||||
'Wizard.prev': 'Zurück',
|
||||
'Wizard.saveAndNext': 'Speichern & Weiter',
|
||||
'year-to-year': '{{from}} - {{to}}',
|
||||
'Year.placeholder': 'Wählen Sie ein Jahr'
|
||||
'Year.placeholder': 'Wählen Sie ein Jahr',
|
||||
'rotate': 'Drehen'
|
||||
});
|
||||
|
@ -201,5 +201,6 @@ register('en-US', {
|
||||
'Wizard.prev': 'Prev',
|
||||
'Wizard.saveAndNext': 'Save & Next',
|
||||
'year-to-year': '{{from}} - {{to}}',
|
||||
'Year.placeholder': 'Select a Year'
|
||||
'Year.placeholder': 'Select a Year',
|
||||
'rotate': 'Rotate'
|
||||
});
|
||||
|
@ -205,5 +205,6 @@ register('zh-CN', {
|
||||
'Wizard.prev': '上一步',
|
||||
'Wizard.saveAndNext': '保存并下一步',
|
||||
'year-to-year': '{{from}} 年 - {{to}} 年',
|
||||
'Year.placeholder': '请选择年'
|
||||
'Year.placeholder': '请选择年',
|
||||
'rotate': '旋转'
|
||||
});
|
||||
|
@ -408,6 +408,7 @@ export default class ImageControl extends React.Component<
|
||||
this.handleCrop = this.handleCrop.bind(this);
|
||||
this.handleDropRejected = this.handleDropRejected.bind(this);
|
||||
this.cancelCrop = this.cancelCrop.bind(this);
|
||||
this.rotatableCrop = this.rotatableCrop.bind(this);
|
||||
this.handleImageLoaded = this.handleImageLoaded.bind(this);
|
||||
this.handleFrameImageLoaded = this.handleFrameImageLoaded.bind(this);
|
||||
this.startUpload = this.startUpload.bind(this);
|
||||
@ -875,6 +876,10 @@ export default class ImageControl extends React.Component<
|
||||
);
|
||||
}
|
||||
|
||||
rotatableCrop() {
|
||||
this.cropper.current!.rotate(90);
|
||||
}
|
||||
|
||||
addFiles(files: Array<FileX>) {
|
||||
if (!files.length) {
|
||||
return;
|
||||
@ -1208,6 +1213,17 @@ export default class ImageControl extends React.Component<
|
||||
<Cropper {...crop} ref={this.cropper} src={cropFile.preview} />
|
||||
</Suspense>
|
||||
<div className={cx('ImageControl-croperToolbar')}>
|
||||
{
|
||||
crop.rotatable &&
|
||||
<a
|
||||
className={cx('ImageControl-cropRotatable')}
|
||||
onClick={this.rotatableCrop}
|
||||
data-tooltip={__('rotate')}
|
||||
data-position="left"
|
||||
>
|
||||
<Icon icon="retry" className="icon" />
|
||||
</a>
|
||||
}
|
||||
<a
|
||||
className={cx('ImageControl-cropCancel')}
|
||||
onClick={this.cancelCrop}
|
||||
|
Loading…
Reference in New Issue
Block a user