diff --git a/src/api/all/agent.ts b/src/api/all/agent.ts index b258e45..d8cee3c 100644 --- a/src/api/all/agent.ts +++ b/src/api/all/agent.ts @@ -6,15 +6,15 @@ export const getChatAgent = (id: number) => { // 获取历史聊天 export const getHistoryChat = (params: any) => { - return Http.get(`/v1/agent/getConversations`, { params }); + return Http.get(`/v1/agent/getConversations`, params); }; // 获取智能体分类 export const getCategoriesMenus = () => { return Http.get(`/v1/agent/getCategoriesMenus`); }; -export const getAgentList = () => { - return Http.get(`/v1/agent/getAgentList`); +export const getAgentList = (params: any) => { + return Http.get(`/v1/agent/getAgentList`, params); }; // 获取工作流详情 @@ -26,3 +26,7 @@ export const getWorkFlowInfo = (id: number) => { export const executeWorkFlow = (params: any) => { return Http.post(`/v1/agent/executeWorkFlow`, params); }; + +export const delAgentMessage = (params: any) => { + return Http.post(`/v1/agent/delAgentMessage`, params); +}; diff --git a/src/assets/svg/img.png b/src/assets/svg/img.png new file mode 100644 index 0000000..6503abc Binary files /dev/null and b/src/assets/svg/img.png differ diff --git a/src/main.ts b/src/main.ts index 4c78e24..5d9fccb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,9 +14,16 @@ import './core'; import 'uno.css'; import './mock'; // import '@/styles/vars.css'; // 优先加载 +import { loadDynamicMenus } from './router/routes/modules/agentDynamic'; const app = createApp(App); app.use(store); app.use(router); app.component('NoData', NoData); -app.mount('#app'); + +router.isReady().then(async () => { + await loadDynamicMenus(router); // 传入 router 实例 + + console.log(router,'router') + app.mount('#app'); +}); diff --git a/src/router/routes/modules/agentDynamic.ts b/src/router/routes/modules/agentDynamic.ts new file mode 100644 index 0000000..720a7df --- /dev/null +++ b/src/router/routes/modules/agentDynamic.ts @@ -0,0 +1,46 @@ +import { getCategoriesMenus } from '@/api/all/agent'; +import type { AppRouteRecordRaw } from '../types'; +import { MENU_GROUP_IDS } from '@/router/constants'; +import IconRepository from '@/assets/svg/icon-repository.svg'; +import { IconBookmark } from '@arco-design/web-vue/es/icon'; + +export const loadDynamicMenus = async (routerInstance) => { + try { + const { code, data } = await getCategoriesMenus(); + + let router = [ + { + path: '/repository233', + name: 'Repository', + redirect: 'repository/brandMaterials', + meta: { + locale: '品牌资产管理', + icon: IconRepository, + requiresAuth: true, + requireLogin: true, + roles: ['*'], + id: MENU_GROUP_IDS.PROPERTY_ID, + }, + children: [ + { + path: 'brandMaterials', + name: 'RepositoryBrandMaterials', + meta: { + locale: '品牌信息', + requiresAuth: true, + requireLogin: true, + roles: ['*'], + }, + component: () => import('@/views/property-marketing/brands/brand-materials/index.vue'), + }, + ], + }, + ]; + // 添加子路由到名为 Agent 的父路由下 + router.forEach(route => { + routerInstance.addRoute('Agent', route); + }); + } catch (error) { + console.error('Failed to load dynamic menus:', error); + } +}; diff --git a/src/views/Agent/Chat/components/HistoryChat.vue b/src/views/Agent/Chat/components/HistoryChat.vue index af7802e..c3abfd3 100644 --- a/src/views/Agent/Chat/components/HistoryChat.vue +++ b/src/views/Agent/Chat/components/HistoryChat.vue @@ -1,27 +1,39 @@ @@ -48,4 +75,19 @@ onMounted(() => { .logo { margin-bottom: 20px; } + +.menu-title { + color: var(--Text-1, #211f24); + font-size: 18px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 26px; + word-wrap: break-word; +} +.agent-img { + width: 100%; + height: 230px; + border-radius: 4px; +} + diff --git a/src/views/Agent/Chat/index.vue b/src/views/Agent/Chat/index.vue index 96f616e..7cf179c 100644 --- a/src/views/Agent/Chat/index.vue +++ b/src/views/Agent/Chat/index.vue @@ -1,9 +1,15 @@ diff --git a/src/views/Agent/work-flow/form/InputField.vue b/src/views/Agent/work-flow/form/InputField.vue deleted file mode 100644 index b4a9616..0000000 --- a/src/views/Agent/work-flow/form/InputField.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/src/views/Agent/work-flow/form/SelectField.vue b/src/views/Agent/work-flow/form/SelectField.vue deleted file mode 100644 index 0896a55..0000000 --- a/src/views/Agent/work-flow/form/SelectField.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/src/views/Agent/work-flow/index.vue b/src/views/Agent/work-flow/index.vue index 689e663..824ae77 100644 --- a/src/views/Agent/work-flow/index.vue +++ b/src/views/Agent/work-flow/index.vue @@ -1,27 +1,21 @@