接口地址修改
This commit is contained in:
1 parent
19aeba5fab
commit
cf5550ab0a
2 files changed
+66
-24
No files matched your search
@@ -62,8 +62,13 @@ export const sidebarMenuItems: MenuItem[] = [
|
||||
path: "/page/strategy/qa/multi-agent-roundtable",
|
||||
},
|
||||
// { id: "expert-qa", label: "专家问答", icon: Brain, path: "/page/strategy/qa/expert-qa" },
|
||||
{ id: "qa-zzjc", label: "zzjc支持", icon: Bot },
|
||||
{ id: "qa-zzxd", label: "zzXD应用", icon: Layout },
|
||||
{
|
||||
id: "qa-zzjc",
|
||||
label: "zzjc支持",
|
||||
icon: Bot,
|
||||
path: "/page/strategy/agents/6bf/chats/new",
|
||||
},
|
||||
{ id: "qa-zzxd", label: "zzXD应用", icon: Layout, path: "/page/strategy/agents/10d69686718349688e58a8790cb61024/chats/new", },
|
||||
{ id: "qa-research", label: "课题研究", icon: FileText, path: "/page/canvas/ai-writing" },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -289,6 +289,43 @@ function ChainCard({
|
||||
const deletedCount = chain.seats.length - survivingCount;
|
||||
const usable = survivingCount >= CHAIN_MIN_SEATS;
|
||||
|
||||
// ── 席位编排(体现「同层并行 · 层间串行」)─────────────────────────────
|
||||
// 名称回退表:实时 name(nameById)→ 落库快照(seat.name)→ agent_id。
|
||||
const seatById = new Map(chain.seats.map((s) => [s.agent_id, s] as const));
|
||||
// 带 stages(分层编排)按 stages 渲染(过滤空阶段);否则每席位各成一段、顺序串行。
|
||||
const stages =
|
||||
chain.stages && chain.stages.length > 0
|
||||
? chain.stages.filter((s) => s.length > 0)
|
||||
: chain.seats.map((s) => [s.agent_id]);
|
||||
// 跨阶段累加的全局序号 —— 决定头像配色,与展平 seats 顺序对齐。
|
||||
const orderById = new Map<string, number>();
|
||||
let seatOrder = 0;
|
||||
for (const stageIds of stages) {
|
||||
for (const id of stageIds) {
|
||||
orderById.set(id, seatOrder);
|
||||
seatOrder += 1;
|
||||
}
|
||||
}
|
||||
// 单个席位 tag:存活按配色,已删除置灰删除线(保留旧行为)。
|
||||
const seatTag = (agentId: string) => {
|
||||
const alive = isExisting(agentId);
|
||||
const label = nameById.get(agentId) ?? seatById.get(agentId)?.name ?? agentId;
|
||||
return (
|
||||
<span
|
||||
key={`tag-${agentId}`}
|
||||
className={cn(
|
||||
"rounded border px-1.5 py-0.5 text-[11px] font-medium",
|
||||
alive
|
||||
? chainTagClasses(getAvatarTypeFor(agentId, orderById.get(agentId) ?? 0))
|
||||
: "border-dashed border-border bg-muted text-muted-foreground/60 line-through",
|
||||
)}
|
||||
title={alive ? undefined : "该智能体已不存在"}
|
||||
>
|
||||
{label}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
@@ -322,36 +359,36 @@ function ChainCard({
|
||||
<div className="mt-1 line-clamp-1 text-xs text-muted-foreground">{chain.description}</div>
|
||||
)}
|
||||
|
||||
{/* 智能体名 tag(按顺序,← 箭头连接) */}
|
||||
{/* 席位编排:按 stage 分组——并行阶段竖向并列在虚线框里,阶段之间用 → 串联。
|
||||
不用 <Fragment>:dev 期 tagger 会往 Fragment 注入 data-lov-id 触发 React 警告,
|
||||
这里用带 key 的扁平数组(箭头 + 阶段),注入落到真实元素上即可。 */}
|
||||
<div className="mt-2 flex flex-wrap items-center gap-1">
|
||||
{chain.seats.flatMap((seat, i) => {
|
||||
const alive = isExisting(seat.agent_id);
|
||||
const label = nameById.get(seat.agent_id) ?? seat.name ?? seat.agent_id;
|
||||
// 不用 <Fragment>:dev 期 tagger 会往 Fragment 注入 data-lov-id 触发 React 警告,
|
||||
// 这里改成带 key 的扁平数组(箭头 + tag),注入落到真实元素上即可。
|
||||
{stages.flatMap((stageIds, stageIdx) => {
|
||||
const nodes: ReactNode[] = [];
|
||||
if (i > 0) {
|
||||
if (stageIdx > 0) {
|
||||
nodes.push(
|
||||
<ArrowRightIcon
|
||||
key={`arrow-${seat.agent_id}`}
|
||||
key={`arrow-${stageIdx}`}
|
||||
className="size-3 shrink-0 text-muted-foreground/50"
|
||||
/>,
|
||||
);
|
||||
}
|
||||
nodes.push(
|
||||
<span
|
||||
key={`tag-${seat.agent_id}`}
|
||||
className={cn(
|
||||
"rounded border px-1.5 py-0.5 text-[11px] font-medium",
|
||||
alive
|
||||
? chainTagClasses(getAvatarTypeFor(seat.agent_id, i))
|
||||
: "border-dashed border-border bg-muted text-muted-foreground/60 line-through",
|
||||
)}
|
||||
title={alive ? undefined : "该智能体已不存在"}
|
||||
>
|
||||
{label}
|
||||
</span>,
|
||||
);
|
||||
if (stageIds.length > 1) {
|
||||
// 并行阶段:席位竖向并列在虚线框里,左上角标「并行 N」。
|
||||
nodes.push(
|
||||
<div
|
||||
key={`stage-${stageIdx}`}
|
||||
className="relative flex flex-col gap-1 rounded-lg border border-dashed border-primary/40 bg-primary/[0.04] px-1.5 pb-1.5 pt-2.5"
|
||||
>
|
||||
<span className="pointer-events-none absolute -top-2 left-1.5 rounded-full bg-card px-1.5 text-[10px] font-semibold leading-tight text-primary">
|
||||
并行 {stageIds.length}
|
||||
</span>
|
||||
{stageIds.map((id) => seatTag(id))}
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
nodes.push(seatTag(stageIds[0]));
|
||||
}
|
||||
return nodes;
|
||||
})}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user