2025-06-13 15:27:25 +08:00
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import type { AiImageApi } from '#/api/ai/image';
|
|
|
|
|
|
|
|
|
|
|
|
import { ref, toRefs, watch } from 'vue';
|
|
|
|
|
|
|
|
|
|
|
|
import { Image } from 'ant-design-vue';
|
|
|
|
|
|
|
|
|
|
|
|
import { getImageMy } from '#/api/ai/image';
|
|
|
|
|
|
import {
|
|
|
|
|
|
AiPlatformEnum,
|
|
|
|
|
|
Dall3StyleList,
|
|
|
|
|
|
StableDiffusionClipGuidancePresets,
|
|
|
|
|
|
StableDiffusionSamplers,
|
|
|
|
|
|
StableDiffusionStylePresets,
|
|
|
|
|
|
} from '#/utils/constants';
|
|
|
|
|
|
import { formatTime } from '#/utils/formatTime';
|
|
|
|
|
|
|
|
|
|
|
|
// 图片详细信息
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
id: {
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
const detail = ref<AiImageApi.ImageVO>({} as AiImageApi.ImageVO);
|
|
|
|
|
|
|
|
|
|
|
|
/** 获取图片详情 */
|
|
|
|
|
|
const getImageDetail = async (id: number) => {
|
|
|
|
|
|
detail.value = await getImageMy(id);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const { id } = toRefs(props);
|
|
|
|
|
|
watch(
|
|
|
|
|
|
id,
|
|
|
|
|
|
async (newVal) => {
|
|
|
|
|
|
if (newVal) {
|
|
|
|
|
|
await getImageDetail(newVal);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{ immediate: true },
|
|
|
|
|
|
);
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="mb-5 w-full overflow-hidden break-words">
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
|
|
|
|
|
<Image class="rounded-[10px]" :src="detail?.picUrl" />
|
2025-06-13 15:27:25 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<!-- 时间 -->
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="mb-5 w-full overflow-hidden break-words">
|
|
|
|
|
|
<div class="tip text-lg font-bold">时间</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
提交时间:{{ formatTime(detail.createTime, 'yyyy-MM-dd HH:mm:ss') }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
生成时间:{{ formatTime(detail.finishTime, 'yyyy-MM-dd HH:mm:ss') }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<!-- 模型 -->
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="mb-5 w-full overflow-hidden break-words">
|
|
|
|
|
|
<div class="tip text-lg font-bold">模型</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{ detail.model }}({{ detail.height }}x{{ detail.width }})
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<!-- 提示词 -->
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="mb-5 w-full overflow-hidden break-words">
|
|
|
|
|
|
<div class="tip text-lg font-bold">提示词</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{ detail.prompt }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 图片地址 -->
|
|
|
|
|
|
<div class="mb-5 w-full overflow-hidden break-words">
|
|
|
|
|
|
<div class="tip text-lg font-bold">图片地址</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{ detail.picUrl }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- StableDiffusion 专属 -->
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.STABLE_DIFFUSION &&
|
|
|
|
|
|
detail?.options?.sampler
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">采样方法</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{
|
|
|
|
|
|
StableDiffusionSamplers.find(
|
2025-06-16 13:16:07 +08:00
|
|
|
|
(item) => item.key === detail?.options?.sampler,
|
2025-06-13 15:27:25 +08:00
|
|
|
|
)?.name
|
|
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.STABLE_DIFFUSION &&
|
|
|
|
|
|
detail?.options?.clipGuidancePreset
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">CLIP</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{
|
|
|
|
|
|
StableDiffusionClipGuidancePresets.find(
|
2025-06-16 13:16:07 +08:00
|
|
|
|
(item) => item.key === detail?.options?.clipGuidancePreset,
|
2025-06-13 15:27:25 +08:00
|
|
|
|
)?.name
|
|
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.STABLE_DIFFUSION &&
|
|
|
|
|
|
detail?.options?.stylePreset
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">风格</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{
|
|
|
|
|
|
StableDiffusionStylePresets.find(
|
2025-06-16 13:16:07 +08:00
|
|
|
|
(item) => item.key === detail?.options?.stylePreset,
|
2025-06-13 15:27:25 +08:00
|
|
|
|
)?.name
|
|
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.STABLE_DIFFUSION &&
|
|
|
|
|
|
detail?.options?.steps
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">迭代步数</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">{{ detail?.options?.steps }}</div>
|
2025-06-13 15:27:25 +08:00
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.STABLE_DIFFUSION &&
|
|
|
|
|
|
detail?.options?.scale
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">引导系数</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">{{ detail?.options?.scale }}</div>
|
2025-06-13 15:27:25 +08:00
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.STABLE_DIFFUSION &&
|
|
|
|
|
|
detail?.options?.seed
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">随机因子</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">{{ detail?.options?.seed }}</div>
|
2025-06-13 15:27:25 +08:00
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- Dall3 专属 -->
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="detail.platform === AiPlatformEnum.OPENAI && detail?.options?.style"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">风格选择</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
{{
|
2025-06-16 13:16:07 +08:00
|
|
|
|
Dall3StyleList.find((item) => item.key === detail?.options?.style)?.name
|
2025-06-13 15:27:25 +08:00
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- Midjourney 专属 -->
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.MIDJOURNEY && detail?.options?.version
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">模型版本</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">{{ detail?.options?.version }}</div>
|
2025-06-13 15:27:25 +08:00
|
|
|
|
</div>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
detail.platform === AiPlatformEnum.MIDJOURNEY &&
|
|
|
|
|
|
detail?.options?.referImageUrl
|
|
|
|
|
|
"
|
2025-06-16 13:16:07 +08:00
|
|
|
|
class="mb-5 w-full overflow-hidden break-words"
|
2025-06-13 15:27:25 +08:00
|
|
|
|
>
|
2025-06-16 13:16:07 +08:00
|
|
|
|
<div class="tip text-lg font-bold">参考图</div>
|
|
|
|
|
|
<div class="body mt-2 text-gray-600">
|
2025-06-13 15:27:25 +08:00
|
|
|
|
<Image :src="detail.options.referImageUrl" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|