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
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { NButton } from 'naive-ui'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import { AppDrawer } from '../../../components/ui'
|
||||
import type { ShotValidation } from '../types'
|
||||
|
||||
/** 同一剧集、节拍和镜头的校验问题分组。 */
|
||||
@@ -14,7 +14,7 @@ interface BreakdownIssueGroup {
|
||||
messages: string[]
|
||||
}
|
||||
|
||||
/** 拆解问题单独展示,设置弹窗不承载长错误正文。 */
|
||||
/** 拆解问题及调用方提供的修订、恢复操作使用独立全屏抽屉展示。 */
|
||||
const props = defineProps<{
|
||||
/** 后端分镜校验问题,保留原始描述和位置。 */
|
||||
issues: ShotValidation['issues']
|
||||
@@ -23,10 +23,10 @@ const props = defineProps<{
|
||||
/** 当前结果是否允许定位到分镜正文。 */
|
||||
locatable: boolean
|
||||
}>()
|
||||
/** 独立问题弹窗显隐。 */
|
||||
/** 独立问题抽屉显隐。 */
|
||||
const open = defineModel<boolean>('open', { default: false })
|
||||
/** 弹窗关闭后再定位正文或打开设置,避免叠加焦点陷阱。 */
|
||||
const emit = defineEmits<{ locate: [issue: ShotValidation['issues'][number]]; settings: [] }>()
|
||||
/** 抽屉关闭后再定位正文,避免焦点陷阱阻止定位。 */
|
||||
const emit = defineEmits<{ locate: [issue: ShotValidation['issues'][number]] }>()
|
||||
/** 相同镜头的问题合并为一组,重复消息不重复显示。 */
|
||||
const groups = computed(() => {
|
||||
const result = new Map<string, BreakdownIssueGroup>()
|
||||
@@ -42,11 +42,9 @@ const groups = computed(() => {
|
||||
const count = computed(() => groups.value.reduce((total, group) => total + group.messages.length, 0))
|
||||
/** 等待离场后执行的定位。 */
|
||||
const pendingLocation = ref<ShotValidation['issues'][number] | null>(null)
|
||||
/** 等待离场后打开设置。 */
|
||||
const pendingSettings = ref(false)
|
||||
|
||||
/**
|
||||
* 关闭问题弹窗后定位到对应剧集、节拍或镜头。
|
||||
* 关闭问题抽屉后定位到对应剧集、节拍或镜头。
|
||||
* @param issue 后端提供的问题位置
|
||||
*/
|
||||
function locate(issue: ShotValidation['issues'][number]) {
|
||||
@@ -54,11 +52,6 @@ function locate(issue: ShotValidation['issues'][number]) {
|
||||
pendingLocation.value = { ...issue }
|
||||
open.value = false
|
||||
}
|
||||
/** 关闭当前弹窗后打开拆解设置,避免同时显示两个操作弹窗。 */
|
||||
function settings() {
|
||||
pendingSettings.value = true
|
||||
open.value = false
|
||||
}
|
||||
/** 离场动画结束后再交接焦点。 */
|
||||
function finish() {
|
||||
if (pendingLocation.value) {
|
||||
@@ -66,16 +59,12 @@ function finish() {
|
||||
pendingLocation.value = null
|
||||
emit('locate', issue)
|
||||
}
|
||||
if (pendingSettings.value) {
|
||||
pendingSettings.value = false
|
||||
emit('settings')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是独立的拆解执行错误与分镜校验问题模块 -->
|
||||
<AppDialog v-model:open="open" title="拆解问题" wide @closed="finish">
|
||||
<!-- 以下是全屏展示的拆解执行错误与分镜校验问题模块 -->
|
||||
<AppDrawer v-model:open="open" title="拆解问题" @closed="finish">
|
||||
<template #description
|
||||
><span v-if="count">{{ count }} 项校验问题 · {{ groups.length }} 个位置</span
|
||||
><span v-else>查看最近保存结果中的问题</span></template
|
||||
@@ -105,12 +94,12 @@ function finish() {
|
||||
</p>
|
||||
</article>
|
||||
<p v-if="!groups.length && !workflowError" class="py-5 text-sm text-muted">
|
||||
后端尚未返回具体问题,请刷新拆解结果后查看。
|
||||
当前没有具体错误描述,可读取修复清单确认待处理镜头。
|
||||
</p>
|
||||
</div>
|
||||
<template #footer
|
||||
><NButton @click="settings">拆解设置</NButton
|
||||
><NButton type="primary" @click="open = false">关闭</NButton></template
|
||||
>
|
||||
</AppDialog>
|
||||
<!-- 以下是独立的问题修订与阶段恢复模块,不承载生成配置或候选提交 -->
|
||||
<div v-if="$slots.repair" class="mt-6 space-y-5" aria-label="问题修订与恢复"><slot name="repair" /></div>
|
||||
<!-- 以下是灰底关闭操作,绿色主按钮仅用于提交或执行任务 -->
|
||||
<template #footer><NButton type="default" @click="open = false">关闭</NButton></template>
|
||||
</AppDrawer>
|
||||
</template>
|
||||
Reference in new issue
Block a user