Skip to content

Commit 0177edb

Browse files
feat: 复用框架能力完善 DataAgent 执行链路
1 parent e6b606c commit 0177edb

57 files changed

Lines changed: 923 additions & 222 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ modified_mcp_config.json
5858

5959
uploads/*
6060
vectorstore/*
61+
**/vectorstore/
6162
.java-version
6263

6364
# spring-ai-alibaba source
6465
spring-ai-alibaba-1.1.0.0/
66+
.gstack/
67+
.codegraph/

‎data-agent-frontend-nuxt/app/components/BaseDrawer/index.vue‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,21 @@ const cssVars = computed(() => ({
123123
overflow: auto;
124124
position: relative;
125125
}
126+
127+
@media (max-width: 768px) {
128+
.base-drawer__left {
129+
position: absolute;
130+
inset: 0 auto 0 0;
131+
z-index: 100;
132+
box-shadow: 8px 0 24px rgba(15, 23, 42, 0.2);
133+
}
134+
135+
.base-drawer__left--closed {
136+
box-shadow: none;
137+
}
138+
139+
.base-drawer__right {
140+
width: 100%;
141+
}
142+
}
126143
</style>

‎data-agent-frontend-nuxt/app/components/chat/ChatInputArea.vue‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,4 +544,14 @@ onUnmounted(() => document.removeEventListener('click', closeMenus));
544544
.fade-enter-from, .fade-leave-to { opacity: 0; }
545545
.slide-up-enter-active, .slide-up-leave-active { transition: all 0.2s ease; }
546546
.slide-up-enter-from, .slide-up-leave-to { transform: translateY(10px); opacity: 0; }
547+
548+
@media (max-width: 768px) {
549+
.input-area {
550+
padding: 10px 12px 12px;
551+
}
552+
553+
.chip-dropdown {
554+
max-width: calc(100vw - 24px);
555+
}
556+
}
547557
</style>

‎data-agent-frontend-nuxt/app/components/chat/ChatMessageList.vue‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,17 @@ watch(
633633
border: 1px solid #fca5a5;
634634
color: #991b1b;
635635
}
636+
637+
@media (max-width: 768px) {
638+
.messages-inner {
639+
padding: 16px 12px;
640+
gap: 14px;
641+
}
642+
643+
.user-card,
644+
.ai-card,
645+
.status-banner {
646+
max-width: calc(100% - 38px);
647+
}
648+
}
636649
</style>

‎data-agent-frontend-nuxt/app/components/chat/ChatSidebar.vue‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,4 +472,10 @@ async function confirmDelete() {
472472
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
473473
background: #94a3b8;
474474
}
475+
476+
@media (max-width: 768px) {
477+
.sidebar-wrapper {
478+
display: none;
479+
}
480+
}
475481
</style>

‎data-agent-frontend-nuxt/app/components/chat/ChatWorkflowTimeline.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@
108108
</template>
109109

110110
<script setup lang="ts">
111-
import hljs from 'highlight.js';
112111
import DOMPurify from 'dompurify';
113112
import { useEchartsRenderer } from '~/composables/useEchartsRenderer';
113+
import { hljs } from '~/utils/markdown/markdown-plugin-highlight';
114114
import type { GraphNodeResponse } from '~/services/graph/index';
115115
import type { ResultData } from '~/services/resultSet/index';
116116
import ChatResultSet from './ChatResultSet.vue';

‎data-agent-frontend-nuxt/app/composables/useEchartsRenderer.ts‎

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,30 @@
1515
*/
1616

1717
import { nextTick, onBeforeUnmount } from 'vue';
18-
import * as echarts from 'echarts';
18+
import * as echarts from 'echarts/core';
19+
import { BarChart, LineChart, PieChart } from 'echarts/charts';
20+
import {
21+
DatasetComponent,
22+
GridComponent,
23+
LegendComponent,
24+
TitleComponent,
25+
TooltipComponent,
26+
} from 'echarts/components';
27+
import { LabelLayout } from 'echarts/features';
28+
import { CanvasRenderer } from 'echarts/renderers';
29+
30+
echarts.use([
31+
BarChart,
32+
LineChart,
33+
PieChart,
34+
DatasetComponent,
35+
GridComponent,
36+
LegendComponent,
37+
TitleComponent,
38+
TooltipComponent,
39+
LabelLayout,
40+
CanvasRenderer,
41+
]);
1942

2043
const EXTENDED_COLORS = [
2144
'#5584FF',
@@ -58,10 +81,7 @@ function renderEChartsInContainer(container: HTMLElement) {
5881

5982
if (!code || code.trim() === '') return;
6083

61-
const options = new Function(`return (${code})`)() as Record<
62-
string,
63-
unknown
64-
>;
84+
const options = JSON.parse(code) as Record<string, unknown>;
6585
if (!options.color) {
6686
options.color = EXTENDED_COLORS;
6787
}

‎data-agent-frontend-nuxt/app/layouts/default.vue‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,24 @@
314314
import BaseDrawer from '../components/BaseDrawer/index.vue';
315315
import agentService from '~/services/agent/index';
316316
import modelConfigService from '~/services/modelConfig/index';
317+
import { useDisplay } from 'vuetify';
317318
318319
const { dialogState, handleGlobalConfirm } = useConfirm();
319320
const drawer = ref(true);
321+
const { mobile } = useDisplay();
320322
const router = useRouter();
321323
const route = useRoute();
322324
// 默认都展开
323325
const openedGroups = ref(['knowledge', 'system']);
324326
327+
watch(
328+
mobile,
329+
(isMobile) => {
330+
if (isMobile) drawer.value = false;
331+
},
332+
{ immediate: true },
333+
);
334+
325335
type DrawerAgentOption = {
326336
id: number;
327337
name: string;

‎data-agent-frontend-nuxt/app/pages/system/agents.vue‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,20 @@
206206
<template #no-data>
207207
<div class="text-center py-16">
208208
<v-icon icon="mdi-robot-confused-outline" size="64" color="grey-lighten-2" class="mb-4" />
209-
<h3 class="text-h6 font-weight-medium text-grey-darken-1">暂无智能体</h3>
209+
<h3 class="text-h6 font-weight-medium text-grey-darken-1">
210+
{{ debouncedSearch.trim() ? '未找到匹配的智能体' : '暂无智能体' }}
211+
</h3>
210212
<p class="text-body-2 text-grey mb-6">
211-
{{ activeFilter === 'all' ? '您还没有创建任何智能体' : '该分类下暂无智能体' }}
213+
{{
214+
debouncedSearch.trim()
215+
? `没有与“${debouncedSearch.trim()}”匹配的结果,请调整搜索条件`
216+
: activeFilter === 'all'
217+
? '您还没有创建任何智能体'
218+
: '该分类下暂无智能体'
219+
}}
212220
</p>
213221
<v-btn
214-
v-if="activeFilter === 'all'"
222+
v-if="activeFilter === 'all' && !debouncedSearch.trim()"
215223
color="black"
216224
variant="flat"
217225
prepend-icon="mdi-plus"

‎data-agent-frontend-nuxt/app/services/graph/index.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ class GraphService {
133133

134134
let isCompleted = false;
135135

136+
eventSource.addEventListener("error", async (event) => {
137+
if (!(event instanceof MessageEvent) || !event.data || isCompleted) return;
138+
isCompleted = true;
139+
eventSource.close();
140+
try {
141+
const response = JSON.parse(event.data) as GraphNodeResponse;
142+
if (onError) {
143+
await onError(new Error(response.text || "Stream processing failed"));
144+
}
145+
} catch {
146+
if (onError) await onError(new Error("Stream processing failed"));
147+
}
148+
});
149+
136150
eventSource.onerror = async (_error) => {
137151
// If already completed or the connection was intentionally closed, ignore
138152
if (isCompleted) {

0 commit comments

Comments
 (0)