feat(roundtable): 深链接第一步任务/行动展示 + xdfx 行动详情接入会商
- Step1 深链接(taskId)下:左栏顶部「业务链选择」隐藏,改显当前任务(rwfx/3qfx:任务名称+描述) 或当前行动(xdfx:行动名称+叙事);顶栏「业务链条」入口隐藏;「新建任务」改「重新分析」 (复位 autoStarted + resetToStep1,对同一任务重做意图分析) - xdfx 行动详情接入会商:fetchActionDetail 取到即 persistActionDetail 缓存;新增 readActionDetail/persistActionDetail + ACTION_DETAIL_STORAGE_KEY;resolveTaskDeeplinkTarget 会商分支为 xdfx 把 actionId/actionName 带入 roundtablePrefill - xdfx 首条交给任务理解的消息 = 任务名称 + 任务描述 + 行动名称 - 「原任务已有结果」(目的树预览 headerLeftSlot) 仅 rwfx-A(6BF) 显示 注:行动详情 mock(actionName/narration) 在 config.yaml(按惯例不提交,单独管理)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b1b1ff98f5
commit
b513a0d56c
2 files changed
+160
-15
No files matched your search
@@ -35,6 +35,9 @@ export interface CopTaskDetail {
|
||||
/** 任务详情整包暂存的 sessionStorage key(目标页/后续可读取)。 */
|
||||
export const COP_TASK_DETAIL_STORAGE_KEY = "login.copTaskDetail";
|
||||
|
||||
/** 行动详情整包暂存的 sessionStorage key(xdfx 行动分析:会商/单智能体读取行动名称/叙事)。 */
|
||||
export const ACTION_DETAIL_STORAGE_KEY = "login.actionDetail";
|
||||
|
||||
/** goPath 基础码 → 业务码(配置管理 businessCode)。 */
|
||||
const GOPATH_BUSINESS_CODE: Record<string, string> = {
|
||||
"3qfx": "3Q", // 三情分析
|
||||
@@ -111,6 +114,25 @@ export function readCopTaskDetail(): CopTaskDetail | null {
|
||||
}
|
||||
}
|
||||
|
||||
/** 把行动详情整包暂存到 sessionStorage(xdfx 行动分析用;隐私模式/quota 异常时静默失败)。 */
|
||||
export function persistActionDetail(detail: ActionDetail): void {
|
||||
try {
|
||||
sessionStorage.setItem(ACTION_DETAIL_STORAGE_KEY, JSON.stringify(detail));
|
||||
} catch {
|
||||
/* noop */
|
||||
}
|
||||
}
|
||||
|
||||
/** 读取暂存的行动详情(会商左上角「当前行动」、单智能体行动详情卡都可读)。 */
|
||||
export function readActionDetail(): ActionDetail | null {
|
||||
try {
|
||||
const raw = sessionStorage.getItem(ACTION_DETAIL_STORAGE_KEY);
|
||||
return raw ? (JSON.parse(raw) as ActionDetail) : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 行动详情接口 ``{action_detail_url}/{actionId}`` 返回的 ``data`` 字段(xdfx 行动分析用)。 */
|
||||
export interface ActionDetail {
|
||||
/** 行动id(深链 ?taskId= 传入的就是它)。 */
|
||||
@@ -148,7 +170,7 @@ export async function fetchActionDetail(actionId: string): Promise<ActionDetail
|
||||
const data = body && typeof body === "object" ? (body as { data?: unknown }).data : null;
|
||||
if (!data || typeof data !== "object") return null;
|
||||
const d = data as Record<string, unknown>;
|
||||
return {
|
||||
const detail: ActionDetail = {
|
||||
id: d.id != null ? String(d.id) : "",
|
||||
taskId: d.taskId != null ? String(d.taskId) : "",
|
||||
purposeId: d.purposeId != null ? String(d.purposeId) : "",
|
||||
@@ -157,6 +179,10 @@ export async function fetchActionDetail(actionId: string): Promise<ActionDetail
|
||||
typeof d.actionStatus === "number" || typeof d.actionStatus === "string" ? d.actionStatus : "",
|
||||
narration: typeof d.narration === "string" ? d.narration : "",
|
||||
};
|
||||
// 取到即整包暂存:登录解析任务id 时(resolveDeeplinkTaskId→fetchTaskIdFromAction)就会缓存它,
|
||||
// 之后会商左上角「当前行动」、单智能体行动详情卡都能直接 readActionDetail(),避免重复请求。
|
||||
persistActionDetail(detail);
|
||||
return detail;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -228,6 +254,15 @@ export async function resolveTaskDeeplinkTarget(
|
||||
if (parsed.roundtable) {
|
||||
// 多智能体会商:嵌进对应业务的「任务管理」布局;businessCode 让会商页自动选用配置的业务链条;
|
||||
// taskId 让会商页按任务隔离存取草稿(一个 taskId 多条记录),并触发第三步自动结构化输出。
|
||||
// xdfx(行动分析):根是「行动」——把行动名称随首条消息交给任务理解,左上角展示「当前行动」。
|
||||
// 行动详情登录解析任务id 时已缓存(fetchActionDetail 内 persistActionDetail);这里优先读缓存。
|
||||
let actionName = "";
|
||||
let actionId = "";
|
||||
if (parsed.businessCode === XDFX_BUSINESS_CODE && rawId) {
|
||||
actionId = rawId;
|
||||
const ad = readActionDetail() ?? (await fetchActionDetail(rawId));
|
||||
actionName = ad?.actionName ?? "";
|
||||
}
|
||||
return {
|
||||
path: `${taskBase}/roundtable`,
|
||||
state: {
|
||||
@@ -236,6 +271,8 @@ export async function resolveTaskDeeplinkTarget(
|
||||
taskGoal: detail.taskContent,
|
||||
businessCode: parsed.businessCode,
|
||||
taskId: taskId || undefined,
|
||||
...(actionId ? { actionId } : {}),
|
||||
...(actionName ? { actionName } : {}),
|
||||
autoStart: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user