perf: hover显示大图

This commit is contained in:
rd
2025-08-13 11:07:48 +08:00
parent a0a96f512a
commit e9085c19c2
3 changed files with 27 additions and 16 deletions

View File

@ -83,11 +83,13 @@
<span class="cts num">{{ exactFormatTime(record[column.dataIndex]) }}</span> <span class="cts num">{{ exactFormatTime(record[column.dataIndex]) }}</span>
</template> </template>
<template v-else-if="column.dataIndex === 'cover'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'cover'" #cell="{ record }">
<HoverImagePreview :src="record.cover">
<a-image :width="64" :height="64" :src="record.cover" class="!rounded-6px" fit="cover"> <a-image :width="64" :height="64" :src="record.cover" class="!rounded-6px" fit="cover">
<template #error> <template #error>
<img :src="icon4" class="w-full h-full" /> <img :src="icon4" class="w-full h-full" />
</template> </template>
</a-image> </a-image>
</HoverImagePreview>
</template> </template>
<template v-else-if="column.dataIndex === 'operation'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'operation'" #cell="{ record }">
<div class="flex items-center"> <div class="flex items-center">
@ -126,6 +128,7 @@ import {
import { slsWithCatch } from '@/utils/stroage.ts'; import { slsWithCatch } from '@/utils/stroage.ts';
import TextOverTips from '@/components/text-over-tips'; import TextOverTips from '@/components/text-over-tips';
import HoverImagePreview from '@/components/hover-image-preview';
import icon1 from '@/assets/img/media-account/icon-delete.png'; import icon1 from '@/assets/img/media-account/icon-delete.png';
import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png'; import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png';

View File

@ -71,11 +71,13 @@
{{ exactFormatTime(record[column.dataIndex]) }} {{ exactFormatTime(record[column.dataIndex]) }}
</template> </template>
<template v-else-if="column.dataIndex === 'cover'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'cover'" #cell="{ record }">
<HoverImagePreview :src="record.cover">
<a-image :width="64" :height="64" :src="record.cover" class="!rounded-6px" fit="cover"> <a-image :width="64" :height="64" :src="record.cover" class="!rounded-6px" fit="cover">
<template #error> <template #error>
<img :src="icon4" class="w-full h-full" /> <img :src="icon4" class="w-full h-full" />
</template> </template>
</a-image> </a-image>
</HoverImagePreview>
</template> </template>
<template v-else-if="column.dataIndex === 'operation'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'operation'" #cell="{ record }">
<div class="flex items-center"> <div class="flex items-center">
@ -99,6 +101,7 @@ import { TABLE_COLUMNS } from './constants';
import { CHECK_STATUS, EnumManuscriptType } from '@/views/creative-generation-workshop/manuscript/list/constants'; import { CHECK_STATUS, EnumManuscriptType } from '@/views/creative-generation-workshop/manuscript/list/constants';
import TextOverTips from '@/components/text-over-tips'; import TextOverTips from '@/components/text-over-tips';
import HoverImagePreview from '@/components/hover-image-preview';
import icon1 from '@/assets/img/media-account/icon-delete.png'; import icon1 from '@/assets/img/media-account/icon-delete.png';
import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png'; import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png';

View File

@ -54,7 +54,9 @@
<img v-else width="24" height="24" :src="PLATFORMS.find((item) => item.value === record.platform)?.icon" /> <img v-else width="24" height="24" :src="PLATFORMS.find((item) => item.value === record.platform)?.icon" />
</template> </template>
<template v-else-if="column.dataIndex === 'compliance_level'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'compliance_level'" #cell="{ record }">
<span class="cts num !color-#6D4CFE">{{ record.ai_review?.compliance_level ? `${record.ai_review?.compliance_level}%` : '-' }}</span> <span class="cts num !color-#6D4CFE">{{
record.ai_review?.compliance_level ? `${record.ai_review?.compliance_level}%` : '-'
}}</span>
</template> </template>
<template v-else-if="column.dataIndex === 'title'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'title'" #cell="{ record }">
<TextOverTips :context="record.title" :line="3" class="title" @click="onDetail(record)" /> <TextOverTips :context="record.title" :line="3" class="title" @click="onDetail(record)" />
@ -84,11 +86,13 @@
<span class="cts num">{{ exactFormatTime(record[column.dataIndex]) }}</span> <span class="cts num">{{ exactFormatTime(record[column.dataIndex]) }}</span>
</template> </template>
<template v-else-if="column.dataIndex === 'cover'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'cover'" #cell="{ record }">
<HoverImagePreview :src="record.cover">
<a-image :width="64" :height="64" :src="record.cover" class="!rounded-6px" fit="cover"> <a-image :width="64" :height="64" :src="record.cover" class="!rounded-6px" fit="cover">
<template #error> <template #error>
<img :src="icon4" class="w-full h-full" /> <img :src="icon4" class="w-full h-full" />
</template> </template>
</a-image> </a-image>
</HoverImagePreview>
</template> </template>
<template v-else-if="column.dataIndex === 'operation'" #cell="{ record }"> <template v-else-if="column.dataIndex === 'operation'" #cell="{ record }">
<div class="flex items-center"> <div class="flex items-center">
@ -130,6 +134,7 @@ import { slsWithCatch } from '@/utils/stroage.ts';
import TextOverTips from '@/components/text-over-tips'; import TextOverTips from '@/components/text-over-tips';
import ShareModal from '@/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/share-modal.vue'; import ShareModal from '@/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/share-modal.vue';
import HoverImagePreview from '@/components/hover-image-preview';
import icon1 from '@/assets/img/media-account/icon-delete.png'; import icon1 from '@/assets/img/media-account/icon-delete.png';
import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png'; import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png';