feat(short-drama-agent-front): 接入关系修复并优化配置与弹窗

This commit is contained in:
GJ committed 2026-10-31 22:37:22 +08:00
1 parent 2db8549818
commit 41d1cfe3ed
15 files changed
+1134 -323

No files matched your search

+76 -9
View File
@@ -49,6 +49,10 @@ const issuesOpen = ref(false)
const exceptionSaving = ref(false)
/** 从设置切换时等待关闭动画结束,避免两层弹窗同时显示。 */
const pendingIssues = ref(false)
/** 候选安全预检与关系修复使用独立抽屉,不与拆解设置叠加。 */
const candidateSafetyOpen = ref(false)
/** 从设置交接时绑定项目,离场后禁止打开旧项目预检。 */
const pendingSafetyProject = ref('')
/** 问题入口统一使用红色文字、图标和柔和底色,交互时保持错误语义。 */
const issueButtonTheme = {
color: 'var(--app-danger-soft)',
@@ -209,7 +213,24 @@ function finishOpeningIssues() {
pendingIssues.value = false
issuesOpen.value = true
}
if (pendingSafetyProject.value) {
const id = pendingSafetyProject.value
pendingSafetyProject.value = ''
if (id === projectId.value) candidateSafetyOpen.value = true
}
}
/** 打开同一个候选预检抽屉;从设置进入先释放原有焦点约束。 */
function openCandidateSafety() {
if (toolsOpen.value) {
pendingSafetyProject.value = projectId.value
toolsOpen.value = false
} else candidateSafetyOpen.value = true
}
/** 项目变化时撤销旧的抽屉交接,不回填旧项目预检。 */
watch(projectId, () => {
pendingSafetyProject.value = ''
candidateSafetyOpen.value = false
})
/**
* 切换到分镜结果并定位后端返回的真实问题坐标。
* @param issue 问题所属剧集、节拍和镜头
@@ -785,15 +806,18 @@ const isInitialEmpty = computed(
任务状态尚未确认,请重新读取后台状态后再操作。
</p>
</section>
<BreakdownCandidatePanel
v-show="!startPolicy.reviewOpen.value"
:project-id="projectId"
:state="qualityObservation.source.value.state || undefined"
:quality="quality"
:checkpoint-id="latestCheckpoint?.checkpointId"
:disabled="issueActionsDisabled"
@refresh="refreshCandidate"
/>
<!-- 以下是候选确认交接入口,问题与预检在独立抽屉处理 -->
<section v-if="quality.isCandidate && !startPolicy.reviewOpen.value" class="space-y-3">
<h3 class="text-sm font-medium">待确认的拆解候选</h3>
<p class="text-sm text-muted">候选通过质量审核后,再核对安全预检并确认采用正式结果。</p>
<NButton
class="workspace-action-button"
:disabled="issueActionsDisabled || !quality.canRequestCommitPreview"
@click="openCandidateSafety"
>
<template #icon><ShieldCheck :size="15" aria-hidden="true" /></template>候选安全预检
</NButton>
</section>
<!-- 以下是明确标记的历史执行回执,旧任务结论不表示当前候选质量 -->
<component
:is="executionHistorical ? NCollapse : 'div'"
@@ -898,6 +922,24 @@ const isInitialEmpty = computed(
>
<template #suffix
><div class="tabs-toolbar-actions breakdown-toolbar-actions">
<!-- 以下是待安全预检候选的直接入口,桌面显示文字,手机保留图标与提示 -->
<WorkspaceActionTooltip
v-if="quality.isCandidate && quality.canRequestCommitPreview"
label="候选安全预检"
mobile-only
>
<NButton
class="workspace-action-button breakdown-safety-trigger"
aria-label="候选安全预检"
aria-haspopup="dialog"
:aria-expanded="candidateSafetyOpen"
:disabled="issueActionsDisabled"
@click="openCandidateSafety"
>
<template #icon><ShieldCheck :size="15" aria-hidden="true" /></template>
<span class="breakdown-safety-label">候选安全预检</span>
</NButton>
</WorkspaceActionTooltip>
<!-- 以下是移动端校验问题入口,与设置图标并排且共用问题详情 -->
<NButton
v-if="hasBreakdownIssues"
@@ -1055,6 +1097,17 @@ const isInitialEmpty = computed(
</section>
</template>
</WorkspacePage>
<!-- 以下是独立的安全预检、单条关系修复和最终采用流程,共用真实状态刷新 -->
<BreakdownCandidatePanel
v-model:open="candidateSafetyOpen"
:project-id="projectId"
:state="qualityObservation.source.value.state || undefined"
:quality="quality"
:checkpoint-id="latestCheckpoint?.checkpointId"
:disabled="issueActionsDisabled"
:episodes="project?.episodes ?? []"
@refresh="refreshCandidate"
/>
<!-- 以下是与拆解设置分离的全屏问题详情抽屉 -->
<BreakdownIssuesDialog
v-model:open="issuesOpen"
@@ -1398,4 +1451,18 @@ const isInitialEmpty = computed(
@apply min-h-0 flex-nowrap;
}
}
/* 工具栏在手机仅保留预检图标,正文与底栏的确认操作继续显示完整文字。 */
@media (max-width: 639px) {
.breakdown-safety-label {
display: none;
}
.breakdown-safety-trigger {
width: 34px;
height: 34px;
padding: 0;
}
.breakdown-safety-trigger .n-button__icon {
margin: 0;
}
}
</style>