代码修改

This commit is contained in:
fengxiangdebaozi committed 2026-06-10 17:01:17 +08:00
1 parent 559340143e
commit e03ca7b4bd
8 files changed
+249 -85

No files matched your search

@@ -0,0 +1,64 @@
/**
* 业务链条配置页(独立页面版)。
*
* 把原本挂在圆桌页顶栏「业务链条」按钮上的 `BusinessChainListDialog` 弹窗内容,
* 单独画成一个全屏页面:综合管理 → 业务链条配置 入口进来即是本页。
*
* - 列表主体复用 `BusinessChainListBody`(与弹窗同一份加载 / 发布 / 卡片逻辑)。
* - 顶部「配置」按钮 = 进入编辑器空白新建;卡片「设置」= 进入编辑器并切到该链条。
*
* 路由 base 感知:用 `useRouteNavigate` 跳转,strategy / workspace 两套路由树下
* 都能落到当前 base 的编辑器(`roundtable/chains`)。
*/
import { LayersIcon, SettingsIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useRouteNavigate } from "@/core/route-base";
import { BusinessChainListBody } from "@/roundtable-planning/components/BusinessChainListDialog";
export default function BusinessChainListPage() {
const navigate = useRouteNavigate();
// 进入编辑器:带 chainId = 打开并切到该链条;不带 = 空白新建。
// 路径写 workspace base,`useRouteNavigate` 会按当前路由 base 改写。
const goConfigure = (chainId?: string) => {
navigate(
chainId
? `/page/workspace/roundtable/chains?chainId=${encodeURIComponent(chainId)}`
: "/page/workspace/roundtable/chains",
);
};
return (
<div className="flex h-full min-h-0 flex-col bg-muted/40 text-foreground">
{/* 顶栏:标题 + 描述 + 配置入口 */}
<header className="shrink-0 border-b border-border bg-card px-6 py-4">
<div className="mx-auto flex w-full max-w-3xl items-start justify-between gap-4">
<div className="min-w-0">
<div className="flex items-center gap-2 text-base font-bold text-foreground">
<LayersIcon className="size-5 text-primary" />
业务链条配置
</div>
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">
可复用的有序智能体编排。点击卡片「设置」可进入编辑器修改该链条;「发布」后所有账号都能在「公共」里查看 / 选用。
</p>
</div>
<Button onClick={() => goConfigure()} className="shrink-0 gap-1.5">
<SettingsIcon className="size-4" />
配置
</Button>
</div>
</header>
{/* 列表主体(与弹窗共用 BusinessChainListBody) */}
<div className="mx-auto flex w-full min-h-0 max-w-3xl flex-1 flex-col px-6 py-4">
<BusinessChainListBody
active
onConfigure={goConfigure}
emptyHint="业务链条是可复用的有序智能体编排。点击右上角「配置」去创建第一条链条。"
/>
</div>
</div>
);
}