feat(short-drama-agent-front): 完善镜头定位与项目配置
This commit is contained in:
1 parent
470b52e26d
commit
5b134207b8
66 files changed
+2042
-984
No files matched your search
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NFormItem, NInputNumber, NSelect, NSwitch, NTag } from 'naive-ui'
|
||||
import FieldLabel from '../../../components/ui/FieldLabel.vue'
|
||||
import type { SelectOption } from 'naive-ui'
|
||||
import type {
|
||||
CreativeProfileAspectRatio,
|
||||
@@ -9,6 +10,7 @@ import type {
|
||||
GenerationOptions
|
||||
} from '../types'
|
||||
|
||||
/** 本次生成模型与参数控件,字段说明在标签图标中按需查看。 */
|
||||
const props = defineProps<{
|
||||
type: 'image' | 'video'
|
||||
catalog: GenerationModelCatalog
|
||||
@@ -17,15 +19,19 @@ const props = defineProps<{
|
||||
aspectRatio: CreativeProfileAspectRatio
|
||||
disabled?: boolean
|
||||
}>()
|
||||
/** 模型与参数编辑通知。 */
|
||||
const emit = defineEmits<{
|
||||
'update:provider': [value: string]
|
||||
'update:options': [value: GenerationOptions]
|
||||
}>()
|
||||
|
||||
/** 当前已启用的媒介模型。 */
|
||||
const models = computed(() =>
|
||||
(props.type === 'image' ? props.catalog.images : props.catalog.videos).filter(item => item.enabled)
|
||||
)
|
||||
/** 本次选择的实际模型。 */
|
||||
const model = computed(() => models.value.find(item => item.provider === props.provider) ?? models.value[0])
|
||||
/** 可用模型的下拉选项。 */
|
||||
const modelOptions = computed(() =>
|
||||
models.value.map(item => ({
|
||||
label: item.modelLabel ? `${item.providerLabel} · ${item.modelLabel}` : item.providerLabel,
|
||||
@@ -88,7 +94,10 @@ function selectValue(key: string): string | number | null {
|
||||
:key="item.key"
|
||||
class="generation-model-field"
|
||||
:label="item.label"
|
||||
:show-feedback="false"
|
||||
>
|
||||
<!-- 以下是生成参数标签与说明提示模块 -->
|
||||
<template #label><FieldLabel :label="item.label" :description="item.description" /></template>
|
||||
<div class="generation-model-field-control">
|
||||
<div v-if="item.type === 'boolean'" class="generation-model-toggle">
|
||||
<NSwitch
|
||||
@@ -120,14 +129,13 @@ function selectValue(key: string): string | number | null {
|
||||
:disabled="disabled || item.userEditable === false"
|
||||
@update:value="updateOption(item.key, $event)"
|
||||
/>
|
||||
<p v-if="item.description" class="generation-model-description">{{ item.description }}</p>
|
||||
</div>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem class="generation-model-field" label="画幅比例">
|
||||
<NFormItem class="generation-model-field" label="画幅比例" :show-feedback="false">
|
||||
<template #label><FieldLabel label="画幅比例" description="项目画幅 · 单次生成不可覆盖" /></template>
|
||||
<div class="generation-model-static">
|
||||
<NTag size="small">{{ aspectRatio }}</NTag>
|
||||
<span class="generation-model-description">项目画幅 · 单次生成不可覆盖</span>
|
||||
</div>
|
||||
</NFormItem>
|
||||
</template>
|
||||
@@ -165,9 +173,6 @@ function selectValue(key: string): string | number | null {
|
||||
.generation-model-static {
|
||||
@apply flex min-h-[34px] min-w-0 items-center gap-2.5;
|
||||
}
|
||||
.generation-model-description {
|
||||
@apply m-0 text-[11px] leading-5 text-muted;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.generation-model-controls {
|
||||
@apply grid-cols-[minmax(0,_1fr)] gap-y-4;
|
||||
|
||||
Reference in new issue
Block a user