diff --git a/src/views/ai/image/index/components/ImageDetail.vue b/src/views/ai/image/index/components/ImageDetail.vue index ad15aa8d7..d4f8dc67e 100644 --- a/src/views/ai/image/index/components/ImageDetail.vue +++ b/src/views/ai/image/index/components/ImageDetail.vue @@ -5,139 +5,111 @@ @close="handleDrawerClose" custom-class="drawer-class" > - -
-
- -
-
- -
-
时间
-
-
提交时间:{{ formatTime(detail.createTime, 'yyyy-MM-dd HH:mm:ss') }}
-
生成时间:{{ formatTime(detail.finishTime, 'yyyy-MM-dd HH:mm:ss') }}
-
-
- -
-
模型
-
{{ detail.model }}({{ detail.height }}x{{ detail.width }})
-
- -
-
提示词
-
- {{ detail.prompt }} -
-
- -
-
图片地址
-
- {{ detail.picUrl }} -
+ +
+
+ + + + + {{ formatTime(detail.createTime, 'yyyy-MM-dd HH:mm:ss') }} + + + {{ formatTime(detail.finishTime, 'yyyy-MM-dd HH:mm:ss') }} + + + {{ detail.model }}({{ detail.height }}x{{ detail.width }}) + + +
{{ detail.prompt }}
+
+ +
{{ detail.picUrl }}
+
+
+ -
-
采样方法
-
+ {{ StableDiffusionSamplers.find( (item: ImageModelVO) => item.key === detail?.options?.sampler )?.name }} -
-
-
-
CLIP
-
+ + {{ StableDiffusionClipGuidancePresets.find( (item: ImageModelVO) => item.key === detail?.options?.clipGuidancePreset )?.name }} -
-
-
-
风格
-
+ + {{ StableDiffusionStylePresets.find( (item: ImageModelVO) => item.key === detail?.options?.stylePreset )?.name }} -
-
-
-
迭代步数
-
+ + {{ detail?.options?.steps }} -
-
-
-
引导系数
-
+ + {{ detail?.options?.scale }} -
-
-
-
随机因子
-
+ + {{ detail?.options?.seed }} -
-
+ + + -
-
风格选择
-
+ + {{ Dall3StyleList.find((item: ImageModelVO) => item.key === detail?.options?.style)?.name }} -
-
+ + + -
-
模型版本
-
+ {{ detail?.options?.version }} -
-
-
-
参考图
-
- -
-
+ + + + + @@ -156,6 +128,25 @@ import { formatTime } from '@/utils' const showDrawer = ref(false) // 是否显示 const detail = ref({} as ImageVO) // 图片详细信息 +// 计算属性:判断是否有 StableDiffusion 选项 +const hasStableDiffusionOptions = computed(() => { + const options = detail.value?.options + return ( + options?.sampler || + options?.clipGuidancePreset || + options?.stylePreset || + options?.steps || + options?.scale || + options?.seed + ) +}) + +// 计算属性:判断是否有 Midjourney 选项 +const hasMidjourneyOptions = computed(() => { + const options = detail.value?.options + return options?.version || options?.referImageUrl +}) + const props = defineProps({ show: { type: Boolean, @@ -175,7 +166,7 @@ const handleDrawerClose = async () => { /** 监听 drawer 是否打开 */ const { show } = toRefs(props) -watch(show, async (newValue, oldValue) => { +watch(show, async (newValue, _oldValue) => { showDrawer.value = newValue as boolean }) @@ -186,7 +177,7 @@ const getImageDetail = async (id: number) => { /** 监听 id 变化,加载最新图片详情 */ const { id } = toRefs(props) -watch(id, async (newVal, oldVal) => { +watch(id, async (newVal, _oldVal) => { if (newVal) { await getImageDetail(newVal) } @@ -194,31 +185,3 @@ watch(id, async (newVal, oldVal) => { const emits = defineEmits(['handleDrawerClose']) - diff --git a/src/views/ai/image/index/components/ImageList.vue b/src/views/ai/image/index/components/ImageList.vue index ced006f04..5169e4596 100644 --- a/src/views/ai/image/index/components/ImageList.vue +++ b/src/views/ai/image/index/components/ImageList.vue @@ -1,12 +1,19 @@