921 lines
36 KiB
TypeScript
921 lines
36 KiB
TypeScript
import { lazy, type ReactNode, useEffect } from "react";
|
||
import { useLayoutMode } from "@/core/system-settings/hooks";
|
||
import { isEmbedActive, isHideChromeActive } from "@/core/embed/embed-session";
|
||
import { Navigate, Route, Routes, useLocation, useNavigate, useParams } from "react-router-dom";
|
||
import { toast } from "@/core/ui/feedback";
|
||
|
||
import { SidebarInset, SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
|
||
import { WorkspaceSidebar } from "@/components/workspace/workspace-sidebar";
|
||
import { getAccountDisplayName, getStoredAuth } from "@/core/auth";
|
||
import { readTaskContext } from "@/core/auth/task-purpose";
|
||
import {
|
||
persistCopTaskDetail,
|
||
prefetchTaskDeeplink,
|
||
resolveTaskDeeplinkTarget,
|
||
stubCopTaskDetail,
|
||
} from "@/core/auth/task-deeplink";
|
||
import { isSentimentAgentVisible } from "@/core/sentiment-agent/config";
|
||
import { RouteBaseProvider } from "@/core/route-base";
|
||
import "@/roundtable-planning/styles/roundtable-planning.css";
|
||
import { AGENT_MODULES } from "@/components/workspace/agents/agent-module-sidebar";
|
||
import { ChatRuntime } from "@/components/workspace/chat-runtime";
|
||
|
||
const AnalysisProjectsPage = lazy(() => import("./AnalysisProjectsPage"));
|
||
const GeneralQA = lazy(() => import("@/strategy-components/components/chat-qa/GeneralQA"));
|
||
const SentimentAnalyzes = lazy(
|
||
() => import("@/strategy-components/components/task-components/SentimentAnalyzes"),
|
||
);
|
||
const TaskManagement = lazy(
|
||
() => import("@/strategy-components/components/task-components/TaskManagement"),
|
||
);
|
||
const TaskPgFrom = lazy(
|
||
() => import("@/strategy-components/components/task-components/TaskPgFrom"),
|
||
);
|
||
const TaskTyFrom = lazy(
|
||
() => import("@/strategy-components/components/task-components/TaskTyFrom"),
|
||
);
|
||
const TaskXkFrom = lazy(
|
||
() => import("@/strategy-components/components/task-components/TaskXkFrom"),
|
||
);
|
||
const TaskAnalyzes = lazy(
|
||
() => import("@/strategy-components/components/task-components/TaskAnalyzes"),
|
||
);
|
||
const TaskFxWorkspace = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskFxWorkspace").then((module) => ({
|
||
default: module.TaskFxWorkspace,
|
||
})),
|
||
);
|
||
const TaskFxIndexResolver = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskFxWorkspace").then((module) => ({
|
||
default: module.TaskFxIndexResolver,
|
||
})),
|
||
);
|
||
const TaskFxChat = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskFxWorkspace").then((module) => ({
|
||
default: module.TaskFxChat,
|
||
})),
|
||
);
|
||
const TaskBindChat = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskFxWorkspace").then((module) => ({
|
||
default: module.TaskBindChat,
|
||
})),
|
||
);
|
||
const AgentFxWorkspace = lazy(() =>
|
||
import("@/strategy-components/components/task-components/AgentFxWorkspace").then((module) => ({
|
||
default: module.AgentFxWorkspace,
|
||
})),
|
||
);
|
||
const AgentFxIndexResolver = lazy(() =>
|
||
import("@/strategy-components/components/task-components/AgentFxWorkspace").then((module) => ({
|
||
default: module.AgentFxIndexResolver,
|
||
})),
|
||
);
|
||
const AgentFxChat = lazy(() =>
|
||
import("@/strategy-components/components/task-components/AgentFxWorkspace").then((module) => ({
|
||
default: module.AgentFxChat,
|
||
})),
|
||
);
|
||
const TaskAnalysisWorkspace = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskAnalysisWorkspace").then((module) => ({
|
||
default: module.TaskAnalysisWorkspace,
|
||
})),
|
||
);
|
||
const TaskAnalysisIndexResolver = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskAnalysisWorkspace").then((module) => ({
|
||
default: module.TaskAnalysisIndexResolver,
|
||
})),
|
||
);
|
||
const TaskAnalysisChat = lazy(() =>
|
||
import("@/strategy-components/components/task-components/TaskAnalysisWorkspace").then((module) => ({
|
||
default: module.TaskAnalysisChat,
|
||
})),
|
||
);
|
||
const ActionAnalyzes = lazy(() =>
|
||
import("@/strategy-components/components/task-components/ActionAnalyzes").then((module) => ({
|
||
default: module.ActionAnalyzes,
|
||
})),
|
||
);
|
||
const KnowledgeBaseResourceManagement = lazy(
|
||
() => import("@/strategy-components/components/resource-management/KnowledgeBaseResourceManagement"),
|
||
);
|
||
const NetworkActorResourceManagement = lazy(
|
||
() => import("@/strategy-components/components/resource-management/NetworkActorResourceManagement"),
|
||
);
|
||
const RoundtablePlanningPage = lazy(
|
||
() => import("@/roundtable-planning/pages/RoundtablePlanningPage"),
|
||
);
|
||
const PositionRoundtablePage = lazy(
|
||
() => import("@/position-roundtable/pages/PositionRoundtablePage"),
|
||
);
|
||
const EightBfRoundtablePage = lazy(
|
||
() => import("@/eightbf-roundtable/pages/EightBfRoundtablePage"),
|
||
);
|
||
const DashboardAgentPage = lazy(
|
||
() => import("@/roundtable-planning/pages/DashboardAgentPage"),
|
||
);
|
||
const DeepResearchPage = lazy(() => import("./DeepResearchPage"));
|
||
const GongwenWorkbench = lazy(() => import("./deep-research/GongwenWorkbench"));
|
||
const ReportStructureCreatePage = lazy(
|
||
() => import("./deep-research/ReportStructureCreatePage"),
|
||
);
|
||
const EnterpriseResearchPage = lazy(() => import("./EnterpriseResearchPage"));
|
||
const BusinessChainListPage = lazy(
|
||
() => import("@/roundtable-planning/pages/BusinessChainListPage"),
|
||
);
|
||
const BusinessChainEditorPage = lazy(
|
||
() => import("@/roundtable-planning/pages/BusinessChainEditorPage"),
|
||
);
|
||
const AgentChatPage = lazy(() => import("./AgentChatPage"));
|
||
const SentimentAgentChatPage = lazy(() => import("./SentimentAgentChatPage"));
|
||
const AgentModuleRoutes = lazy(() =>
|
||
import("./AgentModulePage").then((module) => ({ default: module.AgentModuleRoutes })),
|
||
);
|
||
const AgentsPage = lazy(() => import("./AgentsPage"));
|
||
const AgentsPlazaPage = lazy(() => import("./AgentsPlazaPage"));
|
||
const BusinessChainMappingPage = lazy(() => import("./BusinessChainMappingPage"));
|
||
const ChatPage = lazy(() => import("./ChatPage"));
|
||
const ChatsPage = lazy(() => import("./ChatsPage"));
|
||
const AdminUserLeaderboardPage = lazy(() => import("./AdminUserLeaderboardPage"));
|
||
const AdminUserLeaderboardSettingsPage = lazy(
|
||
() => import("./AdminUserLeaderboardSettingsPage"),
|
||
);
|
||
const PublicLeaderboardPage = lazy(() => import("./PublicLeaderboardPage"));
|
||
const LightAppIframeView = lazy(() => import("./LightAppIframeView"));
|
||
const LightAppListPage = lazy(() => import("./LightAppListPage"));
|
||
const LightAppManagementPage = lazy(() => import("./LightAppManagementPage"));
|
||
const MenuManagementPage = lazy(() => import("./MenuManagementPage"));
|
||
const LoginWhitelistPage = lazy(() => import("./LoginWhitelistPage"));
|
||
const FixedQuestionsPage = lazy(() => import("./FixedQuestionsPage"));
|
||
const SensitiveWordsPage = lazy(() => import("./SensitiveWordsPage"));
|
||
const SkillAddressesPage = lazy(() => import("./SkillAddressesPage"));
|
||
const TaskButtonsPage = lazy(() => import("./TaskButtonsPage"));
|
||
const HtmlTemplatesPage = lazy(() => import("./HtmlTemplatesPage"));
|
||
const PositionRolesPage = lazy(() => import("./PositionRolesPage"));
|
||
const RoundtableDiagnosticsPage = lazy(() => import("./RoundtableDiagnosticsPage"));
|
||
const LightAppNewNotePage = lazy(() => import("./LightAppNewNotePage"));
|
||
const LightAppNoteListPage = lazy(() => import("./LightAppNoteListPage"));
|
||
const LightAppNoteQAPage = lazy(() => import("./LightAppNoteQAPage"));
|
||
const NewAgentPage = lazy(() => import("./NewAgentPage"));
|
||
const PromptPrefixSettingsPage = lazy(() => import("./PromptPrefixSettingsPage"));
|
||
const PrivateSquareSettingsPage = lazy(() => import("./PrivateSquareSettingsPage"));
|
||
const ModelConcurrencySettingsPage = lazy(() => import("./ModelConcurrencySettingsPage"));
|
||
const RecommendedQuestionsPage = lazy(() => import("./RecommendedQuestionsPage"));
|
||
const ScheduledTaskRunDetailPage = lazy(() => import("./ScheduledTaskRunDetailPage"));
|
||
const ScheduledTasksPage = lazy(() => import("./ScheduledTasksPage"));
|
||
const SkillEvolutionPage = lazy(() => import("./SkillEvolutionPage"));
|
||
const SkillsPage = lazy(() => import("./SkillsPage"));
|
||
const PositionsPage = lazy(() => import("./PositionsPage"));
|
||
const TagsPage = lazy(() => import("./TagsPage"));
|
||
const UsersPage = lazy(() => import("./UsersPage"));
|
||
const LlmMetricsPage = lazy(() => import("./LlmMetricsPage"));
|
||
const AdminScheduledTasksPage = lazy(() => import("./AdminScheduledTasksPage"));
|
||
const AdminUserActivityPage = lazy(() => import("./AdminUserActivityPage"));
|
||
const AdminAuditRetentionPage = lazy(() => import("./AdminAuditRetentionPage"));
|
||
const StrategyProjectsPage = lazy(
|
||
() => import("@/strategy-selection/StrategyProjectsPage"),
|
||
);
|
||
const StrategySelectionPage = lazy(
|
||
() => import("@/strategy-selection/StrategySelectionPage"),
|
||
);
|
||
|
||
/**
|
||
* Strategy's legacy `/chats/:thread_id` route shares ChatPage's header.
|
||
* Unlike WorkspaceRoutes it did not render a WorkspaceSidebar, leaving the
|
||
* header's expand/collapse control with no visible panel to operate.
|
||
*/
|
||
function StrategyChatThreadLayout() {
|
||
return (
|
||
<div className="flex size-full min-h-0 overflow-hidden">
|
||
<WorkspaceSidebar compactChrome />
|
||
<SidebarInset className="min-w-0">
|
||
<ChatRuntime>
|
||
<ChatPage />
|
||
</ChatRuntime>
|
||
</SidebarInset>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function StrategyProjectsLayout({ children }: { children: ReactNode }) {
|
||
const [layoutMode] = useLayoutMode();
|
||
const showNavigation =
|
||
layoutMode === "compact" && !isEmbedActive() && !isHideChromeActive();
|
||
return (
|
||
<SidebarProvider defaultOpen className="relative h-full min-h-0 w-full overflow-hidden [&_[data-slot=sidebar-container]]:absolute [&_[data-slot=sidebar-container]]:left-0 [&_[data-slot=sidebar-container]]:top-0">
|
||
{showNavigation && <WorkspaceSidebar />}
|
||
<SidebarInset className="min-h-0 min-w-0 overflow-hidden">
|
||
{showNavigation && (
|
||
<div className="p-2 md:hidden"><SidebarTrigger aria-label="展开功能菜单" /></div>
|
||
)}
|
||
{children}
|
||
</SidebarInset>
|
||
</SidebarProvider>
|
||
);
|
||
}
|
||
|
||
function StrategyProjectWorkbenchRoute() {
|
||
const { project_id: projectId = "" } = useParams<{ project_id: string }>();
|
||
return <StrategySelectionPage key={projectId} projectId={projectId} />;
|
||
}
|
||
|
||
/**
|
||
* A custom business mapping's single-agent landing page.
|
||
*
|
||
* It intentionally has no task-workspace or agent-gallery left rail. The
|
||
* deep-link target adds `hideChrome=1`, so PageLayout also suppresses the
|
||
* global header and navigation sidebar for this clean entry surface.
|
||
*/
|
||
function CustomDeeplinkAgentChatRoute() {
|
||
const { agent_id: agentId = "" } = useParams<{ agent_id: string }>();
|
||
const context = readTaskContext();
|
||
const chatBasePath = `/page/strategy/custom-deeplink/${encodeURIComponent(agentId)}/chats`;
|
||
return (
|
||
<ChatRuntime>
|
||
<AgentChatPage
|
||
chatBasePath={chatBasePath}
|
||
taskBind
|
||
taskGoPath={context?.goPath}
|
||
hideTaskStartButton
|
||
// 自定义业务深链入口专属:启用该智能体的专属落地页风格;
|
||
// 智能体管理「对话」、任务工作区等其他入口不传,保持全局原样式。
|
||
agentStyleEnabled
|
||
/>
|
||
</ChatRuntime>
|
||
);
|
||
}
|
||
|
||
/**
|
||
* 已登录用户的自定义业务深链入口。
|
||
*
|
||
* 入口示例:
|
||
* ``#/page/strategy/custom-deeplink-entry?goPath=区域研判&hideChrome=1``。
|
||
* 它不经过 LoginPage,因此不会清理或重新建立当前登录会话;解析成功后复用与登录
|
||
* 深链一致的任务上下文、智能体/业务链配置与无全局 chrome 的落地页。
|
||
*/
|
||
function CustomDeeplinkEntryRoute() {
|
||
const { search } = useLocation();
|
||
const navigate = useNavigate();
|
||
const query = new URLSearchParams(search);
|
||
const taskId = query.get("taskId")?.trim() ?? "";
|
||
const goPath = query.get("goPath")?.trim() ?? "";
|
||
|
||
useEffect(() => {
|
||
let cancelled = false;
|
||
|
||
async function openDeeplink() {
|
||
if (!goPath) {
|
||
toast.error("缺少 goPath,无法打开自定义业务入口");
|
||
navigate("/page/strategy/qa/general", { replace: true });
|
||
return;
|
||
}
|
||
|
||
try {
|
||
let resolvedTaskId = taskId;
|
||
let detail = stubCopTaskDetail(taskId);
|
||
if (taskId) {
|
||
const prefetch = prefetchTaskDeeplink(taskId, goPath);
|
||
resolvedTaskId = (await prefetch.realTaskId) || taskId;
|
||
detail = (await prefetch.taskDetail) ?? stubCopTaskDetail(resolvedTaskId);
|
||
persistCopTaskDetail(detail);
|
||
}
|
||
if (cancelled) return;
|
||
|
||
const target = await resolveTaskDeeplinkTarget(
|
||
goPath,
|
||
detail,
|
||
resolvedTaskId,
|
||
taskId || undefined,
|
||
);
|
||
if (cancelled) return;
|
||
if (!target) {
|
||
toast.error("未找到该自定义类型的智能体或业务链配置");
|
||
navigate("/page/strategy/qa/general", { replace: true });
|
||
return;
|
||
}
|
||
navigate(target.path, { replace: true, state: target.state });
|
||
} catch (error) {
|
||
console.warn("[custom-deeplink-entry] resolve failed", { goPath, taskId, error });
|
||
if (cancelled) return;
|
||
toast.error("自定义业务入口跳转失败");
|
||
navigate("/page/strategy/qa/general", { replace: true });
|
||
}
|
||
}
|
||
|
||
void openDeeplink();
|
||
return () => { cancelled = true; };
|
||
}, [goPath, navigate, taskId]);
|
||
|
||
return (
|
||
<div className="text-muted-foreground flex size-full items-center justify-center text-sm">
|
||
正在打开业务入口…
|
||
</div>
|
||
);
|
||
}
|
||
|
||
export default function StrategyRoutes() {
|
||
const storedAuth = getStoredAuth();
|
||
const canManageBusinessMappings = !storedAuth || storedAuth.system_role === "admin";
|
||
|
||
return (
|
||
<RouteBaseProvider value="/page/strategy">
|
||
<SidebarProvider>
|
||
<div className="h-full w-full overflow-hidden">
|
||
<Routes>
|
||
<Route index element={<Navigate to="qa/general" replace />} />
|
||
|
||
<Route path="qa/general" element={<GeneralQA />} />
|
||
<Route
|
||
path="qa/projects"
|
||
element={
|
||
<StrategyProjectsLayout><StrategyProjectsPage basePath="/page/strategy/qa/projects" /></StrategyProjectsLayout>
|
||
}
|
||
/>
|
||
<Route path="qa/projects/solutions/*" element={<StrategyProjectsLayout><AnalysisProjectsPage basePath="/page/strategy/qa/projects/solutions" listPath="/page/strategy/qa/projects?type=solution" mode="solution" showSidebarTrigger={false} /></StrategyProjectsLayout>} />
|
||
<Route path="qa/projects/groups/*" element={<StrategyProjectsLayout><AnalysisProjectsPage basePath="/page/strategy/qa/projects/groups" listPath="/page/strategy/qa/projects?type=qa" mode="qa" showSidebarTrigger={false} /></StrategyProjectsLayout>} />
|
||
<Route
|
||
path="qa/projects/:project_id"
|
||
element={<StrategyProjectsLayout><StrategyProjectWorkbenchRoute /></StrategyProjectsLayout>}
|
||
/>
|
||
<Route
|
||
path="qa/strategy-selection"
|
||
element={<Navigate to="/page/strategy/qa/projects" replace />}
|
||
/>
|
||
<Route
|
||
path="qa/expert-qa"
|
||
element={
|
||
<GeneralQA
|
||
chatHeadTitle="æ¶“æ’³î†é—‚瓟"
|
||
chatDesign="é€îˆ›å¯”é—æ›¡ç–†RAG銆佸æžç”ŠAGéŠ†ä½¹ç¹æ´ï¸½î—…ç»±ãˆ å¼·ç¼æ’´ç‰ç€µè§„瘮"
|
||
/>
|
||
}
|
||
/>
|
||
<Route
|
||
path="qa/multi-agent-roundtable"
|
||
element={
|
||
<ChatRuntime>
|
||
<RoundtablePlanningPage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
<Route
|
||
path="qa/8bf-roundtable"
|
||
element={
|
||
<ChatRuntime>
|
||
<EightBfRoundtablePage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
<Route
|
||
path="qa/position-roundtable"
|
||
element={
|
||
<ChatRuntime>
|
||
<PositionRoundtablePage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
<Route path="qa/deep-research" element={<DeepResearchPage />} />
|
||
<Route
|
||
path="qa/gongwen"
|
||
element={<GongwenWorkbench />}
|
||
/>
|
||
<Route
|
||
path="qa/deep-research/structures/new"
|
||
element={
|
||
<ChatRuntime>
|
||
<ReportStructureCreatePage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
<Route path="qa/enterprise-research" element={<EnterpriseResearchPage />} />
|
||
|
||
{/* 大屏绘制智能体独立页面(按 taskId 存取;ChatRuntime 提供 ArtifactsProvider 给沙箱预览) */}
|
||
<Route
|
||
path="dashboard-agent"
|
||
element={
|
||
<ChatRuntime>
|
||
<DashboardAgentPage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
|
||
{/* 需求 0616 #3/#4:zzJC / zzXD 「按类型聚合」模块页(重做,独立路由)。 */}
|
||
<Route path="qa/zzjc/*" element={<AgentModuleRoutes module={AGENT_MODULES.zzjc} />} />
|
||
<Route path="qa/zzxd/*" element={<AgentModuleRoutes module={AGENT_MODULES.zzxd} />} />
|
||
|
||
<Route path="task-management" element={<TaskManagement />}>
|
||
<Route index element={<Navigate to="xk-task-jc" replace />} />
|
||
<Route
|
||
path="xk-task-jc"
|
||
element={<TaskXkFrom gopath="/#/pageIndie/pageHome/pageSwrw" />}
|
||
/>
|
||
<Route
|
||
path="xk-task-dispatch"
|
||
element={<TaskXkFrom gopath="/#/pageIndie/pageJczl" />}
|
||
/>
|
||
<Route
|
||
path="effect-task-pg"
|
||
element={<TaskPgFrom gopath="task" />}
|
||
/>
|
||
<Route
|
||
path="effect-action-pg"
|
||
element={<TaskPgFrom gopath="xd" />}
|
||
/>
|
||
<Route
|
||
path="effect-info-pg"
|
||
element={<TaskPgFrom gopath="info" />}
|
||
/>
|
||
<Route
|
||
path="plan-task-sentiment"
|
||
element={
|
||
<SentimentAnalyzes
|
||
title="三情分析"
|
||
category="规划任务"
|
||
subCategory="规划任务"
|
||
/>
|
||
}
|
||
/>
|
||
{/* 任务深链(3qfx / 3qfx-A):把智能体问答 / 会商嵌进 3QFX 业务上下文。 */}
|
||
<Route
|
||
path="plan-task-sentiment/roundtable"
|
||
element={
|
||
<ChatRuntime>
|
||
<RoundtablePlanningPage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
{/* 三情分析:任务工作区(左对话列表 1:N,无目的树闸门;新建对话直接带开场信息)。 */}
|
||
<Route
|
||
path="plan-task-sentiment/agent/:agent_id/chats"
|
||
element={
|
||
<TaskFxWorkspace taskBase="/page/strategy/task-management/plan-task-sentiment" business="3qfx" lite />
|
||
}
|
||
>
|
||
<Route
|
||
index
|
||
element={
|
||
<TaskFxIndexResolver
|
||
taskBase="/page/strategy/task-management/plan-task-sentiment"
|
||
business="3qfx"
|
||
/>
|
||
}
|
||
/>
|
||
<Route
|
||
path=":thread_id"
|
||
element={
|
||
<TaskBindChat
|
||
taskBase="/page/strategy/task-management/plan-task-sentiment"
|
||
business="3qfx"
|
||
/>
|
||
}
|
||
/>
|
||
</Route>
|
||
<Route
|
||
path="plan-task/plan-task-fx"
|
||
element={
|
||
<TaskAnalyzes
|
||
title="任务分析"
|
||
category="规划任务"
|
||
subCategory="规划任务"
|
||
/>
|
||
}
|
||
/>
|
||
{/* 任务深链(rwfx / rwfx-A):嵌进 任务FX 业务上下文。 */}
|
||
<Route
|
||
path="plan-task/plan-task-fx/roundtable"
|
||
element={
|
||
<ChatRuntime>
|
||
<RoundtablePlanningPage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
{/* 任务FX:任务工作区(左对话列表 1:N + 右问答;新建对话顶部目的树闸门)。 */}
|
||
<Route
|
||
path="plan-task/plan-task-fx/agent/:agent_id/chats"
|
||
element={
|
||
<TaskFxWorkspace taskBase="/page/strategy/task-management/plan-task/plan-task-fx" business="rwfx" />
|
||
}
|
||
>
|
||
<Route
|
||
index
|
||
element={
|
||
<TaskFxIndexResolver
|
||
taskBase="/page/strategy/task-management/plan-task/plan-task-fx"
|
||
business="rwfx"
|
||
/>
|
||
}
|
||
/>
|
||
<Route
|
||
path=":thread_id"
|
||
element={
|
||
<TaskFxChat
|
||
taskBase="/page/strategy/task-management/plan-task/plan-task-fx"
|
||
business="rwfx"
|
||
autoStartWhenPurposeEmpty
|
||
/>
|
||
}
|
||
/>
|
||
</Route>
|
||
<Route
|
||
path="plan-task/plan-task-action"
|
||
element={
|
||
<ActionAnalyzes
|
||
title="xdfx"
|
||
category="ç‘™å‹«åžæµ 诲姟"
|
||
subCategory="ç‘™å‹«åžæµ 诲姟"
|
||
/>
|
||
}
|
||
/>
|
||
{/* 任务深链(xdfx / xdfx-A):嵌进 XDFX 业务上下文。 */}
|
||
<Route
|
||
path="plan-task/plan-task-action/roundtable"
|
||
element={
|
||
<ChatRuntime>
|
||
<RoundtablePlanningPage />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
{/* 行动分析:任务工作区(左对话列表 1:N 精简版 + 左上行动详情卡片;直接问答,
|
||
右上角「开始回答」按钮手动发出开场信息,不走目的树闸门/覆盖确认)。
|
||
注意:xdfx 深链传入的是「行动id」,登录时已先经 resolveDeeplinkTaskId 换成任务id。 */}
|
||
<Route
|
||
path="plan-task/plan-task-action/agent/:agent_id/chats"
|
||
element={
|
||
<TaskFxWorkspace taskBase="/page/strategy/task-management/plan-task/plan-task-action" business="xdfx" lite />
|
||
}
|
||
>
|
||
<Route
|
||
index
|
||
element={
|
||
<TaskFxIndexResolver
|
||
taskBase="/page/strategy/task-management/plan-task/plan-task-action"
|
||
business="xdfx"
|
||
/>
|
||
}
|
||
/>
|
||
<Route
|
||
path=":thread_id"
|
||
element={
|
||
<TaskBindChat
|
||
taskBase="/page/strategy/task-management/plan-task/plan-task-action"
|
||
business="xdfx"
|
||
/>
|
||
}
|
||
/>
|
||
</Route>
|
||
{/* 任务深链(agentfx):新系统 iframe 嵌入的智能体问答工作区(独立复制的 3qfx lite 版,
|
||
任务详情来自本系统 cop-task-detail;业务映射用 AFX 行,见 agentfx-deeplink)。 */}
|
||
<Route
|
||
path="plan-task-agentfx/agent/:agent_id/chats"
|
||
element={
|
||
<AgentFxWorkspace taskBase="/page/strategy/task-management/plan-task-agentfx" />
|
||
}
|
||
>
|
||
<Route
|
||
index
|
||
element={
|
||
<AgentFxIndexResolver taskBase="/page/strategy/task-management/plan-task-agentfx" />
|
||
}
|
||
/>
|
||
<Route
|
||
path=":thread_id"
|
||
element={
|
||
<AgentFxChat taskBase="/page/strategy/task-management/plan-task-agentfx" />
|
||
}
|
||
/>
|
||
</Route>
|
||
{/* b5-1:接入方先写入本系统详情,再由任务分析单智能体读取并问答。 */}
|
||
<Route
|
||
path="plan-task-b5-1/agent/:agent_id/chats"
|
||
element={
|
||
<TaskAnalysisWorkspace taskBase="/page/strategy/task-management/plan-task-b5-1" />
|
||
}
|
||
>
|
||
<Route
|
||
index
|
||
element={
|
||
<TaskAnalysisIndexResolver taskBase="/page/strategy/task-management/plan-task-b5-1" />
|
||
}
|
||
/>
|
||
<Route
|
||
path=":thread_id"
|
||
element={
|
||
<TaskAnalysisChat taskBase="/page/strategy/task-management/plan-task-b5-1" />
|
||
}
|
||
/>
|
||
</Route>
|
||
<Route path="mnty-task-mechanism" element={<TaskTyFrom defaultPage="iframeXdty" title="XDTY任务" />} />
|
||
<Route path="mnty-task-plan" element={<TaskTyFrom defaultPage="iframeFaty" title="方案TY任务" />} />
|
||
<Route path="mnty-task-zsty" element={<TaskTyFrom defaultPage="iframeSysystem" title="XXTY任务" />} />
|
||
</Route>
|
||
|
||
<Route
|
||
path="resource-management/resource-network-actor"
|
||
element={<NetworkActorResourceManagement />}
|
||
/>
|
||
<Route
|
||
path="resource-management/resource-knowledge-base"
|
||
element={<KnowledgeBaseResourceManagement />}
|
||
/>
|
||
<Route
|
||
path="resource-management/resource-evaluation-index"
|
||
element={<TaskXkFrom gopath="#/pageIndie/pageZyjc/pageZyzl" />}
|
||
/>
|
||
|
||
<Route path="light-app/management" element={<LightAppManagementPage />} />
|
||
<Route path="light-app/apps" element={<LightAppListPage />} />
|
||
<Route path="light-app/view/:appId" element={<LightAppIframeView />} />
|
||
<Route path="light-app/new-note" element={<LightAppNewNotePage />} />
|
||
<Route path="light-app/notes" element={<LightAppNoteListPage />} />
|
||
<Route path="light-app/note-qa" element={<LightAppNoteQAPage />} />
|
||
|
||
<Route path="chats" element={<ChatsPage />} />
|
||
<Route
|
||
path="chats/:thread_id"
|
||
element={<StrategyChatThreadLayout />}
|
||
/>
|
||
|
||
<Route path="agents" element={<AgentsPage />} />
|
||
<Route path="agents/plaza" element={<AgentsPlazaPage />} />
|
||
<Route path="agents/new" element={<NewAgentPage />} />
|
||
{/* 舆情分析虚拟智能体:经 Gateway 转发外部 AG-UI 网关的专用对话页。 */}
|
||
<Route
|
||
path="agents/sentiment-analysis/chats"
|
||
element={
|
||
isSentimentAgentVisible() ? (
|
||
<Navigate to="/page/strategy/agents/sentiment-analysis/chats/new" replace />
|
||
) : (
|
||
<Navigate to="/page/strategy/agents" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="agents/sentiment-analysis/chats/:thread_id"
|
||
element={
|
||
isSentimentAgentVisible() ? (
|
||
<SentimentAgentChatPage />
|
||
) : (
|
||
<Navigate to="/page/strategy/agents" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="agents/:agent_id/chats"
|
||
element={<Navigate to="/page/strategy/agents" replace />}
|
||
/>
|
||
<Route
|
||
path="agents/:agent_id/chats/:thread_id"
|
||
element={
|
||
<ChatRuntime>
|
||
<AgentChatPage showAgentList />
|
||
</ChatRuntime>
|
||
}
|
||
/>
|
||
<Route
|
||
path="custom-deeplink/:agent_id/chats/:thread_id"
|
||
element={<CustomDeeplinkAgentChatRoute />}
|
||
/>
|
||
<Route path="custom-deeplink-entry" element={<CustomDeeplinkEntryRoute />} />
|
||
|
||
<Route path="skills" element={<SkillsPage />} />
|
||
<Route path="skills/evolution" element={<SkillEvolutionPage />} />
|
||
<Route
|
||
path="business-chain-mapping"
|
||
element={
|
||
canManageBusinessMappings ? (
|
||
<BusinessChainMappingPage />
|
||
) : (
|
||
<Navigate to="/page/strategy/qa/general" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route path="business-chains" element={<BusinessChainListPage />} />
|
||
<Route path="roundtable/chains" element={<BusinessChainEditorPage />} />
|
||
|
||
<Route
|
||
path="scheduled"
|
||
element={<Navigate to="/page/strategy/scheduled/tasks" replace />}
|
||
/>
|
||
<Route path="scheduled/tasks" element={<ScheduledTasksPage />} />
|
||
<Route
|
||
path="scheduled/runs/:run_id"
|
||
element={<ScheduledTaskRunDetailPage />}
|
||
/>
|
||
|
||
<Route
|
||
path="settings/recommended-questions"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<RecommendedQuestionsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="settings/prompt-prefix"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<PromptPrefixSettingsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="settings/private-square"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<PrivateSquareSettingsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="settings/model-concurrency"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<ModelConcurrencySettingsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="settings/llm-metrics"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<LlmMetricsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/users"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<UsersPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/menu-management"
|
||
element={
|
||
<MenuManagementPage />
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/fixed-questions"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<FixedQuestionsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/sensitive-words"
|
||
element={
|
||
getAccountDisplayName().toLowerCase() === "lqq" ? (
|
||
<SensitiveWordsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/task-buttons"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<TaskButtonsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/html-templates"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<HtmlTemplatesPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/position-roles"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<PositionRolesPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/login-whitelist"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<LoginWhitelistPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/roundtable-diagnostics"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<RoundtableDiagnosticsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/skill-addresses"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<SkillAddressesPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/scheduled-tasks"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<AdminScheduledTasksPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route path="user-leaderboard" element={<PublicLeaderboardPage />} />
|
||
<Route
|
||
path="admin/user-leaderboard"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<AdminUserLeaderboardPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/user-leaderboard/settings"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<AdminUserLeaderboardSettingsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/user-activity"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<AdminUserActivityPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/audit-retention"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<AdminAuditRetentionPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
<Route
|
||
path="admin/tags"
|
||
element={<TagsPage />}
|
||
/>
|
||
<Route
|
||
path="admin/positions"
|
||
element={
|
||
getStoredAuth()?.system_role === "admin" ? (
|
||
<PositionsPage />
|
||
) : (
|
||
<Navigate to="/page/workspace/chats/new" replace />
|
||
)
|
||
}
|
||
/>
|
||
</Routes>
|
||
</div>
|
||
</SidebarProvider>
|
||
</RouteBaseProvider>
|
||
);
|
||
}
|