refactor(chat/shipping): 重构发货通知模块为统一UI State驱动模式

- 重构发货通知的状态与动作获取逻辑:移除从聊天文本解析HXOPS_SHIPPING_ACTIONS注释的旧逻辑,改为统一从后端shipping_ui_state获取任务状态、动作按钮与工作流步骤
- 新增SSE实时推送shipping_ui_state事件,支持前端即时更新聊天气泡与工作台的状态与按钮
- 优化路由与登录流程:调整根路径重定向逻辑,退出登录时跳转到登录页;移除chat路由不必要的props传参;将原路由守卫中的根路径判断迁移到路由配置中
- 完善库存RPA与本地导入流程:新增本地库存文件托管接口,优化RPA回调的文件落盘与任务关联逻辑
- 新增多组单元测试覆盖焦点切换、决策处理、SSE同步等核心场景
- 修复多语言显示逻辑,使用te方法判断翻译key是否存在,避免缺失翻译时的渲染异常
- 新增reparse_inventory菜单动作,支持静默重新解析库存且不追加额外聊天消息
- 重构工作流步骤渲染函数,优先使用后端返回的步骤数据, fallback到本地推导的旧逻辑
- 清理后端旧的chat-actions API接口,将相关逻辑迁移到统一的ui_state接口中
This commit is contained in:
hugo committed 2026-07-02 01:55:19 +08:00
commit 9c036c825b
39 files changed
+3114 -456

No files matched your search

+1 -10
View File
@@ -6,7 +6,7 @@ import type { Router } from 'vue-router';
import { config } from '@/config';
import { adminModulePath } from '@/features/admin/constants/modules';
import { useAuthStore } from '@/features/auth/stores/auth.store';
import { DEFAULT_CHAT_AGENT_ID, isPublicPath } from '@/shared/constants/routes';
import { isPublicPath } from '@/shared/constants/routes';
export function setupRouterGuards(router: Router): void {
router.beforeEach((to, _from, next) => {
@@ -25,15 +25,6 @@ export function setupRouterGuards(router: Router): void {
}
}
if (to.path === '/') {
if (auth.isLoggedIn) {
next(`/chat/${DEFAULT_CHAT_AGENT_ID}`);
return;
}
next('/login');
return;
}
if (to.path === '/login' && auth.isLoggedIn) {
next('/workspace/applications');
return;
@@ -9,6 +9,5 @@ export const chatRoutes: RouteRecordRaw[] = [
path: '/chat/:agentId',
name: 'Chat',
component: () => import('@/features/chat/views/ChatView.vue'),
props: true,
},
];
+10
View File
@@ -8,8 +8,18 @@ import { authRoutes } from './auth.routes';
import { chatRoutes } from './chat.routes';
import { kbRoutes } from './kb.routes';
import { workspaceRoutes } from './workspace.routes';
import { useAuthStore } from '@/features/auth/stores/auth.store';
import { DEFAULT_CHAT_AGENT_ID } from '@/shared/constants/routes';
export const appRoutes: RouteRecordRaw[] = [
{
path: '/',
redirect: () => {
const auth = useAuthStore();
auth.syncFromStorage();
return auth.isLoggedIn ? `/chat/${DEFAULT_CHAT_AGENT_ID}` : '/login';
},
},
...authRoutes,
...workspaceRoutes,
...chatRoutes,