From 975d3ccf6c9599f40af42228d3d6fa779866fe03 Mon Sep 17 00:00:00 2001 From: huangchen1031 Date: Sat, 21 Dec 2024 21:19:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(upload):=20=E4=B8=8A=E4=BC=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20(#4853)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(upload): 上传组件图片展示样式优化 * chore: update snapshot --------- Co-authored-by: github-actions[bot] --- .../__tests__/__snapshots__/index.test.jsx.snap | 2 +- .../__snapshots__/vitest-upload.test.jsx.snap | 6 +++--- src/upload/themes/image-card.tsx | 2 +- src/upload/themes/multiple-flow-list.tsx | 8 +++++++- test/unit/snap/__snapshots__/csr.test.js.snap | 10 +++++----- test/unit/snap/__snapshots__/ssr.test.js.snap | 6 +++--- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/date-picker/__tests__/__snapshots__/index.test.jsx.snap b/src/date-picker/__tests__/__snapshots__/index.test.jsx.snap index e22c8a4953..c8fe1f374c 100644 --- a/src/date-picker/__tests__/__snapshots__/index.test.jsx.snap +++ b/src/date-picker/__tests__/__snapshots__/index.test.jsx.snap @@ -201,4 +201,4 @@ exports[`DatePicker > :value 1`] = ` -`; \ No newline at end of file +`; diff --git a/src/upload/__tests__/__snapshots__/vitest-upload.test.jsx.snap b/src/upload/__tests__/__snapshots__/vitest-upload.test.jsx.snap index bbe11f4073..469deb0eda 100644 --- a/src/upload/__tests__/__snapshots__/vitest-upload.test.jsx.snap +++ b/src/upload/__tests__/__snapshots__/vitest-upload.test.jsx.snap @@ -1213,7 +1213,7 @@ exports[`Upload Component > props.theme: theme=image-flow works fine 1`] = ` @@ -1308,7 +1308,7 @@ exports[`Upload Component > props.theme: theme=image-flow works fine 1`] = ` @@ -1425,7 +1425,7 @@ exports[`Upload Component > props.theme: theme=image-flow works fine 1`] = ` diff --git a/src/upload/themes/image-card.tsx b/src/upload/themes/image-card.tsx index 4afd2d6583..a13798fb31 100644 --- a/src/upload/themes/image-card.tsx +++ b/src/upload/themes/image-card.tsx @@ -66,7 +66,7 @@ export default defineComponent({ const renderMainContent = (file: UploadFile, index: number) => { return (
- +
e.stopPropagation()}> )} {(['waiting', 'success'].includes(file.status) || (!file.status && file.url)) && ( - + )}
{(file.url || file.raw) && !['progress', 'fail'].includes(file.status) && ( diff --git a/test/unit/snap/__snapshots__/csr.test.js.snap b/test/unit/snap/__snapshots__/csr.test.js.snap index 9299dcaffb..7f2f3bc7f1 100644 --- a/test/unit/snap/__snapshots__/csr.test.js.snap +++ b/test/unit/snap/__snapshots__/csr.test.js.snap @@ -64662,7 +64662,7 @@ exports[`csr snapshot test > csr test ./src/form/_example/disabled.vue 1`] = ` @@ -198237,7 +198237,7 @@ exports[`csr snapshot test > csr test ./src/upload/_example/image.vue 1`] = ` @@ -198625,7 +198625,7 @@ exports[`csr snapshot test > csr test ./src/upload/_example/img-flow-list.vue 1` @@ -198884,7 +198884,7 @@ exports[`csr snapshot test > csr test ./src/upload/_example/img-flow-list.vue 1` @@ -199001,7 +199001,7 @@ exports[`csr snapshot test > csr test ./src/upload/_example/img-flow-list.vue 1` diff --git a/test/unit/snap/__snapshots__/ssr.test.js.snap b/test/unit/snap/__snapshots__/ssr.test.js.snap index 07e8f861f3..366afb59e7 100644 --- a/test/unit/snap/__snapshots__/ssr.test.js.snap +++ b/test/unit/snap/__snapshots__/ssr.test.js.snap @@ -447,7 +447,7 @@ exports[`ssr snapshot test > ssr test ./src/form/_example/clear-validate.vue 1`] exports[`ssr snapshot test > ssr test ./src/form/_example/custom-validator.vue 1`] = `"
同一个校验方法可输出不同的错误信息和类型,依次输入:1234 观察变化
自定义异步校验方法
"`; -exports[`ssr snapshot test > ssr test ./src/form/_example/disabled.vue 1`] = `"
接受
  • 图片加载中
请选择单张图片文件上传
"`; +exports[`ssr snapshot test > ssr test ./src/form/_example/disabled.vue 1`] = `"
接受
  • 图片加载中
请选择单张图片文件上传
"`; exports[`ssr snapshot test > ssr test ./src/form/_example/error-message.vue 1`] = `"
一句话介绍自己
"`; @@ -1459,9 +1459,9 @@ exports[`ssr snapshot test > ssr test ./src/upload/_example/draggable.vue 1`] = exports[`ssr snapshot test > ssr test ./src/upload/_example/file-flow-list.vue 1`] = `"

支持批量上传文件,文件格式不限,最多只能上传 10 份文件
点击上方“选择文件”或将文件拖拽到此区域
"`; -exports[`ssr snapshot test > ssr test ./src/upload/_example/image.vue 1`] = `"

  • 请选择图片

单张图片文件上传(上传成功状态演示)
  • 点击上传图片

单张图片文件上传(上传失败状态演示)
  • 点击上传图片

允许选择多张图片文件上传,最多只能上传 3 张图片
"`; +exports[`ssr snapshot test > ssr test ./src/upload/_example/image.vue 1`] = `"

  • 请选择图片

单张图片文件上传(上传成功状态演示)
  • 点击上传图片

单张图片文件上传(上传失败状态演示)
  • 点击上传图片

允许选择多张图片文件上传,最多只能上传 3 张图片
"`; -exports[`ssr snapshot test > ssr test ./src/upload/_example/img-flow-list.vue 1`] = `"
AutoUpload:

支持批量上传图片文件
  • loading.svg


Different Status Images
  • loading.svg

  • loading.svg

  • 上传中 10%

    loading.svg

  • 上传失败

    loading.svg

"`; +exports[`ssr snapshot test > ssr test ./src/upload/_example/img-flow-list.vue 1`] = `"
AutoUpload:

支持批量上传图片文件
  • loading.svg


Different Status Images
  • loading.svg

  • loading.svg

  • 上传中 10%

    loading.svg

  • 上传失败

    loading.svg

"`; exports[`ssr snapshot test > ssr test ./src/upload/_example/listType.vue 1`] = `"

请上传txt文件,大小在60M以内

"`;