-
-
+
+
-import { computed, ref } from 'vue'
+import { computed, ref, watch } from 'vue'
import { NButton, NTabs, NTabPane } from 'naive-ui'
import { AppDrawer } from '../../../components/ui'
import type { CreativeProfileInput } from '../types'
import CreativeProfileSettings from './CreativeProfileSettings.vue'
import QualityPolicySettings from './QualityPolicySettings.vue'
+import type { ProjectSettingsTab } from '../context'
/** 项目全局配置全屏抽屉参数。 */
-const props = defineProps<{
- /** 当前正式项目 ID。 */
- projectId: string
- /** 项目操作期间只读查看,禁止保存模型配置。 */
- disabled: boolean
-}>()
+const props = withDefaults(
+ defineProps<{
+ /** 当前正式项目 ID。 */
+ projectId: string
+ /** 项目操作期间只读查看,禁止保存模型配置。 */
+ disabled: boolean
+ /** 辅助入口指定本次打开的配置分类。 */ initialTab?: ProjectSettingsTab
+ }>(),
+ { initialTab: 'generation' }
+)
/** 真实保存成功后通知项目布局更新就绪信息。 */
-const emit = defineEmits<{ saved: [profile: CreativeProfileInput] }>()
+const emit = defineEmits<{
+ /** 生成配置已真实保存。 */ saved: [profile: CreativeProfileInput]
+ /** 质量规则已真实保存,需要重新读取项目阶段状态。 */ qualitySaved: []
+}>()
/** 项目配置全屏抽屉显隐状态。 */
const open = defineModel('open', { default: false })
/** 保存进行中时禁止关闭抽屉,避免重复写入。 */
@@ -22,7 +30,11 @@ const saving = ref(false)
/** 配置表单实例,footer 调用表单自身的校验与保存入口。 */
const form = ref | null>(null)
/** 项目级配置分类保持同一个全屏抽屉与底栏。 */
-const tab = ref('generation')
+const tab = ref(props.initialTab)
+/** 每次打开定位本次请求的分类,保存中不打断当前表单。 */
+watch([open, () => props.initialTab, () => props.projectId], ([shown]) => {
+ if (shown && !saving.value) tab.value = props.initialTab
+})
/** 质量策略表单实例。 */
const qualityForm = ref | null>(null)
/** 当前标签的独立保存入口,避免跨接口混合保存。 */
@@ -32,7 +44,9 @@ const activeForm = computed(() => (tab.value === 'quality' ? qualityForm.value :
- 设置生成模型、画布与质量规则,后续制作使用已保存的项目配置。
+ 生成配置用于后续生图和视频;质量规则用于拆解与分镜检查,启动拆解时会引导核对确认。
@@ -54,6 +68,7 @@ const activeForm = computed(() => (tab.value === 'quality' ? qualityForm.value :
:project-id="props.projectId"
:disabled="props.disabled"
@busy="saving = $event"
+ @saved="emit('qualitySaved')"
/>
diff --git a/src/features/generation-config/components/QualityPolicySummary.vue b/src/features/generation-config/components/QualityPolicySummary.vue
new file mode 100644
index 0000000..d385d4d
--- /dev/null
+++ b/src/features/generation-config/components/QualityPolicySummary.vue
@@ -0,0 +1,33 @@
+
+
+
+
+ 前往项目配置
diff --git a/src/features/projects/ProjectLayout.vue b/src/features/projects/ProjectLayout.vue
index fd6d846..bdf25cb 100644
--- a/src/features/projects/ProjectLayout.vue
+++ b/src/features/projects/ProjectLayout.vue
@@ -18,6 +18,7 @@ import { productionMessage } from '../production/production-messages'
import StoryboardPreparation from '../storyboard-preparation/StoryboardPreparation.vue'
import ProjectSettingsDialog from '../generation-config/components/ProjectSettingsDialog.vue'
import { projectGenerationRevisionKey, projectSettingsOpenKey } from '../generation-config/context'
+import type { ProjectSettingsTab } from '../generation-config/context'
import CreateDramaSkeleton from '../create-drama/CreateDramaSkeleton.vue'
import BreakdownSkeleton from '../breakdown/BreakdownSkeleton.vue'
import VisualStyleSkeleton from '../visual-style/VisualStyleSkeleton.vue'
@@ -39,8 +40,14 @@ const generationRevision = ref(0)
provide(projectGenerationRevisionKey, generationRevision)
/** 项目标题栏共用配置弹窗开关。 */
const settingsOpen = ref(false)
-/** 打开标题栏已有的项目配置抽屉,保留当前镜头与工作区。 */
-function openProjectSettings() {
+/** 本次项目配置打开的指定分类,不改变当前工作区路由。 */
+const settingsTab = ref('generation')
+/**
+ * 打开标题栏已有配置抽屉,保留当前镜头与工作区。
+ * @param tab 本次需要定位的配置分类
+ */
+function openProjectSettings(tab: ProjectSettingsTab = 'generation') {
+ settingsTab.value = tab
settingsOpen.value = true
}
provide(projectSettingsOpenKey, openProjectSettings)
@@ -48,7 +55,7 @@ provide(projectSettingsOpenKey, openProjectSettings)
watch(
() => route.query.configure,
value => {
- if (value === 'profile') settingsOpen.value = true
+ if (value === 'profile') openProjectSettings()
},
{ immediate: true }
)
@@ -292,7 +299,7 @@ onScopeDispose(() => {
size="small"
aria-label="项目配置"
:disabled="!context.project.value"
- @click="settingsOpen = true"
+ @click="openProjectSettings()"
> 项目配置
@@ -315,9 +322,11 @@ onScopeDispose(() => {
:key="id"
v-if="context.project.value?.id === id"
v-model:open="settingsOpen"
+ :initial-tab="settingsTab"
:project-id="id"
:disabled="operation.pending"
@saved="projectSettingsSaved"
+ @quality-saved="context.refresh()"
/>
diff --git a/src/features/storyboard-preparation/StoryboardPreparation.vue b/src/features/storyboard-preparation/StoryboardPreparation.vue
index e0dd659..e204fcc 100644
--- a/src/features/storyboard-preparation/StoryboardPreparation.vue
+++ b/src/features/storyboard-preparation/StoryboardPreparation.vue
@@ -1,11 +1,13 @@
+
+
+
diff --git a/src/features/generation-config/context.ts b/src/features/generation-config/context.ts
index c203b08..82fea7b 100644
--- a/src/features/generation-config/context.ts
+++ b/src/features/generation-config/context.ts
@@ -1,9 +1,12 @@
import { inject, ref, type InjectionKey, type Ref } from 'vue'
+/** 项目配置沿用同一个抽屉,可直接定位生成配置或质量规则。 */
+export type ProjectSettingsTab = 'generation' | 'quality'
+
/** 项目内共享的配置修订号,成功保存后通知已挂载的生成表单重新读取。 */
export const projectGenerationRevisionKey: InjectionKey> = Symbol('project-generation-revision')
/** 工作区辅助入口打开同一个项目配置抽屉,避免新建重复表单或覆盖当前路由。 */
-export const projectSettingsOpenKey: InjectionKey<() => void> = Symbol('project-settings-open')
+export const projectSettingsOpenKey: InjectionKey<(tab?: ProjectSettingsTab) => void> = Symbol('project-settings-open')
/**
* 读取项目配置修订号,独立使用组件时保留本地修订状态。
diff --git a/src/features/production/components/AdvancedProduction.vue b/src/features/production/components/AdvancedProduction.vue
index 44e370f..c4778ea 100644
--- a/src/features/production/components/AdvancedProduction.vue
+++ b/src/features/production/components/AdvancedProduction.vue
@@ -153,7 +153,7 @@ const confirmationDescription = computed(
v-if="openProjectSettings"
class="workspace-action-button"
:disabled="operation.pending"
- @click="openProjectSettings"
+ @click="openProjectSettings()"
>
物理表现:{{ physicsLabels[policy.physicsMode] }}
+
+ 夸张动作:{{ policy.allowExaggeratedMotion ? '允许' : '不允许' }}
+ 非物理动作:{{ policy.allowNonPhysicalActions ? '允许' : '不允许' }}
+ 超自然能力:{{ policy.allowSupernaturalAbilities ? '允许' : '不允许' }}
+
+
+
+ 自定义规则
+-
+
- + {{ rule }} + +
未添加自定义规则。
+