feat(cmsAd): 优化广告图片展示和引入图片压缩工具

- 使用压缩后的图片 URL 显示广告图片,提升加载性能
- 添加图片预览功能,支持点击查看原图
- 调整图片展示宽度参数,保证视觉效果
- 引入图片压缩工具方法 getCompressedImageUrl 以统一处理图片请求
This commit is contained in:
2026-07-27 14:25:11 +08:00
parent 4a8b0a957c
commit dd094f8769

View File

@@ -47,7 +47,11 @@
v-for="(item, index) in record.imageList"
:key="index"
>
<a-image :src="item.url" :width="80" />
<a-image
:src="getCompressedImageUrl(item.url, { width: 160, quality: 90 })"
:preview="{ src: item.url }"
:width="80"
/>
</template>
<template v-if="record.type == 4">
{{ record.comments }}
@@ -113,6 +117,7 @@
import { listCmsNavigation } from '@/api/cms/cmsNavigation';
import { getPageTitle } from '@/utils/common';
import { getTenantId } from '@/utils/domain';
import { getCompressedImageUrl } from '@/utils/image';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);