- 添加智能体列表页面和相关API - 实现聊天功能,包括历史对话和当前对话 - 新增工作流功能,包括表单提交和结果展示- 优化路由配置,增加智能体相关路由 - 添加全局常量和枚举,用于智能体类型区分
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
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);
|
|
}
|
|
};
|