fix(short-drama-agent-front): 统一全屏布局与问题处理交互
This commit is contained in:
1 parent
db91a4b871
commit
cc27d463e0
25 files changed
+838
-316
No files matched your search
@@ -6,14 +6,14 @@ import { requiredTextRule, integerRule } from '../../../lib/form-rules'
|
||||
import { NButton, NInput, NInputNumber, NSelect } from 'naive-ui'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { ArrowRight, LoaderCircle, Plus } from '@lucide/vue'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import { AppDrawer } from '../../../components/ui'
|
||||
import { projectsApi } from '../api'
|
||||
import type { DramaDurationBudget } from '../types'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
|
||||
/** 新建剧本表单,202 成功后交由父级跳转,不在前端模拟生成。 */
|
||||
const emit = defineEmits<{ created: [projectId: string, executionId: string] }>()
|
||||
/** 新建剧本弹窗是否打开。 */
|
||||
/** 新建剧本全屏抽屉是否打开。 */
|
||||
const open = ref(false)
|
||||
/** 创建请求是否正在提交。 */
|
||||
const busy = ref(false)
|
||||
@@ -120,22 +120,22 @@ const rules = computed(() => ({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppDialog
|
||||
<!-- 以下是新建剧本入口与从右侧展开的全屏抽屉模块 -->
|
||||
<NButton @click="open = true" type="primary"><Plus :size="16" />新建剧本</NButton>
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="新建剧本"
|
||||
description="从一个故事想法开始。提交后,工作流将依次生成角色、世界观和剧集,并进行审核。"
|
||||
:busy="busy"
|
||||
class="create-project-drawer"
|
||||
>
|
||||
<template #trigger
|
||||
><NButton @click="open = true" type="primary"><Plus :size="16" />新建剧本</NButton></template
|
||||
>
|
||||
<AppForm
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:disabled="busy"
|
||||
:reset-key="open"
|
||||
class="mt-7 space-y-4"
|
||||
class="create-project-form grid gap-6"
|
||||
@submit="submit"
|
||||
>
|
||||
<!-- 以下是项目基本信息模块 -->
|
||||
@@ -147,65 +147,65 @@ const rules = computed(() => ({
|
||||
:input-props="{ id: 'title', autocomplete: 'off' }"
|
||||
></NInput
|
||||
></NFormItem>
|
||||
<NFormItem path="topic" label="故事主题" :label-props="{ for: 'topic' }"
|
||||
><NInput
|
||||
placeholder="描述主角、故事背景,以及你希望展开的核心冲突……"
|
||||
:disabled="busy"
|
||||
:input-props="{ id: 'topic' }"
|
||||
class="project-story-input min-h-32 resize-y"
|
||||
v-model:value="form.topic"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 12 }"
|
||||
></NInput
|
||||
></NFormItem>
|
||||
<!-- 故事内容:主题和风格相邻,方便填写与对照。 -->
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<!-- 以下是故事内容模块,主题和风格各占一行并铺满可用宽度 -->
|
||||
<div class="grid grid-cols-1 items-start gap-6">
|
||||
<NFormItem path="topic" label="故事主题" :label-props="{ for: 'topic' }"
|
||||
><NInput
|
||||
placeholder="描述主角、故事背景,以及你希望展开的核心冲突……"
|
||||
:disabled="busy"
|
||||
:input-props="{ id: 'topic' }"
|
||||
class="project-story-input min-h-48 resize-y"
|
||||
v-model:value="form.topic"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 6, maxRows: 16 }"
|
||||
></NInput
|
||||
></NFormItem>
|
||||
<NFormItem path="style" label="剧本风格" :label-props="{ for: 'style' }"
|
||||
><NInput
|
||||
placeholder="如:都市悬疑、爽文反转"
|
||||
:disabled="busy"
|
||||
:input-props="{ id: 'style' }"
|
||||
class="project-story-input min-h-32 resize-y"
|
||||
class="project-story-input min-h-48 resize-y"
|
||||
v-model:value="form.style"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 12 }"
|
||||
:autosize="{ minRows: 6, maxRows: 16 }"
|
||||
></NInput
|
||||
></NFormItem>
|
||||
</div>
|
||||
<!-- 时长与集数:按规划模式动态显示。 -->
|
||||
<NFormItem label="时长规划模式"
|
||||
><NSelect v-model:value="form.durationMode" :options="durationOptions" :disabled="busy"
|
||||
/></NFormItem>
|
||||
<NFormItem v-if="form.durationMode !== 'auto'" label="整剧目标时长(分钟)"
|
||||
><NInputNumber
|
||||
:value="form.totalMinutes"
|
||||
@update:value="form.totalMinutes = $event ?? 0"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="busy"
|
||||
class="w-full"
|
||||
/></NFormItem>
|
||||
<div v-if="form.durationMode === 'flexible_episode_count'" class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<NFormItem label="单集最短时长(秒)"
|
||||
<!-- 以下是时长与集数模块,各字段按规划模式逐行显示 -->
|
||||
<div class="grid grid-cols-1 items-start gap-6">
|
||||
<NFormItem label="时长规划模式"
|
||||
><NSelect v-model:value="form.durationMode" :options="durationOptions" :disabled="busy"
|
||||
/></NFormItem>
|
||||
<NFormItem v-if="form.durationMode !== 'auto'" label="整剧目标时长(分钟)"
|
||||
><NInputNumber
|
||||
:value="form.minSeconds"
|
||||
@update:value="form.minSeconds = $event ?? 0"
|
||||
:value="form.totalMinutes"
|
||||
@update:value="form.totalMinutes = $event ?? 0"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="busy"
|
||||
class="w-full"
|
||||
/></NFormItem>
|
||||
<NFormItem label="单集最长时长(秒)"
|
||||
><NInputNumber
|
||||
:value="form.maxSeconds"
|
||||
@update:value="form.maxSeconds = $event ?? 0"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="busy"
|
||||
class="w-full"
|
||||
/></NFormItem>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<template v-if="form.durationMode === 'flexible_episode_count'">
|
||||
<NFormItem label="单集最短时长(秒)"
|
||||
><NInputNumber
|
||||
:value="form.minSeconds"
|
||||
@update:value="form.minSeconds = $event ?? 0"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="busy"
|
||||
class="w-full"
|
||||
/></NFormItem>
|
||||
<NFormItem label="单集最长时长(秒)"
|
||||
><NInputNumber
|
||||
:value="form.maxSeconds"
|
||||
@update:value="form.maxSeconds = $event ?? 0"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="busy"
|
||||
class="w-full"
|
||||
/></NFormItem>
|
||||
</template>
|
||||
<NFormItem
|
||||
v-if="form.durationMode !== 'flexible_episode_count'"
|
||||
path="episodeCount"
|
||||
@@ -223,6 +223,7 @@ const rules = computed(() => ({
|
||||
</div>
|
||||
<FeedbackMessage v-if="feedback" :message="feedback" />
|
||||
</AppForm>
|
||||
<!-- 以下是固定底部操作模块,长内容滚动时仍可取消或提交 -->
|
||||
<template #footer>
|
||||
<NButton :disabled="busy" @click="open = false">取消</NButton>
|
||||
<NButton :disabled="busy" type="primary" @click="formRef?.validate(submit)">
|
||||
@@ -231,5 +232,5 @@ const rules = computed(() => ({
|
||||
<ArrowRight v-if="!busy" :size="16" />
|
||||
</NButton>
|
||||
</template>
|
||||
</AppDialog>
|
||||
</AppDrawer>
|
||||
</template>
|
||||
Reference in new issue
Block a user