refactor: 图片预览
This commit is contained in:
@@ -42,6 +42,7 @@ import { computed } from 'vue';
|
||||
import { MoreFilled } from '@element-plus/icons-vue';
|
||||
import { useDict } from '@/utils/useDict';
|
||||
import { PROJECT_EXE_STATUS_CODE } from '@/utils/enum/project';
|
||||
import { FileUtil } from '@/utils/file';
|
||||
import projectBlue from '@/assets/imgs/projectList/project-blue.png';
|
||||
import projectGreen from '@/assets/imgs/projectList/project-green.png';
|
||||
|
||||
@@ -60,10 +61,9 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
const emit = defineEmits(['cardClick', 'actionClick']);
|
||||
|
||||
const { PROJECT_EXE_STATUS } = useDict('PROJECT_EXE_STATUS');
|
||||
const env = import.meta.env;
|
||||
|
||||
const coverImgMap = computed(() => ({
|
||||
custom: `${env.VITE_API_IMAGE_PREVIEW_URL}/data/previewImage?fileId=${props.project.detailImgUrl}`,
|
||||
custom: FileUtil.getFilePreviewImgPathUrl(props.project.detailImgUrl),
|
||||
blue: projectBlue,
|
||||
green: projectGreen,
|
||||
}));
|
||||
|
||||
@@ -33,6 +33,7 @@ import { computed } from 'vue';
|
||||
import { MoreFilled } from '@element-plus/icons-vue';
|
||||
import { useDict } from '@/utils/useDict';
|
||||
import { PROJECT_EXE_STATUS_CODE } from '@/utils/enum/project';
|
||||
import { FileUtil } from '@/utils/file';
|
||||
import projectBlue from '@/assets/imgs/projectList/project-blue.png';
|
||||
import projectGreen from '@/assets/imgs/projectList/project-green.png';
|
||||
|
||||
@@ -51,10 +52,9 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
const emit = defineEmits(['cardClick', 'actionClick']);
|
||||
|
||||
const { PROJECT_EXE_STATUS } = useDict('PROJECT_EXE_STATUS');
|
||||
const env = import.meta.env;
|
||||
|
||||
const coverImgMap = computed(() => ({
|
||||
custom: `${env.VITE_API_IMAGE_PREVIEW_URL}/data/previewImage?fileId=${props.project.detailImgUrl}`,
|
||||
custom: FileUtil.getFilePreviewImgPathUrl(props.project.detailImgUrl),
|
||||
blue: projectBlue,
|
||||
green: projectGreen,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user