代码合并
This commit is contained in:
1 parent
7548620683
commit
3632b0d726
17 files changed
+279
-25
No files matched your search
@@ -16,7 +16,13 @@ VITE_AIPI_GENERATE_CHAT_URL=https://ch1.b.uat.4.cn/jialai_b1_chat
|
|||||||
VITE_AIPI_TASK_CHAT_URL=https://ch1.b.uat.4.cn/qq_b1_chat
|
VITE_AIPI_TASK_CHAT_URL=https://ch1.b.uat.4.cn/qq_b1_chat
|
||||||
VITE_AIPI_KNOWLEDGE_URL=https://chlib.b.uat.4.cn/knowlibrary
|
VITE_AIPI_KNOWLEDGE_URL=https://chlib.b.uat.4.cn/knowlibrary
|
||||||
VITE_AIPI_B1COH_URL=https://ch1.b.uat.4.cn/web
|
VITE_AIPI_B1COH_URL=https://ch1.b.uat.4.cn/web
|
||||||
VITE_AIPI_B2ACTOR_URL=htttps://ty.b.uat.4.cn
|
VITE_AIPI_B2ACTOR_URL=https://ty.b.uat.4.cn
|
||||||
|
VITE_AIPI_B2ACTOR_XWT_PATH=/fromB/toXWT?isFrame=1
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_API_URL=https://ch1.b.uat.4.cn/knowes/api/iframeKnowledgeUrl
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_SKIN=red
|
||||||
|
VITE_AIPI_B2ACTOR_XWT_PATH=/fromB/toXWT?isFrame=1
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_API_URL=https://ch1.b.uat.4.cn/knowes/api/iframeKnowledgeUrl
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_SKIN=red
|
||||||
VITE_AIPI_MOPECHAT_URL=https://ch1.b.uat.4.cn/likun_b1_mope
|
VITE_AIPI_MOPECHAT_URL=https://ch1.b.uat.4.cn/likun_b1_mope
|
||||||
VITE_AIPI_BACKENP_URL=https://knowledgetoolserver.b.uat.4.cn
|
VITE_AIPI_BACKENP_URL=https://knowledgetoolserver.b.uat.4.cn
|
||||||
VITE_AIPI_CONSUMER_URL=https://ch1.b.uat.4.cn/consumer
|
VITE_AIPI_CONSUMER_URL=https://ch1.b.uat.4.cn/consumer
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ VITE_AIPI_GENERATE_CHAT_URL=https://ch1.b.uat.4.cn/jialai_b1_chat
|
|||||||
VITE_AIPI_TASK_CHAT_URL=https://ch1.b.uat.4.cn/qq_b1_chat
|
VITE_AIPI_TASK_CHAT_URL=https://ch1.b.uat.4.cn/qq_b1_chat
|
||||||
VITE_AIPI_KNOWLEDGE_URL=https://chlib.b.uat.4.cn/knowlibrary
|
VITE_AIPI_KNOWLEDGE_URL=https://chlib.b.uat.4.cn/knowlibrary
|
||||||
VITE_AIPI_B1COH_URL=https://ch1.b.uat.4.cn/web
|
VITE_AIPI_B1COH_URL=https://ch1.b.uat.4.cn/web
|
||||||
VITE_AIPI_B2ACTOR_URL=htttps://ty.b.uat.4.cn
|
VITE_AIPI_B2ACTOR_URL=https://ty.b.uat.4.cn
|
||||||
|
VITE_AIPI_B2ACTOR_XWT_PATH=/fromB/toXWT?isFrame=1
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_API_URL=https://ch1.b.uat.4.cn/knowes/api/iframeKnowledgeUrl
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_SKIN=red
|
||||||
VITE_AIPI_MOPECHAT_URL=https://ch1.b.uat.4.cn/likun_b1_mope
|
VITE_AIPI_MOPECHAT_URL=https://ch1.b.uat.4.cn/likun_b1_mope
|
||||||
VITE_AIPI_BACKENP_URL=https://knowledgetoolserver.b.uat.4.cn
|
VITE_AIPI_BACKENP_URL=https://knowledgetoolserver.b.uat.4.cn
|
||||||
VITE_AIPI_CONSUMER_URL=https://ch1.b.uat.4.cn/consumer
|
VITE_AIPI_CONSUMER_URL=https://ch1.b.uat.4.cn/consumer
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
# --- 生产打包(见 .env.production)---
|
# --- 生产打包(见 .env.production)---
|
||||||
# 部署前修改 .env.production 中的地址,再执行 pnpm build
|
# 部署前修改 .env.production 中的地址,再执行 pnpm build
|
||||||
|
|
||||||
|
# VITE_AIPI_B2ACTOR_URL=https://ty.b.uat.4.cn
|
||||||
|
# VITE_AIPI_B2ACTOR_XWT_PATH=/fromB/toXWT?isFrame=1
|
||||||
|
# VITE_AIPI_KNOWLEDGE_IFRAME_API_URL=https://ch1.b.uat.4.cn/knowes/api/iframeKnowledgeUrl
|
||||||
|
# VITE_AIPI_KNOWLEDGE_IFRAME_SKIN=red
|
||||||
|
|
||||||
# 可选
|
# 可选
|
||||||
# VITE_CANVAS_LANGGRAPH_BASE_URL=
|
# VITE_CANVAS_LANGGRAPH_BASE_URL=
|
||||||
# VITE_STATIC_WEBSITE_ONLY=
|
# VITE_STATIC_WEBSITE_ONLY=
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ VITE_AIPI_GENERATE_CHAT_URL=https://ch1.b.uat.4.cn/jialai_b1_chat
|
|||||||
VITE_AIPI_TASK_CHAT_URL=https://ch1.b.uat.4.cn/qq_b1_chat
|
VITE_AIPI_TASK_CHAT_URL=https://ch1.b.uat.4.cn/qq_b1_chat
|
||||||
VITE_AIPI_KNOWLEDGE_URL=https://chlib.b.uat.4.cn/knowlibrary
|
VITE_AIPI_KNOWLEDGE_URL=https://chlib.b.uat.4.cn/knowlibrary
|
||||||
VITE_AIPI_B1COH_URL=https://ch1.b.uat.4.cn/web
|
VITE_AIPI_B1COH_URL=https://ch1.b.uat.4.cn/web
|
||||||
VITE_AIPI_B2ACTOR_URL=htttps://ty.b.uat.4.cn
|
VITE_AIPI_B2ACTOR_URL=https://ty.b.uat.4.cn
|
||||||
|
VITE_AIPI_B2ACTOR_XWT_PATH=/fromB/toXWT?isFrame=1
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_API_URL=https://ch1.b.uat.4.cn/knowes/api/iframeKnowledgeUrl
|
||||||
|
VITE_AIPI_KNOWLEDGE_IFRAME_SKIN=red
|
||||||
VITE_AIPI_MOPECHAT_URL=https://ch1.b.uat.4.cn/likun_b1_mope
|
VITE_AIPI_MOPECHAT_URL=https://ch1.b.uat.4.cn/likun_b1_mope
|
||||||
VITE_AIPI_BACKENP_URL=https://knowledgetoolserver.b.uat.4.cn
|
VITE_AIPI_BACKENP_URL=https://knowledgetoolserver.b.uat.4.cn
|
||||||
VITE_AIPI_CONSUMER_URL=https://ch1.b.uat.4.cn/consumer
|
VITE_AIPI_CONSUMER_URL=https://ch1.b.uat.4.cn/consumer
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ const menuItems: MenuItem[] = [
|
|||||||
icon: HelpCircle,
|
icon: HelpCircle,
|
||||||
children: [
|
children: [
|
||||||
{ id: "general-qa", label: "通用问答", icon: CircleHelp, path: "/page/workspace/chats/new" },
|
{ id: "general-qa", label: "通用问答", icon: CircleHelp, path: "/page/workspace/chats/new" },
|
||||||
|
{ id: "expert-qa", label: "专家问答", icon: Brain, path: "/page/strategy/qa/expert-qa" },
|
||||||
{ id: "qa-zzjc", label: "zzjc支持", icon: Bot },
|
{ id: "qa-zzjc", label: "zzjc支持", icon: Bot },
|
||||||
{ id: "qa-zzxd", label: "zzXD应用", icon: Layout },
|
{ id: "qa-zzxd", label: "zzXD应用", icon: Layout },
|
||||||
{ id: "qa-research", label: "课题研究", icon: FileText, path: "/page/canvas/ai-writing" },
|
{ id: "qa-research", label: "课题研究", icon: FileText, path: "/page/canvas/ai-writing" },
|
||||||
@@ -237,9 +238,24 @@ const menuItems: MenuItem[] = [
|
|||||||
label: "资源管理",
|
label: "资源管理",
|
||||||
icon: Database,
|
icon: Database,
|
||||||
children: [
|
children: [
|
||||||
{ id: "resource-network-xwt", label: "网络xwt资源管理", icon: Network },
|
{
|
||||||
{ id: "resource-knowledge-base", label: "知识库资源管理", icon: Library },
|
id: "resource-network-xwt",
|
||||||
{ id: "resource-zz", label: "ZZ资源管理", icon: FileBox },
|
label: "网络xwt资源管理",
|
||||||
|
icon: Network,
|
||||||
|
path: "/page/strategy/resource-management/resource-network-actor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resource-knowledge-base",
|
||||||
|
label: "知识库资源管理",
|
||||||
|
icon: Library,
|
||||||
|
path: "/page/strategy/resource-management/resource-knowledge-base",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resource-evaluation-index",
|
||||||
|
label: "作战资源管理",
|
||||||
|
icon: FileBox,
|
||||||
|
path: "/page/strategy/resource-management/resource-evaluation-index",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ const menuItems: MenuItem[] = [
|
|||||||
icon: HelpCircle,
|
icon: HelpCircle,
|
||||||
children: [
|
children: [
|
||||||
{ id: "general-qa", label: "通用问答", icon: CircleHelp, path: "/page/workspace/chats/new" },
|
{ id: "general-qa", label: "通用问答", icon: CircleHelp, path: "/page/workspace/chats/new" },
|
||||||
|
{ id: "expert-qa", label: "专家问答", icon: Brain, path: "/page/strategy/qa/expert-qa" },
|
||||||
// 「圆桌规划」入口暂时隐藏 —— 功能仍在 /page/roundtable/planning,只是不在侧边栏出现。
|
// 「圆桌规划」入口暂时隐藏 —— 功能仍在 /page/roundtable/planning,只是不在侧边栏出现。
|
||||||
// 需要重新开放时取消注释即可。
|
// 需要重新开放时取消注释即可。
|
||||||
// {
|
// {
|
||||||
@@ -291,9 +292,24 @@ const menuItems: MenuItem[] = [
|
|||||||
label: "资源管理",
|
label: "资源管理",
|
||||||
icon: Database,
|
icon: Database,
|
||||||
children: [
|
children: [
|
||||||
{ id: "resource-network-xwt", label: "网络xwt资源管理", icon: Network },
|
{
|
||||||
{ id: "resource-knowledge-base", label: "知识库资源管理", icon: Library },
|
id: "resource-network-xwt",
|
||||||
{ id: "resource-zz", label: "ZZ资源管理", icon: FileBox },
|
label: "网络xwt资源管理",
|
||||||
|
icon: Network,
|
||||||
|
path: "/page/strategy/resource-management/resource-network-actor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resource-knowledge-base",
|
||||||
|
label: "知识库资源管理",
|
||||||
|
icon: Library,
|
||||||
|
path: "/page/strategy/resource-management/resource-knowledge-base",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resource-evaluation-index",
|
||||||
|
label: "作战资源管理",
|
||||||
|
icon: FileBox,
|
||||||
|
path: "/page/strategy/resource-management/resource-evaluation-index",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/** Strategy 模块外部 iframe / 嵌入页链接(来自 Vite 环境变量) */
|
||||||
|
|
||||||
|
function trimTrailingSlash(url: string): string {
|
||||||
|
return url.replace(/\/+$/, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function readEnv(key: string): string {
|
||||||
|
const value = import.meta.env[key];
|
||||||
|
return typeof value === "string" ? value.trim() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** B2 网络 xwt 资源管理 iframe 基础地址 */
|
||||||
|
export function getB2ActorBaseUrl(): string {
|
||||||
|
return trimTrailingSlash(readEnv("VITE_AIPI_B2ACTOR_URL"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** B2 网络 xwt 资源管理 iframe 路径 */
|
||||||
|
export function getNetworkActorIframePath(): string {
|
||||||
|
return readEnv("VITE_AIPI_B2ACTOR_XWT_PATH") || "/fromB/toXWT?isFrame=1";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 网络 xwt 资源管理完整 iframe URL */
|
||||||
|
export function getNetworkActorIframeUrl(): string {
|
||||||
|
const base = getB2ActorBaseUrl();
|
||||||
|
const path = getNetworkActorIframePath();
|
||||||
|
if (!base) return "";
|
||||||
|
return `${base}${path.startsWith("/") ? path : `/${path}`}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 知识库 iframe 地址换取 API */
|
||||||
|
export function getKnowledgeIframeApiUrl(): string {
|
||||||
|
return readEnv("VITE_AIPI_KNOWLEDGE_IFRAME_API_URL");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 知识库 iframe 皮肤参数 */
|
||||||
|
export function getKnowledgeIframeSkin(): string {
|
||||||
|
return readEnv("VITE_AIPI_KNOWLEDGE_IFRAME_SKIN") || "red";
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import "./styles/globals.css";
|
import "./styles/globals.css";
|
||||||
|
import "tdesign-react/es/style/index.css";
|
||||||
import "katex/dist/katex.min.css";
|
import "katex/dist/katex.min.css";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { getStoredAuth } from "@/core/auth";
|
|||||||
import { RouteBaseProvider } from "@/core/route-base";
|
import { RouteBaseProvider } from "@/core/route-base";
|
||||||
import { SidebarProvider } from "@/components/ui/sidebar";
|
import { SidebarProvider } from "@/components/ui/sidebar";
|
||||||
|
|
||||||
import GeneralQA from "@/strategy-components/components/qa/GeneralQA";
|
import GeneralQA from "@/strategy-components/components/chat-qa/GeneralQA";
|
||||||
import { ChatRuntime } from "./WorkspaceRoutes";
|
import { ChatRuntime } from "./WorkspaceRoutes";
|
||||||
import AgentsPage from "./AgentsPage";
|
import AgentsPage from "./AgentsPage";
|
||||||
import ChatsPage from "./ChatsPage";
|
import ChatsPage from "./ChatsPage";
|
||||||
@@ -37,6 +37,8 @@ import XXTyPage from "@/strategy-components/components/task-components/XXTy";
|
|||||||
import SentimentAnalyzes from "@/strategy-components/components/task-components/SentimentAnalyzes";
|
import SentimentAnalyzes from "@/strategy-components/components/task-components/SentimentAnalyzes";
|
||||||
import TaskAnalyzes from "@/strategy-components/components/task-components/TaskAnalyzes";
|
import TaskAnalyzes from "@/strategy-components/components/task-components/TaskAnalyzes";
|
||||||
import { ActionAnalyzes } from "@/strategy-components/components/task-components/ActionAnalyzes";
|
import { ActionAnalyzes } from "@/strategy-components/components/task-components/ActionAnalyzes";
|
||||||
|
import NetworkActorResourceManagement from "@/strategy-components/components/resource-management/NetworkActorResourceManagement";
|
||||||
|
import KnowledgeBaseResourceManagement from "@/strategy-components/components/resource-management/KnowledgeBaseResourceManagement";
|
||||||
|
|
||||||
export default function StrategyRoutes() {
|
export default function StrategyRoutes() {
|
||||||
return (
|
return (
|
||||||
@@ -48,6 +50,16 @@ export default function StrategyRoutes() {
|
|||||||
|
|
||||||
{/* 问答中心 */}
|
{/* 问答中心 */}
|
||||||
<Route path="qa/general" element={<GeneralQA />} />
|
<Route path="qa/general" element={<GeneralQA />} />
|
||||||
|
<Route
|
||||||
|
path="qa/expert-qa"
|
||||||
|
element={
|
||||||
|
<GeneralQA
|
||||||
|
pageTitle="专家问答"
|
||||||
|
pageSubtitle="支持单轮RAG、多轮RAG、深度检索及结果对比"
|
||||||
|
initialMode="general"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
{/* 任务管理 */}
|
{/* 任务管理 */}
|
||||||
<Route path="task-management" element={<TaskManagement />}>
|
<Route path="task-management" element={<TaskManagement />}>
|
||||||
{/* XK任务 */}
|
{/* XK任务 */}
|
||||||
@@ -155,6 +167,21 @@ export default function StrategyRoutes() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</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/new-note" element={<LightAppNewNotePage />} />
|
<Route path="light-app/new-note" element={<LightAppNewNotePage />} />
|
||||||
<Route path="light-app/notes" element={<LightAppNoteListPage />} />
|
<Route path="light-app/notes" element={<LightAppNoteListPage />} />
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import type { QASingleRagTrace, QAThinkingTrace } from './QACommon';
|
import type { QASingleRagTrace, QAThinkingTrace } from '../qa/QACommon';
|
||||||
import type { ComparePane, KnowledgeBaseChunk, Message, QAMode, SourceItem } from './GeneralQA.types';
|
import type { ComparePane, KnowledgeBaseChunk, Message, QAMode, SourceItem } from './GeneralQA.types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+15
-10
@@ -11,7 +11,7 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { Dialog, Select, Slider } from 'tdesign-react';
|
import { Dialog, Select, Slider } from 'tdesign-react';
|
||||||
import { useTheme } from '@/contexts/ThemeContext';
|
import { useTheme } from '@/contexts/ThemeContext';
|
||||||
import { ChatMessage, EmptyChatState, QAAvatar, QAComposer, QASingleRagTrace, QAThinkingRound, QAThinkingTrace, RetrievalThinkingTrace, SingleRagAnswer, TypingIndicator } from './QACommon';
|
import { ChatMessage, EmptyChatState, QAAvatar, QAComposer, QASingleRagTrace, QAThinkingRound, QAThinkingTrace, RetrievalThinkingTrace, SingleRagAnswer, TypingIndicator } from '../qa/QACommon';
|
||||||
import GeneralQAHeader from './GeneralQAHeader';
|
import GeneralQAHeader from './GeneralQAHeader';
|
||||||
import GeneralQAConfigSidebar from './GeneralQAConfigSidebar';
|
import GeneralQAConfigSidebar from './GeneralQAConfigSidebar';
|
||||||
import type { ComparePane, CompareResult, KnowledgeBaseChunk, Message, QAMode, SourceItem, ToolCallData, ViewMode } from './GeneralQA.types';
|
import type { ComparePane, CompareResult, KnowledgeBaseChunk, Message, QAMode, SourceItem, ToolCallData, ViewMode } from './GeneralQA.types';
|
||||||
@@ -26,13 +26,21 @@ import {
|
|||||||
parseSingleRagStream,
|
parseSingleRagStream,
|
||||||
} from './GeneralQA.mock';
|
} from './GeneralQA.mock';
|
||||||
|
|
||||||
|
type GeneralQAProps = {
|
||||||
|
pageTitle?: string;
|
||||||
|
pageSubtitle?: string;
|
||||||
|
initialMode?: 'general' | 'new';
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用问答组件
|
* 通用/专家问答组件
|
||||||
* 支持单轮RAG、多轮RAG、深度检索及结果对比功能
|
* 支持单轮RAG、多轮RAG、深度检索及结果对比功能
|
||||||
* @param onNavigate - 页面导航函数
|
|
||||||
* @param initialMode - 初始模式(可选)
|
|
||||||
*/
|
*/
|
||||||
const GeneralQA: React.FC = () => {
|
const GeneralQA: React.FC<GeneralQAProps> = ({
|
||||||
|
pageTitle = '通用问答',
|
||||||
|
pageSubtitle = '支持单轮RAG、多轮RAG、深度检索及结果对比',
|
||||||
|
initialMode: _initialMode = 'general',
|
||||||
|
}) => {
|
||||||
const { theme } = useTheme();
|
const { theme } = useTheme();
|
||||||
const isDark = theme === 'dark';
|
const isDark = theme === 'dark';
|
||||||
|
|
||||||
@@ -1390,10 +1398,6 @@ const GeneralQA: React.FC = () => {
|
|||||||
runAfterGenerationConfirm(() => setViewMode(mode));
|
runAfterGenerationConfirm(() => setViewMode(mode));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSafeNavigate = (page: string) => {
|
|
||||||
// runAfterGenerationConfirm(() => onNavigate(page));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSafeReset = () => {
|
const handleSafeReset = () => {
|
||||||
runAfterGenerationConfirm(() => {
|
runAfterGenerationConfirm(() => {
|
||||||
setMessages([]);
|
setMessages([]);
|
||||||
@@ -1633,7 +1637,8 @@ const GeneralQA: React.FC = () => {
|
|||||||
isDark={isDark}
|
isDark={isDark}
|
||||||
viewMode={viewMode}
|
viewMode={viewMode}
|
||||||
setViewMode={handleSafeViewModeChange}
|
setViewMode={handleSafeViewModeChange}
|
||||||
onNavigate={handleSafeNavigate}
|
pageTitle={pageTitle}
|
||||||
|
pageSubtitle={pageSubtitle}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 主体内容区 */}
|
{/* 主体内容区 */}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import type { QASingleRagTrace, QAThinkingTrace } from './QACommon';
|
import type { QASingleRagTrace, QAThinkingTrace } from '../qa/QACommon';
|
||||||
|
|
||||||
export type QAMode = 'single-round' | 'multi-round' | 'deep-search';
|
export type QAMode = 'single-round' | 'multi-round' | 'deep-search';
|
||||||
export type ViewMode = 'single' | 'compare';
|
export type ViewMode = 'single' | 'compare';
|
||||||
File renamed without changes.
+11
-3
@@ -11,6 +11,8 @@ type Props = {
|
|||||||
isDark: boolean; // 当前是否为暗黑主题,用于样式适配
|
isDark: boolean; // 当前是否为暗黑主题,用于样式适配
|
||||||
viewMode: ViewMode; // 当前视图模式:'single' 单一模式 或 'compare' 对比模式
|
viewMode: ViewMode; // 当前视图模式:'single' 单一模式 或 'compare' 对比模式
|
||||||
setViewMode: (mode: ViewMode) => void; // 设置视图模式回调函数
|
setViewMode: (mode: ViewMode) => void; // 设置视图模式回调函数
|
||||||
|
pageTitle?: string;
|
||||||
|
pageSubtitle?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,15 +22,21 @@ type Props = {
|
|||||||
* 这样拆分后,顶部导航的样式和交互不会和中间问答流处理逻辑混在一起,后续如果要新增
|
* 这样拆分后,顶部导航的样式和交互不会和中间问答流处理逻辑混在一起,后续如果要新增
|
||||||
* “保存模板”“导出记录”等入口,也可以只改这个文件。
|
* “保存模板”“导出记录”等入口,也可以只改这个文件。
|
||||||
*/
|
*/
|
||||||
export default function GeneralQAHeader({ isDark, viewMode, setViewMode }: Props): JSX.Element {
|
export default function GeneralQAHeader({
|
||||||
|
isDark,
|
||||||
|
viewMode,
|
||||||
|
setViewMode,
|
||||||
|
pageTitle = '通用问答',
|
||||||
|
pageSubtitle = '支持单轮RAG、多轮RAG、深度检索及结果对比',
|
||||||
|
}: Props): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-center justify-between px-6 py-4 border-b ${isDark ? 'border-slate-700/50' : 'border-red-100'}`}>
|
<div className={`flex items-center justify-between px-6 py-4 border-b ${isDark ? 'border-slate-700/50' : 'border-red-100'}`}>
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<h1 className={`text-lg font-semibold ${isDark ? 'text-white' : 'text-gray-900'}`}>
|
<h1 className={`text-lg font-semibold ${isDark ? 'text-white' : 'text-gray-900'}`}>
|
||||||
通用问答
|
{pageTitle}
|
||||||
</h1>
|
</h1>
|
||||||
<span className={`text-sm ${isDark ? 'text-slate-400' : 'text-gray-500'}`}>
|
<span className={`text-sm ${isDark ? 'text-slate-400' : 'text-gray-500'}`}>
|
||||||
支持单轮RAG、多轮RAG、深度检索及结果对比
|
{pageSubtitle}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getKnowledgeIframeApiUrl,
|
||||||
|
getKnowledgeIframeSkin,
|
||||||
|
} from "@/core/strategy/external-links";
|
||||||
|
import { requestCrudService } from "@/service/request-axios-service";
|
||||||
|
import "@/strategy-components/components/task-components/css/strategy-data.css";
|
||||||
|
|
||||||
|
const service = requestCrudService;
|
||||||
|
|
||||||
|
const KnowledgeBaseResourceManagement: React.FC = () => {
|
||||||
|
const [iframeUrl, setIframeUrl] = useState("");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const initIframeUrl = async () => {
|
||||||
|
const apiUrl = getKnowledgeIframeApiUrl();
|
||||||
|
if (!apiUrl) return;
|
||||||
|
|
||||||
|
const jsonStr = localStorage.getItem("userInfo");
|
||||||
|
if (!jsonStr) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const userInfo = JSON.parse(jsonStr);
|
||||||
|
const token = userInfo.accessToken;
|
||||||
|
if (!token) return;
|
||||||
|
|
||||||
|
const res = (await service.post(apiUrl, {
|
||||||
|
token,
|
||||||
|
skin: getKnowledgeIframeSkin(),
|
||||||
|
})) as { iframeUrl?: string };
|
||||||
|
if (res?.iframeUrl) {
|
||||||
|
setIframeUrl(res.iframeUrl);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to load knowledge iframe url:", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void initIframeUrl();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="strategy-data iframe-container">
|
||||||
|
<iframe src={iframeUrl} className="full-size-iframe" title="知识库资源管理" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default KnowledgeBaseResourceManagement;
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import { getNetworkActorIframeUrl } from "@/core/strategy/external-links";
|
||||||
|
import "@/strategy-components/components/task-components/css/strategy-data.css";
|
||||||
|
|
||||||
|
const NetworkActorResourceManagement: React.FC = () => {
|
||||||
|
const [iframeUrl, setIframeUrl] = useState("");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setIframeUrl(getNetworkActorIframeUrl());
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="strategy-data iframe-container">
|
||||||
|
<iframe src={iframeUrl} className="full-size-iframe" title="网络xwt资源管理" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NetworkActorResourceManagement;
|
||||||
@@ -175,10 +175,66 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ── TDesign overrides inside task pages ─────────────────────────────── */
|
/* ── TDesign overrides inside task pages ─────────────────────────────── */
|
||||||
|
.strategy-data .t-loading,
|
||||||
.strategy-data .t-loading__parent {
|
.strategy-data .t-loading__parent {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.strategy-data .t-loading--full {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.strategy-data .t-loading__overlay {
|
||||||
|
background: rgb(255 255 255 / 60%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .strategy-data .t-loading__overlay {
|
||||||
|
background: rgb(15 23 42 / 45%);
|
||||||
|
}
|
||||||
|
|
||||||
.strategy-data .t-pagination {
|
.strategy-data .t-pagination {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.strategy-data .t-date-range-picker,
|
||||||
|
.strategy-data .t-date-picker,
|
||||||
|
.strategy-data .t-input {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 360px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.strategy-data .t-input__wrap,
|
||||||
|
.strategy-data .t-range-input {
|
||||||
|
background: var(--td-bg-color-container, #fff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .strategy-data .t-input__wrap,
|
||||||
|
.dark .strategy-data .t-range-input {
|
||||||
|
background: var(--td-bg-color-container, #1e293b);
|
||||||
|
color: var(--td-text-color-primary, #e2e8f0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.strategy-data .t-row,
|
||||||
|
.strategy-data .t-col {
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Popups are portaled to body — keep panels above app chrome */
|
||||||
|
.t-popup,
|
||||||
|
.t-date-picker__panel-container,
|
||||||
|
.t-date-range-picker__panel-container {
|
||||||
|
z-index: 6500;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── iframe embed pages (resource management, TY tasks, etc.) ─────────── */
|
||||||
|
.strategy-data .iframe-container {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100vh - 100px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.strategy-data .full-size-iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user