feat: 对齐后端能力并补齐形态提示词与生产诊断
This commit is contained in:
1 parent
7d8074f90e
commit
f71d2bf0a4
30 files changed
+1707
-66
No files matched your search
@@ -0,0 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NAlert, NButton } from 'naive-ui'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import { downloadText } from '../../../lib/format'
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
import type { SubjectFormAsset } from '../types'
|
||||
|
||||
/** 只管理后端正式提示词;原始外观只读,不提供后端尚不支持的手工保存接口。 */
|
||||
const props = defineProps<{ form: SubjectFormAsset | null; disabled: boolean }>()
|
||||
const open = defineModel<boolean>('open', { default: false })
|
||||
const emit = defineEmits<{ generate: [formId: string, force: boolean] }>()
|
||||
const hasPrompt = computed(() => !!props.form?.generationPrompt?.trim())
|
||||
|
||||
/** 固定本次正式 Form ID,重生成只覆盖提示词,不替换历史图片。 */
|
||||
function generate() {
|
||||
if (!props.disabled && props.form) emit('generate', props.form.id, hasPrompt.value)
|
||||
}
|
||||
|
||||
/** 导出数据库已保存的提示词,不把原始外观伪装成最终 Prompt。 */
|
||||
function exportPrompt() {
|
||||
if (props.form?.generationPrompt) downloadText(`form-${props.form.id}-prompt.txt`, props.form.generationPrompt)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppDialog
|
||||
v-model:open="open"
|
||||
title="形态正式提示词"
|
||||
:description="`${form?.subject.name || ''} · ${form?.name || ''}`"
|
||||
>
|
||||
<NAlert type="info" :show-icon="false" class="mt-5 text-xs">
|
||||
结合形态描述与项目视觉风格生成并保存
|
||||
generationPrompt。只调用文本模型,不生成图片;覆盖不会修改已有图片的实际提示词或主图。
|
||||
</NAlert>
|
||||
<section class="surface-inset mt-5 p-4">
|
||||
<h3 class="text-sm font-medium">原始外观素材</h3>
|
||||
<p class="mt-3 whitespace-pre-wrap break-words text-xs leading-6 text-muted">
|
||||
{{ form?.appearancePrompt || form?.description || '暂无原始外观素材' }}
|
||||
</p>
|
||||
</section>
|
||||
<section class="surface-inset mt-4 p-4">
|
||||
<h3 class="text-sm font-medium">正式生图提示词</h3>
|
||||
<p class="mt-3 whitespace-pre-wrap break-words text-sm leading-6">
|
||||
{{ form?.generationPrompt || '尚未生成。可先在这里生成检查,也可由生图接口自动补齐。' }}
|
||||
</p>
|
||||
</section>
|
||||
<div class="mt-5 flex flex-wrap items-center gap-3">
|
||||
<ConfirmAction
|
||||
:key="form?.id"
|
||||
:label="hasPrompt ? '重新生成正式提示词' : '生成正式提示词'"
|
||||
:disabled="disabled || !form"
|
||||
acknowledgement
|
||||
:description="`为 ${form?.subject.name || ''} · ${form?.name || ''} ${hasPrompt ? '覆盖已有' : '补齐'}正式提示词。会调用文本模型,已有图片保持不变。`"
|
||||
@confirm="generate"
|
||||
/>
|
||||
<NButton :disabled="!hasPrompt" @click="exportPrompt">导出提示词</NButton>
|
||||
</div>
|
||||
</AppDialog>
|
||||
</template>
|
||||
Reference in new issue
Block a user