From 6e04a3827538921782b2823dcbf4993c5b43aee1 Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Fri, 3 Jan 2025 10:12:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E8=A3=81=E5=89=AA=E6=A1=86=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE=E7=BD=AE=E5=AE=BD=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ .../ibiz-image-cropping/ibiz-image-cropping.tsx | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0368cbf8..e1356b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Change + +- 更新移动端裁剪框支持自定义设置宽高 + ### Added - 新增图片裁剪上传组件 diff --git a/src/editor/upload/ibiz-image-cropping/ibiz-image-cropping.tsx b/src/editor/upload/ibiz-image-cropping/ibiz-image-cropping.tsx index 024eb1cf..1c575e3e 100644 --- a/src/editor/upload/ibiz-image-cropping/ibiz-image-cropping.tsx +++ b/src/editor/upload/ibiz-image-cropping/ibiz-image-cropping.tsx @@ -28,6 +28,18 @@ export const IBizImageCropping = defineComponent({ // 是否阻止默认点击 const result = c.editorParams?.STOPPROPAGATION !== 'false'; + const cropRect: IData = {}; + + if (c.editorParams?.cropWidth) { + Object.assign(cropRect, { + cropareaWidth: Number(c.editorParams.cropWidth), + }); + } + if (c.editorParams?.cropHeight) { + Object.assign(cropRect, { + cropareaHeight: Number(c.editorParams.cropHeight), + }); + } const { uploadUrl, headers, @@ -117,6 +129,7 @@ export const IBizImageCropping = defineComponent({ show, tempFile, cropImgUrl, + cropRect, cropChange, }; }, @@ -163,6 +176,7 @@ export const IBizImageCropping = defineComponent({ -- Gitee From 7f6115cc03603f9b610537f974a6b8d87b3c55a0 Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Fri, 3 Jan 2025 18:58:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=A3=81=E5=89=AA=E4=B8=8A=E4=BC=A0=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locale/en/index.ts | 1 + src/locale/zh-CN/index.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/locale/en/index.ts b/src/locale/en/index.ts index 3b157f3e..c2540e7a 100644 --- a/src/locale/en/index.ts +++ b/src/locale/en/index.ts @@ -188,6 +188,7 @@ export default { 'The configuration of uploadparams did not follow the standard JSON format', exportJsonFormatErr: 'The configuration of exportparams did not follow the standard JSON format', + cancelUpload: 'Cancel Upload', }, emojiPicker: { addEmoji: 'Add emoji', diff --git a/src/locale/zh-CN/index.ts b/src/locale/zh-CN/index.ts index 52ab3dc5..ac826e54 100644 --- a/src/locale/zh-CN/index.ts +++ b/src/locale/zh-CN/index.ts @@ -177,6 +177,7 @@ export default { upload: { uploadJsonFormatErr: '配置uploadparams没有按标准JSON格式', exportJsonFormatErr: '配置exportparams没有按标准JSON格式', + cancelUpload: '取消上传', }, emojiPicker: { addEmoji: '添加表情', -- Gitee