feat(i18n): 将前端用户可见中文硬编码改为四语言
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
dce915ea30
commit
ac7b53a523
105 files changed
+2928
-647
No files matched your search
@@ -149,7 +149,7 @@ docker compose logs -f hxops-backend
|
||||
- 🔒 **严禁提交任何密钥/密码/生产地址等敏感信息**。`.env.local` / `.env.*` 不进仓库的部分不得硬编码进代码或提交。
|
||||
- 🧬 **修改数据库表结构必须配套迁移**:任何对 `models.py` / 数据表结构的新增、删除、字段或约束变更,都必须生成并提交对应的 Alembic 迁移脚本(`flask db migrate -m "..."` → `flask db upgrade`),禁止只改模型不出迁移。
|
||||
- 🌐 **环境变量分层**:`.env.shared` + `.env.<env>`(dev/test/prod),不要在代码里写死环境值。规则见 **[docs/convention/env_loading_priority.md](docs/convention/env_loading_priority.md)** 与 **[docs/convention/环境变量规则.md](docs/convention/环境变量规则.md)**。
|
||||
- 🌍 **i18n 四语言**:前端新增文案必须同时补齐 `zh-CN / zh-TW / en-US / th-TH`,禁止硬编码中文。
|
||||
- 🌍 **i18n 四语言**:前端新增文案必须同时补齐 `zh-CN / zh-TW / en / th`,禁止硬编码中文。Agent 流程见项目 Skill `add-i18n-keys` 与 [docs/convention/add-i18n-keys-skill.md](docs/convention/add-i18n-keys-skill.md)。
|
||||
- 📡 **SSE 流式约束**:对话链路依赖 Gevent 异步 worker + Nginx `proxy_buffering off`;对话接口(`chat.py`)使用原生 Fetch/SSE 而非 Axios,改动需保持流式不被破坏。
|
||||
- 🔌 **外部集成依赖**:Oracle Instant Client 19.30 / `pyodbc` / `zeep`(OA、PLM、HR)等本地未必可运行,涉及这些 service 时谨慎并说明。
|
||||
- ➕ **新增依赖需克制**:不擅自引入未经评审的第三方依赖;如需新增,在提交说明中给出理由。
|
||||
@@ -198,6 +198,7 @@ docker compose logs -f hxops-backend
|
||||
| 测试计划 | [docs/test_plan_matrix.md](docs/test_plan_matrix.md) |
|
||||
| 前端架构规范 | [docs/refactor/frontend_architecture_refactor.md](docs/refactor/frontend_architecture_refactor.md) |
|
||||
| 错误处理规范 | [docs/convention/error_handling.md](docs/convention/error_handling.md) |
|
||||
| 前端四语言 i18n Skill | [docs/convention/add-i18n-keys-skill.md](docs/convention/add-i18n-keys-skill.md) |
|
||||
| **业务域文档索引** | [docs/features/README.md](docs/features/README.md) |
|
||||
| 货代发货通知 | [docs/features/shipping-notice/technical.md](docs/features/shipping-notice/technical.md) |
|
||||
| 文件检核 | [docs/features/file-check/technical.md](docs/features/file-check/technical.md) |
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
| [features/](features/README.md) | **业务域**落地手册(部署、Dify、API、运维) |
|
||||
| [platform/](platform/README.md) | **平台级**设计(Agent 注册、多运行时、Registry) |
|
||||
| [prototype/](prototype/) | **产品原型**(评审、验收;实现前) |
|
||||
| [convention/](convention/) | 开发规范(提交、错误处理、环境变量等) |
|
||||
| [convention/](convention/) | 开发规范(提交、错误处理、环境变量、[add-i18n-keys Skill](convention/add-i18n-keys-skill.md) 等) |
|
||||
| [openapi/](openapi/) | Dify / 集成 OpenAPI 契约 |
|
||||
| [dify/](dify/) | Dify 集成说明 |
|
||||
| [integrations/](integrations/) | 外部系统集成资料(运行时依赖的 ERP Schema 等) |
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
# add-i18n-keys Skill 使用说明
|
||||
|
||||
> 文档定位:说明 HXOPS 项目级 Cursor Skill **`add-i18n-keys`** 的用途、触发方式与落地约定。
|
||||
> Agent 执行细则以 [`.cursor/skills/add-i18n-keys/SKILL.md`](../../.cursor/skills/add-i18n-keys/SKILL.md) 为准;错误码契约以 [error_handling.md](error_handling.md) 为准。
|
||||
|
||||
---
|
||||
|
||||
## 1. 背景与目标
|
||||
|
||||
HXOPS 前端使用 Vue I18n,用户可见文案必须同时覆盖四种语言:
|
||||
|
||||
| Locale | 目录 |
|
||||
| --- | --- |
|
||||
| 简体中文 | `frontend/src/locales/zh-CN/` |
|
||||
| 繁体中文 | `frontend/src/locales/zh-TW/` |
|
||||
| English | `frontend/src/locales/en/` |
|
||||
| ไทย | `frontend/src/locales/th/` |
|
||||
|
||||
`AGENTS.md` §8 已将「四语言、禁止硬编码中文」列为红线。本 Skill 把该红线落成**可重复的工作流**:选域 → 四文件同步 → 代码引用 →(如需)注册新域 / 补错误码。
|
||||
|
||||
---
|
||||
|
||||
## 2. 文件位置
|
||||
|
||||
```text
|
||||
.cursor/skills/add-i18n-keys/
|
||||
├── SKILL.md # Agent 执行说明书(自动/显式触发时加载)
|
||||
└── domains.md # 域选择与 auth/kb 展平补充说明
|
||||
```
|
||||
|
||||
| 类型 | 路径 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| 项目 Skill | `.cursor/skills/add-i18n-keys/` | 随仓库共享,拉代码即可用 |
|
||||
| 文案数据 | `frontend/src/locales/{locale}/*.json` | 按业务域拆分 |
|
||||
| 合并入口 | `frontend/src/locales/index.ts` | 新域 JSON 必须在此注册 |
|
||||
|
||||
与常驻规则的关系:
|
||||
|
||||
| | `AGENTS.md` / `.cursor/rules` | `add-i18n-keys` skill |
|
||||
| --- | --- | --- |
|
||||
| **作用** | 常驻原则(必须四语言) | 可执行工作流(怎么改、改哪、checklist) |
|
||||
| **何时生效** | 几乎每次对话 | 提到 i18n / 改 locales / 加文案时 |
|
||||
|
||||
---
|
||||
|
||||
## 3. 何时使用
|
||||
|
||||
适合在以下场景启用本 Skill:
|
||||
|
||||
- 新增/修改按钮、标题、提示、对话框、占位符、Toast 等 UI 文案
|
||||
- 把组件里的硬编码中文改为 i18n key
|
||||
- 编辑 `frontend/src/locales/**`
|
||||
- 后端新增 `error.code`,需同步前端 `errors.codes.*`
|
||||
- 新建业务域 locale 文件(如 `shipping.json`)并完成注册
|
||||
|
||||
不适合:纯后端无用户文案的改动、仅改逻辑不改展示文案的任务(除非顺带涉及错误码)。
|
||||
|
||||
---
|
||||
|
||||
## 4. 怎么用(给开发者)
|
||||
|
||||
### 4.1 自然语言(推荐)
|
||||
|
||||
在 Cursor Agent 对话中直接描述需求即可。Skill 的 `description` 含触发词(i18n、国际化、四语言、locale、`errors.json` 等),相关请求会自动匹配:
|
||||
|
||||
```text
|
||||
给 ChatInputBar 的「清除焦点」按钮补齐四语言,放到 chat.shippingNoticeUi 下
|
||||
```
|
||||
|
||||
```text
|
||||
把这个页面里硬编码的中文改成 i18n,别漏繁中/英/泰
|
||||
```
|
||||
|
||||
```text
|
||||
后端新增 SHIPPING.FOO_BAR,按四语言补 errors.codes
|
||||
```
|
||||
|
||||
### 4.2 显式点名
|
||||
|
||||
需要强制走该流程时,在对话中写出 skill 名:
|
||||
|
||||
```text
|
||||
用 add-i18n-keys:在 admin 域增加「批量导出」文案并接到按钮
|
||||
```
|
||||
|
||||
或:
|
||||
|
||||
```text
|
||||
/add-i18n-keys 为 profile 页保存成功提示补齐四语言
|
||||
```
|
||||
|
||||
### 4.3 写功能时顺带使用
|
||||
|
||||
做前端功能时可补充一句「文案走 i18n / 四语言」,Agent 应按 Skill 同步改四个 JSON 与 `t()` / `$t()` 引用,而不是只改 `zh-CN`。
|
||||
|
||||
---
|
||||
|
||||
## 5. Agent 会执行的流程(摘要)
|
||||
|
||||
1. **选域与 key**:按功能选 `chat` / `common` / `admin` 等;共享文案用 `common`;key 用 camelCase,可按 UI 区块嵌套。
|
||||
2. **四语言同路径写入**:同一 JSON 路径出现在 `zh-CN` / `zh-TW` / `en` / `th`;仅 value 不同;要求真实翻译(繁中勿直接复制简中)。
|
||||
3. **代码引用**:模板用 `$t('…')`,脚本用 `useI18n()` 的 `t('…')`;禁止残留硬编码用户文案。
|
||||
4. **新域文件**(如有):四个 locale 目录各加一份 JSON,并在 `locales/index.ts` 的 `externalModules` 注册;新域默认**带文件名命名空间**(不要仿照 auth/kb 做 spread 展平)。
|
||||
5. **API 错误码**(如有):`USER.EMAIL_EXISTS` → `errors.codes.USER_EMAIL_EXISTS`(`.` 换 `_`),四语言同步;详见 [error_handling.md](error_handling.md)。
|
||||
|
||||
### Key 路径速查
|
||||
|
||||
| 域文件 | 运行时前缀 | 示例 |
|
||||
| --- | --- | --- |
|
||||
| 多数域(`chat.json`、`common.json`…) | `<文件名>.…` | `t('common.cancel')` |
|
||||
| `auth.json` | **展平到根** | `t('login.submit')`(不是 `auth.login.submit`) |
|
||||
| `kb.json` | **展平到根** | `t('kbDifySettings.title')` |
|
||||
| `errors.json` | `errors.…` | `t('errors.codes.AUTH_UNAUTHORIZED')` |
|
||||
|
||||
域职责细表见 Skill 内 [domains.md](../../.cursor/skills/add-i18n-keys/domains.md)。
|
||||
|
||||
---
|
||||
|
||||
## 6. 示例
|
||||
|
||||
### 6.1 普通 UI 文案
|
||||
|
||||
**请求:**
|
||||
|
||||
```text
|
||||
在 chat.shippingNoticeUi 下加 clearFocus,中文「清除焦点」,接到按钮
|
||||
```
|
||||
|
||||
**期望结果:**
|
||||
|
||||
- 四个 `chat.json` 增加相同路径,例如 `shippingNoticeUi.clearFocus`
|
||||
- 组件使用 `$t('chat.shippingNoticeUi.clearFocus')` 或 `t('…')`
|
||||
|
||||
### 6.2 带插值
|
||||
|
||||
```ts
|
||||
t('common.pagination.summary', { total, page, pages })
|
||||
```
|
||||
|
||||
JSON 中保留命名占位符,例如 `"共 {total} 条,当前第 {page} / {pages} 页"`。
|
||||
|
||||
### 6.3 新增错误码
|
||||
|
||||
**后端 code:** `SHIPPING.INVENTORY_SOURCE_INVALID`
|
||||
**前端 key:** `errors.codes.SHIPPING_INVENTORY_SOURCE_INVALID`
|
||||
**文件:** `frontend/src/locales/{zh-CN,zh-TW,en,th}/errors.json` 的 `codes` 对象下各加一条。
|
||||
|
||||
---
|
||||
|
||||
## 7. 完成自检
|
||||
|
||||
- [ ] 变更路径在四语言文件中 key 树一致
|
||||
- [ ] UI 仅通过 i18n key 展示文案
|
||||
- [ ] 新域已在 `frontend/src/locales/index.ts` 注册(若适用)
|
||||
- [ ] 新 `error.code` 已写入四语言 `errors.codes.*`(若适用)
|
||||
- [ ] 涉及 `frontend/` 时本地 `npm run build` 可通过(合并前最低自检)
|
||||
|
||||
---
|
||||
|
||||
## 8. 维护说明
|
||||
|
||||
- 修改 Skill 行为时:同步更新 `.cursor/skills/add-i18n-keys/SKILL.md`(及必要时 `domains.md`)与**本文**。
|
||||
- 新增 locale 域文件或改变展平规则时:更新 `locales/index.ts`、Skill 与本文的域表。
|
||||
- 错误码命名与映射规则变更时:以 [error_handling.md](error_handling.md) 为准,并回改 Skill 中对应步骤。
|
||||
|
||||
---
|
||||
|
||||
## 9. 相关链接
|
||||
|
||||
| 资源 | 路径 |
|
||||
| --- | --- |
|
||||
| Skill 正文 | [`.cursor/skills/add-i18n-keys/SKILL.md`](../../.cursor/skills/add-i18n-keys/SKILL.md) |
|
||||
| 域补充 | [`.cursor/skills/add-i18n-keys/domains.md`](../../.cursor/skills/add-i18n-keys/domains.md) |
|
||||
| Locale 合并 | [`frontend/src/locales/index.ts`](../../frontend/src/locales/index.ts) |
|
||||
| 错误处理规范 | [error_handling.md](error_handling.md) |
|
||||
| 协作总入口 | [AGENTS.md](../../AGENTS.md) |
|
||||
@@ -83,7 +83,7 @@ const onLogout = (event: Event) => {
|
||||
useLinkedNavStore().reset();
|
||||
const detail = (event as CustomEvent<{ remote?: boolean }>).detail;
|
||||
if (detail?.remote) {
|
||||
showMessageDialog('info', '您已在其他标签页退出登录');
|
||||
showMessageDialog('info', t('common.app.remoteLogout'));
|
||||
}
|
||||
const path = router.currentRoute.value.path;
|
||||
if (!isPublicPath(path)) {
|
||||
|
||||
@@ -1,12 +1,38 @@
|
||||
/**
|
||||
* app/router/guards.ts
|
||||
* 全局路由守卫:认证、权限、旧 URL 兼容、document.title。
|
||||
* 依赖:vue-router、config、auth.store、i18n、adminModulePath、isPublicPath。
|
||||
* 逻辑:beforeEach 做登录/管理员校验;afterEach 将 meta.title(i18n key 或字面量)解析为浏览器标题。
|
||||
*/
|
||||
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 { isPublicPath } from '@/shared/constants/routes';
|
||||
import i18n from '@/i18n';
|
||||
|
||||
/**
|
||||
* 将路由 meta.title 解析为当前语言文案。
|
||||
* 核心逻辑:含 `.` 的字符串视为 i18n key(如 admin.nav.users);否则按字面量回退。
|
||||
* @param title - 路由 meta.title
|
||||
* @returns 可展示的页面标题片段
|
||||
*/
|
||||
function resolveRouteTitle(title: unknown): string {
|
||||
if (title == null || title === '') return '';
|
||||
const raw = String(title);
|
||||
if (raw.includes('.')) {
|
||||
return String(i18n.global.t(raw));
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析应用基础标题(不含页面片段)。
|
||||
* @returns common.app.title 对应文案
|
||||
*/
|
||||
function resolveAppBaseTitle(): string {
|
||||
return String(i18n.global.t(config.appTitleKey));
|
||||
}
|
||||
|
||||
export function setupRouterGuards(router: Router): void {
|
||||
router.beforeEach((to, _from, next) => {
|
||||
@@ -39,7 +65,8 @@ export function setupRouterGuards(router: Router): void {
|
||||
});
|
||||
|
||||
router.afterEach((to) => {
|
||||
const baseTitle = config.appTitle || 'AI工作台';
|
||||
document.title = to.meta.title ? `${String(to.meta.title)} - ${baseTitle}` : baseTitle;
|
||||
const baseTitle = resolveAppBaseTitle();
|
||||
const pageTitle = resolveRouteTitle(to.meta.title);
|
||||
document.title = pageTitle ? `${pageTitle} - ${baseTitle}` : baseTitle;
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* app/router/routes/admin.routes.ts
|
||||
* 管理后台嵌套路由;全部 admin 模块已独立拆分。
|
||||
* 依赖:vue-router;meta.title 存 i18n key(如 admin.nav.*),由 guards 解析为 document.title。
|
||||
* 逻辑:AdminLayout 嵌套各管理页;企微为三级子路由。
|
||||
*/
|
||||
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
@@ -65,7 +67,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
path: "dashboard",
|
||||
name: "AdminDashboard",
|
||||
component: DashboardPage,
|
||||
meta: { requiresAdmin: true, adminModule: "dashboard", title: "概览" },
|
||||
meta: { requiresAdmin: true, adminModule: "dashboard", title: "admin.nav.overview" },
|
||||
},
|
||||
|
||||
{
|
||||
@@ -75,7 +77,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "schedules",
|
||||
title: "定时任务",
|
||||
title: "admin.nav.schedules",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -86,7 +88,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "knowledge_base",
|
||||
title: "知识库配置",
|
||||
title: "admin.nav.knowledgeBase",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -94,25 +96,25 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
name: "AdminWecom",
|
||||
component: WecomLayout,
|
||||
redirect: { name: "AdminWecomSettings" },
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信" },
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.nav.wecom" },
|
||||
children: [
|
||||
{
|
||||
path: "settings",
|
||||
name: "AdminWecomSettings",
|
||||
component: WecomSettingsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信配置" },
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.wecom.nav.settingsPage" },
|
||||
},
|
||||
{
|
||||
path: "bindings",
|
||||
name: "AdminWecomBindings",
|
||||
component: WecomBindingsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信绑定" },
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.wecom.nav.bindingsPage" },
|
||||
},
|
||||
{
|
||||
path: "audits",
|
||||
name: "AdminWecomAudits",
|
||||
component: WecomAuditsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "企业微信审计" },
|
||||
meta: { requiresAdmin: true, adminModule: "wecom", title: "admin.wecom.nav.auditsPage" },
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -123,21 +125,21 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "approvals",
|
||||
title: "用户审批",
|
||||
title: "admin.nav.approvals",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "agents",
|
||||
name: "AdminAgents",
|
||||
component: AgentsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "agents", title: "应用管理" },
|
||||
meta: { requiresAdmin: true, adminModule: "agents", title: "admin.nav.agents" },
|
||||
},
|
||||
|
||||
{
|
||||
path: "users",
|
||||
name: "AdminUsers",
|
||||
component: UsersPage,
|
||||
meta: { requiresAdmin: true, adminModule: "users", title: "用户管理" },
|
||||
meta: { requiresAdmin: true, adminModule: "users", title: "admin.nav.users" },
|
||||
},
|
||||
|
||||
{
|
||||
@@ -147,7 +149,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "departments",
|
||||
title: "部门管理",
|
||||
title: "admin.nav.departments",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -158,7 +160,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "announcements",
|
||||
title: "公告管理",
|
||||
title: "admin.nav.announcements",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -169,7 +171,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "questions",
|
||||
title: "常用问题",
|
||||
title: "admin.nav.questions",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -179,7 +181,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "linked_services",
|
||||
title: "关联服务",
|
||||
title: "admin.nav.linkedServices",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -189,7 +191,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "requests",
|
||||
title: "权限申请",
|
||||
title: "admin.nav.requests",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -199,7 +201,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "permissions",
|
||||
title: "权限管理",
|
||||
title: "admin.nav.permissions",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -209,7 +211,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "platform_apps",
|
||||
title: "平台应用说明",
|
||||
title: "admin.nav.platformApps",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -219,14 +221,14 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
requiresAdmin: true,
|
||||
adminModule: "procurement_contract",
|
||||
title: "采购合同审查",
|
||||
title: "admin.nav.procurementContract",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "reports/:table?",
|
||||
name: "AdminReports",
|
||||
component: ReportsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "reports", title: "报表" },
|
||||
meta: { requiresAdmin: true, adminModule: "reports", title: "admin.nav.reports" },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* app/router/routes/workspace.routes.ts
|
||||
* 工作台路由表:/workspace 布局壳 + 各业务子页面懒加载。
|
||||
* 依赖:vue-router;meta.title 存 i18n key(workspace.*),由 guards 解析为 document.title。
|
||||
* 逻辑:WorkspaceLayout 嵌套应用首页、知识库、排程、反馈等子页。
|
||||
*/
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
@@ -8,14 +10,14 @@ export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/workspace',
|
||||
component: () => import('@/features/workspace/views/WorkspaceLayout.vue'),
|
||||
meta: { title: 'AI工作台' },
|
||||
meta: { title: 'workspace.title' },
|
||||
children: [
|
||||
{ path: '', redirect: '/workspace/applications' },
|
||||
{
|
||||
path: 'profile',
|
||||
name: 'workspace-profile',
|
||||
component: () => import('@/features/user/views/UserProfilePage.vue'),
|
||||
meta: { title: '个人中心' },
|
||||
meta: { title: 'workspace.nav.profile' },
|
||||
},
|
||||
{
|
||||
path: 'applications',
|
||||
@@ -33,37 +35,37 @@ export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
path: 'knowledge-base',
|
||||
name: 'workspace-knowledge-base',
|
||||
component: () => import('@/features/workspace/pages/KnowledgeBasePage.vue'),
|
||||
meta: { title: '知识库' },
|
||||
meta: { title: 'workspace.nav.knowledgeBase' },
|
||||
},
|
||||
{
|
||||
path: 'knowledge-base/groups/:groupId',
|
||||
name: 'workspace-knowledge-base-group',
|
||||
component: () => import('@/features/workspace/pages/KnowledgeBasePage.vue'),
|
||||
meta: { title: '知识库' },
|
||||
meta: { title: 'workspace.nav.knowledgeBase' },
|
||||
},
|
||||
{
|
||||
path: 'schedule-runs',
|
||||
name: 'workspace-schedule-runs',
|
||||
component: () => import('@/features/workspace/pages/ScheduleRunsPage.vue'),
|
||||
meta: { title: '排程记录' },
|
||||
meta: { title: 'workspace.nav.scheduleRuns' },
|
||||
},
|
||||
{
|
||||
path: 'shipping-notice',
|
||||
name: 'workspace-shipping-notice',
|
||||
component: () => import('@/features/workspace/pages/ShippingNoticePage.vue'),
|
||||
meta: { title: '货代发货' },
|
||||
meta: { title: 'workspace.nav.shippingNotice' },
|
||||
},
|
||||
{
|
||||
path: 'feedback',
|
||||
name: 'workspace-feedback',
|
||||
component: () => import('@/features/workspace/pages/FeedbackPage.vue'),
|
||||
meta: { title: '意见反馈' },
|
||||
meta: { title: 'workspace.nav.feedback' },
|
||||
},
|
||||
{
|
||||
path: 'history',
|
||||
name: 'workspace-history',
|
||||
component: () => import('@/features/chat/history/HistoryPage.vue'),
|
||||
meta: { title: '聊天历史' },
|
||||
meta: { title: 'workspace.routes.history' },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/**
|
||||
* config.ts
|
||||
* 用途:前端应用级开关与默认配置(登录模式、工作台模块、管理模块可见性)。
|
||||
* 依赖:无运行时依赖;应用标题通过 common.app.title i18n key 解析。
|
||||
* 逻辑:main.ts / router guards 使用 i18n.t(config.appTitleKey) 设置 document.title。
|
||||
*/
|
||||
export const config = {
|
||||
appTitle: '和信AI智能工作台',
|
||||
/** Browser title base name — resolve via i18n `t(config.appTitleKey)`. */
|
||||
appTitleKey: 'common.app.title',
|
||||
auth: {
|
||||
// Login mode switch:
|
||||
// - 'casdoor': submit username/password to backend Casdoor password-login API.
|
||||
|
||||
@@ -15,8 +15,7 @@ import type { ScheduleTask } from '@/shared/types/schedule.types';
|
||||
import type { AgentTypeCatalogEntry, IntentRouteOption } from '../composables/useAgentsAdminRegistry';
|
||||
import type { AdminContentProfileOption } from '@/features/admin/api/admin.api';
|
||||
import {
|
||||
DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS,
|
||||
DEFAULT_TRAINING_HR_CHAT_QUESTIONS,
|
||||
getDefaultTrainingChatQuestions,
|
||||
} from '@/features/chat/training/trainingChatQuestions';
|
||||
import {
|
||||
applyCatalogDefaultsToForm,
|
||||
@@ -188,10 +187,10 @@ const handleTrainingWorkspaceToggle = () => {
|
||||
if (props.form.training_workspace_enabled) {
|
||||
props.form.content_profile = 'training';
|
||||
if (!props.form.training_employee_chat_questions_text.trim()) {
|
||||
props.form.training_employee_chat_questions_text = DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS.join('\n');
|
||||
props.form.training_employee_chat_questions_text = getDefaultTrainingChatQuestions('employee').join('\n');
|
||||
}
|
||||
if (!props.form.training_hr_chat_questions_text.trim()) {
|
||||
props.form.training_hr_chat_questions_text = DEFAULT_TRAINING_HR_CHAT_QUESTIONS.join('\n');
|
||||
props.form.training_hr_chat_questions_text = getDefaultTrainingChatQuestions('hr').join('\n');
|
||||
}
|
||||
} else if (props.form.content_profile === 'training') {
|
||||
props.form.content_profile = '';
|
||||
@@ -305,10 +304,10 @@ const handleTrainingQuestionTypeChange = (form: AgentFormState, index: number) =
|
||||
|
||||
<template v-if="showDifyFields">
|
||||
<div class="space-y-2">
|
||||
<label class="text-xs font-bold text-muted uppercase tracking-wider">Dify应用类型</label>
|
||||
<label class="text-xs font-bold text-muted uppercase tracking-wider">{{ t('admin.agent.fields.difyAppType') }}</label>
|
||||
<select v-model="form.dify_app_type" class="w-full input-field text-sm">
|
||||
<option value="chatflow">Chatflow</option>
|
||||
<option value="workflow">Workflow</option>
|
||||
<option value="chatflow">{{ t('admin.agent.fields.difyAppTypes.chatflow') }}</option>
|
||||
<option value="workflow">{{ t('admin.agent.fields.difyAppTypes.workflow') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
@@ -565,30 +564,30 @@ const handleTrainingQuestionTypeChange = (form: AgentFormState, index: number) =
|
||||
|
||||
<div class="col-span-1 md:col-span-2 space-y-3">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<label class="text-xs font-bold text-muted uppercase tracking-wider">常见问题</label>
|
||||
<label class="text-xs font-bold text-muted uppercase tracking-wider">{{ t('admin.agent.suggestedQuestions.title') }}</label>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-lg border border-default px-3 py-1.5 text-xs font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
@click="emit('addSuggestedQuestion')"
|
||||
>
|
||||
<Plus class="h-4 w-4" />
|
||||
添加问题
|
||||
{{ t('admin.agent.suggestedQuestions.add') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-3 text-sm">
|
||||
<label class="inline-flex items-center gap-2 text-secondary">
|
||||
<input v-model="form.suggested_questions_style" type="radio" value="plain" class="accent-brand-600" />
|
||||
<span>无样式</span>
|
||||
<span>{{ t('admin.agent.suggestedQuestions.stylePlain') }}</span>
|
||||
</label>
|
||||
<label class="inline-flex items-center gap-2 text-secondary">
|
||||
<input v-model="form.suggested_questions_style" type="radio" value="styled" class="accent-brand-600" />
|
||||
<span>有样式</span>
|
||||
<span>{{ t('admin.agent.suggestedQuestions.styleStyled') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="form.suggested_questions.length === 0" class="rounded-xl border border-dashed border-default px-4 py-5 text-sm text-muted">
|
||||
暂未配置常见问题,点击“添加问题”后会同步到对应 Agent 的 Chat 欢迎页。
|
||||
{{ t('admin.agent.suggestedQuestions.empty') }}
|
||||
</div>
|
||||
|
||||
<div v-else class="space-y-3">
|
||||
@@ -602,14 +601,16 @@ const handleTrainingQuestionTypeChange = (form: AgentFormState, index: number) =
|
||||
v-model="item.question"
|
||||
type="text"
|
||||
class="w-full input-field text-sm"
|
||||
placeholder="请输入常见问题,例如:查询我有多少假期?"
|
||||
:placeholder="t('admin.agent.suggestedQuestions.questionPlaceholder')"
|
||||
/>
|
||||
<input
|
||||
v-model="item.group"
|
||||
type="text"
|
||||
class="w-full input-field text-sm"
|
||||
:disabled="form.suggested_questions_style !== 'styled'"
|
||||
:placeholder="form.suggested_questions_style === 'styled' ? '可选:分组标题,例如:考勤与休假' : '无样式下无需分组'"
|
||||
:placeholder="form.suggested_questions_style === 'styled'
|
||||
? t('admin.agent.suggestedQuestions.groupPlaceholderStyled')
|
||||
: t('admin.agent.suggestedQuestions.groupPlaceholderPlain')"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -500,13 +500,13 @@ export function useAgentsAdmin() {
|
||||
payload.dify_api_key = form.value.dify_api_key;
|
||||
}
|
||||
await updateAdminAgent(form.value.id, payload);
|
||||
msg.success('应用更新成功');
|
||||
msg.success(t('admin.agent.updateSuccess'));
|
||||
} else {
|
||||
await createAdminAgent({
|
||||
...registryPayload,
|
||||
dify_api_key: form.value.dify_api_key,
|
||||
});
|
||||
msg.success('应用创建成功');
|
||||
msg.success(t('admin.agent.createSuccess'));
|
||||
}
|
||||
|
||||
await loadAgents();
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/**
|
||||
* features/admin/modules/platform-apps/PlatformAppsPage.vue
|
||||
* 用途:平台应用说明(新手指南)管理——按 Agent 维护指南资料上传、启停与排序。
|
||||
* 依赖:admin.api 指南 CRUD/上传、vue-i18n、lucide 图标。
|
||||
* 逻辑:Admin 路由挂载;选择应用后拉取指南列表,弹窗内上传并保存元数据。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -29,6 +35,9 @@ const form = ref({
|
||||
const isUploading = ref(false);
|
||||
const uploadError = ref('');
|
||||
|
||||
/**
|
||||
* 拉取 Agent 列表并默认选中第一项,再加载其指南。
|
||||
*/
|
||||
const fetchAgents = async () => {
|
||||
try {
|
||||
agents.value = await listAdminAgents();
|
||||
@@ -41,6 +50,9 @@ const fetchAgents = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 按当前选中 Agent 拉取指南列表。
|
||||
*/
|
||||
const fetchGuides = async () => {
|
||||
if (!selectedAgentId.value) return;
|
||||
isLoading.value = true;
|
||||
@@ -62,6 +74,9 @@ onMounted(() => {
|
||||
fetchAgents();
|
||||
});
|
||||
|
||||
/**
|
||||
* 打开新建指南弹窗并重置表单。
|
||||
*/
|
||||
const openCreateModal = () => {
|
||||
isEditing.value = false;
|
||||
editingId.value = null;
|
||||
@@ -79,6 +94,10 @@ const openCreateModal = () => {
|
||||
isModalOpen.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 打开编辑指南弹窗并回填行数据。
|
||||
* @param guide - 列表行指南对象
|
||||
*/
|
||||
const openEditModal = (guide: any) => {
|
||||
isEditing.value = true;
|
||||
editingId.value = guide.id;
|
||||
@@ -96,6 +115,10 @@ const openEditModal = (guide: any) => {
|
||||
isModalOpen.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传指南文件并回填 path/type/size;必要时校正 guide_usage 与文件类型一致性。
|
||||
* @param event - input file change 事件
|
||||
*/
|
||||
const handleFileUpload = async (event: Event) => {
|
||||
const file = (event.target as HTMLInputElement).files?.[0];
|
||||
if (!file) return;
|
||||
@@ -118,12 +141,15 @@ const handleFileUpload = async (event: Event) => {
|
||||
form.value.file_name = res.file_name;
|
||||
}
|
||||
} catch (err: any) {
|
||||
uploadError.value = err.message || '上传失败';
|
||||
uploadError.value = err.message || t('admin.platformApps.uploadFailed');
|
||||
} finally {
|
||||
isUploading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交新建或更新指南元数据。
|
||||
*/
|
||||
const submitForm = async () => {
|
||||
if (!selectedAgentId.value || !form.value.file_path || !form.value.file_name) return;
|
||||
|
||||
@@ -143,8 +169,12 @@ const submitForm = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 确认后删除指南。
|
||||
* @param id - 指南主键
|
||||
*/
|
||||
const deleteGuide = async (id: number) => {
|
||||
if (!confirm('确定要删除该指南吗?删除后不可恢复。')) return;
|
||||
if (!confirm(t('admin.platformApps.confirmDelete'))) return;
|
||||
try {
|
||||
await deleteAdminAgentGuide(id);
|
||||
await fetchGuides();
|
||||
@@ -153,6 +183,10 @@ const deleteGuide = async (id: number) => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 切换指南启停状态。
|
||||
* @param guide - 列表行指南对象
|
||||
*/
|
||||
const toggleStatus = async (guide: any) => {
|
||||
try {
|
||||
await updateAdminAgentGuide(guide.id, { status: guide.status === 1 ? 0 : 1 });
|
||||
@@ -162,6 +196,11 @@ const toggleStatus = async (guide: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 将字节数格式化为可读文件大小。
|
||||
* @param bytes - 文件字节数
|
||||
* @returns 如 `1.2 MB`
|
||||
*/
|
||||
const formatSize = (bytes: number) => {
|
||||
if (!bytes) return '0 B';
|
||||
const k = 1024;
|
||||
@@ -170,6 +209,10 @@ const formatSize = (bytes: number) => {
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||
};
|
||||
|
||||
/**
|
||||
* 按文件类型返回列表图标组件。
|
||||
* @param type - 文件类型(video/pdf/其它)
|
||||
*/
|
||||
const getIcon = (type: string) => {
|
||||
if (type === 'video') return Play;
|
||||
if (type === 'pdf') return FileText;
|
||||
@@ -185,7 +228,7 @@ const getIcon = (type: string) => {
|
||||
{{ t('admin.nav.platformApps') }}
|
||||
</h2>
|
||||
<p class="text-sm text-muted mt-1">
|
||||
管理应用的新手指南资料(支持视频、PDF等)
|
||||
{{ t('admin.platformApps.subtitle') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,7 +236,7 @@ const getIcon = (type: string) => {
|
||||
<div class="surface-panel rounded-2xl p-6 shadow-sm border border-subtle flex-1 flex flex-col gap-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-4">
|
||||
<label class="font-medium text-sm text-default">选择应用:</label>
|
||||
<label class="font-medium text-sm text-default">{{ t('admin.platformApps.selectAgent') }}</label>
|
||||
<select v-model="selectedAgentId" class="input-field w-64" @change="fetchGuides">
|
||||
<option v-for="agent in agents" :key="agent.id" :value="agent.id">
|
||||
{{ agent.name }}
|
||||
@@ -202,7 +245,7 @@ const getIcon = (type: string) => {
|
||||
</div>
|
||||
<button v-if="selectedAgentId" type="button" class="btn-primary" @click="openCreateModal">
|
||||
<Plus class="w-5 h-5 mr-1" />
|
||||
<span>添加指南</span>
|
||||
<span>{{ t('admin.platformApps.addGuide') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -211,25 +254,25 @@ const getIcon = (type: string) => {
|
||||
</div>
|
||||
|
||||
<div v-else-if="!selectedAgentId" class="flex flex-col items-center justify-center py-20 text-muted">
|
||||
请先选择一个应用
|
||||
{{ t('admin.platformApps.selectAgentFirst') }}
|
||||
</div>
|
||||
|
||||
<div v-else-if="guides.length === 0" class="flex flex-col items-center justify-center py-20 text-muted">
|
||||
该应用暂无新手指南资料
|
||||
{{ t('admin.platformApps.emptyGuides') }}
|
||||
</div>
|
||||
|
||||
<div v-else class="overflow-x-auto rounded-xl border border-subtle">
|
||||
<table class="w-full text-left text-sm whitespace-nowrap">
|
||||
<thead class="bg-muted text-muted uppercase text-xs font-semibold tracking-wider border-b border-subtle">
|
||||
<tr>
|
||||
<th class="px-6 py-4">类型</th>
|
||||
<th class="px-6 py-4">资料名称</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.colType') }}</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.colFileName') }}</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.guideUsage') }}</th>
|
||||
<th class="px-6 py-4">Agent应用</th>
|
||||
<th class="px-6 py-4">文件大小</th>
|
||||
<th class="px-6 py-4">排序</th>
|
||||
<th class="px-6 py-4">状态</th>
|
||||
<th class="px-6 py-4 text-right">操作</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.colAgent') }}</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.colFileSize') }}</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.colSort') }}</th>
|
||||
<th class="px-6 py-4">{{ t('admin.platformApps.colStatus') }}</th>
|
||||
<th class="px-6 py-4 text-right">{{ t('admin.platformApps.colActions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-subtle">
|
||||
@@ -259,14 +302,14 @@ const getIcon = (type: string) => {
|
||||
:class="guide.status === 1 ? 'bg-green-100 text-green-700 hover:bg-green-200' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'"
|
||||
@click="toggleStatus(guide)"
|
||||
>
|
||||
{{ guide.status === 1 ? '已启用' : '已禁用' }}
|
||||
{{ guide.status === 1 ? t('admin.platformApps.statusEnabled') : t('admin.platformApps.statusDisabled') }}
|
||||
</button>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right space-x-2">
|
||||
<button type="button" class="btn-icon-ds" @click="openEditModal(guide)" title="编辑">
|
||||
<button type="button" class="btn-icon-ds" @click="openEditModal(guide)" :title="t('common.edit')">
|
||||
<Edit2 class="w-4 h-4" />
|
||||
</button>
|
||||
<button type="button" class="btn-icon-ds text-red-500 hover:bg-red-50" @click="deleteGuide(guide.id)" title="删除">
|
||||
<button type="button" class="btn-icon-ds text-red-500 hover:bg-red-50" @click="deleteGuide(guide.id)" :title="t('common.delete')">
|
||||
<Trash2 class="w-4 h-4" />
|
||||
</button>
|
||||
</td>
|
||||
@@ -280,13 +323,13 @@ const getIcon = (type: string) => {
|
||||
<div v-if="isModalOpen" class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col max-h-[90vh]">
|
||||
<div class="px-6 py-4 border-b border-subtle flex justify-between items-center">
|
||||
<h3 class="text-lg font-bold text-default">{{ isEditing ? '编辑指南' : '添加指南' }}</h3>
|
||||
<h3 class="text-lg font-bold text-default">{{ isEditing ? t('admin.platformApps.editGuide') : t('admin.platformApps.addGuide') }}</h3>
|
||||
<button @click="isModalOpen = false" class="text-muted hover:text-default text-xl leading-none">×</button>
|
||||
</div>
|
||||
|
||||
<div class="p-6 overflow-y-auto space-y-4">
|
||||
<div v-if="!isEditing" class="space-y-2">
|
||||
<label class="text-sm font-medium text-default">上传文件</label>
|
||||
<label class="text-sm font-medium text-default">{{ t('admin.platformApps.uploadFile') }}</label>
|
||||
<input
|
||||
type="file"
|
||||
accept="video/mp4,video/webm,application/pdf,image/png,image/jpeg"
|
||||
@@ -294,20 +337,20 @@ const getIcon = (type: string) => {
|
||||
@change="handleFileUpload"
|
||||
/>
|
||||
<div v-if="isUploading" class="text-sm text-blue-600 mt-2 flex items-center gap-2">
|
||||
<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"></div> 上传中...
|
||||
<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"></div> {{ t('admin.platformApps.uploading') }}
|
||||
</div>
|
||||
<div v-if="uploadError" class="text-sm text-red-500 mt-2">{{ uploadError }}</div>
|
||||
<div v-if="form.file_path && !isUploading" class="text-sm text-green-600 mt-2">已上传文件就绪</div>
|
||||
<div v-if="form.file_path && !isUploading" class="text-sm text-green-600 mt-2">{{ t('admin.platformApps.uploadReady') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
<label class="text-sm font-medium text-default">资料名称</label>
|
||||
<input v-model="form.file_name" type="text" class="input-field w-full" placeholder="如:人事助手使用手册" />
|
||||
<label class="text-sm font-medium text-default">{{ t('admin.platformApps.fileName') }}</label>
|
||||
<input v-model="form.file_name" type="text" class="input-field w-full" :placeholder="t('admin.platformApps.fileNamePlaceholder')" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
<label class="text-sm font-medium text-default">备注说明</label>
|
||||
<textarea v-model="form.remark" class="input-field w-full h-20" placeholder="简要说明..."></textarea>
|
||||
<label class="text-sm font-medium text-default">{{ t('admin.platformApps.remark') }}</label>
|
||||
<textarea v-model="form.remark" class="input-field w-full h-20" :placeholder="t('admin.platformApps.remarkPlaceholder')"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
@@ -321,29 +364,29 @@ const getIcon = (type: string) => {
|
||||
<p class="text-xs text-muted">{{ t('admin.platformApps.guideUsageHint') }}</p>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<label class="text-sm font-medium text-default">排序权重</label>
|
||||
<label class="text-sm font-medium text-default">{{ t('admin.platformApps.sortOrder') }}</label>
|
||||
<input v-model.number="form.sort_order" type="number" class="input-field w-full" />
|
||||
<p class="text-xs text-muted">数值越小越靠前</p>
|
||||
<p class="text-xs text-muted">{{ t('admin.platformApps.sortOrderHint') }}</p>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<label class="text-sm font-medium text-default">状态</label>
|
||||
<label class="text-sm font-medium text-default">{{ t('admin.platformApps.status') }}</label>
|
||||
<select v-model="form.status" class="input-field w-full">
|
||||
<option :value="1">启用</option>
|
||||
<option :value="0">禁用</option>
|
||||
<option :value="1">{{ t('admin.platformApps.enable') }}</option>
|
||||
<option :value="0">{{ t('admin.platformApps.disable') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="px-6 py-4 border-t border-subtle bg-muted flex justify-end gap-3">
|
||||
<button type="button" class="btn-secondary" @click="isModalOpen = false">取消</button>
|
||||
<button type="button" class="btn-secondary" @click="isModalOpen = false">{{ t('admin.cancel') }}</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-primary"
|
||||
@click="submitForm"
|
||||
:disabled="isUploading || !form.file_path || !form.file_name"
|
||||
>
|
||||
保存
|
||||
{{ t('admin.platformApps.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+4
-11
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* features/admin/modules/procurement-contract/ProcurementContractPage.vue
|
||||
* 用途:采购合同审查管理——模板库 / 风险规则 / 审查历史(Tab),含鉴权下载。
|
||||
* 依赖:procurement-contract.api、ContractRiskRulesPanel、DeleteConfirmDialog、useMessage、vue-i18n。
|
||||
* 依赖:procurement-contract.api、contract-ocr-match-tokens、ContractRiskRulesPanel、DeleteConfirmDialog、useMessage、vue-i18n。
|
||||
* 逻辑:Admin 路由挂载;会话 Agent 读模板列表走 /api/procurement-contract。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
type ContractReviewRow,
|
||||
type ContractTemplateRow,
|
||||
} from '@/features/admin/api/procurement-contract.api';
|
||||
import { V4_REGION_CONFIG } from './contract-ocr-match-tokens';
|
||||
import ContractRiskRulesPanel from './components/ContractRiskRulesPanel.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
@@ -44,7 +45,7 @@ const reviewTotal = ref(0);
|
||||
const showUpload = ref(false);
|
||||
const uploading = ref(false);
|
||||
const editingTemplate = ref<ContractTemplateRow | null>(null);
|
||||
const uploadName = ref('标准采购合同');
|
||||
const uploadName = ref(t('admin.procurementContract.defaultTemplateName'));
|
||||
const uploadVersion = ref('V1.0');
|
||||
const uploadStatus = ref<'enabled' | 'disabled'>('enabled');
|
||||
const uploadDefault = ref(false);
|
||||
@@ -89,14 +90,6 @@ const regionSignatureTerms = ref('');
|
||||
const regionAttachmentStart = ref('');
|
||||
let reviewFilterTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
|
||||
const V4_REGION_CONFIG: ContractComparisonRegionConfig = {
|
||||
metadata_fields: ['contract_no', 'buyer', 'seller', 'version'],
|
||||
body_start_anchors: ['兹因甲方向乙方购买设备'],
|
||||
body_end_anchors: ['本合同一式两份', '以下无正文', '本页以下无正文'],
|
||||
signature_terms: ['甲方', '乙方', '盖章', '签署日期', '合同专用章'],
|
||||
attachment_start_anchors: ['附件', '性能需求表', '技术协议', '设备配置清单'],
|
||||
attachment_policy: 'page_count_only',
|
||||
};
|
||||
const metadataFieldOptions: ContractMetadataField[] = ['contract_no', 'buyer', 'seller', 'version'];
|
||||
|
||||
/**
|
||||
@@ -172,7 +165,7 @@ async function switchTab(next: 'templates' | 'rules' | 'reviews'): Promise<void>
|
||||
*/
|
||||
function resetUploadForm(): void {
|
||||
editingTemplate.value = null;
|
||||
uploadName.value = '标准采购合同';
|
||||
uploadName.value = t('admin.procurementContract.defaultTemplateName');
|
||||
uploadVersion.value = 'V1.0';
|
||||
uploadStatus.value = 'enabled';
|
||||
uploadDefault.value = false;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* features/admin/modules/procurement-contract/contract-ocr-match-tokens.ts
|
||||
* 用途:采购合同比对区域的 V4 默认 OCR/正文匹配锚点与签章关键词(检测用 token,非 UI 文案)。
|
||||
* 依赖:procurement-contract.api 的 ContractComparisonRegionConfig 类型。
|
||||
* 逻辑:ProcurementContractPage「恢复 V4 默认配置」与新建区域配置时引用;勿当作 i18n 展示文案。
|
||||
*
|
||||
* NOTE: Strings below are OCR match tokens for Chinese contract PDFs. Keep them in Chinese
|
||||
* regardless of UI locale so region recognition against Chinese source documents still works.
|
||||
*/
|
||||
import type { ContractComparisonRegionConfig } from '@/features/admin/api/procurement-contract.api';
|
||||
|
||||
/** V4 默认比对区域配置(锚点/关键词为中文 OCR 匹配 token)。 */
|
||||
export const V4_REGION_CONFIG: ContractComparisonRegionConfig = {
|
||||
metadata_fields: ['contract_no', 'buyer', 'seller', 'version'],
|
||||
body_start_anchors: ['兹因甲方向乙方购买设备'],
|
||||
body_end_anchors: ['本合同一式两份', '以下无正文', '本页以下无正文'],
|
||||
signature_terms: ['甲方', '乙方', '盖章', '签署日期', '合同专用章'],
|
||||
attachment_start_anchors: ['附件', '性能需求表', '技术协议', '设备配置清单'],
|
||||
attachment_policy: 'page_count_only',
|
||||
};
|
||||
@@ -2,10 +2,11 @@
|
||||
/**
|
||||
* features/chat/components/ChatAssetHistoryDialog.vue
|
||||
* 用途:展示固定资产履历候选文件列表,并复用既有文件预览弹窗打开具体履历。
|
||||
* 依赖:聊天页 useChatPage 提供的查询状态与打开预览回调。
|
||||
* 依赖:vue-i18n、聊天页 useChatPage 提供的查询状态与打开预览回调。
|
||||
* 逻辑:用户点击资产编号后打开;先显示检索状态,再列出共享盘匹配文件,点击单条文件进入预览。
|
||||
*/
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ExternalLink, FileText, Loader2, X } from 'lucide-vue-next';
|
||||
import type { AssetHistoryFileItem } from '../types/chat.types';
|
||||
|
||||
@@ -24,7 +25,8 @@ const emit = defineEmits<{
|
||||
openPreview: [item: AssetHistoryFileItem];
|
||||
}>();
|
||||
|
||||
const titleText = computed(() => props.assetId || props.assetName || '资产履历');
|
||||
const { t } = useI18n();
|
||||
const titleText = computed(() => props.assetId || props.assetName || t('chat.assetHistory.title'));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -36,17 +38,17 @@ const titleText = computed(() => props.assetId || props.assetName || '资产履
|
||||
<div class="dialog-panel flex max-h-[88vh] w-[min(96vw,900px)] max-w-[900px] flex-col">
|
||||
<div class="dialog-header">
|
||||
<div>
|
||||
<h3 class="section-title">资产履历</h3>
|
||||
<p class="section-desc mt-1">当前资产:{{ titleText }}</p>
|
||||
<h3 class="section-title">{{ $t('chat.assetHistory.title') }}</h3>
|
||||
<p class="section-desc mt-1">{{ $t('chat.assetHistory.currentAsset', { name: titleText }) }}</p>
|
||||
</div>
|
||||
<button type="button" class="btn-icon-ds" aria-label="关闭" @click="emit('close')">
|
||||
<button type="button" class="btn-icon-ds" :aria-label="$t('common.close')" @click="emit('close')">
|
||||
<X class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="dialog-body flex min-h-0 flex-1 flex-col gap-4 border-t-0 pt-4">
|
||||
<div v-if="loading" class="flex h-56 items-center justify-center text-sm text-muted">
|
||||
<Loader2 class="mr-2 h-5 w-5 animate-spin text-brand-500" />
|
||||
正在检索共享盘履历文件...
|
||||
{{ $t('chat.assetHistory.searching') }}
|
||||
</div>
|
||||
<div v-else-if="error" class="rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700">
|
||||
{{ error }}
|
||||
@@ -55,7 +57,7 @@ const titleText = computed(() => props.assetId || props.assetName || '资产履
|
||||
v-else-if="items.length === 0"
|
||||
class="flex h-56 items-center justify-center rounded-2xl border border-dashed border-default bg-surface-soft text-sm text-muted"
|
||||
>
|
||||
未找到匹配的履历文件
|
||||
{{ $t('chat.assetHistory.empty') }}
|
||||
</div>
|
||||
<div v-else class="min-h-0 flex-1 overflow-auto rounded-2xl border border-default bg-surface">
|
||||
<div
|
||||
@@ -70,9 +72,9 @@ const titleText = computed(() => props.assetId || props.assetName || '资产履
|
||||
</div>
|
||||
<div class="mt-1 break-all text-xs text-secondary">{{ item.relative_path }}</div>
|
||||
<div class="mt-2 flex flex-wrap gap-3 text-xs text-muted">
|
||||
<span v-if="item.modified_at">修改时间:{{ item.modified_at }}</span>
|
||||
<span v-if="item.size_bytes">大小:{{ Math.max(1, Math.round(item.size_bytes / 1024)) }} KB</span>
|
||||
<span v-if="item.match_reason">匹配方式:{{ item.match_reason }}</span>
|
||||
<span v-if="item.modified_at">{{ $t('chat.assetHistory.modifiedAt', { time: item.modified_at }) }}</span>
|
||||
<span v-if="item.size_bytes">{{ $t('chat.assetHistory.sizeKb', { size: Math.max(1, Math.round(item.size_bytes / 1024)) }) }}</span>
|
||||
<span v-if="item.match_reason">{{ $t('chat.assetHistory.matchReason', { reason: item.match_reason }) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
@@ -81,7 +83,7 @@ const titleText = computed(() => props.assetId || props.assetName || '资产履
|
||||
@click="emit('openPreview', item)"
|
||||
>
|
||||
<ExternalLink class="h-4 w-4" />
|
||||
查看履历
|
||||
{{ $t('chat.assetHistory.viewFile') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/chat/components/ChatGuideModal.vue
|
||||
* Agent 学习之窗:指南目录与视频 / PDF / 图片预览。
|
||||
* 用途:Agent 学习之窗弹窗,展示指南目录与视频 / PDF / 图片预览。
|
||||
* 依赖:lucide-vue-next、useChatGuides.AgentGuide、vue-i18n($t)。
|
||||
* 逻辑:由 Chat 页打开;目录折叠/展开与空态文案走 chat.guide.* / chat.learningWindow。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { BookOpen, FileText, Image as ImageIcon, PanelLeftClose, PanelLeftOpen, Play, X } from 'lucide-vue-next';
|
||||
@@ -27,7 +29,7 @@ defineProps<{
|
||||
<div class="flex shrink-0 items-center justify-between border-b border-default bg-surface px-6 py-4">
|
||||
<h3 class="flex items-center gap-2 text-lg font-bold text-primary">
|
||||
<BookOpen class="h-5 w-5 text-brand-600" />
|
||||
{{ agentName }} - 学习之窗
|
||||
{{ agentName }} - {{ $t('chat.learningWindow') }}
|
||||
</h3>
|
||||
<div class="flex items-center gap-3">
|
||||
<button
|
||||
@@ -36,7 +38,7 @@ defineProps<{
|
||||
@click="showSidebar = !showSidebar"
|
||||
>
|
||||
<component :is="showSidebar ? PanelLeftClose : PanelLeftOpen" class="h-4 w-4" />
|
||||
{{ showSidebar ? '收起目录' : '展开目录' }}
|
||||
{{ showSidebar ? $t('chat.guide.collapseToc') : $t('chat.guide.expandToc') }}
|
||||
</button>
|
||||
<div class="h-5 w-px bg-default" />
|
||||
<button
|
||||
@@ -104,7 +106,7 @@ defineProps<{
|
||||
</template>
|
||||
<div v-else class="flex flex-col items-center gap-3 text-muted">
|
||||
<BookOpen class="h-12 w-12 opacity-20" />
|
||||
<p class="text-sm">请选择左侧指南进行查阅</p>
|
||||
<p class="text-sm">{{ $t('chat.guide.selectHint') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -520,7 +520,7 @@ watch(
|
||||
class="rounded-full border border-default bg-surface-soft px-3 py-1 font-medium text-secondary transition-colors hover:bg-surface-soft/70"
|
||||
@click="emit('use-shipping-suggested-prompt')"
|
||||
>
|
||||
{{ shippingSuggestedPrompt || '推荐问题' }}
|
||||
{{ shippingSuggestedPrompt || $t('chat.recommendedQuestion') }}
|
||||
</button>
|
||||
<span>{{ t('chat.shippingNoticeConfirmBatchHint') }}</span>
|
||||
</div>
|
||||
@@ -557,7 +557,7 @@ watch(
|
||||
<button
|
||||
type="button"
|
||||
:disabled="isThinking || isUploadingAttachments"
|
||||
title="附件"
|
||||
:title="$t('chat.attachmentsUi.title')"
|
||||
class="flex h-9 w-9 items-center justify-center rounded-lg text-muted transition-colors hover:text-brand-600 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
@click="toggleAttachmentMenu"
|
||||
>
|
||||
@@ -574,7 +574,7 @@ watch(
|
||||
@click="selectAttachmentLocal"
|
||||
>
|
||||
<Paperclip class="h-4 w-4 text-brand-500" />
|
||||
上传本地文件
|
||||
{{ $t('chat.attachmentsUi.uploadLocal') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="attachmentPolicy.canRemote"
|
||||
@@ -583,7 +583,7 @@ watch(
|
||||
@click="selectAttachmentUrl"
|
||||
>
|
||||
<Link2 class="h-4 w-4 text-brand-500" />
|
||||
粘贴 URL
|
||||
{{ $t('chat.attachmentsUi.pasteUrl') }}
|
||||
</button>
|
||||
<div v-if="showAttachmentUrlPanel" class="px-3 py-2">
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -591,7 +591,7 @@ watch(
|
||||
ref="attachmentUrlInputRef"
|
||||
v-model="attachmentUrlInput"
|
||||
:disabled="isThinking || isUploadingAttachments"
|
||||
placeholder="粘贴附件 URL(http/https)"
|
||||
:placeholder="$t('chat.attachmentsUi.urlPlaceholder')"
|
||||
class="flex-1 rounded-lg border border-default bg-surface-soft px-3 py-2 text-xs text-secondary placeholder-slate-400 focus:outline-none focus:ring-0"
|
||||
@keydown.enter.prevent="submitRemoteUrl"
|
||||
/>
|
||||
@@ -599,7 +599,7 @@ watch(
|
||||
type="button"
|
||||
:disabled="isThinking || isUploadingAttachments"
|
||||
class="flex h-9 w-9 items-center justify-center rounded-lg border border-default text-muted transition-colors hover:bg-surface-soft disabled:cursor-not-allowed disabled:opacity-50"
|
||||
title="添加"
|
||||
:title="$t('chat.attachmentsUi.add')"
|
||||
@click="submitRemoteUrl"
|
||||
>
|
||||
<Check class="h-4 w-4" />
|
||||
@@ -608,7 +608,7 @@ watch(
|
||||
type="button"
|
||||
:disabled="isThinking || isUploadingAttachments"
|
||||
class="flex h-9 w-9 items-center justify-center rounded-lg border border-default text-muted transition-colors hover:bg-surface-soft disabled:cursor-not-allowed disabled:opacity-50"
|
||||
title="取消"
|
||||
:title="$t('chat.attachmentsUi.cancel')"
|
||||
@click="closeAttachmentMenu"
|
||||
>
|
||||
<X class="h-4 w-4" />
|
||||
|
||||
@@ -75,7 +75,7 @@ onBeforeUnmount(() => {
|
||||
@click="emit('open-guide')"
|
||||
>
|
||||
<BookOpen class="h-4 w-4" />
|
||||
学习之窗
|
||||
{{ $t('chat.learningWindow') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/**
|
||||
* features/chat/components/ChatQueryPreviewDialog.vue
|
||||
* Text2SQL 查询结果全量预览弹窗 UI。
|
||||
* 依赖:vue-i18n、useChatQueryPreview 状态。
|
||||
* 逻辑:列名匹配仍兼容服务端中文表头与本地化后的展示标签,避免切语言后丢失资产编号/图片交互。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Loader2, X } from 'lucide-vue-next';
|
||||
import type { QueryPreviewState } from '../composables/useChatQueryPreview';
|
||||
|
||||
@@ -22,15 +25,32 @@ const emit = defineEmits<{
|
||||
'open-asset-image': [payload: { assetId: string; assetName: string }];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
/** 判断列是否命中资产编号(服务端中文表头或本地化标签)。 */
|
||||
function matchesAssetIdColumn(column: string): boolean {
|
||||
return column === '资产编号' || column === t('chat.assetColumns.assetId');
|
||||
}
|
||||
|
||||
/** 判断列是否命中资产名称。 */
|
||||
function matchesAssetNameColumn(column: string): boolean {
|
||||
return column === '资产名称' || column === t('chat.assetColumns.assetName');
|
||||
}
|
||||
|
||||
/** 判断列是否命中图片。 */
|
||||
function matchesImageColumn(column: string): boolean {
|
||||
return column === '图片' || column === t('chat.assetColumns.image');
|
||||
}
|
||||
|
||||
const totalPages = computed(() =>
|
||||
Math.max(1, Math.ceil((props.state.total || 0) / (props.state.pageSize || 100))),
|
||||
);
|
||||
const assetIdColumnIndex = computed(() => props.state.columns.findIndex((column) => column === '资产编号'));
|
||||
const assetNameColumnIndex = computed(() => props.state.columns.findIndex((column) => column === '资产名称'));
|
||||
const imageColumnIndex = computed(() => props.state.columns.findIndex((column) => column === '图片'));
|
||||
const assetIdColumnIndex = computed(() => props.state.columns.findIndex((column) => matchesAssetIdColumn(column)));
|
||||
const assetNameColumnIndex = computed(() => props.state.columns.findIndex((column) => matchesAssetNameColumn(column)));
|
||||
const imageColumnIndex = computed(() => props.state.columns.findIndex((column) => matchesImageColumn(column)));
|
||||
|
||||
function isHighlightColumn(column: string): boolean {
|
||||
return column === '资产编号' || column === '图片';
|
||||
return matchesAssetIdColumn(column) || matchesImageColumn(column);
|
||||
}
|
||||
|
||||
function normalizeCellText(cell: unknown): string {
|
||||
@@ -68,16 +88,16 @@ function emitAssetAction(row: unknown[], cellIndex: number): void {
|
||||
<div class="dialog-panel flex max-h-[88vh] w-[min(96vw,1280px)] max-w-[1280px] flex-col">
|
||||
<div class="dialog-header">
|
||||
<div>
|
||||
<h3 class="section-title">查询结果全量预览</h3>
|
||||
<h3 class="section-title">{{ $t('chat.queryPreview.title') }}</h3>
|
||||
<p class="section-desc mt-1">{{ state.query || state.title }}</p>
|
||||
</div>
|
||||
<button type="button" class="btn-icon-ds" aria-label="关闭" @click="emit('close')">
|
||||
<button type="button" class="btn-icon-ds" :aria-label="$t('common.close')" @click="emit('close')">
|
||||
<X class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="dialog-body flex min-h-0 flex-1 flex-col gap-4 border-t-0 pt-4">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 rounded-xl border border-default bg-surface-soft px-4 py-3 text-sm text-secondary">
|
||||
<div>共 {{ state.total || 0 }} 条,当前第 {{ state.page }} / {{ totalPages }} 页</div>
|
||||
<div>{{ $t('chat.queryPreview.summary', { total: state.total || 0, page: state.page, pages: totalPages }) }}</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
@@ -85,7 +105,7 @@ function emitAssetAction(row: unknown[], cellIndex: number): void {
|
||||
:disabled="loading || state.page <= 1"
|
||||
@click="emit('change-page', -1)"
|
||||
>
|
||||
上一页
|
||||
{{ $t('chat.queryPreview.prev') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
@@ -93,7 +113,7 @@ function emitAssetAction(row: unknown[], cellIndex: number): void {
|
||||
:disabled="loading || state.page >= totalPages"
|
||||
@click="emit('change-page', 1)"
|
||||
>
|
||||
下一页
|
||||
{{ $t('chat.queryPreview.next') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,7 +125,7 @@ function emitAssetAction(row: unknown[], cellIndex: number): void {
|
||||
<Loader2 class="h-6 w-6 animate-spin text-brand-500" />
|
||||
</div>
|
||||
<div v-else-if="!state.columns.length" class="flex h-56 items-center justify-center text-sm text-muted">
|
||||
暂无可预览数据
|
||||
{{ $t('chat.queryPreview.empty') }}
|
||||
</div>
|
||||
<table v-else class="min-w-full border-collapse text-sm">
|
||||
<thead class="sticky top-0 z-10 bg-slate-50">
|
||||
|
||||
@@ -167,7 +167,7 @@ const userInitial = (fallback: string) => {
|
||||
@click="emit('open-guide')"
|
||||
>
|
||||
<BookOpen class="h-4 w-4" />
|
||||
学习之窗
|
||||
{{ $t('chat.learningWindow') }}
|
||||
</button>
|
||||
</div>
|
||||
<span v-if="agentDescription" class="mt-1 block cursor-help truncate text-[11px] text-muted">
|
||||
@@ -278,7 +278,7 @@ const userInitial = (fallback: string) => {
|
||||
class="flex h-10 min-w-[2.5rem] items-center justify-center rounded-full bg-brand-600 px-3 text-sm font-bold text-white shadow-sm shadow-brand-500/20 transition-colors hover:bg-brand-700"
|
||||
@click="showUserDropdown = !showUserDropdown"
|
||||
>
|
||||
退出
|
||||
{{ $t('chat.exitShort') }}
|
||||
</button>
|
||||
|
||||
<div
|
||||
|
||||
@@ -72,7 +72,7 @@ async function handleQueryPreviewAssetImage(assetId: string, assetName: string)
|
||||
>
|
||||
<div class="flex items-center gap-2 rounded-full border border-brand-200 bg-white/95 px-4 py-2 text-sm text-brand-700 shadow-lg backdrop-blur">
|
||||
<Loader2 class="h-4 w-4 animate-spin text-brand-500" />
|
||||
<span>正在搜索该资产的履历资料,请耐心等待...</span>
|
||||
<span>{{ page.t('chat.assetHistory.searchingToast') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -81,7 +81,7 @@ async function handleQueryPreviewAssetImage(assetId: string, assetName: string)
|
||||
>
|
||||
<div class="flex items-center gap-2 rounded-full border border-brand-200 bg-white/95 px-4 py-2 text-sm text-brand-700 shadow-lg backdrop-blur">
|
||||
<Loader2 class="h-4 w-4 animate-spin text-brand-500" />
|
||||
<span>正在搜索该资产的图片资料,请耐心等待...</span>
|
||||
<span>{{ page.t('chat.assetImage.searchingToast') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<ChatLeaveAgentDialog
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/chat/components/ToolRunProgressCard.vue
|
||||
* 用途:展示文件检核等 Agent 异步 tool_run 的实时进度、知识库同步态与 Excel 下载。
|
||||
* 依赖:vue-i18n、lucide 图标、getAuthHeaders、toolRunProgress.api。
|
||||
* 逻辑:由聊天消息列表在绑定 run_id 后挂载;轮询结果经 props.run 传入,本组件只负责展示与下载。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { AlertCircle, CheckCircle2, Clock3, Download, Loader2 } from 'lucide-vue-next';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import type { ToolRunProgress } from '../api/toolRunProgress.api';
|
||||
@@ -12,19 +19,26 @@ const props = defineProps<{
|
||||
fallbackTitle?: string;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const downloadingExcel = ref(false);
|
||||
const downloadError = ref('');
|
||||
|
||||
/**
|
||||
* 将后端 run.status 映射为本地化状态文案。
|
||||
* 核心逻辑:命中已知状态码用 i18n;未知状态回退原始值,再回退“等待中”。
|
||||
* @param status - 任务状态码
|
||||
* @returns 面向用户的状态标签
|
||||
*/
|
||||
const statusLabel = (status?: string) => {
|
||||
const map: Record<string, string> = {
|
||||
running: '执行中',
|
||||
success: '已完成',
|
||||
partial_failed: '部分失败',
|
||||
failed: '失败',
|
||||
cancelled: '已取消',
|
||||
canceled: '已取消',
|
||||
running: t('chat.toolRun.statusRunning'),
|
||||
success: t('chat.toolRun.statusSuccess'),
|
||||
partial_failed: t('chat.toolRun.statusPartialFailed'),
|
||||
failed: t('chat.toolRun.statusFailed'),
|
||||
cancelled: t('chat.toolRun.statusCancelled'),
|
||||
canceled: t('chat.toolRun.statusCancelled'),
|
||||
};
|
||||
return map[String(status || '')] || status || '等待中';
|
||||
return map[String(status || '')] || status || t('chat.toolRun.statusWaiting');
|
||||
};
|
||||
|
||||
const formatTime = (value?: string | null) => {
|
||||
@@ -52,21 +66,30 @@ const percent = () => {
|
||||
return Math.max(0, Math.min(value, 100));
|
||||
};
|
||||
|
||||
/**
|
||||
* 组装知识库同步徽标文案与样式。
|
||||
* 核心逻辑:按 sync_status 分桶映射 tone/icon;未知状态带上原始 status。
|
||||
* @param status - knowledge_base.sync_status
|
||||
*/
|
||||
const kbSyncMeta = (status?: string | null) => {
|
||||
const value = String(status || '').toLowerCase();
|
||||
if (value === 'success') {
|
||||
return { label: '知识库已同步', tone: 'border-emerald-200 bg-emerald-50 text-emerald-700', icon: 'success' };
|
||||
return { label: t('chat.toolRun.kbSynced'), tone: 'border-emerald-200 bg-emerald-50 text-emerald-700', icon: 'success' };
|
||||
}
|
||||
if (value === 'failed') {
|
||||
return { label: '知识库同步失败', tone: 'border-rose-200 bg-rose-50 text-rose-700', icon: 'failed' };
|
||||
return { label: t('chat.toolRun.kbSyncFailed'), tone: 'border-rose-200 bg-rose-50 text-rose-700', icon: 'failed' };
|
||||
}
|
||||
if (['queued', 'cleaning', 'syncing'].includes(value)) {
|
||||
return { label: '知识库同步中', tone: 'border-sky-200 bg-sky-50 text-sky-700', icon: 'syncing' };
|
||||
return { label: t('chat.toolRun.kbSyncing'), tone: 'border-sky-200 bg-sky-50 text-sky-700', icon: 'syncing' };
|
||||
}
|
||||
if (value === 'skipped') {
|
||||
return { label: '知识库未同步', tone: 'border-slate-200 bg-slate-50 text-slate-600', icon: 'skipped' };
|
||||
return { label: t('chat.toolRun.kbNotSynced'), tone: 'border-slate-200 bg-slate-50 text-slate-600', icon: 'skipped' };
|
||||
}
|
||||
return { label: `知识库:${status || '未知'}`, tone: 'border-slate-200 bg-slate-50 text-slate-600', icon: 'skipped' };
|
||||
return {
|
||||
label: t('chat.toolRun.kbUnknown', { status: status || t('chat.toolRun.kbStatusUnknown') }),
|
||||
tone: 'border-slate-200 bg-slate-50 text-slate-600',
|
||||
icon: 'skipped',
|
||||
};
|
||||
};
|
||||
|
||||
const parseDownloadFilename = (disposition: string | null, fallback: string) => {
|
||||
@@ -99,7 +122,7 @@ const downloadExcel = async () => {
|
||||
const res = await fetch(url, { headers: getAuthHeaders() });
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => ({}));
|
||||
throw new Error(stringifyDownloadError(body, `下载失败:${res.status}`));
|
||||
throw new Error(stringifyDownloadError(body, t('chat.toolRun.downloadFailedStatus', { status: res.status })));
|
||||
}
|
||||
const blob = await res.blob();
|
||||
const filename = parseDownloadFilename(
|
||||
@@ -115,7 +138,7 @@ const downloadExcel = async () => {
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
} catch (e: any) {
|
||||
downloadError.value = e?.message || '下载 Excel 失败';
|
||||
downloadError.value = e?.message || t('chat.toolRun.downloadFailed');
|
||||
} finally {
|
||||
downloadingExcel.value = false;
|
||||
}
|
||||
@@ -133,20 +156,20 @@ const downloadExcel = async () => {
|
||||
<CheckCircle2 v-else-if="run?.status === 'success'" class="h-4 w-4 text-emerald-600" />
|
||||
<AlertCircle v-else-if="run?.status === 'failed' || run?.status === 'partial_failed'" class="h-4 w-4 text-amber-600" />
|
||||
<Clock3 v-else class="h-4 w-4 text-sky-600" />
|
||||
{{ run?.title || fallbackTitle || '任务进度' }}
|
||||
{{ run?.title || fallbackTitle || $t('chat.toolRun.fallbackTitle') }}
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-slate-500">
|
||||
<template v-if="run">
|
||||
批次:{{ run.run_no }} · 状态:{{ statusLabel(run.status) }}
|
||||
<span v-if="run.error_message" class="ml-2 text-rose-700">错误信息:{{ run.error_message }}</span>
|
||||
{{ $t('chat.toolRun.batch', { runNo: run.run_no }) }} · {{ $t('chat.toolRun.status', { status: statusLabel(run.status) }) }}
|
||||
<span v-if="run.error_message" class="ml-2 text-rose-700">{{ $t('chat.toolRun.errorMessage', { message: run.error_message }) }}</span>
|
||||
</template>
|
||||
<template v-else-if="loading || waiting">正在等待检核任务启动...</template>
|
||||
<template v-else-if="loading || waiting">{{ $t('chat.toolRun.waitingStart') }}</template>
|
||||
<template v-else-if="error">{{ error }}</template>
|
||||
</p>
|
||||
<p v-if="run?.status === 'running' && run.current_step" class="mt-1 text-xs text-sky-700">
|
||||
当前阶段:{{ run.current_step.label || run.current_step.step }}
|
||||
<span v-if="run.current_step.row_id"> · 当前记录:{{ run.current_step.row_id }}</span>
|
||||
<span v-if="run.current_step.started_at"> · 阶段开始:{{ formatTime(run.current_step.started_at) }}</span>
|
||||
{{ $t('chat.toolRun.currentStep', { step: run.current_step.label || run.current_step.step }) }}
|
||||
<span v-if="run.current_step.row_id"> · {{ $t('chat.toolRun.currentRow', { rowId: run.current_step.row_id }) }}</span>
|
||||
<span v-if="run.current_step.started_at"> · {{ $t('chat.toolRun.stepStarted', { time: formatTime(run.current_step.started_at) }) }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 flex-wrap items-center justify-end gap-2">
|
||||
@@ -171,7 +194,7 @@ const downloadExcel = async () => {
|
||||
>
|
||||
<Loader2 v-if="downloadingExcel" class="h-3.5 w-3.5 animate-spin" />
|
||||
<Download v-else class="h-3.5 w-3.5" />
|
||||
{{ downloadingExcel ? '下载中...' : '下载 Excel' }}
|
||||
{{ downloadingExcel ? $t('chat.toolRun.downloading') : $t('chat.toolRun.downloadExcel') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -188,47 +211,47 @@ const downloadExcel = async () => {
|
||||
></div>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 text-xs text-slate-500">
|
||||
<span>进度 {{ percent() }}%</span>
|
||||
<span>开始:{{ formatTime(run.started_at) }} · 完成:{{ formatTime(run.finished_at) }}</span>
|
||||
<span>{{ $t('chat.toolRun.progress', { percent: percent() }) }}</span>
|
||||
<span>{{ $t('chat.toolRun.startedAt', { time: formatTime(run.started_at) }) }} · {{ $t('chat.toolRun.finishedAt', { time: formatTime(run.finished_at) }) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-1.5 sm:grid-cols-4 lg:grid-cols-8">
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">总数</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.total') }}</div>
|
||||
<div class="text-base font-bold text-slate-800">{{ run.total_count }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">已处理</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.processed') }}</div>
|
||||
<div class="text-base font-bold text-sky-700">{{ run.processed_count }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">成功</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.success') }}</div>
|
||||
<div class="text-base font-bold text-emerald-700">{{ run.success_count }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">失败</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.failed') }}</div>
|
||||
<div class="text-base font-bold text-rose-700">{{ run.failed_count }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">跳过</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.skipped') }}</div>
|
||||
<div class="text-base font-bold text-amber-700">{{ run.skipped_count }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">合格笔数</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.qualified') }}</div>
|
||||
<div class="text-base font-bold text-emerald-700">{{ run.judgement?.qualified_count ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">不合格笔数</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.unqualified') }}</div>
|
||||
<div class="text-base font-bold text-rose-700">{{ run.judgement?.unqualified_count ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white/80 px-2 py-1.5">
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">人工判定笔数</div>
|
||||
<div class="whitespace-nowrap text-xs text-slate-500">{{ $t('chat.toolRun.manual') }}</div>
|
||||
<div class="text-base font-bold text-amber-700">{{ run.judgement?.manual_count ?? 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="run.knowledge_base?.error_message" class="rounded-xl bg-amber-50 px-3 py-2 text-xs text-amber-700">
|
||||
知识库同步错误:{{ run.knowledge_base.error_message }}
|
||||
{{ $t('chat.toolRun.kbSyncError', { message: run.knowledge_base.error_message }) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -236,7 +259,7 @@ const downloadExcel = async () => {
|
||||
<div class="h-2.5 overflow-hidden rounded-full bg-slate-200">
|
||||
<div class="h-full w-1/3 animate-pulse rounded-full bg-gradient-to-r from-sky-400 to-emerald-400" />
|
||||
</div>
|
||||
<p class="text-xs text-slate-500">检核启动后,这里会显示实时进度。</p>
|
||||
<p class="text-xs text-slate-500">{{ $t('chat.toolRun.waitingHint') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Check, Copy, Download, Edit2, Eye, LayoutGrid, MessageSquareText, RotateCw, X } from 'lucide-vue-next';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import LeaveMessageBlock, { type LeaveMessageHandlers } from './LeaveMessageBlock.vue';
|
||||
@@ -85,6 +86,7 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const authStore = useAuthStore();
|
||||
const { t } = useI18n();
|
||||
const INLINE_DOWNLOAD_ALLOWED_EMPLOYEE_ID = '17070141';
|
||||
const RESTRICTED_INLINE_DOWNLOAD_FILE_NAME = '资产明细全量导出表.csv';
|
||||
|
||||
@@ -149,56 +151,57 @@ interface InlineFileEntry {
|
||||
table: InlinePreviewTable;
|
||||
}
|
||||
|
||||
const FIXED_ASSET_HEADER_LABELS: Record<string, string> = {
|
||||
id: '序号',
|
||||
asset_id: '资产编号',
|
||||
asset_no: '资产编号',
|
||||
asset_name: '资产名称',
|
||||
currency_amount: '本币金额(元)',
|
||||
specification: '规格型号',
|
||||
account_period: '账套',
|
||||
operating_center_code: '账套',
|
||||
custodian_person: '保管人',
|
||||
custodian_name: '保管人',
|
||||
custodian_dept: '保管部门',
|
||||
department_name: '保管部门',
|
||||
image: '图片',
|
||||
picture: '图片',
|
||||
storage_location: '存放位置名称',
|
||||
location_name: '存放位置名称',
|
||||
asset_status: '资产状态',
|
||||
reserved_field: '预留残值',
|
||||
residual_value: '预留残值',
|
||||
supplier: '供应商',
|
||||
vendor_name: '供应商',
|
||||
asset_nature: '资产性质',
|
||||
nature: '资产性质',
|
||||
amount_local: '本币金额(元)',
|
||||
unit_price: '本币金额(元)',
|
||||
quantity: '数量',
|
||||
unit: '计量单位',
|
||||
unit_of_measurement: '计量单位',
|
||||
acquisition_date: '取得时间',
|
||||
acquired_date: '取得时间',
|
||||
accounting_date: '入账日期',
|
||||
recorded_date: '入账日期',
|
||||
created_at: '创建时间',
|
||||
created_time: '创建时间',
|
||||
updated_at: '更新时间',
|
||||
snapshot_time: '快照时间',
|
||||
/** 英文字段名 → chat.assetColumns.* key(展示用;匹配仍用 aliases 中的中英文别名) */
|
||||
const FIXED_ASSET_HEADER_KEYS: Record<string, string> = {
|
||||
id: 'chat.assetColumns.id',
|
||||
asset_id: 'chat.assetColumns.assetId',
|
||||
asset_no: 'chat.assetColumns.assetId',
|
||||
asset_name: 'chat.assetColumns.assetName',
|
||||
currency_amount: 'chat.assetColumns.currencyAmount',
|
||||
specification: 'chat.assetColumns.specification',
|
||||
account_period: 'chat.assetColumns.accountPeriod',
|
||||
operating_center_code: 'chat.assetColumns.accountPeriod',
|
||||
custodian_person: 'chat.assetColumns.custodianPerson',
|
||||
custodian_name: 'chat.assetColumns.custodianPerson',
|
||||
custodian_dept: 'chat.assetColumns.custodianDept',
|
||||
department_name: 'chat.assetColumns.custodianDept',
|
||||
image: 'chat.assetColumns.image',
|
||||
picture: 'chat.assetColumns.image',
|
||||
storage_location: 'chat.assetColumns.storageLocation',
|
||||
location_name: 'chat.assetColumns.storageLocation',
|
||||
asset_status: 'chat.assetColumns.assetStatus',
|
||||
reserved_field: 'chat.assetColumns.residualValue',
|
||||
residual_value: 'chat.assetColumns.residualValue',
|
||||
supplier: 'chat.assetColumns.supplier',
|
||||
vendor_name: 'chat.assetColumns.supplier',
|
||||
asset_nature: 'chat.assetColumns.assetNature',
|
||||
nature: 'chat.assetColumns.assetNature',
|
||||
amount_local: 'chat.assetColumns.currencyAmount',
|
||||
unit_price: 'chat.assetColumns.currencyAmount',
|
||||
quantity: 'chat.assetColumns.quantity',
|
||||
unit: 'chat.assetColumns.unit',
|
||||
unit_of_measurement: 'chat.assetColumns.unit',
|
||||
acquisition_date: 'chat.assetColumns.acquisitionDate',
|
||||
acquired_date: 'chat.assetColumns.acquisitionDate',
|
||||
accounting_date: 'chat.assetColumns.accountingDate',
|
||||
recorded_date: 'chat.assetColumns.accountingDate',
|
||||
created_at: 'chat.assetColumns.createdAt',
|
||||
created_time: 'chat.assetColumns.createdAt',
|
||||
updated_at: 'chat.assetColumns.updatedAt',
|
||||
snapshot_time: 'chat.assetColumns.snapshotTime',
|
||||
};
|
||||
const FIXED_ASSET_CANONICAL_COLUMNS = [
|
||||
{ key: 'id', label: '序号', aliases: ['id', '序号'] },
|
||||
{ key: 'asset_id', label: '资产编号', aliases: ['asset_id', 'asset_no', '资产编号'] },
|
||||
{ key: 'asset_name', label: '资产名称', aliases: ['asset_name', '资产名称'] },
|
||||
{ key: 'custodian_person', label: '保管人', aliases: ['custodian_person', 'custodian_name', '保管人', '保管人姓名'] },
|
||||
{ key: 'custodian_dept', label: '保管部门', aliases: ['custodian_dept', 'department_name', '保管部门', '保管部门名称'] },
|
||||
{ key: 'image', label: '图片', aliases: ['image', 'picture', '图片'] },
|
||||
{ key: 'account_period', label: '账套', aliases: ['account_period', 'operating_center_code', '账套'] },
|
||||
{ key: 'supplier', label: '供应商', aliases: ['supplier', 'vendor_name', '供应商', '供应厂商'] },
|
||||
{ key: 'asset_status', label: '资产状态', aliases: ['asset_status', '资产状态'] },
|
||||
{ key: 'quantity', label: '数量', aliases: ['quantity', '数量'] },
|
||||
{ key: 'acquisition_date', label: '取得时间', aliases: ['acquisition_date', 'acquired_date', '取得时间', '取得日期'] },
|
||||
{ key: 'id', labelKey: 'chat.assetColumns.id', aliases: ['id', '序号'] },
|
||||
{ key: 'asset_id', labelKey: 'chat.assetColumns.assetId', aliases: ['asset_id', 'asset_no', '资产编号'] },
|
||||
{ key: 'asset_name', labelKey: 'chat.assetColumns.assetName', aliases: ['asset_name', '资产名称'] },
|
||||
{ key: 'custodian_person', labelKey: 'chat.assetColumns.custodianPerson', aliases: ['custodian_person', 'custodian_name', '保管人', '保管人姓名'] },
|
||||
{ key: 'custodian_dept', labelKey: 'chat.assetColumns.custodianDept', aliases: ['custodian_dept', 'department_name', '保管部门', '保管部门名称'] },
|
||||
{ key: 'image', labelKey: 'chat.assetColumns.image', aliases: ['image', 'picture', '图片'] },
|
||||
{ key: 'account_period', labelKey: 'chat.assetColumns.accountPeriod', aliases: ['account_period', 'operating_center_code', '账套'] },
|
||||
{ key: 'supplier', labelKey: 'chat.assetColumns.supplier', aliases: ['supplier', 'vendor_name', '供应商', '供应厂商'] },
|
||||
{ key: 'asset_status', labelKey: 'chat.assetColumns.assetStatus', aliases: ['asset_status', '资产状态'] },
|
||||
{ key: 'quantity', labelKey: 'chat.assetColumns.quantity', aliases: ['quantity', '数量'] },
|
||||
{ key: 'acquisition_date', labelKey: 'chat.assetColumns.acquisitionDate', aliases: ['acquisition_date', 'acquired_date', '取得时间', '取得日期'] },
|
||||
] as const;
|
||||
const INLINE_DIALOG_PAGE_SIZE = 15;
|
||||
|
||||
@@ -238,14 +241,15 @@ function parseCsvLine(line: string): string[] {
|
||||
}
|
||||
|
||||
/**
|
||||
* 将固定资产 CSV 的英文列名转换成面向业务展示的中文列名。
|
||||
* 将固定资产 CSV 的英文列名转换成面向业务展示的本地化列名。
|
||||
* 核心逻辑:优先命中已知字段映射;未知字段保留原值,避免误伤其他 Agent 的文件。
|
||||
* @param header - CSV 原始表头。
|
||||
* @returns 中文表头或原始表头。
|
||||
* @returns 本地化表头或原始表头。
|
||||
*/
|
||||
function localizeInlineTableHeader(header: string): string {
|
||||
const normalizedHeader = String(header || '').trim().toLowerCase();
|
||||
return FIXED_ASSET_HEADER_LABELS[normalizedHeader] || header || '-';
|
||||
const key = FIXED_ASSET_HEADER_KEYS[normalizedHeader];
|
||||
return key ? t(key) : (header || '-');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,14 +272,14 @@ function formatInlineDateOnly(value: string): string {
|
||||
|
||||
/**
|
||||
* 统一表格中的空值展示。
|
||||
* 核心逻辑:对空串、短横线、null/none 等占位值统一显示“无”,但保留数字 0 与正常文本。
|
||||
* 核心逻辑:对空串、短横线、null/none 等占位值统一显示本地化“无”,但保留数字 0 与正常文本。
|
||||
* @param value - 原始单元格值。
|
||||
* @returns 归一化后的展示值。
|
||||
*/
|
||||
function normalizeInlineTableCell(value: string): string {
|
||||
const normalized = String(value ?? '').trim();
|
||||
if (!normalized) return '无';
|
||||
if (['-', '--', 'null', 'none', 'n/a', 'na'].includes(normalized.toLowerCase())) return '无';
|
||||
if (!normalized) return t('chat.assetColumns.empty');
|
||||
if (['-', '--', 'null', 'none', 'n/a', 'na'].includes(normalized.toLowerCase())) return t('chat.assetColumns.empty');
|
||||
return normalized;
|
||||
}
|
||||
|
||||
@@ -338,7 +342,7 @@ function serializeCsvRows(rows: string[][]): string {
|
||||
* @returns 规范化后的表头与数据行。
|
||||
*/
|
||||
function buildFixedAssetInlineTable(rawHeaders: string[], dataRows: string[][]): InlinePreviewTable {
|
||||
const headers = FIXED_ASSET_CANONICAL_COLUMNS.map((column) => column.label);
|
||||
const headers = FIXED_ASSET_CANONICAL_COLUMNS.map((column) => t(column.labelKey));
|
||||
const canonicalHeaders = FIXED_ASSET_CANONICAL_COLUMNS.map((column) => column.key);
|
||||
const allRows = dataRows.map((row, rowIndex) => FIXED_ASSET_CANONICAL_COLUMNS.map((column) => {
|
||||
if (column.key === 'id') return String(rowIndex + 1);
|
||||
@@ -352,7 +356,7 @@ function buildFixedAssetInlineTable(rawHeaders: string[], dataRows: string[][]):
|
||||
if (normalizedImageValue) {
|
||||
return normalizeInlineTableCell(normalizedImageValue);
|
||||
}
|
||||
return normalizedAssetId ? '查看' : '无';
|
||||
return normalizedAssetId ? t('chat.assetColumns.view') : t('chat.assetColumns.empty');
|
||||
}
|
||||
const columnIndex = findInlineTableHeaderIndex(rawHeaders, [...column.aliases]);
|
||||
const rawValue = columnIndex >= 0 ? row[columnIndex] ?? '' : '';
|
||||
@@ -573,7 +577,10 @@ function canOpenInlineAssetHistory(cellIndex: number, cellValue: string): boolea
|
||||
}
|
||||
|
||||
function isInlineHighlightHeader(header: string): boolean {
|
||||
return header === '资产编号' || header === '图片';
|
||||
return header === t('chat.assetColumns.assetId')
|
||||
|| header === t('chat.assetColumns.image')
|
||||
|| header === '资产编号'
|
||||
|| header === '图片';
|
||||
}
|
||||
|
||||
async function openInlineAssetHistory(row: string[], cellIndex: number): Promise<void> {
|
||||
@@ -911,7 +918,7 @@ function handleInlineDownload(file: InlineDownloadFile): void {
|
||||
<Download class="h-3.5 w-3.5" />
|
||||
{{ $t('chat.inlineFile.download') }}
|
||||
</button>
|
||||
<button type="button" class="btn-icon-ds" aria-label="关闭" @click="closeInlinePreviewDialog">
|
||||
<button type="button" class="btn-icon-ds" :aria-label="$t('common.close')" @click="closeInlinePreviewDialog">
|
||||
<X class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -79,7 +79,7 @@ const { message, index, handlers } = defineProps<{
|
||||
@change="handlers.syncLeaveDuration(handlers.getLeaveFormPayload(message)!.form)"
|
||||
>
|
||||
<option value="" disabled>{{ $t('chat.selectLeaveType') }}</option>
|
||||
<option v-for="leaveType in LEAVE_TYPES" :key="leaveType.value" :value="leaveType.value">{{ leaveType.label }}</option>
|
||||
<option v-for="leaveType in LEAVE_TYPES" :key="leaveType.value" :value="leaveType.value">{{ $t(leaveType.labelKey) }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
|
||||
@@ -60,20 +60,20 @@ const emit = defineEmits<{
|
||||
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<div class="text-[11px] font-bold uppercase tracking-[0.15em] text-brand-600/80">
|
||||
第三步:逐题考试
|
||||
{{ $t('chat.training.stepExamTitle') }}
|
||||
</div>
|
||||
<h3 class="mt-1 text-lg font-bold text-slate-800">
|
||||
第 {{ currentQuestionIndex + 1 }} / {{ totalCount }} 题
|
||||
{{ $t('chat.training.exam.questionCounter', { current: currentQuestionIndex + 1, total: totalCount }) }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 text-[13px]">
|
||||
<div class="rounded-lg bg-slate-50 px-3 py-1.5 font-medium text-slate-600 border border-slate-100 flex items-center gap-2">
|
||||
<span>当前分数:</span>
|
||||
<span class="text-slate-800 font-bold">{{ score }} 分</span>
|
||||
<span>{{ $t('chat.training.currentScoreLabel') }}</span>
|
||||
<span class="text-slate-800 font-bold">{{ $t('chat.training.scoreShort', { score }) }}</span>
|
||||
</div>
|
||||
<div class="rounded-lg bg-slate-50 px-3 py-1.5 font-medium text-slate-600 border border-slate-100 flex items-center gap-2">
|
||||
<span>及格线:</span>
|
||||
<span class="text-slate-800 font-bold">{{ passScore }} 分</span>
|
||||
<span>{{ $t('chat.training.passLineLabel') }}</span>
|
||||
<span class="text-slate-800 font-bold">{{ $t('chat.training.passScoreShort', { passScore }) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -158,16 +158,16 @@ const emit = defineEmits<{
|
||||
<div class="flex items-center gap-2 text-sm font-bold" :class="feedbackCorrect ? 'text-emerald-700' : 'text-red-700'">
|
||||
<CheckCircle2 v-if="feedbackCorrect" class="h-4 w-4" />
|
||||
<XCircle v-else class="h-4 w-4" />
|
||||
{{ feedbackCorrect ? '回答正确,继续下一题' : '回答错误' }}
|
||||
{{ feedbackCorrect ? $t('chat.training.exam.correctFeedback') : $t('chat.training.wrongFeedbackShort') }}
|
||||
</div>
|
||||
|
||||
<div class="mt-3 space-y-2 text-[13px] leading-6 text-slate-600">
|
||||
<div class="flex gap-2">
|
||||
<span class="font-medium text-slate-500 shrink-0">你的答案:</span>
|
||||
<span class="font-medium text-slate-500 shrink-0">{{ $t('chat.training.yourAnswerLabel') }}</span>
|
||||
<span class="font-medium" :class="feedbackCorrect ? 'text-emerald-600' : 'text-red-600'">{{ answerLabel || '--' }}</span>
|
||||
</div>
|
||||
<div v-if="!feedbackCorrect" class="flex gap-2">
|
||||
<span class="font-medium text-slate-500 shrink-0">正确答案:</span>
|
||||
<span class="font-medium text-slate-500 shrink-0">{{ $t('chat.training.correctAnswerLabel') }}</span>
|
||||
<span class="text-emerald-600 font-medium">{{ question.options?.find(o => o.id === question.answer)?.label || '--' }}</span>
|
||||
</div>
|
||||
<div class="mt-2 pl-2 border-l-2 border-slate-200/60 text-slate-500/90">
|
||||
@@ -183,7 +183,7 @@ const emit = defineEmits<{
|
||||
@click="emit('next')"
|
||||
>
|
||||
<ClipboardCheck class="h-4 w-4" />
|
||||
{{ answeredCount >= totalCount - 1 ? '完成考试并查看结果' : '下一题' }}
|
||||
{{ answeredCount >= totalCount - 1 ? $t('chat.training.finishAndViewResult') : $t('chat.training.exam.nextQuestion') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,10 +33,10 @@ const emit = defineEmits<{
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-[11px] font-bold uppercase tracking-[0.15em] text-slate-500">
|
||||
第四步:结算结果
|
||||
{{ $t('chat.training.stepResultTitle') }}
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-slate-800">
|
||||
{{ isPassed ? '恭喜,你已通过考核!' : '很遗憾,考试未通过' }}
|
||||
{{ isPassed ? $t('chat.training.passTitleShort') : $t('chat.training.failTitleShort') }}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,7 +59,7 @@ const emit = defineEmits<{
|
||||
<div class="mt-1 text-2xl font-black text-emerald-600">{{ correctCount }}</div>
|
||||
</div>
|
||||
<div class="rounded-2xl bg-red-50/50 p-4 border border-red-100/50 text-center">
|
||||
<div class="text-[11px] font-bold text-red-400 uppercase">答错</div>
|
||||
<div class="text-[11px] font-bold text-red-400 uppercase">{{ $t('chat.training.wrongCountShort') }}</div>
|
||||
<div class="mt-1 text-2xl font-black text-red-500">{{ wrongCount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,12 +78,12 @@ const emit = defineEmits<{
|
||||
@click="emit('restart')"
|
||||
>
|
||||
<RotateCcw class="h-4 w-4" />
|
||||
重新考试
|
||||
{{ $t('chat.training.result.retryExam') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-else class="flex items-center gap-2 text-emerald-600 font-medium text-sm">
|
||||
<CheckCircle2 class="h-4 w-4" />
|
||||
成绩已同步至 HR 管理系统
|
||||
{{ $t('chat.training.syncedToHr') }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -30,7 +30,7 @@ const emit = defineEmits<{
|
||||
<div class="h-12 w-12 flex items-center justify-center rounded-full bg-white/20 backdrop-blur-md border border-white/30 group-hover:bg-brand-600 group-hover:border-brand-500 transition-all duration-300">
|
||||
<PlayCircle class="h-6 w-6 text-white fill-white/20" />
|
||||
</div>
|
||||
<span class="text-white text-xs font-medium drop-shadow-md">点击播放视频</span>
|
||||
<span class="text-white text-xs font-medium drop-shadow-md">{{ $t('chat.training.clickPlayVideo') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -377,7 +377,10 @@ export function useChat() {
|
||||
* 说明:
|
||||
* - Dify Chatflow 失败时常以 `workflow_finished + data.status=failed` 返回,HTTP 仍是 200;
|
||||
* - 若这里只按“终态成功”处理,页面会出现“没有任何响应”;
|
||||
* - 因此需要优先从 top-level / nested data / error 对象里抽取失败文案。
|
||||
* - 因此需要优先从 top-level / nested data / error 对象里抽取失败文案;
|
||||
* - 上下文过长与缺省失败文案走 chat.streamError.contextTooLong / workflowFailed。
|
||||
* @param data - SSE 事件 JSON
|
||||
* @returns 用户可读错误;非失败终态返回空串
|
||||
*/
|
||||
const extractWorkflowFailureMessage = (data: Record<string, unknown>) => {
|
||||
if (String(data.event || '') !== 'workflow_finished') return '';
|
||||
@@ -399,11 +402,11 @@ export function useChat() {
|
||||
const normalized = formatStreamError(candidate).trim();
|
||||
if (!normalized || normalized === 'Unknown error') continue;
|
||||
if (/maximum context length|input_tokens/i.test(normalized)) {
|
||||
return '当前会话上下文过长,模型无法继续回答。请新建对话后重新查询该资产编号。';
|
||||
return t('chat.streamError.contextTooLong');
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
return '工作流执行失败,请稍后重试';
|
||||
return t('chat.streamError.workflowFailed');
|
||||
};
|
||||
|
||||
const streamErrorLabels = (): StreamErrorLabels => ({
|
||||
|
||||
@@ -24,9 +24,6 @@ export type AgentSuggestedQuestionItem = {
|
||||
const DEFAULT_KB = '企业知识库';
|
||||
const ERP_KB = 'ERP知识库';
|
||||
|
||||
const TRAINING_AGENT_DESCRIPTION =
|
||||
'我是你的新人培训助手,会在同一个聊天页面内带你完成视频学习、知识点复盘、逐题考试和结果复盘。';
|
||||
|
||||
const normalizeAgentSuggestedQuestions = (value: unknown): AgentSuggestedQuestionItem[] => {
|
||||
if (!Array.isArray(value)) return [];
|
||||
return value
|
||||
@@ -114,7 +111,7 @@ export function useChatAgent(options: UseChatAgentOptions) {
|
||||
const welcome = String(currentAgent.value?.welcome_message || '').trim();
|
||||
if (welcome) return welcome;
|
||||
const text = String(currentAgent.value?.description || '').trim();
|
||||
if (!text && matchesTrainingAgent(currentAgent.value)) return TRAINING_AGENT_DESCRIPTION;
|
||||
if (!text && matchesTrainingAgent(currentAgent.value)) return t('chat.training.agentDescription');
|
||||
return text;
|
||||
});
|
||||
|
||||
@@ -148,7 +145,7 @@ export function useChatAgent(options: UseChatAgentOptions) {
|
||||
const styledSuggestedQuestionSections = computed(() => {
|
||||
const groups = new Map<string, AgentSuggestedQuestionItem[]>();
|
||||
for (const item of agentSuggestedQuestions.value) {
|
||||
const groupName = String(item.group || '').trim() || '常见问题';
|
||||
const groupName = String(item.group || '').trim() || t('chat.faqGroup');
|
||||
if (!groups.has(groupName)) {
|
||||
groups.set(groupName, []);
|
||||
}
|
||||
|
||||
@@ -1,40 +1,42 @@
|
||||
/**
|
||||
* features/chat/composables/useChatAssetHistory.ts
|
||||
* 用途:管理固定资产履历检索、友好提示与文件预览跳转。
|
||||
* 依赖:chat.api、useChatSourceFiles 暴露的 openPreview、聊天提示消息。
|
||||
* 依赖:chat.api、vue-i18n、useChatSourceFiles 暴露的 openPreview、聊天提示消息。
|
||||
* 逻辑:页面层统一持有“打开履历”动作,消息气泡/查询预览弹窗复用该入口;
|
||||
* 点击资产编号后先进入“检索中”状态,命中履历文件则直接打开最佳候选预览,未命中时仅提示用户。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import type { ComputedRef } from 'vue';
|
||||
import type { ComposerTranslation } from 'vue-i18n';
|
||||
import { searchAssetHistoryFiles } from '../api/chat.api';
|
||||
import type { AssetHistoryFileItem, SourceFileLink } from '../types/chat.types';
|
||||
import type { ComputedRef } from 'vue';
|
||||
|
||||
interface UseChatAssetHistoryOptions {
|
||||
agentId: ComputedRef<number>;
|
||||
openPreview: (file: SourceFileLink) => Promise<void>;
|
||||
warn: (message: string) => void;
|
||||
t: ComposerTranslation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把后端返回的技术性错误翻译成用户可理解的提示。
|
||||
* AI 触发时机:当资产履历查询失败,但原始错误包含英文配置名、共享盘术语等技术细节时调用。
|
||||
* 核心逻辑:优先识别已知的履历共享盘配置异常,返回面向业务用户的中文说明;其他错误保持原文,避免吞掉真实上下文。
|
||||
* 核心逻辑:优先识别已知的履历共享盘配置异常,返回面向业务用户的本地化说明;其他错误保持原文。
|
||||
* 参数约束:仅处理展示文案,不改变错误对象本身;返回值必须适合作为 toast/警告弹窗直接展示。
|
||||
*/
|
||||
function normalizeAssetHistoryErrorMessage(message: string): string {
|
||||
function normalizeAssetHistoryErrorMessage(message: string, t: ComposerTranslation): string {
|
||||
const normalizedMessage = String(message || '').trim();
|
||||
const lowerCaseMessage = normalizedMessage.toLowerCase();
|
||||
if (lowerCaseMessage.includes('asset history share is not configured')) {
|
||||
return '当前系统暂未配置资产履历文件目录,暂时无法查看履历,请联系管理员处理。';
|
||||
return String(t('chat.assetHistory.shareNotConfigured'));
|
||||
}
|
||||
if (lowerCaseMessage.includes('asset history share is unreachable')) {
|
||||
return '当前环境暂时无法访问资产履历共享盘,请联系管理员检查测试环境共享盘挂载或访问权限。';
|
||||
return String(t('chat.assetHistory.shareUnreachable'));
|
||||
}
|
||||
if (lowerCaseMessage.includes('asset history share is invalid')) {
|
||||
return '当前环境的资产履历目录配置无效,请联系管理员检查共享盘目录配置。';
|
||||
return String(t('chat.assetHistory.shareInvalid'));
|
||||
}
|
||||
return normalizedMessage || '检索资产履历失败';
|
||||
return normalizedMessage || String(t('chat.assetHistory.searchFailed'));
|
||||
}
|
||||
|
||||
export function useChatAssetHistory(options: UseChatAssetHistoryOptions) {
|
||||
@@ -44,6 +46,7 @@ export function useChatAssetHistory(options: UseChatAssetHistoryOptions) {
|
||||
const assetId = ref('');
|
||||
const assetName = ref('');
|
||||
const items = ref<AssetHistoryFileItem[]>([]);
|
||||
const { t } = options;
|
||||
|
||||
const close = () => {
|
||||
open.value = false;
|
||||
@@ -66,7 +69,7 @@ export function useChatAssetHistory(options: UseChatAssetHistoryOptions) {
|
||||
return;
|
||||
}
|
||||
if (!normalizedAssetId && !normalizedAssetName) {
|
||||
options.warn('当前资产缺少可用于检索履历的编号或名称');
|
||||
options.warn(String(t('chat.assetHistory.missingIdentifier')));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,15 +88,15 @@ export function useChatAssetHistory(options: UseChatAssetHistoryOptions) {
|
||||
const bestMatch = items.value[0];
|
||||
if (!bestMatch) {
|
||||
const displayName = normalizedAssetId || normalizedAssetName;
|
||||
options.warn(`未找到资产 ${displayName} 的履历文件,如确认应有履历,请联系管理员补充。`);
|
||||
options.warn(String(t('chat.assetHistory.notFound', { name: displayName })));
|
||||
return;
|
||||
}
|
||||
await openHistoryFilePreview(bestMatch);
|
||||
} catch (err: unknown) {
|
||||
const rawMessage = err instanceof Error ? err.message : '检索资产履历失败';
|
||||
const message = normalizeAssetHistoryErrorMessage(rawMessage);
|
||||
const rawMessage = err instanceof Error ? err.message : String(t('chat.assetHistory.searchFailed'));
|
||||
const message = normalizeAssetHistoryErrorMessage(rawMessage, t);
|
||||
error.value = message;
|
||||
options.warn(`履历查询失败:${message}`);
|
||||
options.warn(String(t('chat.assetHistory.queryFailed', { message })));
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/**
|
||||
* features/chat/composables/useChatAssetImage.ts
|
||||
* 用途:管理固定资产图片检索、友好提示与预览跳转。
|
||||
* 依赖:chat.api、useChatSourceFiles 暴露的 openPreview、聊天提示消息。
|
||||
* 依赖:chat.api、vue-i18n、useChatSourceFiles 暴露的 openPreview、聊天提示消息。
|
||||
* 逻辑:用户点击“图片 -> 查看”后,本 composable 统一向后端索要最佳图片,再复用现有文件预览弹窗在站内展示。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import type { ComputedRef } from 'vue';
|
||||
import type { ComposerTranslation } from 'vue-i18n';
|
||||
import { resolveAssetImagePreview } from '../api/chat.api';
|
||||
import type { SourceFileLink } from '../types/chat.types';
|
||||
|
||||
@@ -13,37 +14,39 @@ interface UseChatAssetImageOptions {
|
||||
agentId: ComputedRef<number>;
|
||||
openPreviewGallery: (files: SourceFileLink[], initialIndex?: number) => Promise<void>;
|
||||
warn: (message: string) => void;
|
||||
t: ComposerTranslation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把后端返回的图片检索错误翻译成业务用户能看懂的提示。
|
||||
* AI 触发时机:当用户点击“图片 -> 查看”失败,但原始报错包含接口路径、外部系统术语等技术细节时调用。
|
||||
* 核心逻辑:优先识别已知的配置/检索异常并转成中文说明;未知错误保留原始文本,方便排查。
|
||||
* 核心逻辑:优先识别已知的配置/检索异常并转成本地化说明;未知错误保留原始文本,方便排查。
|
||||
* 参数与输出约束:只负责展示文案,不吞掉真实错误对象;返回值必须适合作为 toast 直接展示。
|
||||
*/
|
||||
function normalizeAssetImageErrorMessage(message: string): string {
|
||||
function normalizeAssetImageErrorMessage(message: string, t: ComposerTranslation): string {
|
||||
const normalizedMessage = String(message || '').trim();
|
||||
const lowerCaseMessage = normalizedMessage.toLowerCase();
|
||||
if (lowerCaseMessage.includes('固定资产图片文档库未配置')) {
|
||||
return '当前系统暂未配置固定资产图片文档库,暂时无法查看图片,请联系管理员处理。';
|
||||
return String(t('chat.assetImage.libraryNotConfigured'));
|
||||
}
|
||||
if (lowerCaseMessage.includes('请求的资源不存在')) {
|
||||
return '设备管理员还未上传照片~';
|
||||
return String(t('chat.assetImage.noPhotoUploaded'));
|
||||
}
|
||||
if (lowerCaseMessage.includes('未找到资产')) {
|
||||
return normalizedMessage;
|
||||
}
|
||||
return normalizedMessage || '检索固定资产图片失败';
|
||||
return normalizedMessage || String(t('chat.assetImage.searchFailed'));
|
||||
}
|
||||
|
||||
|
||||
export function useChatAssetImage(options: UseChatAssetImageOptions) {
|
||||
const loading = ref(false);
|
||||
const { t } = options;
|
||||
|
||||
/**
|
||||
* 检索固定资产图片并直接打开预览。
|
||||
* AI 触发时机:当用户点击聊天表格或 CSV 预览里的“图片 -> 查看”时调用。
|
||||
* 核心逻辑:先向后端请求全部命中的图片文件,再把图片组交给通用 FilePreviewModal 预览。
|
||||
* 核心逻辑:先向后端请求全部命中的图片文件,再把图片组交给通用 FilePreviewModal 预览。
|
||||
* 参数约束:至少要提供资产编号或资产名称之一;后端负责登录外部文档库和挑选最佳图片。
|
||||
*/
|
||||
const openImage = async (nextAssetId: string, nextAssetName = '') => {
|
||||
@@ -51,7 +54,7 @@ export function useChatAssetImage(options: UseChatAssetImageOptions) {
|
||||
const normalizedAssetName = String(nextAssetName || '').trim();
|
||||
if (loading.value) return;
|
||||
if (!normalizedAssetId && !normalizedAssetName) {
|
||||
options.warn('当前资产缺少可用于检索图片的编号或名称');
|
||||
options.warn(String(t('chat.assetImage.missingIdentifier')));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,7 +69,7 @@ export function useChatAssetImage(options: UseChatAssetImageOptions) {
|
||||
: (result?.item ? [result.item] : []);
|
||||
if (!items.length) {
|
||||
const displayName = normalizedAssetId || normalizedAssetName;
|
||||
options.warn(`未找到资产 ${displayName} 的图片文件,请联系管理员补充。`);
|
||||
options.warn(String(t('chat.assetImage.notFound', { name: displayName })));
|
||||
return;
|
||||
}
|
||||
await options.openPreviewGallery(
|
||||
@@ -78,12 +81,12 @@ export function useChatAssetImage(options: UseChatAssetImageOptions) {
|
||||
0,
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
const rawMessage = err instanceof Error ? err.message : '检索固定资产图片失败';
|
||||
const message = normalizeAssetImageErrorMessage(rawMessage);
|
||||
if (message === '设备管理员还未上传照片~') {
|
||||
const rawMessage = err instanceof Error ? err.message : String(t('chat.assetImage.searchFailed'));
|
||||
const message = normalizeAssetImageErrorMessage(rawMessage, t);
|
||||
if (message === String(t('chat.assetImage.noPhotoUploaded'))) {
|
||||
options.warn(message);
|
||||
} else {
|
||||
options.warn(`图片查询失败:${message}`);
|
||||
options.warn(String(t('chat.assetImage.queryFailed', { message })));
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
|
||||
@@ -66,7 +66,7 @@ export interface UseChatAttachmentsOptions {
|
||||
|
||||
export function useChatAttachments(options: UseChatAttachmentsOptions) {
|
||||
const { deps, currentAgentId, currentAgent } = options;
|
||||
const { msg } = deps;
|
||||
const { msg, t } = deps;
|
||||
|
||||
const attachments = ref<PendingAttachment[]>([]);
|
||||
const isUploadingAttachments = ref(false);
|
||||
@@ -267,12 +267,12 @@ export function useChatAttachments(options: UseChatAttachmentsOptions) {
|
||||
const files = Array.from(fileList);
|
||||
for (const f of files) {
|
||||
if (attachmentPolicy.value.totalLimit && attachments.value.length >= attachmentPolicy.value.totalLimit) {
|
||||
msg.warning(`附件数量已达上限(${attachmentPolicy.value.totalLimit})`);
|
||||
msg.warning(t('chat.attachmentsUi.limitReached', { limit: attachmentPolicy.value.totalLimit }));
|
||||
break;
|
||||
}
|
||||
const ext = extractExt(f.name || '');
|
||||
if (attachmentPolicy.value.allowedExts && (!ext || !attachmentPolicy.value.allowedExts.has(ext))) {
|
||||
msg.warning(`不支持的附件类型:${f.name}`);
|
||||
msg.warning(t('chat.attachmentsUi.unsupportedType', { name: f.name }));
|
||||
continue;
|
||||
}
|
||||
let type = inferFileTypeFromFile(f);
|
||||
@@ -280,23 +280,23 @@ export function useChatAttachments(options: UseChatAttachmentsOptions) {
|
||||
if (attachmentPolicy.value.enabled.custom.local && !isKnownDifyExt(ext)) {
|
||||
type = 'custom';
|
||||
} else {
|
||||
msg.warning(`不支持的附件类型:${f.name}`);
|
||||
msg.warning(t('chat.attachmentsUi.unsupportedType', { name: f.name }));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
const caps = attachmentPolicy.value.enabled[type];
|
||||
if (!caps?.local) {
|
||||
msg.warning(`当前应用不支持上传此类型附件:${type}`);
|
||||
msg.warning(t('chat.attachmentsUi.typeNotAllowed', { type }));
|
||||
continue;
|
||||
}
|
||||
const limit = attachmentPolicy.value.sizeLimitMb[type];
|
||||
if (limit && f.size > limit * 1024 * 1024) {
|
||||
msg.warning(`附件过大(上限 ${limit}MB):${f.name}`);
|
||||
msg.warning(t('chat.attachmentsUi.tooLarge', { limit, name: f.name }));
|
||||
continue;
|
||||
}
|
||||
const countSameType = attachments.value.filter((a) => a.type === type).length;
|
||||
if (caps.limit && countSameType >= caps.limit) {
|
||||
msg.warning(`该类型附件数量已达上限(${caps.limit})`);
|
||||
msg.warning(t('chat.attachmentsUi.typeLimitReached', { limit: caps.limit }));
|
||||
continue;
|
||||
}
|
||||
attachments.value.push({ id: `${Date.now()}_${Math.random()}`, kind: 'local', file: f, type });
|
||||
@@ -309,20 +309,20 @@ export function useChatAttachments(options: UseChatAttachmentsOptions) {
|
||||
if (!raw) return;
|
||||
const url = raw.startsWith('//') ? `${window.location.protocol}${raw}` : raw;
|
||||
if (!/^https?:\/\//i.test(url)) {
|
||||
msg.warning('仅支持 http/https URL');
|
||||
msg.warning(t('chat.attachmentsUi.httpOnly'));
|
||||
return;
|
||||
}
|
||||
if (!attachmentPolicy.value.canRemote) {
|
||||
msg.warning('当前应用不支持 URL 附件');
|
||||
msg.warning(t('chat.attachmentsUi.urlNotSupported'));
|
||||
return;
|
||||
}
|
||||
if (attachmentPolicy.value.totalLimit && attachments.value.length >= attachmentPolicy.value.totalLimit) {
|
||||
msg.warning(`附件数量已达上限(${attachmentPolicy.value.totalLimit})`);
|
||||
msg.warning(t('chat.attachmentsUi.limitReached', { limit: attachmentPolicy.value.totalLimit }));
|
||||
return;
|
||||
}
|
||||
const ext = extractExt(url);
|
||||
if (attachmentPolicy.value.allowedExts && (!ext || !attachmentPolicy.value.allowedExts.has(ext))) {
|
||||
msg.warning('不支持的 URL 附件类型');
|
||||
msg.warning(t('chat.attachmentsUi.unsupportedUrlType'));
|
||||
return;
|
||||
}
|
||||
let type = inferFileTypeFromUrl(url);
|
||||
@@ -330,18 +330,18 @@ export function useChatAttachments(options: UseChatAttachmentsOptions) {
|
||||
if (attachmentPolicy.value.enabled.custom.remote && !isKnownDifyExt(ext)) {
|
||||
type = 'custom';
|
||||
} else {
|
||||
msg.warning('不支持的 URL 附件类型');
|
||||
msg.warning(t('chat.attachmentsUi.unsupportedUrlType'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
const caps = attachmentPolicy.value.enabled[type];
|
||||
if (!caps?.remote) {
|
||||
msg.warning(`当前应用不支持该类型 URL 附件:${type}`);
|
||||
msg.warning(t('chat.attachmentsUi.urlTypeNotAllowed', { type }));
|
||||
return;
|
||||
}
|
||||
const countSameType = attachments.value.filter((a) => a.type === type).length;
|
||||
if (caps.limit && countSameType >= caps.limit) {
|
||||
msg.warning(`该类型附件数量已达上限(${caps.limit})`);
|
||||
msg.warning(t('chat.attachmentsUi.typeLimitReached', { limit: caps.limit }));
|
||||
return;
|
||||
}
|
||||
attachments.value.push({ id: `${Date.now()}_${Math.random()}`, kind: 'remote', url, type });
|
||||
|
||||
@@ -120,9 +120,9 @@ export function useChatLeave(options: UseChatLeaveOptions) {
|
||||
canUseLeaveFeature,
|
||||
...oaLogin,
|
||||
...agentPicker,
|
||||
getLeaveTypeLabel,
|
||||
getLeaveTypeLabel: (val: string) => getLeaveTypeLabel(val, t),
|
||||
formatDurationLabel: (hours: number, leaveType?: string) => formatDurationLabel(hours, leaveType, t),
|
||||
formatYesNoLabel,
|
||||
formatYesNoLabel: (value: 0 | 1 | null) => formatYesNoLabel(value, t),
|
||||
syncLeaveDuration,
|
||||
getLeaveFormPayload,
|
||||
getLeaveConfirmationPayload,
|
||||
|
||||
@@ -180,11 +180,13 @@ export function useChatPage() {
|
||||
agentId: currentAgentId,
|
||||
openPreview,
|
||||
warn: (text) => msg.warning(text),
|
||||
t,
|
||||
});
|
||||
const assetImage = useChatAssetImage({
|
||||
agentId: currentAgentId,
|
||||
openPreviewGallery,
|
||||
warn: (text) => msg.warning(text),
|
||||
t,
|
||||
});
|
||||
|
||||
watch(currentAgentId, (id) => {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/**
|
||||
* features/chat/composables/useChatQueryPreview.ts
|
||||
* Text2SQL 查询结果全量预览弹窗:分页加载与消息 payload 解析。
|
||||
* 用途:Text2SQL 查询结果全量预览弹窗:分页加载与消息 payload 解析。
|
||||
* 依赖:vue-i18n、chat.api.getChatQueryPreviewPage、chat.types.ChatMessage。
|
||||
* 逻辑:Chat 消息气泡触发 openDialog;文案走 chat.queryPreview.*。
|
||||
*/
|
||||
import { ref, type ComputedRef } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { getChatQueryPreviewPage } from '../api/chat.api';
|
||||
import type { ChatMessage } from '../types/chat.types';
|
||||
|
||||
@@ -29,8 +32,15 @@ export interface UseChatQueryPreviewOptions {
|
||||
currentAgentId: ComputedRef<number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装查询结果全量预览弹窗状态与分页加载逻辑。
|
||||
* 核心逻辑:从消息 payload 判断可预览;调用 getChatQueryPreviewPage 拉取分页数据。
|
||||
* @param options.currentAgentId - 当前 Agent ID(请求预览接口必填)
|
||||
* @returns 弹窗状态、摘要文案与 open/close/changePage 操作
|
||||
*/
|
||||
export function useChatQueryPreview(options: UseChatQueryPreviewOptions) {
|
||||
const { currentAgentId } = options;
|
||||
const { t } = useI18n();
|
||||
|
||||
const show = ref(false);
|
||||
const loading = ref(false);
|
||||
@@ -46,6 +56,11 @@ export function useChatQueryPreview(options: UseChatQueryPreviewOptions) {
|
||||
total: 0,
|
||||
});
|
||||
|
||||
/**
|
||||
* 从消息中提取 text2sql 预览 payload。
|
||||
* @param msg - 聊天消息
|
||||
* @returns 预览 payload;非目标 kind 时返回 null
|
||||
*/
|
||||
const getPayload = (msg: ChatMessage): QueryPreviewPayload | null => {
|
||||
const payload = msg?.payload;
|
||||
if (!payload || typeof payload !== 'object') return null;
|
||||
@@ -53,29 +68,52 @@ export function useChatQueryPreview(options: UseChatQueryPreviewOptions) {
|
||||
return payload as QueryPreviewPayload;
|
||||
};
|
||||
|
||||
/**
|
||||
* 判断消息是否可打开全量预览。
|
||||
* @param msg - 聊天消息
|
||||
* @returns 是否可预览
|
||||
*/
|
||||
const canOpen = (msg: ChatMessage) => {
|
||||
const payload = getPayload(msg);
|
||||
return !!(payload?.previewable && Number(msg?.chat_log_id) > 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* 生成“查看全部预览”摘要文案(含可选总条数)。
|
||||
* @param msg - 聊天消息
|
||||
* @returns 本地化摘要
|
||||
*/
|
||||
const getSummary = (msg: ChatMessage) => {
|
||||
const payload = getPayload(msg);
|
||||
const total = Number(payload?.total_count || 0);
|
||||
if (total > 0) return `查看全部预览(共 ${total} 条)`;
|
||||
return '查看全部预览';
|
||||
if (total > 0) return t('chat.queryPreview.viewAllWithTotal', { total });
|
||||
return t('chat.queryPreview.viewAll');
|
||||
};
|
||||
|
||||
/**
|
||||
* 按当前 pageSize 计算总页数。
|
||||
* @returns 至少为 1 的页数
|
||||
*/
|
||||
const totalPages = () =>
|
||||
Math.max(1, Math.ceil((state.value.total || 0) / (state.value.pageSize || 100)));
|
||||
|
||||
/**
|
||||
* 关闭预览弹窗并清空错误。
|
||||
*/
|
||||
const close = () => {
|
||||
show.value = false;
|
||||
error.value = '';
|
||||
};
|
||||
|
||||
/**
|
||||
* 拉取指定 chat_log 的分页预览数据。
|
||||
* 核心逻辑:Agent 未就绪时写本地化错误;成功后合并 state;失败回落 loadFailed。
|
||||
* @param chatLogId - 聊天日志 ID
|
||||
* @param page - 页码,默认 1
|
||||
*/
|
||||
const loadPage = async (chatLogId: number, page = 1) => {
|
||||
if (!currentAgentId.value) {
|
||||
error.value = '当前 Agent 未就绪,请稍后重试';
|
||||
error.value = t('chat.queryPreview.agentNotReady');
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
@@ -85,10 +123,11 @@ export function useChatQueryPreview(options: UseChatQueryPreviewOptions) {
|
||||
page,
|
||||
page_size: state.value.pageSize,
|
||||
});
|
||||
const fallbackTitle = t('chat.queryPreview.title');
|
||||
state.value = {
|
||||
...state.value,
|
||||
chatLogId,
|
||||
title: String(result.query || state.value.title || '查询结果全量预览').trim() || '查询结果全量预览',
|
||||
title: String(result.query || state.value.title || fallbackTitle).trim() || fallbackTitle,
|
||||
query: String(result.query || '').trim(),
|
||||
columns: Array.isArray(result.columns) ? result.columns : [],
|
||||
rows: Array.isArray(result.rows) ? result.rows : [],
|
||||
@@ -97,20 +136,25 @@ export function useChatQueryPreview(options: UseChatQueryPreviewOptions) {
|
||||
total: Number(result.total || 0),
|
||||
};
|
||||
} catch (err: unknown) {
|
||||
error.value = (err as { message?: string })?.message || '加载全量预览失败';
|
||||
error.value = (err as { message?: string })?.message || t('chat.queryPreview.loadFailed');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 打开预览弹窗并加载第一页。
|
||||
* @param msg - 触发预览的聊天消息
|
||||
*/
|
||||
const openDialog = async (msg: ChatMessage) => {
|
||||
const chatLogId = Number(msg?.chat_log_id || 0);
|
||||
if (!chatLogId) return;
|
||||
const payload = getPayload(msg);
|
||||
const fallbackTitle = t('chat.queryPreview.title');
|
||||
state.value = {
|
||||
...state.value,
|
||||
chatLogId,
|
||||
title: String(payload?.query || msg?.content || '查询结果全量预览').trim() || '查询结果全量预览',
|
||||
title: String(payload?.query || msg?.content || fallbackTitle).trim() || fallbackTitle,
|
||||
query: String(payload?.query || '').trim(),
|
||||
page: 1,
|
||||
total: Number(payload?.total_count || 0),
|
||||
@@ -119,6 +163,10 @@ export function useChatQueryPreview(options: UseChatQueryPreviewOptions) {
|
||||
await loadPage(chatLogId, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* 相对当前页翻页并重新加载。
|
||||
* @param delta - 页码增量(通常 ±1)
|
||||
*/
|
||||
const changePage = async (delta: number) => {
|
||||
const nextPage = state.value.page + delta;
|
||||
if (nextPage < 1 || nextPage > totalPages()) return;
|
||||
|
||||
@@ -551,6 +551,7 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
currentAgentId,
|
||||
refreshShippingActions,
|
||||
msg,
|
||||
t,
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -659,6 +660,7 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
saveLocalMessageToBackend,
|
||||
refreshShippingActions,
|
||||
msg,
|
||||
t,
|
||||
});
|
||||
|
||||
const shippingIntakes = useShippingNoticeIntakes({
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/chat/composables/useChatSourceFiles.ts
|
||||
* 检索来源 / 源文件链接解析与预览。
|
||||
* 用途:检索来源 / 源文件链接解析与预览。
|
||||
* 依赖:vue-i18n(t)、chat.api.resolveChatSourceFile、useMessage。
|
||||
* 逻辑:消息气泡源文件按钮调用 openPreview;缺链时抛 chat.sourcePreviewLinkMissing。
|
||||
*/
|
||||
import { ref, type ComputedRef, type Ref } from 'vue';
|
||||
import type { ComposerTranslation } from 'vue-i18n';
|
||||
@@ -389,7 +391,7 @@ export function useChatSourceFiles({ agentId, t, msg, isMobile }: UseChatSourceF
|
||||
};
|
||||
}
|
||||
}
|
||||
if (!file.url) throw new Error('当前源文件暂未返回可预览链接');
|
||||
if (!file.url) throw new Error(t('chat.sourcePreviewLinkMissing'));
|
||||
return { name: file.name, url: file.url, actualExt: file.actualExt };
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
/**
|
||||
* features/chat/composables/useToolRunProgress.ts
|
||||
* 用途:轮询 Tool/文件检核任务进度,并在执行中锁定输入。
|
||||
* 依赖:vue-i18n、toolRunProgress.api、toolRunProgressConfig。
|
||||
* 逻辑:Chat 页 progress 卡片消费;lockMessage / queryFailed 走 chat.toolRun.*。
|
||||
*/
|
||||
import { computed, onBeforeUnmount, ref, type Ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { buildFileCheckLogProgressUrl } from '../utils/toolRunProgressConfig';
|
||||
import { getToolRunProgress, type ToolRunProgress } from '../api/toolRunProgress.api';
|
||||
import type { ToolRunProgressMatchSource } from '../types/tool-run-progress.types';
|
||||
@@ -43,11 +50,15 @@ const isTerminalStatus = (status?: string | null) => TERMINAL_STATUSES.has(Strin
|
||||
|
||||
/**
|
||||
* 轮询任务进度:有 run_id 时走 detail;或走 for-log / active。
|
||||
* 核心逻辑:按 config 选择 detail/session/active URL;running 时定时刷新;终态停表。
|
||||
* @param configRef - 进度轮询配置
|
||||
* @param options.allowEmptySessionPolls - 允许 for-session 空结果继续重试
|
||||
*/
|
||||
export function useToolRunProgress(
|
||||
configRef: Ref<ToolRunProgressConfig | null>,
|
||||
options: UseToolRunProgressOptions = {},
|
||||
) {
|
||||
const { t } = useI18n();
|
||||
const run = ref<ToolRunProgress | null>(null);
|
||||
const matchSource = ref<ToolRunProgressMatchSource | null>(null);
|
||||
const loading = ref(false);
|
||||
@@ -68,7 +79,7 @@ export function useToolRunProgress(
|
||||
|
||||
const isRunning = computed(() => run.value?.status === 'running');
|
||||
const shouldLockInput = computed(() => Boolean(configRef.value?.lock_input_when_running) && isRunning.value);
|
||||
const lockMessage = computed(() => configRef.value?.lock_message || '当前任务执行中,请等待完成');
|
||||
const lockMessage = computed(() => configRef.value?.lock_message || t('chat.toolRun.lockWaiting'));
|
||||
|
||||
const clearTimer = () => {
|
||||
if (timer !== undefined) {
|
||||
@@ -100,7 +111,7 @@ export function useToolRunProgress(
|
||||
matchSource.value = payload.match_source ?? null;
|
||||
return payload.run ?? null;
|
||||
} catch (e: unknown) {
|
||||
const message = e instanceof Error ? e.message : '任务进度查询失败';
|
||||
const message = e instanceof Error ? e.message : t('chat.toolRun.queryFailed');
|
||||
error.value = message;
|
||||
matchSource.value = null;
|
||||
clearTimer();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/chat/constants/leave.ts
|
||||
* 请假功能常量:假别编码、OA 跳转地址。
|
||||
* 用途:请假功能常量:假别编码、OA 跳转地址、假别 i18n key 映射。
|
||||
* 依赖:无;展示文案由 chat.leave.types.* 经 t() 解析。
|
||||
* 逻辑:LEAVE_TYPES 仅保留 value + labelKey;LEAVE_TYPE_MAP 仍为 NLU 关键词匹配(不走 i18n)。
|
||||
* 说明:Agent 门控已迁移至 shared/utils/agent-registry.utils(intent_routes)。
|
||||
*/
|
||||
export const OA_BASE_URL = 'http://192.168.100.221:8888';
|
||||
@@ -10,34 +12,48 @@ export const OA_REQUEST_VIEW_PATH = '/workflow/request/ViewRequest.jsp?requestid
|
||||
export const OA_AUTO_LOGIN_TARGET = 'hxops-oa-leave-request';
|
||||
export const OA_PASSWORD_STORAGE_KEY = 'hxops_oa_login_password';
|
||||
|
||||
/** 下拉假别选项(value 为 OA 编码) */
|
||||
export const LEAVE_TYPES = [
|
||||
{ label: '事假(小时)', value: '005' },
|
||||
{ label: '病假(小时)', value: '006' },
|
||||
{ label: '丧假(天)', value: '007' },
|
||||
{ label: '年假(天)', value: '010' },
|
||||
{ label: '因公出差(小时)', value: '021' },
|
||||
{ label: '调休假(小时)', value: '025' },
|
||||
{ label: '产假(天)', value: '401' },
|
||||
{ label: '陪产假(天)', value: '402' },
|
||||
{ label: '婚假(天)', value: '403' },
|
||||
{ label: '住院病假(小时)', value: '405' },
|
||||
{ label: '工伤假(天)', value: '406' },
|
||||
{ label: '返乡假(小时)', value: 'ZZ01' },
|
||||
{ label: '事假(经理专用小时)', value: 'ZZ04' },
|
||||
{ label: '病假(经理专用小时)', value: 'ZZ05' },
|
||||
{ label: '丧假(经理专用天)', value: 'ZZ07' },
|
||||
{ label: '产假(经理专用天)', value: 'ZZ08' },
|
||||
{ label: '陪产假(经理专用天)', value: 'ZZ09' },
|
||||
{ label: '婚假(经理专用天)', value: 'ZZ10' },
|
||||
{ label: '其他假(小时)', value: '035' },
|
||||
{ label: '育儿假(小时)', value: '408' },
|
||||
/** 假别编码 → i18n key(相对 chat.leave.types) */
|
||||
export const LEAVE_TYPE_LABEL_KEYS: Record<string, string> = {
|
||||
'005': 'chat.leave.types.005',
|
||||
'006': 'chat.leave.types.006',
|
||||
'007': 'chat.leave.types.007',
|
||||
'010': 'chat.leave.types.010',
|
||||
'021': 'chat.leave.types.021',
|
||||
'025': 'chat.leave.types.025',
|
||||
'401': 'chat.leave.types.401',
|
||||
'402': 'chat.leave.types.402',
|
||||
'403': 'chat.leave.types.403',
|
||||
'405': 'chat.leave.types.405',
|
||||
'406': 'chat.leave.types.406',
|
||||
ZZ01: 'chat.leave.types.ZZ01',
|
||||
ZZ04: 'chat.leave.types.ZZ04',
|
||||
ZZ05: 'chat.leave.types.ZZ05',
|
||||
ZZ07: 'chat.leave.types.ZZ07',
|
||||
ZZ08: 'chat.leave.types.ZZ08',
|
||||
ZZ09: 'chat.leave.types.ZZ09',
|
||||
ZZ10: 'chat.leave.types.ZZ10',
|
||||
'035': 'chat.leave.types.035',
|
||||
'408': 'chat.leave.types.408',
|
||||
};
|
||||
|
||||
/** 下拉假别展示顺序(与 OA 编码一致) */
|
||||
const LEAVE_TYPE_ORDER = [
|
||||
'005', '006', '007', '010', '021', '025',
|
||||
'401', '402', '403', '405', '406',
|
||||
'ZZ01', 'ZZ04', 'ZZ05', 'ZZ07', 'ZZ08', 'ZZ09', 'ZZ10',
|
||||
'035', '408',
|
||||
] as const;
|
||||
|
||||
/** 下拉假别选项(value 为 OA 编码;labelKey 供 t() 解析) */
|
||||
export const LEAVE_TYPES: Array<{ labelKey: string; value: string }> = LEAVE_TYPE_ORDER.map((value) => ({
|
||||
labelKey: LEAVE_TYPE_LABEL_KEYS[value] ?? `chat.leave.types.${value}`,
|
||||
value,
|
||||
}));
|
||||
|
||||
/** 按「天」计价的假别编码 */
|
||||
export const LEAVE_TYPE_BY_DAY = new Set(['010', '007', '401', '402', '403', '406', 'ZZ07', 'ZZ08', 'ZZ09', 'ZZ10']);
|
||||
|
||||
/** 自然语言关键词 → OA 假别编码 */
|
||||
/** 自然语言关键词 → OA 假别编码(NLU 匹配,故意保留中文关键词) */
|
||||
export const LEAVE_TYPE_MAP: Record<string, string> = {
|
||||
事假: '005',
|
||||
病假: '006',
|
||||
|
||||
@@ -1,26 +1,48 @@
|
||||
/**
|
||||
* features/chat/constants/shipping.ts
|
||||
* 用途:发货通知功能常量 — 任务编号正则、菜单动作规格与决策动作集合。
|
||||
* 依赖:types/shipping.types(ShippingMenuAction)。
|
||||
* 依赖:types/shipping.types(ShippingMenuAction)、vue-i18n(菜单展示文案)。
|
||||
* 逻辑:shipping/* handler 与 useChatShipping 引用本模块,避免动作 id 硬编码分散。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
import type { ShippingMenuAction } from '../types/shipping.types';
|
||||
|
||||
/** 工作区发货任务编号格式(如 SN-20250610-ABCDEF12) */
|
||||
export const SHIPPING_TASK_ID_RE = /SN-\d{8}-[A-F0-9]{8}/i;
|
||||
|
||||
/** 菜单动作 id / variant(展示文案经 resolveShippingMenuActionSpec 取 i18n) */
|
||||
export const SHIPPING_MENU_ACTION_SPECS: Record<
|
||||
ShippingMenuAction,
|
||||
{ id: string; label: string; message: string; variant: 'primary' | 'secondary' | 'danger' }
|
||||
{ id: string; variant: 'primary' | 'secondary' | 'danger' }
|
||||
> = {
|
||||
upload: { id: 'upload_inventory_file', label: '选择库存文件', message: '我要上传库存 Excel', variant: 'primary' },
|
||||
paste: { id: 'paste_inventory_json', label: '粘贴库存', message: '我粘贴库存小表', variant: 'secondary' },
|
||||
retry_rpa: { id: 'retry_rpa', label: '重新获取库存', message: '重新获取库存', variant: 'secondary' },
|
||||
confirm: { id: 'confirm', label: '确认', message: '确认', variant: 'primary' },
|
||||
reparse: { id: 'reparse', label: '重新解析', message: '重新解析', variant: 'secondary' },
|
||||
reject: { id: 'reject', label: '驳回', message: '驳回', variant: 'danger' },
|
||||
upload: { id: 'upload_inventory_file', variant: 'primary' },
|
||||
paste: { id: 'paste_inventory_json', variant: 'secondary' },
|
||||
retry_rpa: { id: 'retry_rpa', variant: 'secondary' },
|
||||
confirm: { id: 'confirm', variant: 'primary' },
|
||||
reparse: { id: 'reparse', variant: 'secondary' },
|
||||
reject: { id: 'reject', variant: 'danger' },
|
||||
};
|
||||
|
||||
/**
|
||||
* 解析菜单动作的展示 label / message(四语言)。
|
||||
* 核心逻辑:id/variant 来自静态规格;文案走 chat.shippingNoticeMenu.*。
|
||||
* @param action - 菜单动作键
|
||||
* @param t - 可选翻译函数;缺省用全局 i18n
|
||||
* @returns 含 id/label/message/variant 的完整动作规格
|
||||
*/
|
||||
export function resolveShippingMenuActionSpec(
|
||||
action: ShippingMenuAction,
|
||||
t?: (key: string, ...args: unknown[]) => string,
|
||||
) {
|
||||
const base = SHIPPING_MENU_ACTION_SPECS[action];
|
||||
const translate = t || ((key: string, ...args: unknown[]) => String(i18n.global.t(key, ...(args as []))));
|
||||
return {
|
||||
...base,
|
||||
label: translate(`chat.shippingNoticeMenu.${action}.label`),
|
||||
message: translate(`chat.shippingNoticeMenu.${action}.message`),
|
||||
};
|
||||
}
|
||||
|
||||
export const SHIPPING_DECISION_ACTIONS = new Set([
|
||||
'confirm',
|
||||
'confirm_inventory_mapping',
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
/**
|
||||
* 请假:假种标签、时长/是否展示、余额数字格式化。
|
||||
* features/chat/leave/leaveDisplay.ts
|
||||
* 用途:请假假种标签、时长/是否展示、余额数字格式化。
|
||||
* 依赖:leave.ts 常量、leaveDateTime、vue-i18n t()。
|
||||
* 逻辑:由 LeaveMessageBlock / useChatLeave 在展示层调用;假别文案经 labelKey + t() 解析。
|
||||
*/
|
||||
import { LEAVE_TYPES } from '../constants/leave';
|
||||
import { LEAVE_TYPES, LEAVE_TYPE_LABEL_KEYS } from '../constants/leave';
|
||||
import { isLeaveTypeByDay } from './leaveDateTime';
|
||||
|
||||
export function getLeaveTypeLabel(val: string): string {
|
||||
const item = LEAVE_TYPES.find((x) => x.value === val);
|
||||
return item ? item.label : val;
|
||||
/**
|
||||
* 按 OA 假别编码解析本地化标签。
|
||||
* 核心逻辑:优先 LEAVE_TYPE_LABEL_KEYS;找不到则回退编码本身。
|
||||
* @param val - OA 假别编码
|
||||
* @param t - i18n t 函数
|
||||
* @returns 本地化假别名
|
||||
*/
|
||||
export function getLeaveTypeLabel(val: string, t: (key: string) => string): string {
|
||||
const key = LEAVE_TYPE_LABEL_KEYS[val] || LEAVE_TYPES.find((x) => x.value === val)?.labelKey;
|
||||
return key ? t(key) : val;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按时长与假别计价单位格式化展示文案。
|
||||
* @param hours - 小时数
|
||||
* @param leaveType - 假别编码
|
||||
* @param t - i18n t 函数
|
||||
*/
|
||||
export function formatDurationLabel(
|
||||
hours: number,
|
||||
leaveType: string | undefined,
|
||||
@@ -22,12 +38,20 @@ export function formatDurationLabel(
|
||||
return `${hours} ${t('chat.hourUnit')}`;
|
||||
}
|
||||
|
||||
export function formatYesNoLabel(value: 0 | 1 | null): string {
|
||||
if (value === 0) return '是';
|
||||
if (value === 1) return '否';
|
||||
return '未选择';
|
||||
/**
|
||||
* 将 0/1 是否字段格式化为是/否/未选择。
|
||||
* @param value - OA 是否字段
|
||||
* @param t - i18n t 函数
|
||||
*/
|
||||
export function formatYesNoLabel(value: 0 | 1 | null, t: (key: string) => string): string {
|
||||
if (value === 0) return t('chat.yes');
|
||||
if (value === 1) return t('chat.no');
|
||||
return t('chat.notSelected');
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化假期余额数字;空值显示「暂无数据」。
|
||||
*/
|
||||
export function formatLeaveBalanceNumber(value: unknown, t: (key: string) => string): string {
|
||||
if (value === null || value === undefined) return t('chat.noData');
|
||||
const num = Number(value);
|
||||
|
||||
@@ -114,7 +114,7 @@ export function createLeaveFormApi(ctx: LeaveFormContext) {
|
||||
const unit = isByDay ? ctx.t('chat.dayUnit') : ctx.t('chat.hourUnit');
|
||||
const requestedDisplay = isByDay ? Math.round(requestedHours / 8) : requestedHours;
|
||||
const remainingDisplay = isByDay ? Math.round(balance.remaining_hours / 8) : balance.remaining_hours;
|
||||
const label = getLeaveTypeLabel(form.leaveType);
|
||||
const label = getLeaveTypeLabel(form.leaveType, ctx.t);
|
||||
ctx.msg.warning(ctx.t('chat.durationExceedsBalance', {
|
||||
label,
|
||||
requested: `${requestedDisplay}${unit}`,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/**
|
||||
* features/chat/page/useChatPageMarkdown.ts
|
||||
* 用途:统一处理聊天页 Markdown 渲染、内嵌文件块提取、消息可见性判断与特殊链接点击。
|
||||
* 依赖:Vue computed、marked、ChatMessageBubble handlers、聊天消息类型。
|
||||
* 依赖:Vue computed、marked、vue-i18n、ChatMessageBubble handlers、聊天消息类型。
|
||||
* 逻辑:由 useChatPage 组装上下文后创建页面级 Markdown API,再分发给 ChatMessageBubble 做消息渲染和交互。
|
||||
*/
|
||||
import { computed } from 'vue';
|
||||
import { marked } from 'marked';
|
||||
import i18n from '@/i18n';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { ChatMessageBubbleHandlers } from '../components/messages/ChatMessageBubble.vue';
|
||||
import type { ChatMessage, InlineDownloadFile, SourceFileLink } from '../types/chat.types';
|
||||
@@ -19,6 +20,42 @@ import {
|
||||
|
||||
marked.setOptions({ gfm: true, breaks: true });
|
||||
|
||||
const tt = (key: string, params?: Record<string, unknown>) => String(i18n.global.t(key, params as any));
|
||||
|
||||
/** 内部规范表头键(兼容服务端中文列名);展示时再映射到 chat.assetColumns.* */
|
||||
const FIXED_ASSET_TABLE_TARGET_HEADERS = [
|
||||
'序号',
|
||||
'资产编号',
|
||||
'资产名称',
|
||||
'保管人',
|
||||
'保管部门',
|
||||
'图片',
|
||||
'账套',
|
||||
'供应商',
|
||||
'资产状态',
|
||||
'数量',
|
||||
'取得时间',
|
||||
] as const;
|
||||
|
||||
const FIXED_ASSET_HEADER_I18N_KEYS: Record<(typeof FIXED_ASSET_TABLE_TARGET_HEADERS)[number], string> = {
|
||||
序号: 'chat.assetColumns.id',
|
||||
资产编号: 'chat.assetColumns.assetId',
|
||||
资产名称: 'chat.assetColumns.assetName',
|
||||
保管人: 'chat.assetColumns.custodianPerson',
|
||||
保管部门: 'chat.assetColumns.custodianDept',
|
||||
图片: 'chat.assetColumns.image',
|
||||
账套: 'chat.assetColumns.accountPeriod',
|
||||
供应商: 'chat.assetColumns.supplier',
|
||||
资产状态: 'chat.assetColumns.assetStatus',
|
||||
数量: 'chat.assetColumns.quantity',
|
||||
取得时间: 'chat.assetColumns.acquisitionDate',
|
||||
};
|
||||
|
||||
function displayFixedAssetHeader(header: string): string {
|
||||
const key = FIXED_ASSET_HEADER_I18N_KEYS[header as keyof typeof FIXED_ASSET_HEADER_I18N_KEYS];
|
||||
return key ? tt(key) : header;
|
||||
}
|
||||
|
||||
const INLINE_FILE_BLOCK_REGEX = /\[FILE_START\]([\s\S]*?)\[FILE_END\]/g;
|
||||
const INLINE_ATTACHMENT_HINT_REGEX = /^.*(?:如果您需要查看全部数据,请下载附件。?|请下载附件。?).*$/gim;
|
||||
|
||||
@@ -188,24 +225,11 @@ function downloadInlineFile(file: InlineDownloadFile): void {
|
||||
|
||||
function normalizeAssetHistoryText(value: string): string {
|
||||
const normalized = String(value || '').trim();
|
||||
if (!normalized || normalized === '-' || normalized === '无') return '';
|
||||
const emptyLabel = tt('chat.assetColumns.empty');
|
||||
if (!normalized || normalized === '-' || normalized === '无' || normalized === emptyLabel) return '';
|
||||
return normalized;
|
||||
}
|
||||
|
||||
const FIXED_ASSET_TABLE_TARGET_HEADERS = [
|
||||
'序号',
|
||||
'资产编号',
|
||||
'资产名称',
|
||||
'保管人',
|
||||
'保管部门',
|
||||
'图片',
|
||||
'账套',
|
||||
'供应商',
|
||||
'资产状态',
|
||||
'数量',
|
||||
'取得时间',
|
||||
];
|
||||
|
||||
const FIXED_ASSET_TABLE_HEADER_ALIASES: Record<string, string[]> = {
|
||||
序号: ['序号', 'id'],
|
||||
资产编号: ['资产编号', 'asset_id', 'asset_no'],
|
||||
@@ -265,10 +289,12 @@ function normalizeFixedAssetPreviewTables(container: HTMLElement): void {
|
||||
if (header === '图片') {
|
||||
const assetIdIndex = headerIndexMap.get('资产编号');
|
||||
const assetId = assetIdIndex !== undefined ? normalizeAssetHistoryText(cells[assetIdIndex]?.textContent || '') : '';
|
||||
return assetId ? '查看' : '无';
|
||||
return assetId ? tt('chat.assetColumns.view') : tt('chat.assetColumns.empty');
|
||||
}
|
||||
const cellIndex = headerIndexMap.get(header);
|
||||
return cellIndex !== undefined ? normalizeAssetHistoryText(cells[cellIndex]?.textContent || '') || '无' : '无';
|
||||
return cellIndex !== undefined
|
||||
? normalizeAssetHistoryText(cells[cellIndex]?.textContent || '') || tt('chat.assetColumns.empty')
|
||||
: tt('chat.assetColumns.empty');
|
||||
};
|
||||
return FIXED_ASSET_TABLE_TARGET_HEADERS.map((header) => pickCellText(header));
|
||||
});
|
||||
@@ -278,32 +304,36 @@ function normalizeFixedAssetPreviewTables(container: HTMLElement): void {
|
||||
if (!thead || !tbody) return;
|
||||
|
||||
thead.innerHTML = `<tr>${FIXED_ASSET_TABLE_TARGET_HEADERS.map((header) => (
|
||||
`<th class="${header === '资产编号' || header === '图片' ? 'chat-fixed-asset-highlight-header' : ''}">${header}</th>`
|
||||
`<th class="${header === '资产编号' || header === '图片' ? 'chat-fixed-asset-highlight-header' : ''}">${displayFixedAssetHeader(header)}</th>`
|
||||
)).join('')}</tr>`;
|
||||
tbody.innerHTML = normalizedRows.map((row) => (
|
||||
`<tr>${row.map((cell) => `<td>${cell || '无'}</td>`).join('')}</tr>`
|
||||
`<tr>${row.map((cell) => `<td>${cell || tt('chat.assetColumns.empty')}</td>`).join('')}</tr>`
|
||||
)).join('');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 把聊天结果表格里的“资产编号”和“图片”列增强为可点击入口。
|
||||
* 核心逻辑:只处理包含“资产编号”表头的表格,并从同行“资产名称”列一并带出检索关键词;资产编号走履历检索,图片走图片预览检索。
|
||||
* 核心逻辑:只处理包含资产编号表头的表格(兼容服务端中文与本地化展示标签),并从同行资产名称列一并带出检索关键词。
|
||||
*/
|
||||
function enhanceAssetHistoryTableLinks(html: string): string {
|
||||
if (!html || typeof document === 'undefined' || !html.includes('<table')) return html;
|
||||
const container = document.createElement('div');
|
||||
container.innerHTML = html;
|
||||
normalizeFixedAssetPreviewTables(container);
|
||||
const assetIdLabel = tt('chat.assetColumns.assetId');
|
||||
const assetNameLabel = tt('chat.assetColumns.assetName');
|
||||
const imageLabel = tt('chat.assetColumns.image');
|
||||
const viewLabel = tt('chat.assetColumns.view');
|
||||
const tables = Array.from(container.querySelectorAll('table'));
|
||||
tables.forEach((table) => {
|
||||
const headerCells = Array.from(table.querySelectorAll('thead th'));
|
||||
if (headerCells.length === 0) return;
|
||||
const headerLabels = headerCells.map((cell) => normalizeAssetHistoryText(cell.textContent || ''));
|
||||
const assetIdIndex = headerLabels.findIndex((label) => label === '资产编号');
|
||||
const assetIdIndex = headerLabels.findIndex((label) => label === '资产编号' || label === assetIdLabel);
|
||||
if (assetIdIndex < 0) return;
|
||||
const assetNameIndex = headerLabels.findIndex((label) => label === '资产名称');
|
||||
const imageIndex = headerLabels.findIndex((label) => label === '图片');
|
||||
const assetNameIndex = headerLabels.findIndex((label) => label === '资产名称' || label === assetNameLabel);
|
||||
const imageIndex = headerLabels.findIndex((label) => label === '图片' || label === imageLabel);
|
||||
const rows = Array.from(table.querySelectorAll('tbody tr'));
|
||||
rows.forEach((row) => {
|
||||
const cells = Array.from(row.querySelectorAll('td'));
|
||||
@@ -322,7 +352,7 @@ function enhanceAssetHistoryTableLinks(html: string): string {
|
||||
if (imageIndex >= 0) {
|
||||
const imageCell = cells[imageIndex];
|
||||
if (!imageCell) return;
|
||||
const imageText = normalizeAssetHistoryText(imageCell.textContent || '') || '查看';
|
||||
const imageText = normalizeAssetHistoryText(imageCell.textContent || '') || viewLabel;
|
||||
const imageLink = document.createElement('a');
|
||||
imageLink.href = `#asset-image?asset_id=${encodeURIComponent(assetId)}&asset_name=${encodeURIComponent(assetName)}`;
|
||||
imageLink.className = 'chat-asset-history-link';
|
||||
@@ -411,7 +441,7 @@ export function createChatPageMarkdownApi(ctx: ChatPageMarkdownContext) {
|
||||
if (fileCheckRunId) {
|
||||
event.preventDefault();
|
||||
void downloadFileCheckExcelByRunId(fileCheckRunId).catch((error: unknown) => {
|
||||
const text = error instanceof Error ? error.message : '下载 Excel 失败';
|
||||
const text = error instanceof Error ? error.message : tt('chat.toolRun.downloadFailed');
|
||||
message.error(text);
|
||||
});
|
||||
return;
|
||||
@@ -436,7 +466,7 @@ export function createChatPageMarkdownApi(ctx: ChatPageMarkdownContext) {
|
||||
const html = typeof rendered === 'string' ? rendered : displayText;
|
||||
return enhanceAssetHistoryTableLinks(html)
|
||||
.replace(/<(td|th)\b([^>]*)>(?:\s| |<br\s*\/?>)*<\/\1>/gi, (_match, tagName: string, attrs: string) => (
|
||||
`<${tagName}${attrs}>无</${tagName}>`
|
||||
`<${tagName}${attrs}>${tt('chat.assetColumns.empty')}</${tagName}>`
|
||||
))
|
||||
.replace(/<table\b[\s\S]*?<\/table>/gi, (tableHtml: string) => (
|
||||
`<div class="chat-table-scroll"><div class="chat-table-inner">${tableHtml}</div></div>`
|
||||
|
||||
@@ -72,7 +72,7 @@ export interface ChatPageSendContext {
|
||||
refreshToolRunProgressAfterSend: () => Promise<void>;
|
||||
prepareToolRunProgressBeforeSend: () => Promise<void>;
|
||||
msg: { warning: (text: string) => void; info: (text: string) => void };
|
||||
t: (key: string) => string;
|
||||
t: (key: string, values?: Record<string, unknown>) => string;
|
||||
copiedIndex: Ref<number | null>;
|
||||
getChatContext?: () => { task_id?: string; batch_no?: string; display_query?: string };
|
||||
onAssistantMessageFinished?: (message: ChatMessage, runMessages: ChatMessage[]) => void | Promise<void>;
|
||||
@@ -123,7 +123,7 @@ export function createChatPageSendApi(ctx: ChatPageSendContext) {
|
||||
if (requestId) suffix = `(rid=${requestId})`;
|
||||
}
|
||||
const message = e instanceof Error ? e.message : 'unknown error';
|
||||
ctx.msg.warning(`附件处理失败:${message}${suffix}`);
|
||||
ctx.msg.warning(ctx.t('chat.attachmentsUi.processFailed', { message, suffix }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import { computed, nextTick, ref, watch, type Ref } from 'vue';
|
||||
import i18n from '@/i18n';
|
||||
|
||||
import {
|
||||
agentHasProgress,
|
||||
@@ -208,7 +209,7 @@ export function useChatPageToolRun(ctx: ChatPageToolRunContext) {
|
||||
|
||||
...runErrors.value,
|
||||
|
||||
[runId]: e instanceof Error ? e.message : '任务进度查询失败',
|
||||
[runId]: e instanceof Error ? e.message : String(i18n.global.t('chat.toolRun.queryFailed')),
|
||||
|
||||
};
|
||||
|
||||
@@ -272,7 +273,7 @@ export function useChatPageToolRun(ctx: ChatPageToolRunContext) {
|
||||
|
||||
...chatLogErrors.value,
|
||||
|
||||
[chatLogId]: '暂未找到关联的检核任务,请稍后刷新或查看排程执行记录',
|
||||
[chatLogId]: String(i18n.global.t('chat.toolRun.runNotFound')),
|
||||
|
||||
};
|
||||
|
||||
@@ -292,7 +293,7 @@ export function useChatPageToolRun(ctx: ChatPageToolRunContext) {
|
||||
|
||||
...chatLogErrors.value,
|
||||
|
||||
[chatLogId]: e instanceof Error ? e.message : '任务进度查询失败',
|
||||
[chatLogId]: e instanceof Error ? e.message : String(i18n.global.t('chat.toolRun.queryFailed')),
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
/**
|
||||
* 对话页:当前登录用户展示名、工号与登出/管理入口。
|
||||
* features/chat/page/useChatPageUser.ts
|
||||
* 用途:对话页当前登录用户展示名、工号与登出/管理入口。
|
||||
* 依赖:vue-i18n、vue-router、shared/utils/auth。
|
||||
* 逻辑:Chat 页顶栏展示名;无真实姓名时回落 chat.currentUser。
|
||||
*/
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { Router } from 'vue-router';
|
||||
import { getStoredAuthUser, logoutAuth } from '@/shared/utils/auth';
|
||||
|
||||
/**
|
||||
* 组装对话页用户展示与登出/管理跳转。
|
||||
* 核心逻辑:优先 real_name → name/wecom_name → 非纯数字 username → chat.currentUser。
|
||||
* @param router - Vue Router,用于登出与管理后台跳转
|
||||
*/
|
||||
export function useChatPageUser(router: Router) {
|
||||
const { t } = useI18n();
|
||||
const currentUser = ref(getStoredAuthUser());
|
||||
|
||||
const currentUserDisplayName = computed(() => {
|
||||
@@ -16,7 +26,7 @@ export function useChatPageUser(router: Router) {
|
||||
if (aliasName) return aliasName;
|
||||
const username = currentUser.value?.username?.trim();
|
||||
if (username && !/^\d+$/.test(username)) return username;
|
||||
return '当前用户';
|
||||
return t('chat.currentUser');
|
||||
});
|
||||
|
||||
const currentUserEmployeeId = computed(() => {
|
||||
@@ -26,16 +36,25 @@ export function useChatPageUser(router: Router) {
|
||||
return username || '-';
|
||||
});
|
||||
|
||||
/**
|
||||
* 清空本地 currentUser(响应全局登出事件)。
|
||||
*/
|
||||
const onAuthLogout = () => {
|
||||
currentUser.value = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 登出并跳转登录页。
|
||||
*/
|
||||
const handleLogout = () => {
|
||||
logoutAuth();
|
||||
onAuthLogout();
|
||||
router.push('/login');
|
||||
};
|
||||
|
||||
/**
|
||||
* 跳转管理后台。
|
||||
*/
|
||||
const goToAdmin = () => {
|
||||
router.push('/admin');
|
||||
};
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingConversation.ts
|
||||
* 用途:发货聊天会话侧栏同步与带任务编号的菜单消息发送。
|
||||
* 依赖:chat.types、shipping.types、Vue Ref/ComputedRef。
|
||||
* 逻辑:useChatShipping 通过 createShippingConversationHelpers 发送菜单类消息并刷新历史。
|
||||
* 依赖:chat.types、shipping.types、vue-i18n、Vue Ref/ComputedRef。
|
||||
* 逻辑:useChatShipping 通过 createShippingConversationHelpers 发送菜单类消息并刷新历史;
|
||||
* 带 taskId 时用 chat.shippingNoticeTurn.withTaskId 拼接正文。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
import type { ChatSessionItem } from '../types/chat.types';
|
||||
import type { ChatUploadFileSpec } from '../types/shipping.types';
|
||||
import type { ComputedRef, Ref } from 'vue';
|
||||
@@ -36,11 +38,16 @@ export async function ensureShippingHistorySynced(ctx: ShippingConversationConte
|
||||
|
||||
/**
|
||||
* 创建发货会话辅助函数(菜单消息发送 + 历史同步)。
|
||||
* 核心逻辑:有 taskId 时用 i18n withTaskId 模板拼接;display_query 仍为原始菜单文案。
|
||||
* @param ctx - 发货会话上下文
|
||||
* @returns sendShippingMenuMessage / ensureShippingHistorySynced
|
||||
*/
|
||||
export function createShippingConversationHelpers(ctx: ShippingConversationContext) {
|
||||
const sendShippingMenuMessage = async (message: string) => {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
const text = taskId ? `${message}\n任务编号:${taskId}` : message;
|
||||
const text = taskId
|
||||
? String(i18n.global.t('chat.shippingNoticeTurn.withTaskId', { text: message, taskId }))
|
||||
: message;
|
||||
await ctx.sendMessage(text, ctx.currentAgentId.value, ctx.selectedKb.value, [], {
|
||||
task_id: taskId || undefined,
|
||||
display_query: message,
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingDecisionFormat.ts
|
||||
* 用途:决策 API 响应格式化为助手 Markdown 消息。
|
||||
* 依赖:无;useChatShippingDecision 在 submit_decision 成功后调用。
|
||||
* 依赖:vue-i18n;useChatShippingDecision 在 submit_decision 成功后调用。
|
||||
* 逻辑:按 decision 类型追加映射提示、下一步指引与任务编号尾注。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
|
||||
const tt = (key: string, params?: Record<string, unknown>) =>
|
||||
String(params ? i18n.global.t(key, params) : i18n.global.t(key));
|
||||
|
||||
/**
|
||||
* 将 submit_decision 结果格式化为本地 assistant 消息 Markdown。
|
||||
*/
|
||||
@@ -19,9 +24,14 @@ export function formatShippingDecisionAssistantMessage(
|
||||
const headers = Array.isArray(preview.headers) ? (preview.headers as unknown[]).filter(Boolean) : [];
|
||||
const suggested = (preview.suggested_mapping || {}) as Record<string, string>;
|
||||
if (preview.header_row_index) {
|
||||
lines.push('', `表头在第 ${preview.header_row_index} 行:${headers.join(' | ')}`);
|
||||
lines.push('', tt('chat.shippingNoticeDecisionFormat.headerAtRow', {
|
||||
row: preview.header_row_index,
|
||||
headers: headers.join(' | '),
|
||||
}));
|
||||
} else if (headers.length) {
|
||||
lines.push('', `当前表头:${headers.join(' | ')}`);
|
||||
lines.push('', tt('chat.shippingNoticeDecisionFormat.currentHeaders', {
|
||||
headers: headers.join(' | '),
|
||||
}));
|
||||
}
|
||||
const mappingLines = [
|
||||
suggested.sku ? `- sku → ${suggested.sku}` : null,
|
||||
@@ -29,20 +39,20 @@ export function formatShippingDecisionAssistantMessage(
|
||||
suggested.available_qty ? `- available_qty → ${suggested.available_qty}` : null,
|
||||
].filter((line): line is string => Boolean(line));
|
||||
if (mappingLines.length) {
|
||||
lines.push('', '建议列映射:', ...mappingLines);
|
||||
lines.push('', tt('chat.shippingNoticeDecisionFormat.suggestedMapping'), ...mappingLines);
|
||||
}
|
||||
lines.push(
|
||||
'',
|
||||
'如需调整,请说明要改的列(例如:available_qty 改用 Qty Available)。',
|
||||
'也可点击「选择库存文件」重新上传。',
|
||||
tt('chat.shippingNoticeDecisionFormat.adjustHint'),
|
||||
tt('chat.shippingNoticeDecisionFormat.reuploadHint'),
|
||||
);
|
||||
} else if (decision === 'confirm_inventory_mapping') {
|
||||
if (String(result.checkpoint || '').trim() === 'map_ok') {
|
||||
lines.push('', '下一步:匹配库存与发货需求。');
|
||||
lines.push('', tt('chat.shippingNoticeDecisionFormat.nextMatch'));
|
||||
}
|
||||
} else if (decision === 'reparse_inventory') {
|
||||
lines.push('', '请重新上传或粘贴库存 Excel。');
|
||||
lines.push('', tt('chat.shippingNoticeDecisionFormat.reuploadOrPaste'));
|
||||
}
|
||||
lines.push('', `任务编号:${taskId}`);
|
||||
lines.push('', tt('chat.shippingNoticeDecisionFormat.taskIdLine', { taskId }));
|
||||
return lines.join('\n');
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
* 用途:发货聊天用户输入意图识别,供 handleSend 前置拦截。
|
||||
* 依赖:shippingMenu.resolveShippingNumericChoice、types/shipping.types。
|
||||
* 逻辑:useChatShippingSendHandler 调用;覆盖手工上传、库存上传、Excel 生成/下载、列映射与切票。
|
||||
*
|
||||
* [NLU] 本文件中文关键词/正则为匹配中文用户输入的意图 token,刻意保留,不作 UI 展示国际化。
|
||||
*/
|
||||
import { resolveShippingNumericChoice } from './shippingMenu';
|
||||
import type { ShippingMenuAction } from '../types/shipping.types';
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingMapping.ts
|
||||
* 用途:库存列映射消息 payload 读取与字段对齐 Markdown 生成。
|
||||
* 依赖:shippingText.normalizeShippingHeaderForDisplay、chat.types、shipping.types。
|
||||
* 依赖:shippingText.normalizeShippingHeaderForDisplay、chat.types、shipping.types、vue-i18n。
|
||||
* 逻辑:ShippingInventoryMappingMessage 与 useChatShippingMappingForm 读取 mapping 消息数据。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
import { normalizeShippingHeaderForDisplay } from './shippingText';
|
||||
import type { ChatMessage } from '../types/chat.types';
|
||||
import type { ShippingInventoryMappingFormPayload } from '../types/shipping.types';
|
||||
|
||||
const tt = (key: string, params?: Record<string, unknown>) =>
|
||||
String(params ? i18n.global.t(key, params) : i18n.global.t(key));
|
||||
|
||||
/**
|
||||
* 从 shipping-inventory-mapping 类型消息中提取 taskId、schema_preview 与 form。
|
||||
*/
|
||||
@@ -41,14 +45,16 @@ export function buildShippingFieldAlignmentText(payload: { data?: { field_alignm
|
||||
const invCols = (alignment as { inventory_columns?: { mapping?: Record<string, { source_column?: string }> } }).inventory_columns || {};
|
||||
const mapping = invCols.mapping || {};
|
||||
const rows: Array<[string, string]> = [
|
||||
['sku', normalizeShippingHeaderForDisplay(mapping?.sku?.source_column) || '(未识别)'],
|
||||
['reservation_id', normalizeShippingHeaderForDisplay(mapping?.reservation_id?.source_column) || '(未识别/可选)'],
|
||||
['available_qty', normalizeShippingHeaderForDisplay(mapping?.available_qty?.source_column) || '(未识别)'],
|
||||
['sku', normalizeShippingHeaderForDisplay(mapping?.sku?.source_column) || tt('chat.shippingNoticeFieldAlignment.unrecognized')],
|
||||
['reservation_id', normalizeShippingHeaderForDisplay(mapping?.reservation_id?.source_column) || tt('chat.shippingNoticeFieldAlignment.unrecognizedOptional')],
|
||||
['available_qty', normalizeShippingHeaderForDisplay(mapping?.available_qty?.source_column) || tt('chat.shippingNoticeFieldAlignment.unrecognized')],
|
||||
];
|
||||
const lines: string[] = [];
|
||||
const matchRule = String((alignment as { match_rule?: string }).match_rule || '').trim();
|
||||
if (matchRule) lines.push(`匹配规则:${matchRule}`);
|
||||
lines.push('', '字段对齐表:', '', '|系统字段|库存列|', '|---|---|');
|
||||
if (matchRule) lines.push(tt('chat.shippingNoticeFieldAlignment.matchRule', { rule: matchRule }));
|
||||
const sys = tt('chat.shippingNoticeFieldAlignment.tableHeaderSystem');
|
||||
const inv = tt('chat.shippingNoticeFieldAlignment.tableHeaderInventory');
|
||||
lines.push('', tt('chat.shippingNoticeFieldAlignment.tableTitle'), '', `|${sys}|${inv}|`, '|---|---|');
|
||||
for (const [k, v] of rows) {
|
||||
lines.push(`|${k}|${v}|`);
|
||||
}
|
||||
@@ -56,7 +62,7 @@ export function buildShippingFieldAlignmentText(payload: { data?: { field_alignm
|
||||
? (alignment as { warnings: unknown[] }).warnings.filter(Boolean)
|
||||
: [];
|
||||
if (warnings.length) {
|
||||
lines.push('', '提示:', ...warnings.map((w) => `- ${String(w)}`));
|
||||
lines.push('', tt('chat.shippingNoticeFieldAlignment.hints'), ...warnings.map((w) => `- ${String(w)}`));
|
||||
}
|
||||
return lines.join('\n').trim();
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
* 用途:发货聊天数字菜单解析、动作按钮合并与决策文本识别(纯函数)。
|
||||
* 依赖:types/shipping.types。
|
||||
* 逻辑:useChatShippingSendHandler 在发送前调用;按钮只来自后端状态机 UI State,不从自然语言正文猜测。
|
||||
*
|
||||
* [NLU] classify / resolve* 中的中文正则与决策词表用于匹配用户/Agent 中文输入,刻意保留;展示文案在 UI 层走 i18n。
|
||||
*/
|
||||
import type { ShippingActionButton, ShippingMenuAction } from '../types/shipping.types';
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingText.ts
|
||||
* 用途:发货聊天消息文本净化(纯函数,无 Vue 依赖)。
|
||||
* 依赖:constants/shippingNoticeActions、types/shipping.types。
|
||||
* 用途:发货聊天消息文本净化(展示替换走 i18n;匹配模式保留中文以对齐 Agent 中文输出)。
|
||||
* 依赖:constants/shippingNoticeActions、types/shipping.types、vue-i18n。
|
||||
* 逻辑:ChatView 渲染前 sanitize;动作按钮统一来自后端 shipping_ui_state。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
import { SHIPPING_INTERNAL_STATUS_TOKENS } from '@/constants/shippingNoticeActions';
|
||||
import type { ShippingActionButton } from '../types/shipping.types';
|
||||
|
||||
const tt = (key: string) => String(i18n.global.t(key));
|
||||
|
||||
/**
|
||||
* 文本归一化用于判断 Agent 正文编号项是否重复描述了结构化按钮。
|
||||
*/
|
||||
@@ -18,6 +21,7 @@ const normalizeActionComparableText = (value: string) =>
|
||||
const isNumberedActionLine = (line: string) =>
|
||||
/^\s*(?:[-*]\s*)?[1-91-9][\.\、\)::]\s*/.test(line);
|
||||
|
||||
// [NLU] 下列中文正则用于匹配 Agent 中文正文/历史菜单泄漏,非 UI 展示文案,刻意保留。
|
||||
const isActionListContextLine = (line: string) =>
|
||||
/(?:请选择操作|选择操作|操作选项|按钮)/.test(line);
|
||||
|
||||
@@ -36,38 +40,38 @@ const isPlainActionMenuLine = (line: string) =>
|
||||
/**
|
||||
* 规范化运行态提示文案,隐藏“第几次重试/尝试”这类面对业务用户价值较低的过程指标。
|
||||
*
|
||||
* 核心逻辑:仅收敛库存获取相关状态短语,保留“已触发 / 已重新触发 / 进行中”这些对下一步决策有帮助的状态,
|
||||
* 不在前台暴露机械性的第 N 次计数。
|
||||
* 核心逻辑:匹配侧保留中文状态短语(对齐后端/Agent 输出);替换侧走 i18n 展示。
|
||||
*/
|
||||
export function sanitizeShippingRuntimeStatusText(text: string): string {
|
||||
// [NLU] 左侧正则匹配中文运行态原文;右侧为 UI 展示文案。
|
||||
return String(text || '')
|
||||
.replace(
|
||||
/已手动重新触发\s*RPA\s*库存导出\s*[((]\s*(?:手动第\s*\d+\s*次(?:尝试)?|第\s*\d+(?:\s*\/\s*\d+)?\s*次(?:尝试)?)\s*[))]\s*[。.]?/gi,
|
||||
'已重新触发库存获取。',
|
||||
tt('chat.shippingNoticeSanitize.retriggeredInventory'),
|
||||
)
|
||||
.replace(
|
||||
/已重新触发库存获取\s*[((]\s*第\s*\d+(?:\s*\/\s*\d+)?\s*次(?:尝试)?\s*[))]\s*[。.]?/gi,
|
||||
'已重新触发库存获取。',
|
||||
tt('chat.shippingNoticeSanitize.retriggeredInventory'),
|
||||
)
|
||||
.replace(
|
||||
/已触发库存获取\s*[((]\s*第\s*\d+(?:\s*\/\s*\d+)?\s*次(?:尝试)?\s*[))]\s*[。.]?/gi,
|
||||
'已触发库存获取。',
|
||||
tt('chat.shippingNoticeSanitize.triggeredInventory'),
|
||||
)
|
||||
.replace(
|
||||
/已触发\s*RPA\s*库存导出\s*[((]\s*第\s*\d+(?:\s*\/\s*\d+)?\s*次(?:尝试)?\s*[))]\s*[。.]?/gi,
|
||||
'已触发库存获取。',
|
||||
tt('chat.shippingNoticeSanitize.triggeredInventory'),
|
||||
)
|
||||
.replace(
|
||||
/RPA\s*库存导出进行中\s*[((]\s*第\s*\d+(?:\s*\/\s*\d+)?\s*次(?:尝试)?\s*[))]\s*[。.]?/gi,
|
||||
'库存获取进行中。',
|
||||
tt('chat.shippingNoticeSanitize.inventoryInProgress'),
|
||||
)
|
||||
.replace(
|
||||
/库存获取进行中\s*[((]\s*第\s*\d+(?:\s*\/\s*\d+)?\s*次(?:尝试)?\s*[))]\s*[。.]?/gi,
|
||||
'库存获取进行中。',
|
||||
tt('chat.shippingNoticeSanitize.inventoryInProgress'),
|
||||
)
|
||||
.replace(
|
||||
/手动第\s*\d+\s*次尝试/gi,
|
||||
'手动重试',
|
||||
tt('chat.shippingNoticeSanitize.manualRetry'),
|
||||
)
|
||||
.replace(/\s+([。!?,])/g, '$1')
|
||||
.trim();
|
||||
@@ -244,50 +248,53 @@ export function stripShippingActionListByButtons(
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏 Agent 回复中的内部状态 token,并将 task_id 统一为「任务编号」展示。
|
||||
* 隐藏 Agent 回复中的内部状态 token,并将 task_id 统一为本地化「任务编号」展示。
|
||||
* 核心逻辑:匹配侧保留中文/英文工程词;替换侧走 chat.shippingNoticeSanitize。
|
||||
*/
|
||||
export function sanitizeShippingConversationText(text: string, enabled: boolean): string {
|
||||
if (!enabled) return text;
|
||||
// [NLU] 匹配模式对齐中文 Agent 工程泄漏;替换串为 UI 文案。
|
||||
let result = sanitizeShippingRuntimeStatusText(String(text || ''))
|
||||
.replace(
|
||||
/已回到列映射步骤。?请根据\s*schema_preview\s*提供新的\s*map_json\s*[,,]\s*再调用\s*(?:应用库存字段映射|apply_inventory_mapping)[^。.\n]*[。.]?/gi,
|
||||
'已回到库存字段确认步骤。请检查系统识别的库存列名,确认无误后继续;如有问题请修改映射。',
|
||||
tt('chat.shippingNoticeSanitize.backToAlignConfirm'),
|
||||
)
|
||||
.replace(
|
||||
/请根据\s*schema_preview\s*提供新的\s*map_json\s*[,,]\s*再调用\s*(?:应用库存字段映射|apply_inventory_mapping)[^。.\n]*[。.]?/gi,
|
||||
'请检查系统识别的库存列名,确认无误后继续;如有问题请修改映射。',
|
||||
tt('chat.shippingNoticeSanitize.checkColumnsContinue'),
|
||||
)
|
||||
.replace(
|
||||
/根据\s*data\.schema_preview\.headers\s*与\s*sample_rows\s*推断\s*JSON[^。.\n]*再调用\s*(?:应用库存字段映射|apply_inventory_mapping)[^。.\n]*[。.]?/gi,
|
||||
'请根据库存表头和样例行确认字段对应关系。',
|
||||
tt('chat.shippingNoticeSanitize.confirmHeadersFromSample'),
|
||||
)
|
||||
.replace(/通过\s*(?:Hxops|HXOPS|hxops)\s*聊天区上传/gi, '在当前对话中上传')
|
||||
.replace(/在\s*(?:Hxops|HXOPS|hxops)\s*聊天区上传/gi, '在当前对话中上传')
|
||||
.replace(/(?:Hxops|HXOPS|hxops)\s*聊天区/gi, '当前对话')
|
||||
.replace(/(?:Hxops|HXOPS|hxops)\s*Chat/gi, '当前对话')
|
||||
.replace(/到\s*(?:Hxops|HXOPS|hxops)(\s*[??])?/gi, '到当前对话$1')
|
||||
.replace(/\b(?:Hxops|HXOPS|hxops)\b/g, '当前系统')
|
||||
.replace(/\btask_id\s*[::]/gi, '任务编号:')
|
||||
.replace(/\btask_id\b/gi, '任务编号');
|
||||
.replace(/通过\s*(?:Hxops|HXOPS|hxops)\s*聊天区上传/gi, tt('chat.shippingNoticeSanitize.uploadInCurrentChat'))
|
||||
.replace(/在\s*(?:Hxops|HXOPS|hxops)\s*聊天区上传/gi, tt('chat.shippingNoticeSanitize.uploadInCurrentChat'))
|
||||
.replace(/(?:Hxops|HXOPS|hxops)\s*聊天区/gi, tt('chat.shippingNoticeSanitize.currentChat'))
|
||||
.replace(/(?:Hxops|HXOPS|hxops)\s*Chat/gi, tt('chat.shippingNoticeSanitize.currentChat'))
|
||||
.replace(/到\s*(?:Hxops|HXOPS|hxops)(\s*[??])?/gi, (_m, q) => `${tt('chat.shippingNoticeSanitize.toCurrentChatPrefix')}${q || ''}`)
|
||||
.replace(/\b(?:Hxops|HXOPS|hxops)\b/g, tt('chat.shippingNoticeSanitize.currentSystem'))
|
||||
.replace(/\btask_id\s*[::]/gi, tt('chat.shippingNoticeSanitize.taskIdLabel'))
|
||||
.replace(/\btask_id\b/gi, tt('chat.shippingNoticeSanitize.taskIdWord'));
|
||||
result = result
|
||||
.replace(/\bcreate_task\b/gi, '新建任务')
|
||||
.replace(/\bget_task_status\b/gi, '查询任务状态')
|
||||
.replace(/\bparse_notice\b/gi, '解析发货通知')
|
||||
.replace(/\bsubmit_decision\b/gi, '提交处理结果')
|
||||
.replace(/\bmatch_inventory\b/gi, '匹配库存')
|
||||
.replace(/\bgenerate_excel\b/gi, '生成发货 Excel')
|
||||
.replace(/\bgenerate_shipment_excel\b/gi, '生成发货 Excel')
|
||||
.replace(/\bupload_to_freight\b/gi, '上传货代系统')
|
||||
.replace(/\bapply_inventory_mapping\b/gi, '应用库存字段映射')
|
||||
.replace(/\bget_inventory_schema_preview\b/gi, '读取库存表头预览')
|
||||
.replace(/\bschema_preview(?:\.headers)?\b/gi, '库存表头预览')
|
||||
.replace(/\bdata\.库存表头预览\b/gi, '库存表头预览')
|
||||
.replace(/\bmap_json\b/gi, '字段映射')
|
||||
.replace(/\bsample_rows\b/gi, '样例行')
|
||||
.replace(/\bretry_rpa\b/gi, '重新获取库存')
|
||||
.replace(/\bretry_upload\b/gi, '重试上传货代')
|
||||
.replace(/\bstructured\b/gi, '结构化内容')
|
||||
.replace(/\braw_text\b/gi, '通知原文');
|
||||
.replace(/\bcreate_task\b/gi, tt('chat.shippingNoticeSanitize.createTask'))
|
||||
.replace(/\bget_task_status\b/gi, tt('chat.shippingNoticeSanitize.getTaskStatus'))
|
||||
.replace(/\bparse_notice\b/gi, tt('chat.shippingNoticeSanitize.parseNotice'))
|
||||
.replace(/\bsubmit_decision\b/gi, tt('chat.shippingNoticeSanitize.submitDecision'))
|
||||
.replace(/\bmatch_inventory\b/gi, tt('chat.shippingNoticeSanitize.matchInventory'))
|
||||
.replace(/\bgenerate_excel\b/gi, tt('chat.shippingNoticeSanitize.generateExcel'))
|
||||
.replace(/\bgenerate_shipment_excel\b/gi, tt('chat.shippingNoticeSanitize.generateExcel'))
|
||||
.replace(/\bupload_to_freight\b/gi, tt('chat.shippingNoticeSanitize.uploadFreight'))
|
||||
.replace(/\bapply_inventory_mapping\b/gi, tt('chat.shippingNoticeSanitize.applyInventoryMapping'))
|
||||
.replace(/\bget_inventory_schema_preview\b/gi, tt('chat.shippingNoticeSanitize.getSchemaPreview'))
|
||||
.replace(/\bschema_preview(?:\.headers)?\b/gi, tt('chat.shippingNoticeSanitize.schemaPreview'))
|
||||
// [NLU] Agent 偶发把已汉化的 schema_preview 再包一层 data.前缀
|
||||
.replace(/\bdata\.库存表头预览\b/gi, tt('chat.shippingNoticeSanitize.schemaPreview'))
|
||||
.replace(/\bmap_json\b/gi, tt('chat.shippingNoticeSanitize.mapJson'))
|
||||
.replace(/\bsample_rows\b/gi, tt('chat.shippingNoticeSanitize.sampleRows'))
|
||||
.replace(/\bretry_rpa\b/gi, tt('chat.shippingNoticeSanitize.retryRpa'))
|
||||
.replace(/\bretry_upload\b/gi, tt('chat.shippingNoticeSanitize.retryUpload'))
|
||||
.replace(/\bstructured\b/gi, tt('chat.shippingNoticeSanitize.structured'))
|
||||
.replace(/\braw_text\b/gi, tt('chat.shippingNoticeSanitize.rawText'));
|
||||
result = result.replace(/[((]\s*显示\s*[「"'`][^"'`]+[」"'`]\s*[))]/g, '');
|
||||
result = result.replace(
|
||||
/\b(process_status|pending_human_reason|review_status|checkpoint|match_status|human_options)\s*[::=]\s*[「"'`]?[\w.-]+[「"'`]?/gi,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingTurnActions.ts
|
||||
* 用途:将发货通知菜单/决策 action.id 映射为 Chat Turn action_type + payload。
|
||||
* 依赖:constants/shipping。
|
||||
* 依赖:constants/shipping、vue-i18n(displayText)。
|
||||
* 逻辑:useChatShippingDecision 与 useChatShippingMenuHandler 调用本模块,不再直调 workspace API 插消息。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
import { SHIPPING_DECISION_ACTIONS } from '../constants/shipping';
|
||||
|
||||
export interface ShippingChatTurnSpec {
|
||||
@@ -11,6 +12,9 @@ export interface ShippingChatTurnSpec {
|
||||
payload: Record<string, unknown>;
|
||||
}
|
||||
|
||||
const tt = (key: string, params?: Record<string, unknown>) =>
|
||||
String(params ? i18n.global.t(key, params) : i18n.global.t(key));
|
||||
|
||||
/**
|
||||
* 将发货 UI 动作 id 解析为平台 Chat Turn 规格。
|
||||
* @param actionId - 状态机 action_buttons.id
|
||||
@@ -72,6 +76,7 @@ export function buildShippingSubmitDecisionTurn(
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造发货通知建批 Chat Turn(multipart 上传)。
|
||||
*/
|
||||
@@ -82,8 +87,10 @@ export function buildShippingCreateBatchTurn(
|
||||
): { actionType: string; displayText: string; payload: Record<string, unknown>; files: File[] } {
|
||||
const count = files.length;
|
||||
const displayText = count === 1
|
||||
? `上传发货通知:${files[0]?.name || '附件'}`
|
||||
: `上传 ${count} 份发货通知`;
|
||||
? tt('chat.shippingNoticeTurn.createBatchSingle', {
|
||||
fileName: files[0]?.name || tt('chat.shippingNoticeTurn.attachmentFallback'),
|
||||
})
|
||||
: tt('chat.shippingNoticeTurn.createBatchMulti', { count });
|
||||
return {
|
||||
actionType: 'shipping.create_batch_from_notices',
|
||||
displayText,
|
||||
@@ -106,8 +113,8 @@ export function buildShippingCreateBatchFromIntakesTurn(
|
||||
): { actionType: string; displayText: string; payload: Record<string, unknown> } {
|
||||
const count = intakeNos.length;
|
||||
const displayText = count === 1
|
||||
? `确认建单:${intakeNos[0]}`
|
||||
: `确认建单:${count} 份发货通知`;
|
||||
? tt('chat.shippingNoticeTurn.confirmBatchSingle', { intakeNo: intakeNos[0] })
|
||||
: tt('chat.shippingNoticeTurn.confirmBatchMulti', { count });
|
||||
return {
|
||||
actionType: 'shipping.create_batch_from_intakes',
|
||||
displayText,
|
||||
@@ -131,33 +138,42 @@ export function buildShippingTurnRefs(taskNo: string, batchNo?: string): Record<
|
||||
return refs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造库存上传 Chat Turn。
|
||||
*/
|
||||
export function buildShippingUploadInventoryTurn(taskNo: string, file: File) {
|
||||
const task = String(taskNo || '').trim().toUpperCase();
|
||||
return {
|
||||
actionType: 'shipping.upload_inventory',
|
||||
displayText: `上传库存文件:${file.name}`,
|
||||
displayText: tt('chat.shippingNoticeTurn.uploadInventory', { fileName: file.name }),
|
||||
payload: { task_no: task },
|
||||
files: [file],
|
||||
refs: buildShippingTurnRefs(task),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造重新上传发货通知 Chat Turn。
|
||||
*/
|
||||
export function buildShippingReplaceNoticeTurn(taskNo: string, file: File) {
|
||||
const task = String(taskNo || '').trim().toUpperCase();
|
||||
return {
|
||||
actionType: 'shipping.replace_notice',
|
||||
displayText: `重新上传发货通知:${file.name}`,
|
||||
displayText: tt('chat.shippingNoticeTurn.replaceNotice', { fileName: file.name }),
|
||||
payload: { task_no: task },
|
||||
files: [file],
|
||||
refs: buildShippingTurnRefs(task),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造应用库存列映射 Chat Turn。
|
||||
*/
|
||||
export function buildShippingApplyMappingTurn(taskNo: string, mapping: Record<string, string>) {
|
||||
const task = String(taskNo || '').trim().toUpperCase();
|
||||
return {
|
||||
actionType: 'shipping.apply_inventory_mapping',
|
||||
displayText: `应用库存列映射(任务 ${task})`,
|
||||
displayText: tt('chat.shippingNoticeTurn.applyMapping', { taskId: task }),
|
||||
payload: { task_no: task, map_json: mapping },
|
||||
refs: buildShippingTurnRefs(task),
|
||||
};
|
||||
|
||||
@@ -37,7 +37,12 @@ const createContext = (
|
||||
warning: vi.fn(),
|
||||
success: vi.fn(),
|
||||
},
|
||||
t: (key: string) => key,
|
||||
t: (key: string, params?: Record<string, unknown>) => {
|
||||
if (key === 'chat.shippingNoticeTurn.withTaskId' && params) {
|
||||
return `${params.text}\n任务编号:${params.taskId}`;
|
||||
}
|
||||
return key;
|
||||
},
|
||||
...overrides,
|
||||
});
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export function createShippingDecisionHandlers(ctx: ShippingDecisionContext) {
|
||||
const ok = await ctx.startChatTurn({
|
||||
agentId: ctx.currentAgentId.value,
|
||||
inputType: 'action',
|
||||
displayText: options?.silent ? userText : `${userText}\n任务编号:${taskId}`,
|
||||
displayText: options?.silent ? userText : ctx.t('chat.shippingNoticeTurn.withTaskId', { text: userText, taskId }),
|
||||
actionType: turnSpec.actionType,
|
||||
payload: turnSpec.payload,
|
||||
refs: buildShippingTurnRefs(taskId, ctx.getActiveShippingBatchNo()),
|
||||
@@ -121,7 +121,7 @@ export function createShippingDecisionHandlers(ctx: ShippingDecisionContext) {
|
||||
const normalizedTaskId = String(taskId || '').trim().toUpperCase();
|
||||
if (!normalizedTaskId || manualUploadInFlightTaskIds.has(normalizedTaskId)) return false;
|
||||
manualUploadInFlightTaskIds.add(normalizedTaskId);
|
||||
const userText = (displayText || '我已在货代系统完成上传').trim();
|
||||
const userText = (displayText || ctx.t('chat.shippingNoticeToast.manualUploadedDefault')).trim();
|
||||
try {
|
||||
const ok = await ctx.startChatTurn({
|
||||
agentId: ctx.currentAgentId.value,
|
||||
@@ -145,7 +145,7 @@ export function createShippingDecisionHandlers(ctx: ShippingDecisionContext) {
|
||||
});
|
||||
return ok;
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '标记手工上传失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.markManualUploadFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
return false;
|
||||
} finally {
|
||||
|
||||
@@ -26,6 +26,7 @@ export interface ShippingMappingFormContext {
|
||||
currentAgentId: import('vue').ComputedRef<number>;
|
||||
refreshShippingActions: () => Promise<void>;
|
||||
msg: { warning: (text: string) => void };
|
||||
t: (key: string, params?: Record<string, unknown>) => string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +73,7 @@ export function createShippingMappingFormHandlers(ctx: ShippingMappingFormContex
|
||||
}
|
||||
const schemaPreview = ctx.shippingInventorySchemaPreviewCache.value[id];
|
||||
if (!schemaPreview || typeof schemaPreview !== 'object') {
|
||||
ctx.msg.warning('未找到表头预览,请重新上传库存文件后再点击“修改映射”');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.schemaPreviewMissing'));
|
||||
return false;
|
||||
}
|
||||
const detail = await getWorkspaceShippingTask(id).catch(() => null);
|
||||
@@ -87,8 +88,8 @@ export function createShippingMappingFormHandlers(ctx: ShippingMappingFormContex
|
||||
role: 'assistant',
|
||||
type: 'shipping-inventory-mapping',
|
||||
content: [
|
||||
'请用下拉框选择库存列映射(必须从表头中选择)。',
|
||||
`任务编号:${id}`,
|
||||
ctx.t('chat.shippingNoticeToast.mappingFormIntro'),
|
||||
ctx.t('chat.shippingNoticeDecisionFormat.taskIdLine', { taskId: id }),
|
||||
].filter(Boolean).join('\n'),
|
||||
payload: {
|
||||
taskId: id,
|
||||
@@ -116,7 +117,7 @@ export function createShippingMappingFormHandlers(ctx: ShippingMappingFormContex
|
||||
if (payload.applying) return;
|
||||
const taskId = String(payload.taskId || '').trim();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning('未找到任务编号');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeMissingTaskId'));
|
||||
return;
|
||||
}
|
||||
const mapping: Record<string, string> = {
|
||||
@@ -125,7 +126,7 @@ export function createShippingMappingFormHandlers(ctx: ShippingMappingFormContex
|
||||
reservation_id: String(payload.form?.reservation_id || '').trim(),
|
||||
};
|
||||
if (!mapping.sku || !mapping.available_qty) {
|
||||
ctx.msg.warning('请先选择 SKU 列 与 可用数量列');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.selectSkuAndQty'));
|
||||
return;
|
||||
}
|
||||
if (!mapping.reservation_id) {
|
||||
@@ -148,9 +149,9 @@ export function createShippingMappingFormHandlers(ctx: ShippingMappingFormContex
|
||||
},
|
||||
},
|
||||
});
|
||||
if (!ok) ctx.msg.warning('应用映射失败');
|
||||
if (!ok) ctx.msg.warning(ctx.t('chat.shippingNoticeToast.applyMappingFailed'));
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '应用映射失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.applyMappingFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
} finally {
|
||||
payload.applying = false;
|
||||
|
||||
@@ -95,7 +95,7 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
const actionId = String(action.id || '').trim();
|
||||
const turnSpec = resolveShippingChatTurn(actionId, taskId, extra);
|
||||
if (!turnSpec) return false;
|
||||
const displayBase = String(action.message || actionId || '操作').trim();
|
||||
const displayBase = String(action.message || actionId || ctx.t('chat.shippingNoticeToast.actionFallback')).trim();
|
||||
const displayText = actionId === 'confirm_inventory_source'
|
||||
? ctx.t('chat.shippingNoticeUi.inventorySource.confirmWithTask', { taskId })
|
||||
: ctx.t('chat.shippingNoticeUi.inventorySource.actionWithTask', { message: displayBase, taskId });
|
||||
@@ -138,7 +138,7 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
try {
|
||||
await downloadWorkspaceShippingExcelFile(taskId);
|
||||
} catch (e: unknown) {
|
||||
ctx.msg.warning(e instanceof Error ? e.message : '下载 Excel 失败');
|
||||
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.downloadExcelFailed'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
}
|
||||
}
|
||||
if (action.id === 'mark_manual_uploaded') {
|
||||
await ctx.executeShippingManualUpload(taskId, '我已在货代系统完成上传');
|
||||
await ctx.executeShippingManualUpload(taskId, ctx.t('chat.shippingNoticeToast.manualUploadedDefault'));
|
||||
return;
|
||||
}
|
||||
const label = String(('label' in action ? action.label : '') || sourceCode).trim();
|
||||
@@ -187,7 +187,7 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
sourceCode ? { sourceCode } : undefined,
|
||||
);
|
||||
} catch (e: unknown) {
|
||||
ctx.msg.warning(e instanceof Error ? e.message : '操作失败');
|
||||
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.operationFailed'));
|
||||
if (chatMsg) chatMsg.shipping_actions_used = false;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -23,6 +23,7 @@ export interface ShippingParseReviewContext {
|
||||
saveLocalMessageToBackend: (msg: ChatMessage, userQuery?: string) => Promise<void>;
|
||||
refreshShippingActions: () => Promise<void>;
|
||||
msg: { warning: (text: string) => void };
|
||||
t: (key: string, params?: Record<string, unknown>) => string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,12 +64,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
|
||||
payload.saving = true;
|
||||
const taskId = String(payload.taskId || '').trim().toUpperCase();
|
||||
try {
|
||||
await updateWorkspaceShippingNoticeFields(taskId, fields, '聊天区订单表修订');
|
||||
await updateWorkspaceShippingNoticeFields(taskId, fields, ctx.t('chat.shippingNoticeToast.auditCommentHeaderEdit'));
|
||||
await syncShippingParseReviewCard(taskId);
|
||||
await ctx.refreshShippingActions();
|
||||
return true;
|
||||
} catch (e: unknown) {
|
||||
ctx.msg.warning(e instanceof Error ? e.message : '更新解析结果失败');
|
||||
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.updateParseFailed'));
|
||||
return false;
|
||||
} finally {
|
||||
const current = getShippingParseReviewPayload(msgObj);
|
||||
@@ -86,12 +87,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
|
||||
payload.saving = true;
|
||||
const taskId = String(payload.taskId || '').trim().toUpperCase();
|
||||
try {
|
||||
await updateWorkspaceShippingNoticeLine(taskId, lineIndex, patch, '聊天区订单表修订');
|
||||
await updateWorkspaceShippingNoticeLine(taskId, lineIndex, patch, ctx.t('chat.shippingNoticeToast.auditCommentHeaderEdit'));
|
||||
await syncShippingParseReviewCard(taskId);
|
||||
await ctx.refreshShippingActions();
|
||||
return true;
|
||||
} catch (e: unknown) {
|
||||
ctx.msg.warning(e instanceof Error ? e.message : '更新解析结果失败');
|
||||
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.updateParseFailed'));
|
||||
return false;
|
||||
} finally {
|
||||
const current = getShippingParseReviewPayload(msgObj);
|
||||
@@ -108,12 +109,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
|
||||
payload.saving = true;
|
||||
const taskId = String(payload.taskId || '').trim().toUpperCase();
|
||||
try {
|
||||
await addWorkspaceShippingNoticeLine(taskId, line, '聊天区订单表新增行');
|
||||
await addWorkspaceShippingNoticeLine(taskId, line, ctx.t('chat.shippingNoticeToast.auditCommentLineAdd'));
|
||||
await syncShippingParseReviewCard(taskId);
|
||||
await ctx.refreshShippingActions();
|
||||
return true;
|
||||
} catch (e: unknown) {
|
||||
ctx.msg.warning(e instanceof Error ? e.message : '新增订单行失败');
|
||||
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.addLineFailed'));
|
||||
return false;
|
||||
} finally {
|
||||
const current = getShippingParseReviewPayload(msgObj);
|
||||
@@ -130,12 +131,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
|
||||
payload.saving = true;
|
||||
const taskId = String(payload.taskId || '').trim().toUpperCase();
|
||||
try {
|
||||
await removeWorkspaceShippingNoticeLine(taskId, lineIndex, '聊天区订单表删除行');
|
||||
await removeWorkspaceShippingNoticeLine(taskId, lineIndex, ctx.t('chat.shippingNoticeToast.auditCommentLineDelete'));
|
||||
await syncShippingParseReviewCard(taskId);
|
||||
await ctx.refreshShippingActions();
|
||||
return true;
|
||||
} catch (e: unknown) {
|
||||
ctx.msg.warning(e instanceof Error ? e.message : '删除订单行失败');
|
||||
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.deleteLineFailed'));
|
||||
return false;
|
||||
} finally {
|
||||
const current = getShippingParseReviewPayload(msgObj);
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
getWorkspaceShippingBatch,
|
||||
getWorkspaceShippingTask,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
import { SHIPPING_DECISION_ACTIONS, SHIPPING_MENU_ACTION_SPECS } from '../constants/shipping';
|
||||
import { SHIPPING_DECISION_ACTIONS, resolveShippingMenuActionSpec } from '../constants/shipping';
|
||||
import { buildShippingApplyMappingTurn, buildShippingSwitchFocusTurn } from './shippingTurnActions';
|
||||
import { downloadWorkspaceShippingExcelFile } from './shippingDownload';
|
||||
import {
|
||||
@@ -137,14 +137,14 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
if (!intent) return false;
|
||||
const batchNo = ctx.getActiveShippingBatchNo();
|
||||
if (!batchNo) {
|
||||
ctx.msg.warning('当前没有可切换的批次');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.noBatchToSwitch'));
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
const detail = await getWorkspaceShippingBatch(batchNo);
|
||||
const tasks = Array.isArray(detail.tasks) ? detail.tasks : [];
|
||||
if (tasks.length <= 1) {
|
||||
ctx.msg.info('当前批次只有 1 票,无需切换');
|
||||
ctx.msg.info(ctx.t('chat.shippingNoticeToast.batchOnlyOneTask'));
|
||||
return true;
|
||||
}
|
||||
const focusTaskNo = String(detail.focus_task?.task_no || detail.current_focus_task_no || '').trim().toUpperCase();
|
||||
@@ -158,11 +158,17 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
targetTaskNo = String(tasks[Math.max(currentIndex - 1, 0)]?.task_no || '').trim().toUpperCase();
|
||||
}
|
||||
if (!targetTaskNo) {
|
||||
ctx.msg.warning('未找到要切换的任务');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.taskNotFoundToSwitch'));
|
||||
return true;
|
||||
}
|
||||
if (targetTaskNo === focusTaskNo) {
|
||||
ctx.msg.info(intent.mode === 'next' ? '已经是最后一票' : intent.mode === 'prev' ? '已经是第一票' : '已在当前任务');
|
||||
ctx.msg.info(
|
||||
intent.mode === 'next'
|
||||
? ctx.t('chat.shippingNoticeToast.alreadyLastTask')
|
||||
: intent.mode === 'prev'
|
||||
? ctx.t('chat.shippingNoticeToast.alreadyFirstTask')
|
||||
: ctx.t('chat.shippingNoticeToast.alreadyOnCurrentTask'),
|
||||
);
|
||||
return true;
|
||||
}
|
||||
ctx.resolvedShippingTaskId.value = targetTaskNo;
|
||||
@@ -181,7 +187,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
},
|
||||
});
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '切换任务失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.switchTaskFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
}
|
||||
return true;
|
||||
@@ -215,7 +221,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
try {
|
||||
await ctx.handleShippingAutoUploadNoticeBatch([]);
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '文件处理失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.fileProcessFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
}
|
||||
return true;
|
||||
@@ -233,7 +239,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
const localFiles = ctx.attachments.value.filter((a) => a.kind === 'local') as Array<Extract<PendingAttachment, { kind: 'local' }>>;
|
||||
const first = localFiles[0];
|
||||
if (!first) {
|
||||
ctx.msg.warning('当前仅支持本地附件触发自动流程');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.localAttachmentOnly'));
|
||||
return true;
|
||||
}
|
||||
const kind = classifyShippingUploadFile(first.file, extractExt);
|
||||
@@ -241,12 +247,12 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
ctx.attachments.value = [];
|
||||
if (typeof textOrEvent !== 'string') ctx.input.value = '';
|
||||
if (localFiles.length > 1) {
|
||||
ctx.msg.warning('一次仅支持处理一个文件,将自动处理第一个');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.oneFileOnlyAutoFirst'));
|
||||
}
|
||||
try {
|
||||
await ctx.handleShippingAutoUploadFile(first.file);
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '文件处理失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.fileProcessFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
}
|
||||
return true;
|
||||
@@ -257,7 +263,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
try {
|
||||
await ctx.handleShippingAutoUploadNoticeBatch(localFiles.map((item) => item.file));
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '文件处理失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.fileProcessFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
}
|
||||
return true;
|
||||
@@ -310,11 +316,11 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
ctx.msg.info(ctx.t('chat.shippingNoticePasteHint'));
|
||||
return true;
|
||||
} else if (SHIPPING_DECISION_ACTIONS.has(menuChoice)) {
|
||||
const spec = SHIPPING_MENU_ACTION_SPECS[menuChoice];
|
||||
await ctx.executeShippingDecision(menuChoice, spec?.label || spec?.message || menuChoice);
|
||||
const spec = resolveShippingMenuActionSpec(menuChoice, ctx.t);
|
||||
await ctx.executeShippingDecision(menuChoice, spec.label || spec.message || menuChoice);
|
||||
return true;
|
||||
} else {
|
||||
await ctx.sendShippingMenuMessage(SHIPPING_MENU_ACTION_SPECS[menuChoice].message);
|
||||
await ctx.sendShippingMenuMessage(resolveShippingMenuActionSpec(menuChoice, ctx.t).message);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -323,12 +329,13 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
if (typeof textOrEvent !== 'string') ctx.input.value = '';
|
||||
if (await ctx.executeShippingDecision(shippingDecision, content.trim())) return true;
|
||||
}
|
||||
// [NLU] 助手上下文含中文「列映射/字段对齐」时进入映射文本解析
|
||||
if (assistantCtx.includes('schema_preview') || assistantCtx.includes('列映射') || assistantCtx.includes('字段对齐')) {
|
||||
const mapping = parseShippingColumnMappingFromText(content);
|
||||
if (mapping) {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning('未找到任务编号,请先上传库存文件');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.missingTaskIdUploadInventory'));
|
||||
return true;
|
||||
}
|
||||
ctx.resolvedShippingTaskId.value = taskId;
|
||||
@@ -338,7 +345,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
await ctx.startChatTurn({
|
||||
agentId: ctx.currentAgentId.value,
|
||||
inputType: 'form_submit',
|
||||
displayText: `${content.trim()}\n任务编号:${taskId}`,
|
||||
displayText: ctx.t('chat.shippingNoticeTurn.withTaskId', { text: content.trim(), taskId }),
|
||||
actionType: turn.actionType,
|
||||
payload: turn.payload,
|
||||
refs: turn.refs,
|
||||
@@ -354,7 +361,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
if (isShippingManualUploadIntent(content)) {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning('未找到任务编号,请先完成前面的步骤');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.missingTaskIdPreviousSteps'));
|
||||
return true;
|
||||
}
|
||||
ctx.resolvedShippingTaskId.value = taskId;
|
||||
@@ -370,7 +377,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
if (isShippingGenerateExcelIntent(content)) {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning('未找到任务编号,请先完成解析与库存匹配');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.missingTaskIdParseMatch'));
|
||||
return true;
|
||||
}
|
||||
ctx.resolvedShippingTaskId.value = taskId;
|
||||
@@ -382,7 +389,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
if (isShippingDownloadExcelIntent(content)) {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning('未找到任务编号,请先完成解析与库存匹配');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.missingTaskIdParseMatch'));
|
||||
return true;
|
||||
}
|
||||
ctx.resolvedShippingTaskId.value = taskId;
|
||||
@@ -391,7 +398,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
try {
|
||||
await downloadWorkspaceShippingExcelFile(taskId);
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '下载 Excel 失败';
|
||||
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.downloadExcelFailed');
|
||||
ctx.msg.warning(errorMessage);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -382,7 +382,7 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
|
||||
syncBatchContextFromNoticeResponse(created as unknown as Record<string, unknown>);
|
||||
taskId = String(created.task_id || '').trim();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning('自动创建发货任务失败');
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeToast.autoCreateTaskFailed'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* features/chat/training/trainingChatQuestions.ts
|
||||
* 用途:统一维护员工培训 Agent 的员工版 / HR 版聊天常见问题默认值与解析逻辑。
|
||||
* 依赖:被 Admin 后台培训配置表单与 Chat 欢迎区共同引用,避免默认问题与字段名出现多份散落副本。
|
||||
* 逻辑:优先读取 extra_config.training_config 中的角色化问题列表;未配置时回退到内置示例,显式保存空数组时尊重为空。
|
||||
* 依赖:vue-i18n(默认问题从 chat.training.defaultQuestions.* 读取)、Admin 培训配置表单与 Chat 欢迎区。
|
||||
* 逻辑:优先读取 extra_config.training_config 中的角色化问题列表;未配置时回退到 i18n 内置示例,显式保存空数组时尊重为空。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
|
||||
export type TrainingChatQuestionRole = 'employee' | 'hr';
|
||||
|
||||
@@ -12,19 +13,25 @@ const TRAINING_ROLE_QUESTION_KEYS: Record<TrainingChatQuestionRole, string[]> =
|
||||
hr: ['hr_chat_suggested_questions', 'admin_chat_suggested_questions'],
|
||||
};
|
||||
|
||||
export const DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS = [
|
||||
'这次员工培训主要学习什么内容?',
|
||||
'完成培训需要经过哪些步骤?',
|
||||
'员工培训的通过规则是什么?',
|
||||
'开始考试前需要注意什么?',
|
||||
];
|
||||
/**
|
||||
* 读取当前语言下的培训默认常见问题列表。
|
||||
* 核心逻辑:从 chat.training.defaultQuestions.{role} 取数组;非数组时回退空列表。
|
||||
* @param role - employee | hr
|
||||
*/
|
||||
const resolveLocalizedDefaultQuestions = (role: TrainingChatQuestionRole): string[] => {
|
||||
// tm 在严格 locale 类型下可能推断为 never;运行时仍为 string[]
|
||||
const raw = i18n.global.tm(`chat.training.defaultQuestions.${role}`) as unknown;
|
||||
if (Array.isArray(raw)) {
|
||||
return raw.map((item: unknown) => String(item || '').trim()).filter(Boolean);
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
||||
export const DEFAULT_TRAINING_HR_CHAT_QUESTIONS = [
|
||||
'现在有多少人参加了培训?',
|
||||
'当前培训通过率是多少?',
|
||||
'哪些员工还没有完成培训?',
|
||||
'我想查看本月培训成绩统计',
|
||||
];
|
||||
/** @deprecated 兼容 Admin 表单旧引用:返回当前语言默认员工问题 */
|
||||
export const DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS = resolveLocalizedDefaultQuestions('employee');
|
||||
|
||||
/** @deprecated 兼容 Admin 表单旧引用:返回当前语言默认 HR 问题(模块加载时快照) */
|
||||
export const DEFAULT_TRAINING_HR_CHAT_QUESTIONS = resolveLocalizedDefaultQuestions('hr');
|
||||
|
||||
const asRecord = (value: unknown): Record<string, unknown> => (
|
||||
value && typeof value === 'object' && !Array.isArray(value)
|
||||
@@ -49,10 +56,12 @@ const normalizeTrainingChatQuestionList = (value: unknown): string[] => {
|
||||
.filter(Boolean);
|
||||
};
|
||||
|
||||
const getDefaultQuestions = (role: TrainingChatQuestionRole) => (
|
||||
role === 'hr'
|
||||
? cloneQuestions(DEFAULT_TRAINING_HR_CHAT_QUESTIONS)
|
||||
: cloneQuestions(DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS)
|
||||
/**
|
||||
* 获取培训角色默认常见问题(按当前 i18n 语言实时解析)。
|
||||
* @param role - employee | hr
|
||||
*/
|
||||
export const getDefaultTrainingChatQuestions = (role: TrainingChatQuestionRole): string[] => (
|
||||
cloneQuestions(resolveLocalizedDefaultQuestions(role))
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -69,7 +78,7 @@ export const resolveTrainingRoleChatQuestions = (
|
||||
if (!matchedKey) {
|
||||
return {
|
||||
configured: false,
|
||||
questions: getDefaultQuestions(role),
|
||||
questions: getDefaultTrainingChatQuestions(role),
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* features/chat/utils/fileCheckExcelDownload.ts
|
||||
* 用途:解析文件检核 Excel 下载链接,并通过 Workspace 会话鉴权下载(不依赖短期 JWT)。
|
||||
* 依赖:getAuthHeaders。
|
||||
* 依赖:getAuthHeaders、vue-i18n。
|
||||
* 逻辑:ChatMessageBubble 点击 Dify 返回的 Tool API 链接时,改走 workspace 下载接口以支持历史对话。
|
||||
*/
|
||||
|
||||
import i18n from '@/i18n';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
|
||||
const FILE_CHECK_TOOL_EXCEL_PATH_RE = /\/api\/file-check\/tools\/runs\/(\d+)\/excel(?:\?.*)?$/i;
|
||||
@@ -71,6 +72,7 @@ const parseDownloadFilename = (disposition: string | null, fallback: string) =>
|
||||
|
||||
/**
|
||||
* 通过 Workspace 接口下载检核 Excel(使用登录态,不依赖 Tool API 短期 token)。
|
||||
* 核心逻辑:fetch blob;失败优先用后端 message,否则 chat.toolRun.downloadFailedStatus。
|
||||
* @param runId - 检核批次 ID。
|
||||
* @param fallbackName - 默认文件名。
|
||||
*/
|
||||
@@ -86,7 +88,7 @@ export async function downloadFileCheckExcelByRunId(
|
||||
? body.message
|
||||
: typeof body?.error?.message === 'string'
|
||||
? body.error.message
|
||||
: `下载失败:${res.status}`;
|
||||
: String(i18n.global.t('chat.toolRun.downloadFailedStatus', { status: res.status }));
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
/**
|
||||
* features/kb/api/kb.api.ts
|
||||
* 知识库 HTTP API。
|
||||
* 用途:知识库 HTTP API 封装。
|
||||
* 依赖:auth、requestJson/BusinessError、vue-i18n(错误 fallback 文案)。
|
||||
* 逻辑:KbWorkspace / composables 调用;失败时优先保留 BusinessError.message,否则回退本地化 fallback。
|
||||
*/
|
||||
import i18n from '@/i18n';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import { BusinessError, requestJson } from '@/shared/api/client';
|
||||
|
||||
const kbT = (key: string) => String(i18n.global.t(key));
|
||||
const kbErrorMessage = (e: unknown, fallbackKey: string) =>
|
||||
(e as Error).message || kbT(fallbackKey);
|
||||
|
||||
export interface KbGroup {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -137,8 +144,6 @@ export interface KbListResponse<T> {
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
const jsonAuth = () => ({ headers: { 'Content-Type': 'application/json', ...getAuthHeaders() } });
|
||||
|
||||
const kbErrorMessage = (e: unknown, fallback: string) => (e as Error).message || fallback;
|
||||
|
||||
const getJson = async <T>(path: string, fallback: T): Promise<T> => {
|
||||
try {
|
||||
return await requestJson<T>(path, auth());
|
||||
@@ -156,7 +161,7 @@ const getJsonWithStatus = async <T>(path: string, fallback: T): Promise<KbListRe
|
||||
return {
|
||||
ok: false,
|
||||
data: fallback,
|
||||
error: kbErrorMessage(e, '知识库接口请求失败'),
|
||||
error: kbErrorMessage(e, 'kbWorkspace.errors.apiRequestFailed'),
|
||||
status: err.status,
|
||||
};
|
||||
}
|
||||
@@ -190,7 +195,7 @@ export const createKbGroup = async (payload: {
|
||||
});
|
||||
return { ok: true, group };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '创建知识库分组失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.createGroupFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -217,7 +222,7 @@ export const updateKbDifySettings = async (
|
||||
});
|
||||
return { ok: true, settings };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '保存 Dify 设置失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.saveDifySettingsFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -235,7 +240,7 @@ export const runKbJob = async (
|
||||
});
|
||||
return { ok: true, job, run_result: job.run_result };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '执行任务失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.executeJobFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -251,7 +256,7 @@ export const createKbDocument = async (
|
||||
});
|
||||
return { ok: true, document };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '创建文档失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.createDocumentFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -267,7 +272,7 @@ export const updateKbDocument = async (
|
||||
});
|
||||
return { ok: true, document };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '更新文档失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.updateDocumentFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -278,7 +283,7 @@ export const deleteKbDocument = async (
|
||||
await requestJson(`/api/kb/documents/${documentId}`, { method: 'DELETE', ...auth() });
|
||||
return { ok: true };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '删除文档失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.deleteDocumentFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -296,7 +301,7 @@ export const getKbDocumentVersionSourceFile = async (
|
||||
headers: getAuthHeaders(),
|
||||
});
|
||||
if (!res.ok) {
|
||||
let message = '读取原始文件失败';
|
||||
let message = kbT('kbWorkspace.msg.readSourceFailed');
|
||||
try {
|
||||
const data = await res.json();
|
||||
if (typeof data?.error === 'string' && data.error.trim()) message = data.error;
|
||||
@@ -316,7 +321,7 @@ export const getKbDocumentVersionSourceFile = async (
|
||||
contentType: res.headers.get('content-type') || undefined,
|
||||
};
|
||||
} catch {
|
||||
return { ok: false, error: '知识库接口暂未就绪,请稍后再试' };
|
||||
return { ok: false, error: kbT('kbWorkspace.msg.apiNotReady') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -333,7 +338,7 @@ export const getKbDocumentMarkdown = async (
|
||||
const data = await requestJson<KbDocumentMarkdown>(`/api/kb/documents/${documentId}/markdown`, auth());
|
||||
return { ok: true, data };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '读取清洗后的 Markdown 失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.readMarkdownFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -349,7 +354,7 @@ export const updateKbDocumentMarkdown = async (
|
||||
});
|
||||
return { ok: true, data };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '保存 Markdown 失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.saveMarkdownFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -371,11 +376,11 @@ export const uploadKbDocumentVersion = async (
|
||||
if (err.status === 413) {
|
||||
return {
|
||||
ok: false,
|
||||
error: '文件过大,超过当前上传限制,请联系管理员放宽限制后重试',
|
||||
error: kbT('kbWorkspace.msg.fileTooLarge'),
|
||||
status: 413,
|
||||
};
|
||||
}
|
||||
return { ok: false, error: kbErrorMessage(e, '上传文档版本失败'), status: err.status };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.uploadVersionFailed'), status: err.status };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -390,7 +395,7 @@ export const submitKbDocumentClean = async (
|
||||
return { ok: true, job, message: job.message || undefined };
|
||||
} catch (e) {
|
||||
const err = e as BusinessError;
|
||||
return { ok: false, error: kbErrorMessage(e, '提交清洗任务失败'), status: err.status };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.submitCleanFailed'), status: err.status };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -411,7 +416,7 @@ export const createKbPathUploadJob = async (
|
||||
return { ok: true, job };
|
||||
} catch (e) {
|
||||
const err = e as BusinessError;
|
||||
return { ok: false, error: kbErrorMessage(e, '创建路径上传任务失败'), status: err.status };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.createPathJobFailed'), status: err.status };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -435,11 +440,11 @@ export const uploadKbPathJobFile = async (
|
||||
if (err.status === 413) {
|
||||
return {
|
||||
ok: false,
|
||||
error: '文件过大,超过当前上传限制,请联系管理员放宽限制后重试',
|
||||
error: kbT('kbWorkspace.msg.fileTooLarge'),
|
||||
status: 413,
|
||||
};
|
||||
}
|
||||
return { ok: false, error: kbErrorMessage(e, '上传路径文件失败'), status: err.status };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.uploadPathFileFailed'), status: err.status };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -455,7 +460,7 @@ export const markKbPathJobFileFailed = async (
|
||||
});
|
||||
return { ok: true, job };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '记录路径文件失败状态失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.markPathFileFailedStatusFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -469,7 +474,7 @@ export const finalizeKbPathUploadJob = async (
|
||||
});
|
||||
return { ok: true, job };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '提交路径上传任务失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.submitPathUploadFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -486,7 +491,7 @@ export const retryFailedKbPathUploadJob = async (
|
||||
return { ok: true, job };
|
||||
} catch (e) {
|
||||
const err = e as BusinessError;
|
||||
return { ok: false, error: kbErrorMessage(e, '重试失败文件失败'), status: err.status };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.retryPathFailed'), status: err.status };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -502,7 +507,7 @@ export const deleteKbPathJobFile = async (
|
||||
);
|
||||
return { ok: true, job: result.job, document_deleted: result.document_deleted };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '删除路径上传文件失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.deletePathFileFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -516,7 +521,7 @@ export const syncKbDocumentToDify = async (
|
||||
});
|
||||
return { ok: true, job };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '同步到 Dify 失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.syncDifyFailedGeneric') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -532,7 +537,7 @@ export const updateKbGroup = async (
|
||||
});
|
||||
return { ok: true, group };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '更新知识库分组失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.updateGroupFailed') };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -543,6 +548,6 @@ export const deleteKbGroup = async (
|
||||
await requestJson(`/api/kb/groups/${groupId}`, { method: 'DELETE', ...auth() });
|
||||
return { ok: true };
|
||||
} catch (e) {
|
||||
return { ok: false, error: kbErrorMessage(e, '删除知识库分组失败') };
|
||||
return { ok: false, error: kbErrorMessage(e, 'kbWorkspace.msg.deleteGroupFailed') };
|
||||
}
|
||||
};
|
||||
@@ -58,7 +58,9 @@ export const getDocumentDisplayDescription = (doc: KbDocumentItem, t: KbTranslat
|
||||
return text || getDocumentDisplayTitle(doc, t);
|
||||
};
|
||||
|
||||
/** 将后端重复文档错误归一为前端可展示的简短文案 */
|
||||
/** 将后端重复文档错误归一为前端可展示的简短文案。
|
||||
* [NLU] includes() 匹配后端中文错误原文,刻意保留;返回值走 i18n。
|
||||
*/
|
||||
export const normalizeDuplicateDocumentError = (message: string | null | undefined, t: KbTranslateFn) => {
|
||||
const text = String(message || '').trim();
|
||||
if (!text) return t('kbWorkspace.errors.apiRequestFailed');
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/**
|
||||
* features/maintenance/components/MaintenanceRecordPanel.vue
|
||||
* 用途:设备维保助手右侧固定面板中的“新增维修记录”页面。
|
||||
* 依赖:maintenanceRecord.api、maintenanceLedger.api、MaintenanceDeviceSnapshotCard、useMessage。
|
||||
* 依赖:maintenanceRecord.api、maintenanceLedger.api、MaintenanceDeviceSnapshotCard、useMessage、vue-i18n。
|
||||
* 逻辑:管理员通过按钮进入固定面板后填写维修记录;设备编号失焦时查询台账快照,保存后刷新最近记录用于确认。
|
||||
*/
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import MaintenanceDeviceSnapshotCard from '@/features/maintenance/components/MaintenanceDeviceSnapshotCard.vue';
|
||||
import { listMaintenanceDevices } from '@/features/maintenance/api/maintenanceLedger.api';
|
||||
@@ -19,8 +20,10 @@ import type {
|
||||
MaintenanceRecordPayload,
|
||||
MaintenanceRepairStatus,
|
||||
} from '@/features/maintenance/types/record.types';
|
||||
import { repairStatusLabelKey } from '@/features/maintenance/utils/repair-status-display.utils';
|
||||
|
||||
const msg = useMessage();
|
||||
const { t } = useI18n();
|
||||
const saving = ref(false);
|
||||
const deviceLoading = ref(false);
|
||||
const recentLoading = ref(false);
|
||||
@@ -49,24 +52,28 @@ const form = reactive<MaintenanceRecordPayload>({
|
||||
});
|
||||
|
||||
const statusOptions: Array<{ value: MaintenanceRepairStatus | ''; label: string }> = [
|
||||
{ value: '', label: '全部状态' },
|
||||
{ value: 'pending', label: '待维修' },
|
||||
{ value: 'processing', label: '维修中' },
|
||||
{ value: 'done', label: '已完成' },
|
||||
{ value: 'cancelled', label: '已取消' },
|
||||
{ value: '', label: 'maintenance.record.status.all' },
|
||||
{ value: 'pending', label: 'maintenance.record.status.pending' },
|
||||
{ value: 'processing', label: 'maintenance.record.status.processing' },
|
||||
{ value: 'done', label: 'maintenance.record.status.done' },
|
||||
{ value: 'cancelled', label: 'maintenance.record.status.cancelled' },
|
||||
];
|
||||
|
||||
const selectedStatusLabel = computed(() => {
|
||||
return statusOptions.find((item) => item.value === form.repairStatus)?.label || form.repairStatus;
|
||||
const key = repairStatusLabelKey(form.repairStatus);
|
||||
return key ? t(key) : form.repairStatus;
|
||||
});
|
||||
|
||||
/**
|
||||
* 将状态值转换为中文展示。
|
||||
* 将状态值转换为当前语言展示文案。
|
||||
* @param value - 后端状态枚举。
|
||||
* @returns 页面展示文案。
|
||||
*/
|
||||
const formatStatus = (value: string): string => {
|
||||
return statusOptions.find((item) => item.value === value)?.label || value || '-';
|
||||
const key = repairStatusLabelKey(value);
|
||||
if (key) return t(key);
|
||||
const option = statusOptions.find((item) => item.value === value);
|
||||
return option ? t(option.label) : value || '-';
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -103,7 +110,7 @@ const loadDeviceSnapshot = async (): Promise<void> => {
|
||||
const result = await listMaintenanceDevices({ keyword: code, page: 1, pageSize: 5 });
|
||||
matchedDevice.value = result.items.find((item) => item.deviceCode === code) || null;
|
||||
} catch (error: any) {
|
||||
msg.error(error?.message || '查询设备台账失败');
|
||||
msg.error(error?.message || t('maintenance.record.messages.deviceLoadFailed'));
|
||||
} finally {
|
||||
deviceLoading.value = false;
|
||||
}
|
||||
@@ -121,12 +128,12 @@ const ensureDeviceExists = async (): Promise<boolean> => {
|
||||
const result = await listMaintenanceDevices({ keyword: code, page: 1, pageSize: 5 });
|
||||
matchedDevice.value = result.items.find((item) => item.deviceCode === code) || null;
|
||||
if (!matchedDevice.value) {
|
||||
msg.warning('设备不存在,不能新增维修记录');
|
||||
msg.warning(t('maintenance.record.messages.deviceNotFound'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
msg.error(error?.message || '鏌ヨ璁惧鍙拌处澶辫触');
|
||||
msg.error(error?.message || t('maintenance.record.messages.deviceLoadFailed'));
|
||||
return false;
|
||||
} finally {
|
||||
deviceLoading.value = false;
|
||||
@@ -147,7 +154,7 @@ const loadRecentRecords = async (): Promise<void> => {
|
||||
});
|
||||
recentRecords.value = result.items;
|
||||
} catch (error: any) {
|
||||
msg.error(error?.message || '查询维修记录失败');
|
||||
msg.error(error?.message || t('maintenance.record.messages.loadFailed'));
|
||||
} finally {
|
||||
recentLoading.value = false;
|
||||
}
|
||||
@@ -182,7 +189,7 @@ const resetForm = (): void => {
|
||||
const saveRecord = async (): Promise<void> => {
|
||||
const payload = buildPayload();
|
||||
if (!payload.deviceCode || !payload.reportDate || !payload.faultDescription) {
|
||||
msg.warning('设备编号、报修日期和故障描述不能为空');
|
||||
msg.warning(t('maintenance.record.messages.required'));
|
||||
return;
|
||||
}
|
||||
if (!await ensureDeviceExists()) {
|
||||
@@ -191,12 +198,12 @@ const saveRecord = async (): Promise<void> => {
|
||||
saving.value = true;
|
||||
try {
|
||||
await createMaintenanceRecord(payload);
|
||||
msg.success('维修记录已保存');
|
||||
msg.success(t('maintenance.record.messages.saved'));
|
||||
recordKeyword.value = payload.deviceCode;
|
||||
resetForm();
|
||||
await loadRecentRecords();
|
||||
} catch (error: any) {
|
||||
msg.error(error?.message || '保存维修记录失败');
|
||||
msg.error(error?.message || t('maintenance.record.messages.saveFailed'));
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
@@ -209,22 +216,22 @@ onMounted(loadRecentRecords);
|
||||
<section class="flex h-full min-h-0 flex-col gap-4">
|
||||
<form class="min-h-0 flex-1 overflow-auto" @submit.prevent="saveRecord">
|
||||
<div class="mb-4 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900">
|
||||
维修记录为管理员配置入口,查询类问题仍建议通过会话直接提问。
|
||||
{{ t('maintenance.record.notice') }}
|
||||
</div>
|
||||
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
设备编号 *
|
||||
{{ t('maintenance.record.fields.deviceCode') }} *
|
||||
<input
|
||||
v-model="form.deviceCode"
|
||||
class="admin-table-filter-input"
|
||||
placeholder="如 EQ-2026-001"
|
||||
:placeholder="t('maintenance.record.placeholder.deviceCode')"
|
||||
@blur="loadDeviceSnapshot"
|
||||
@keyup.enter.prevent="loadDeviceSnapshot"
|
||||
/>
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
报修日期 *
|
||||
{{ t('maintenance.record.fields.reportDate') }} *
|
||||
<input v-model="form.reportDate" type="date" class="admin-table-filter-input" />
|
||||
</label>
|
||||
</div>
|
||||
@@ -239,94 +246,122 @@ onMounted(loadRecentRecords);
|
||||
|
||||
<div class="mt-4 grid gap-4 md:grid-cols-2">
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修类别
|
||||
<input v-model="form.repairCategory" class="admin-table-filter-input" placeholder="日常维修 / 保养 / 点检" />
|
||||
{{ t('maintenance.record.fields.repairCategory') }}
|
||||
<input
|
||||
v-model="form.repairCategory"
|
||||
class="admin-table-filter-input"
|
||||
:placeholder="t('maintenance.record.placeholder.repairCategory')"
|
||||
/>
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修状态
|
||||
{{ t('maintenance.record.fields.repairStatus') }}
|
||||
<select v-model="form.repairStatus" class="admin-table-filter-input">
|
||||
<option value="pending">待维修</option>
|
||||
<option value="processing">维修中</option>
|
||||
<option value="done">已完成</option>
|
||||
<option value="cancelled">已取消</option>
|
||||
<option value="pending">{{ t('maintenance.record.status.pending') }}</option>
|
||||
<option value="processing">{{ t('maintenance.record.status.processing') }}</option>
|
||||
<option value="done">{{ t('maintenance.record.status.done') }}</option>
|
||||
<option value="cancelled">{{ t('maintenance.record.status.cancelled') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 grid gap-4 md:grid-cols-2">
|
||||
<label class="grid gap-1 text-sm text-secondary md:col-span-2">
|
||||
故障描述 *
|
||||
{{ t('maintenance.record.fields.faultDescription') }} *
|
||||
<textarea v-model="form.faultDescription" class="admin-table-filter-input min-h-24" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
报修人
|
||||
{{ t('maintenance.record.fields.reporter') }}
|
||||
<input v-model="form.reporter" class="admin-table-filter-input" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
审批人
|
||||
{{ t('maintenance.record.fields.approver') }}
|
||||
<input v-model="form.approver" class="admin-table-filter-input" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修日期
|
||||
{{ t('maintenance.record.fields.repairDate') }}
|
||||
<input v-model="form.repairDate" type="date" class="admin-table-filter-input" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修单位
|
||||
{{ t('maintenance.record.fields.repairUnit') }}
|
||||
<input v-model="form.repairUnit" class="admin-table-filter-input" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修人
|
||||
{{ t('maintenance.record.fields.repairer') }}
|
||||
<input v-model="form.repairer" class="admin-table-filter-input" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
来源工单号
|
||||
{{ t('maintenance.record.fields.sourceOrderNo') }}
|
||||
<input v-model="form.sourceOrderNo" class="admin-table-filter-input" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修费用
|
||||
<input v-model="form.repairCost" class="admin-table-filter-input" placeholder="如 1200.00" />
|
||||
{{ t('maintenance.record.fields.repairCost') }}
|
||||
<input
|
||||
v-model="form.repairCost"
|
||||
class="admin-table-filter-input"
|
||||
:placeholder="t('maintenance.record.placeholder.repairCost')"
|
||||
/>
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary">
|
||||
维修工时
|
||||
<input v-model="form.repairHours" class="admin-table-filter-input" placeholder="如 3.5h" />
|
||||
{{ t('maintenance.record.fields.repairHours') }}
|
||||
<input
|
||||
v-model="form.repairHours"
|
||||
class="admin-table-filter-input"
|
||||
:placeholder="t('maintenance.record.placeholder.repairHours')"
|
||||
/>
|
||||
</label>
|
||||
<label class="grid gap-1 text-sm text-secondary md:col-span-2">
|
||||
维修说明
|
||||
{{ t('maintenance.record.fields.repairDescription') }}
|
||||
<textarea v-model="form.repairDescription" class="admin-table-filter-input min-h-24" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="sticky bottom-0 mt-5 flex justify-end gap-2 border-t border-default bg-surface py-3">
|
||||
<button type="button" class="admin-report-page-btn" @click="resetForm">清空</button>
|
||||
<button type="button" class="admin-report-page-btn" @click="resetForm">
|
||||
{{ t('maintenance.record.actions.clear') }}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="admin-report-page-btn admin-report-page-btn--active"
|
||||
:disabled="saving"
|
||||
>
|
||||
{{ saving ? '保存中...' : `保存为${selectedStatusLabel}` }}
|
||||
{{
|
||||
saving
|
||||
? t('maintenance.record.actions.saving')
|
||||
: t('maintenance.record.actions.saveAs', { status: selectedStatusLabel })
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="border-t border-default pt-4">
|
||||
<div class="mb-3 flex items-center justify-between gap-2">
|
||||
<h3 class="text-sm font-semibold text-primary">最近维修记录</h3>
|
||||
<button type="button" class="admin-report-page-btn" @click="loadRecentRecords">刷新</button>
|
||||
<h3 class="text-sm font-semibold text-primary">{{ t('maintenance.record.recentTitle') }}</h3>
|
||||
<button type="button" class="admin-report-page-btn" @click="loadRecentRecords">
|
||||
{{ t('common.refresh') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="mb-3 grid gap-2 md:grid-cols-[1fr_120px_72px]">
|
||||
<input v-model="recordKeyword" class="admin-table-filter-input" placeholder="筛选设备编号、故障、维修人" />
|
||||
<input
|
||||
v-model="recordKeyword"
|
||||
class="admin-table-filter-input"
|
||||
:placeholder="t('maintenance.record.filters.recentKeywordPlaceholder')"
|
||||
/>
|
||||
<select v-model="recordStatus" class="admin-table-filter-input">
|
||||
<option v-for="item in statusOptions" :key="item.value || 'all'" :value="item.value">
|
||||
{{ item.label }}
|
||||
{{ t(item.label) }}
|
||||
</option>
|
||||
</select>
|
||||
<button type="button" class="admin-report-page-btn admin-report-page-btn--active" @click="loadRecentRecords">
|
||||
查询
|
||||
{{ t('maintenance.record.actions.search') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="max-h-56 overflow-auto rounded-xl border border-default bg-surface">
|
||||
<div v-if="recentLoading" class="px-3 py-6 text-center text-sm text-secondary">加载中...</div>
|
||||
<div v-else-if="!recentRecords.length" class="px-3 py-6 text-center text-sm text-secondary">暂无维修记录</div>
|
||||
<div v-if="recentLoading" class="px-3 py-6 text-center text-sm text-secondary">
|
||||
{{ t('maintenance.record.table.loading') }}
|
||||
</div>
|
||||
<div v-else-if="!recentRecords.length" class="px-3 py-6 text-center text-sm text-secondary">
|
||||
{{ t('maintenance.record.table.empty') }}
|
||||
</div>
|
||||
<div
|
||||
v-for="record in recentRecords"
|
||||
v-else
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* features/maintenance/utils/repair-status-display.utils.ts
|
||||
* 用途:维修记录状态在列表、卡片中的标签配色映射。
|
||||
* 用途:维修记录状态在列表、卡片中的标签配色与 i18n key 映射。
|
||||
* 依赖:MaintenanceRepairStatus 类型。
|
||||
* 逻辑:MaintenanceRecordManagerPanel、MaintenanceDeviceResultCard 等组件统一引用,保证状态色一致。
|
||||
* 逻辑:MaintenanceRecordManagerPanel、MaintenanceRecordPanel、MaintenanceDeviceResultCard 等组件统一引用,保证状态色与文案一致。
|
||||
*/
|
||||
import type { MaintenanceRepairStatus } from '@/features/maintenance/types/record.types';
|
||||
|
||||
@@ -18,3 +18,16 @@ export function repairStatusBadgeClass(value: MaintenanceRepairStatus | string):
|
||||
if (value === 'cancelled') return 'border-slate-200 bg-slate-100 text-slate-600';
|
||||
return 'border-slate-200 bg-slate-50 text-slate-600';
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回维修状态对应的 i18n 文案 key,供组件内 t() 翻译。
|
||||
* @param value - 维修状态枚举值。
|
||||
* @returns maintenance.record.status.* 的 key 路径;未知状态返回空字符串。
|
||||
*/
|
||||
export function repairStatusLabelKey(value: MaintenanceRepairStatus | string): string {
|
||||
if (value === 'pending') return 'maintenance.record.status.pending';
|
||||
if (value === 'processing') return 'maintenance.record.status.processing';
|
||||
if (value === 'done') return 'maintenance.record.status.done';
|
||||
if (value === 'cancelled') return 'maintenance.record.status.cancelled';
|
||||
return '';
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/workspace/components/WorkspaceModals.vue
|
||||
* 工作台弹窗:公告详情、快捷问题删除、意见反馈。
|
||||
* 用途:工作台弹窗:公告详情、快捷问题删除、意见反馈。
|
||||
* 依赖:DeleteConfirmDialog、GeneralFeedbackDialog、workspace.context、vue-i18n。
|
||||
* 逻辑:由 WorkspaceLayout 挂载;反馈成功 toast 使用 feedback.msg.submitSuccess。
|
||||
*/
|
||||
import { inject } from 'vue';
|
||||
import { X } from 'lucide-vue-next';
|
||||
@@ -52,7 +54,7 @@ const ws = inject(WORKSPACE_KEY)! as any;
|
||||
v-model="ws.showGeneralFeedbackDialog"
|
||||
:auth-headers="getAuthHeaders()"
|
||||
source-page="workspace"
|
||||
@submitted="ws.msg.success('反馈提交成功')"
|
||||
@submitted="ws.msg.success($t('feedback.msg.submitSuccess'))"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/workspace/composables/useWorkspace.ts
|
||||
* 工作台编排层:组合各子 composable,挂载生命周期,provide 给 Layout 与子页面。
|
||||
* 用途:工作台编排层:组合各子 composable,挂载生命周期,provide 给 Layout 与子页面。
|
||||
* 依赖:useWorkspaceHome/Session/Navigation/Locale、useUserProfile、useChatHistory、useWorkspaceSchedule。
|
||||
* 逻辑:登录校验后 fetchHome;知识库拒绝由 Navigation 内 t(KB_ACCESS_DENIED_KEY) 处理。
|
||||
*/
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
@@ -51,7 +53,6 @@ export function useWorkspace() {
|
||||
const navigation = useWorkspaceNavigation(deps, {
|
||||
isLoggedIn: session.isLoggedIn,
|
||||
hasKnowledgeBaseAccess: session.hasKnowledgeBaseAccess,
|
||||
KB_ACCESS_DENIED_MESSAGE: session.KB_ACCESS_DENIED_MESSAGE,
|
||||
agents: home.agents,
|
||||
layoutSections: home.layoutSections,
|
||||
profileUserId: computed(() => profile.profileUser.value.id),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/workspace/composables/useWorkspaceNavigation.ts
|
||||
* 子路由导航、移动端 Tab、聊天跳转、企微 deeplink 与旧 view 参数兼容。
|
||||
* 用途:子路由导航、移动端 Tab、聊天跳转、企微 deeplink 与旧 view 参数兼容。
|
||||
* 依赖:vue-router、config、auth、requestJson、workspace routes/types。
|
||||
* 逻辑:由 useWorkspace 注入;知识库无权限时 toast t('workspace.kb.accessDenied')。
|
||||
*/
|
||||
import { computed, nextTick, ref, watch, type ComputedRef, type Ref } from 'vue';
|
||||
import { config } from '@/config';
|
||||
@@ -8,7 +10,7 @@ import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import { getLastChatAgentId } from '@/shared/utils/lastChatAgent';
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
import { WORKSPACE_PATHS, workspacePathFromLegacyView } from '../constants/routes';
|
||||
import { DEFAULT_POST_LOGIN_AGENT_ID, type WorkspaceAgent, type WorkspaceSidebarItem } from '../types/workspace.types';
|
||||
import { DEFAULT_POST_LOGIN_AGENT_ID, KB_ACCESS_DENIED_KEY, type WorkspaceAgent, type WorkspaceSidebarItem } from '../types/workspace.types';
|
||||
import type { WorkspaceLayoutSection } from '../types/workspace.types';
|
||||
import type { WorkspaceDeps } from './workspace.deps';
|
||||
|
||||
@@ -27,7 +29,6 @@ const ROUTE_NAME_TO_SIDEBAR: Record<string, WorkspaceSidebarItem> = {
|
||||
interface NavigationOptions {
|
||||
isLoggedIn: ComputedRef<boolean>;
|
||||
hasKnowledgeBaseAccess: ComputedRef<boolean>;
|
||||
KB_ACCESS_DENIED_MESSAGE: string;
|
||||
agents: Ref<WorkspaceAgent[]>;
|
||||
layoutSections: Ref<WorkspaceLayoutSection[]>;
|
||||
profileUserId: ComputedRef<number>;
|
||||
@@ -37,12 +38,17 @@ interface NavigationOptions {
|
||||
loadWorkspaceScheduleRuns: () => Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装工作台侧栏/移动端导航与路由副作用。
|
||||
* 核心逻辑:映射 route.name → sidebar item;无知识库权限时本地化 toast 并拦截跳转。
|
||||
* @param deps - t/msg/router/route
|
||||
* @param options - 登录态、权限与各模块加载回调
|
||||
*/
|
||||
export function useWorkspaceNavigation(deps: WorkspaceDeps, options: NavigationOptions) {
|
||||
const { t, msg, router, route } = deps;
|
||||
const {
|
||||
isLoggedIn,
|
||||
hasKnowledgeBaseAccess,
|
||||
KB_ACCESS_DENIED_MESSAGE,
|
||||
agents,
|
||||
layoutSections,
|
||||
profileUserId,
|
||||
@@ -97,8 +103,11 @@ export function useWorkspaceNavigation(deps: WorkspaceDeps, options: NavigationO
|
||||
const navigateToApplications = () => router.push(WORKSPACE_PATHS.applications);
|
||||
const navigateToUpdates = () => router.push(WORKSPACE_PATHS.updates);
|
||||
|
||||
/**
|
||||
* 弹出知识库无权限提示(四语言)。
|
||||
*/
|
||||
const showKnowledgeBaseAccessDenied = () => {
|
||||
msg.warning(KB_ACCESS_DENIED_MESSAGE);
|
||||
msg.warning(t(KB_ACCESS_DENIED_KEY));
|
||||
};
|
||||
|
||||
const navigateToKnowledgeBase = () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* features/workspace/composables/useWorkspaceSession.ts
|
||||
* 登录态:当前用户、知识库权限判断、登出与 401 清理。
|
||||
* 用途:登录态:当前用户、知识库权限判断、登出与 401 清理。
|
||||
* 依赖:auth utils、workspace.types.WorkspaceUser。
|
||||
* 逻辑:useWorkspace 组合本模块;知识库拒绝文案由导航层 t('workspace.kb.accessDenied') 解析。
|
||||
*/
|
||||
import { computed, type Ref } from 'vue';
|
||||
import { logoutAuth, getStoredAuthUser } from '@/shared/utils/auth';
|
||||
import { KB_ACCESS_DENIED_MESSAGE } from '../types/workspace.types';
|
||||
import type { WorkspaceUser } from '../types/workspace.types';
|
||||
import type { WorkspaceDeps } from './workspace.deps';
|
||||
|
||||
@@ -79,7 +80,6 @@ export function useWorkspaceSession(deps: WorkspaceDeps, options: SessionOptions
|
||||
currentUser,
|
||||
isLoggedIn,
|
||||
hasKnowledgeBaseAccess,
|
||||
KB_ACCESS_DENIED_MESSAGE,
|
||||
loadAuthUser,
|
||||
applyLoggedOutState,
|
||||
handleLogout,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/workspace/types/workspace.types.ts
|
||||
* 工作台相关 TypeScript 类型与业务常量。
|
||||
* 用途:工作台相关 TypeScript 类型与业务常量。
|
||||
* 依赖:wecom utils、chat.types(历史项 re-export)。
|
||||
* 逻辑:composables/views 共享类型;知识库拒绝文案 key 为 KB_ACCESS_DENIED_KEY,由导航层 t() 解析。
|
||||
*/
|
||||
import type { WecomMatchField } from '@/shared/utils/wecom';
|
||||
import type { WecomLoginDialogContent } from '@/shared/utils/wecom';
|
||||
@@ -85,5 +87,6 @@ export const SECTION_TITLE_KEY_MAP: Record<string, string> = {
|
||||
};
|
||||
|
||||
export const DEFAULT_POST_LOGIN_AGENT_ID = 16;
|
||||
export const KB_ACCESS_DENIED_MESSAGE = '需要管理员权限才能访问知识库。';
|
||||
/** 知识库无权限提示的 i18n key(在 toast 使用点调用 t()) */
|
||||
export const KB_ACCESS_DENIED_KEY = 'workspace.kb.accessDenied';
|
||||
export const WS_SCHEDULE_FILTER_INPUT_CLASS = 'admin-table-filter-input text-xs py-1.5 px-2';
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/workspace/views/WorkspaceLayout.vue
|
||||
* 工作台布局壳:初始化 composable、侧边栏、子路由出口与全局弹窗。
|
||||
* 用途:工作台布局壳:初始化 composable、侧边栏、子路由出口与全局弹窗。
|
||||
* 依赖:useWorkspace、WorkspaceSidebar/Modals、ExternalSystemLinks。
|
||||
* 逻辑:provide WORKSPACE_KEY;移动端返回按钮文案走 workspace.nav.backShort。
|
||||
*/
|
||||
import { provide } from 'vue';
|
||||
import { LayoutGrid, Bot, User } from 'lucide-vue-next';
|
||||
@@ -40,7 +42,7 @@ const mobileTabs = [
|
||||
class="flex h-7 w-7 items-center justify-center rounded-lg bg-gradient-to-br from-brand-500 via-brand-600 to-purple-600 text-xs font-bold text-white shadow-sm shadow-brand-500/20"
|
||||
:title="$t('workspace.nav.backToChat')"
|
||||
>
|
||||
返
|
||||
{{ $t('workspace.nav.backShort') }}
|
||||
</button>
|
||||
<span class="text-sm font-semibold text-primary">{{ ws.mobileTabTitle }}</span>
|
||||
</div>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"delete": "Delete",
|
||||
"nav": {
|
||||
"dashboard": "Dashboard",
|
||||
"overview": "Overview",
|
||||
"approvals": "User Approvals",
|
||||
"users": "User Maintenance",
|
||||
"departments": "Departments",
|
||||
@@ -67,6 +68,36 @@
|
||||
}
|
||||
},
|
||||
"platformApps": {
|
||||
"subtitle": "Manage onboarding guides for apps (video, PDF, and more)",
|
||||
"selectAgent": "Select app:",
|
||||
"addGuide": "Add Guide",
|
||||
"editGuide": "Edit Guide",
|
||||
"selectAgentFirst": "Please select an app first",
|
||||
"emptyGuides": "No onboarding guides for this app yet",
|
||||
"colType": "Type",
|
||||
"colFileName": "Guide Name",
|
||||
"colAgent": "Agent App",
|
||||
"colFileSize": "File Size",
|
||||
"colSort": "Order",
|
||||
"colStatus": "Status",
|
||||
"colActions": "Actions",
|
||||
"statusEnabled": "Enabled",
|
||||
"statusDisabled": "Disabled",
|
||||
"confirmDelete": "Delete this guide? This cannot be undone.",
|
||||
"uploadFile": "Upload File",
|
||||
"uploading": "Uploading...",
|
||||
"uploadReady": "File uploaded and ready",
|
||||
"uploadFailed": "Upload failed",
|
||||
"fileName": "Guide Name",
|
||||
"fileNamePlaceholder": "e.g. HR Assistant User Guide",
|
||||
"remark": "Remarks",
|
||||
"remarkPlaceholder": "Brief description...",
|
||||
"sortOrder": "Sort Weight",
|
||||
"sortOrderHint": "Smaller numbers appear first",
|
||||
"status": "Status",
|
||||
"enable": "Enable",
|
||||
"disable": "Disable",
|
||||
"save": "Save",
|
||||
"guideUsage": "Guide Usage",
|
||||
"generalGuide": "General Guide",
|
||||
"trainingVideo": "Employee Training Video",
|
||||
@@ -211,6 +242,11 @@
|
||||
"api": "API Integration (Dify)",
|
||||
"iframe": "Iframe Embed"
|
||||
},
|
||||
"difyAppType": "Dify App Type",
|
||||
"difyAppTypes": {
|
||||
"chatflow": "Chatflow",
|
||||
"workflow": "Workflow"
|
||||
},
|
||||
"appId": "Dify App ID",
|
||||
"apiKey": "API Key",
|
||||
"apiKeyCreatePlaceholder": "Required when creating",
|
||||
@@ -386,7 +422,19 @@
|
||||
"uncategorized": "Uncategorized",
|
||||
"memberCount": "{count} child apps",
|
||||
"normalListHint": "This app only"
|
||||
}
|
||||
},
|
||||
"suggestedQuestions": {
|
||||
"title": "Suggested Questions",
|
||||
"add": "Add Question",
|
||||
"stylePlain": "Plain",
|
||||
"styleStyled": "Styled",
|
||||
"empty": "No suggested questions yet. Click “Add Question” to sync them to this Agent’s Chat welcome page.",
|
||||
"questionPlaceholder": "Enter a question, e.g. How many leave days do I have left?",
|
||||
"groupPlaceholderStyled": "Optional group title, e.g. Attendance & Leave",
|
||||
"groupPlaceholderPlain": "No group needed for plain style"
|
||||
},
|
||||
"createSuccess": "App created successfully",
|
||||
"updateSuccess": "App updated successfully"
|
||||
},
|
||||
"question": {
|
||||
"title": "Common Questions",
|
||||
@@ -547,7 +595,10 @@
|
||||
"nav": {
|
||||
"settings": "Settings",
|
||||
"bindings": "Bindings",
|
||||
"audits": "Login Audits"
|
||||
"audits": "Login Audits",
|
||||
"settingsPage": "WeCom Settings",
|
||||
"bindingsPage": "WeCom Bindings",
|
||||
"auditsPage": "WeCom Audits"
|
||||
},
|
||||
"overview": {
|
||||
"bound": "Bound userids",
|
||||
@@ -1477,6 +1528,7 @@
|
||||
"regionPreviewRecognized": "Body region recognized",
|
||||
"regionPreviewIncomplete": "Anchors are incomplete; reviews will safely fall back",
|
||||
"regionPreviewFailed": "Region recognition preview failed",
|
||||
"regionSaved": "Comparison region configuration saved"
|
||||
"regionSaved": "Comparison region configuration saved",
|
||||
"defaultTemplateName": "Standard Procurement Contract"
|
||||
}
|
||||
}
|
||||
@@ -463,6 +463,7 @@
|
||||
"oaRequestMissing": "OA request ID is missing.",
|
||||
"devComingSoon": "This feature is under development",
|
||||
"previewUnavailable": "Preview is temporarily unavailable",
|
||||
"sourcePreviewLinkMissing": "No previewable link is available for this source file yet",
|
||||
"invalidBrowserUrl": "Please enter a valid URL such as https://example.com or localhost:8891",
|
||||
"enterBrowserUrl": "Please enter a URL first",
|
||||
"queryLeaveBalance": "Checking your leave balance, please wait...",
|
||||
@@ -532,7 +533,9 @@
|
||||
"networkDisconnectedEmpty": "Connection lost before a reply was received. Please try again.",
|
||||
"partialInterrupted": "The reply was interrupted. The content above may be incomplete—please ask again.",
|
||||
"upstreamDisconnected": "The AI service connection was interrupted. Please try again.",
|
||||
"generic": "The request failed. Please try again."
|
||||
"generic": "The request failed. Please try again.",
|
||||
"contextTooLong": "This conversation context is too long for the model to continue. Start a new chat and query the asset ID again.",
|
||||
"workflowFailed": "Workflow execution failed. Please try again later."
|
||||
},
|
||||
"actions": {
|
||||
"copy": "Copy",
|
||||
@@ -977,7 +980,37 @@
|
||||
"answer": "true",
|
||||
"explanation": "Product requirements must cover both regulations and customer requirements."
|
||||
}
|
||||
]
|
||||
],
|
||||
"stepExamTitle": "Step 3: Exam",
|
||||
"stepResultTitle": "Step 4: Results",
|
||||
"scoreShort": "{score} pts",
|
||||
"passScoreShort": "{passScore} pts",
|
||||
"currentScoreLabel": "Score:",
|
||||
"passLineLabel": "Pass line:",
|
||||
"yourAnswerLabel": "Your answer:",
|
||||
"correctAnswerLabel": "Correct answer:",
|
||||
"wrongFeedbackShort": "Incorrect",
|
||||
"finishAndViewResult": "Finish exam and view results",
|
||||
"passTitleShort": "Congrats, you passed!",
|
||||
"failTitleShort": "Sorry, you did not pass",
|
||||
"wrongCountShort": "Wrong",
|
||||
"syncedToHr": "Score synced to HR",
|
||||
"clickPlayVideo": "Click to play video",
|
||||
"agentDescription": "I am your onboarding training assistant. I will guide you through video learning, knowledge review, exam questions, and results in the same chat.",
|
||||
"defaultQuestions": {
|
||||
"employee": [
|
||||
"What will this employee training cover?",
|
||||
"What steps are required to complete training?",
|
||||
"What are the pass rules for employee training?",
|
||||
"What should I know before starting the exam?"
|
||||
],
|
||||
"hr": [
|
||||
"How many people are in training now?",
|
||||
"What is the current training pass rate?",
|
||||
"Which employees have not finished training?",
|
||||
"I want this month training score statistics"
|
||||
]
|
||||
}
|
||||
},
|
||||
"procurementContract": {
|
||||
"modeCompare": "Contract Compare",
|
||||
@@ -1100,5 +1133,283 @@
|
||||
"attachmentAdded": "The returned contract adds {count} attachment page(s)",
|
||||
"attachmentRemoved": "The returned contract removes {count} attachment page(s)",
|
||||
"attachmentContentIgnored": "Attachment content is excluded from differences"
|
||||
},
|
||||
"learningWindow": "Learning Guide",
|
||||
"guide": {
|
||||
"collapseToc": "Collapse TOC",
|
||||
"expandToc": "Expand TOC",
|
||||
"selectHint": "Select a guide from the left to view"
|
||||
},
|
||||
"exitShort": "Exit",
|
||||
"recommendedQuestion": "Suggested question",
|
||||
"faqGroup": "FAQ",
|
||||
"toolRun": {
|
||||
"fallbackTitle": "Task progress",
|
||||
"batch": "Batch: {runNo}",
|
||||
"status": "Status: {status}",
|
||||
"errorMessage": "Error: {message}",
|
||||
"waitingStart": "Waiting for the check task to start...",
|
||||
"currentStep": "Current stage: {step}",
|
||||
"currentRow": "Current record: {rowId}",
|
||||
"stepStarted": "Stage started: {time}",
|
||||
"downloadExcel": "Download Excel",
|
||||
"downloading": "Downloading...",
|
||||
"downloadFailed": "Failed to download Excel",
|
||||
"downloadFailedStatus": "Download failed: {status}",
|
||||
"progress": "Progress {percent}%",
|
||||
"startedAt": "Started: {time}",
|
||||
"finishedAt": "Finished: {time}",
|
||||
"total": "Total",
|
||||
"processed": "Processed",
|
||||
"success": "Succeeded",
|
||||
"failed": "Failed",
|
||||
"skipped": "Skipped",
|
||||
"qualified": "Qualified",
|
||||
"unqualified": "Unqualified",
|
||||
"manual": "Manual review",
|
||||
"kbSyncError": "Knowledge base sync error: {message}",
|
||||
"waitingHint": "Live progress will appear here once the check starts.",
|
||||
"statusRunning": "Running",
|
||||
"statusSuccess": "Completed",
|
||||
"statusPartialFailed": "Partially failed",
|
||||
"statusFailed": "Failed",
|
||||
"statusCancelled": "Cancelled",
|
||||
"statusWaiting": "Waiting",
|
||||
"kbSynced": "Knowledge base synced",
|
||||
"kbSyncFailed": "Knowledge base sync failed",
|
||||
"kbSyncing": "Syncing knowledge base",
|
||||
"kbNotSynced": "Knowledge base not synced",
|
||||
"kbUnknown": "Knowledge base: {status}",
|
||||
"kbStatusUnknown": "Unknown",
|
||||
"queryFailed": "Failed to load task progress",
|
||||
"lockWaiting": "A task is running. Please wait until it finishes.",
|
||||
"runNotFound": "No related check task found. Refresh later or check schedule run records."
|
||||
},
|
||||
"assetColumns": {
|
||||
"id": "No.",
|
||||
"assetId": "Asset ID",
|
||||
"assetName": "Asset name",
|
||||
"currencyAmount": "Amount (local currency)",
|
||||
"specification": "Specification",
|
||||
"accountPeriod": "Ledger",
|
||||
"custodianPerson": "Custodian",
|
||||
"custodianPersonFull": "Custodian name",
|
||||
"custodianDept": "Custodian dept",
|
||||
"custodianDeptFull": "Custodian department",
|
||||
"image": "Image",
|
||||
"storageLocation": "Storage location",
|
||||
"assetStatus": "Asset status",
|
||||
"residualValue": "Residual value",
|
||||
"supplier": "Supplier",
|
||||
"vendorAlias": "Vendor",
|
||||
"assetNature": "Asset nature",
|
||||
"quantity": "Quantity",
|
||||
"unit": "Unit",
|
||||
"acquisitionDate": "Acquisition date",
|
||||
"acquisitionDateAlias": "Acquired on",
|
||||
"accountingDate": "Posted date",
|
||||
"createdAt": "Created at",
|
||||
"updatedAt": "Updated at",
|
||||
"snapshotTime": "Snapshot time",
|
||||
"empty": "N/A",
|
||||
"view": "View"
|
||||
},
|
||||
"assetHistory": {
|
||||
"title": "Asset history",
|
||||
"currentAsset": "Current asset: {name}",
|
||||
"searching": "Searching shared-drive history files...",
|
||||
"empty": "No matching history files found",
|
||||
"modifiedAt": "Modified: {time}",
|
||||
"sizeKb": "Size: {size} KB",
|
||||
"matchReason": "Match: {reason}",
|
||||
"viewFile": "View history",
|
||||
"searchingToast": "Searching asset history. Please wait...",
|
||||
"missingIdentifier": "This asset is missing an ID or name for history search",
|
||||
"notFound": "No history file found for asset {name}. Contact an admin if one should exist.",
|
||||
"queryFailed": "History lookup failed: {message}",
|
||||
"searchFailed": "Failed to search asset history",
|
||||
"shareNotConfigured": "Asset history folder is not configured. Contact an admin.",
|
||||
"shareUnreachable": "Asset history share is unreachable. Ask an admin to check mount and permissions.",
|
||||
"shareInvalid": "Asset history folder config is invalid. Ask an admin to review the share path."
|
||||
},
|
||||
"assetImage": {
|
||||
"searchingToast": "Searching asset images. Please wait...",
|
||||
"missingIdentifier": "This asset is missing an ID or name for image search",
|
||||
"notFound": "No image found for asset {name}. Ask an admin to upload one.",
|
||||
"queryFailed": "Image lookup failed: {message}",
|
||||
"searchFailed": "Failed to search fixed-asset images",
|
||||
"libraryNotConfigured": "Fixed-asset image library is not configured. Contact an admin.",
|
||||
"noPhotoUploaded": "No photo has been uploaded by the device admin yet~"
|
||||
},
|
||||
"queryPreview": {
|
||||
"title": "Full query result preview",
|
||||
"viewAll": "View full preview",
|
||||
"viewAllWithTotal": "View full preview ({total} rows)",
|
||||
"agentNotReady": "The current agent is not ready. Please try again shortly.",
|
||||
"loadFailed": "Failed to load the full preview",
|
||||
"summary": "{total} rows · page {page} / {pages}",
|
||||
"prev": "Previous",
|
||||
"next": "Next",
|
||||
"empty": "No preview data"
|
||||
},
|
||||
"attachmentsUi": {
|
||||
"title": "Attachments",
|
||||
"uploadLocal": "Upload local file",
|
||||
"pasteUrl": "Paste URL",
|
||||
"urlPlaceholder": "Paste attachment URL (http/https)",
|
||||
"add": "Add",
|
||||
"cancel": "Cancel",
|
||||
"limitReached": "Attachment limit reached ({limit})",
|
||||
"unsupportedType": "Unsupported attachment type: {name}",
|
||||
"typeNotAllowed": "This app does not allow uploading this attachment type: {type}",
|
||||
"tooLarge": "Attachment too large (max {limit}MB): {name}",
|
||||
"typeLimitReached": "Limit reached for this attachment type ({limit})",
|
||||
"httpOnly": "Only http/https URLs are supported",
|
||||
"urlNotSupported": "This app does not support URL attachments",
|
||||
"unsupportedUrlType": "Unsupported URL attachment type",
|
||||
"urlTypeNotAllowed": "This app does not allow this URL attachment type: {type}",
|
||||
"processFailed": "Failed to process attachment: {message}{suffix}"
|
||||
},
|
||||
"leave": {
|
||||
"types": {
|
||||
"401": "Maternity leave (days)",
|
||||
"402": "Paternity leave (days)",
|
||||
"403": "Marriage leave (days)",
|
||||
"405": "Hospital sick leave (hours)",
|
||||
"406": "Work injury leave (days)",
|
||||
"408": "Parental leave (hours)",
|
||||
"005": "Personal leave (hours)",
|
||||
"006": "Sick leave (hours)",
|
||||
"007": "Bereavement leave (days)",
|
||||
"010": "Annual leave (days)",
|
||||
"021": "Business trip (hours)",
|
||||
"025": "Comp time (hours)",
|
||||
"ZZ01": "Home leave (hours)",
|
||||
"ZZ04": "Personal leave (manager hours)",
|
||||
"ZZ05": "Sick leave (manager hours)",
|
||||
"ZZ07": "Bereavement leave (manager days)",
|
||||
"ZZ08": "Maternity leave (manager days)",
|
||||
"ZZ09": "Paternity leave (manager days)",
|
||||
"ZZ10": "Marriage leave (manager days)",
|
||||
"035": "Other leave (hours)"
|
||||
}
|
||||
},
|
||||
"shippingNoticeMenu": {
|
||||
"upload": {
|
||||
"label": "Select inventory file",
|
||||
"message": "I want to upload inventory Excel"
|
||||
},
|
||||
"paste": {
|
||||
"label": "Paste inventory",
|
||||
"message": "I paste a small inventory table"
|
||||
},
|
||||
"retry_rpa": {
|
||||
"label": "Fetch inventory again",
|
||||
"message": "Fetch inventory again"
|
||||
},
|
||||
"confirm": {
|
||||
"label": "Confirm",
|
||||
"message": "Confirm"
|
||||
},
|
||||
"reparse": {
|
||||
"label": "Re-parse",
|
||||
"message": "Re-parse"
|
||||
},
|
||||
"reject": {
|
||||
"label": "Reject",
|
||||
"message": "Reject"
|
||||
}
|
||||
},
|
||||
"shippingNoticeTurn": {
|
||||
"createBatchSingle": "Upload shipping notice: {fileName}",
|
||||
"createBatchMulti": "Upload {count} shipping notices",
|
||||
"attachmentFallback": "attachment",
|
||||
"confirmBatchSingle": "Confirm create: {intakeNo}",
|
||||
"confirmBatchMulti": "Confirm create: {count} shipping notices",
|
||||
"uploadInventory": "Upload inventory file: {fileName}",
|
||||
"replaceNotice": "Re-upload shipping notice: {fileName}",
|
||||
"applyMapping": "Apply inventory column mapping (task {taskId})",
|
||||
"withTaskId": "{text}\nTask ID: {taskId}"
|
||||
},
|
||||
"shippingNoticeToast": {
|
||||
"noBatchToSwitch": "No batch available to switch",
|
||||
"batchOnlyOneTask": "Current batch has only 1 task; no switch needed",
|
||||
"taskNotFoundToSwitch": "Target task not found",
|
||||
"alreadyLastTask": "Already on the last task",
|
||||
"alreadyFirstTask": "Already on the first task",
|
||||
"alreadyOnCurrentTask": "Already on the current task",
|
||||
"switchTaskFailed": "Failed to switch task",
|
||||
"fileProcessFailed": "File processing failed",
|
||||
"localAttachmentOnly": "Only local attachments can trigger the auto flow",
|
||||
"oneFileOnlyAutoFirst": "Only one file is supported at a time; processing the first file",
|
||||
"missingTaskIdUploadInventory": "Task ID not found. Upload an inventory file first",
|
||||
"missingTaskIdPreviousSteps": "Task ID not found. Complete the previous steps first",
|
||||
"missingTaskIdParseMatch": "Task ID not found. Complete parsing and inventory matching first",
|
||||
"downloadExcelFailed": "Failed to download Excel",
|
||||
"autoCreateTaskFailed": "Failed to auto-create shipping task",
|
||||
"schemaPreviewMissing": "Header preview not found. Re-upload the inventory file, then click “Edit mapping”",
|
||||
"mappingFormIntro": "Use the dropdowns to map inventory columns (must pick from headers).",
|
||||
"selectSkuAndQty": "Select SKU column and available quantity column first",
|
||||
"applyMappingFailed": "Failed to apply mapping",
|
||||
"updateParseFailed": "Failed to update parse result",
|
||||
"addLineFailed": "Failed to add order line",
|
||||
"deleteLineFailed": "Failed to delete order line",
|
||||
"auditCommentHeaderEdit": "Chat order table revision",
|
||||
"auditCommentLineAdd": "Chat order table add line",
|
||||
"auditCommentLineDelete": "Chat order table delete line",
|
||||
"manualUploadedDefault": "I have finished uploading in the freight system",
|
||||
"markManualUploadFailed": "Failed to mark manual upload",
|
||||
"actionFallback": "Action",
|
||||
"operationFailed": "Operation failed"
|
||||
},
|
||||
"shippingNoticeSanitize": {
|
||||
"retriggeredInventory": "Inventory fetch retriggered.",
|
||||
"triggeredInventory": "Inventory fetch triggered.",
|
||||
"inventoryInProgress": "Inventory fetch in progress.",
|
||||
"manualRetry": "manual retry",
|
||||
"backToAlignConfirm": "Back to inventory field confirmation. Check the detected column names, then continue; edit the mapping if needed.",
|
||||
"checkColumnsContinue": "Check the detected inventory column names, then continue; edit the mapping if needed.",
|
||||
"confirmHeadersFromSample": "Confirm field mapping from inventory headers and sample rows.",
|
||||
"uploadInCurrentChat": "upload in the current chat",
|
||||
"currentChat": "current chat",
|
||||
"toCurrentChatPrefix": "to the current chat",
|
||||
"currentSystem": "current system",
|
||||
"taskIdLabel": "Task ID: ",
|
||||
"taskIdWord": "Task ID",
|
||||
"createTask": "create task",
|
||||
"getTaskStatus": "get task status",
|
||||
"parseNotice": "parse shipping notice",
|
||||
"submitDecision": "submit decision",
|
||||
"matchInventory": "match inventory",
|
||||
"generateExcel": "generate shipping Excel",
|
||||
"uploadFreight": "upload to freight system",
|
||||
"applyInventoryMapping": "apply inventory field mapping",
|
||||
"getSchemaPreview": "read inventory header preview",
|
||||
"schemaPreview": "inventory header preview",
|
||||
"mapJson": "field mapping",
|
||||
"sampleRows": "sample rows",
|
||||
"retryRpa": "fetch inventory again",
|
||||
"retryUpload": "retry freight upload",
|
||||
"structured": "structured content",
|
||||
"rawText": "notice text"
|
||||
},
|
||||
"shippingNoticeDecisionFormat": {
|
||||
"headerAtRow": "Headers on row {row}: {headers}",
|
||||
"currentHeaders": "Current headers: {headers}",
|
||||
"suggestedMapping": "Suggested column mapping:",
|
||||
"adjustHint": "To adjust, say which column to change (e.g. available_qty → Qty Available).",
|
||||
"reuploadHint": "Or click “Select inventory file” to re-upload.",
|
||||
"nextMatch": "Next: match inventory to shipping demand.",
|
||||
"reuploadOrPaste": "Please re-upload or paste inventory Excel.",
|
||||
"taskIdLine": "Task ID: {taskId}"
|
||||
},
|
||||
"shippingNoticeFieldAlignment": {
|
||||
"unrecognized": "(unrecognized)",
|
||||
"unrecognizedOptional": "(unrecognized / optional)",
|
||||
"matchRule": "Match rule: {rule}",
|
||||
"tableTitle": "Field alignment:",
|
||||
"tableHeaderSystem": "System field",
|
||||
"tableHeaderInventory": "Inventory column",
|
||||
"hints": "Notes:"
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
"refresh": "Refresh",
|
||||
"yes": "Yes",
|
||||
"no": "No",
|
||||
"app": {
|
||||
"title": "Hexin AI Workspace",
|
||||
"shortTitle": "AI Workspace",
|
||||
"remoteLogout": "You have signed out in another tab"
|
||||
},
|
||||
"sso": {
|
||||
"authorizing": "Opening the external system",
|
||||
"authorizingHint": "Completing secure single sign-on. Please wait.",
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
},
|
||||
"msg": {
|
||||
"fillContent": "Please enter feedback content",
|
||||
"submitFailed": "Failed to submit feedback"
|
||||
"submitFailed": "Failed to submit feedback",
|
||||
"submitSuccess": "Feedback submitted successfully"
|
||||
},
|
||||
"cancel": "Cancel",
|
||||
"submitting": "Submitting...",
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
"downloading": "Downloading...",
|
||||
"tooLarge": "The file is too large for online preview. Please click Download File above to get the original file.",
|
||||
"previewFailed": "Preview failed: ",
|
||||
"imageCounter": "{current} / {total}",
|
||||
"zoomOut": "Zoom out",
|
||||
"zoomIn": "Zoom in",
|
||||
"resetZoom": "Reset zoom",
|
||||
"prevImage": "Previous image",
|
||||
"nextImage": "Next image",
|
||||
"unsupportedRawPreview": "This raw file cannot be previewed directly; automatic download was blocked.",
|
||||
"msg": {
|
||||
"downloadFailed": "Download failed: {reason}",
|
||||
"unknownError": "Unknown error"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"kbDifySettings": {
|
||||
"title": "Dify Settings",
|
||||
"subtitle": "Manage Dify connection and default sync parameters for the knowledge base module.",
|
||||
@@ -391,8 +391,19 @@
|
||||
"markdownFailedRetry": "Clean failed, no Markdown yet. Please re-clean.",
|
||||
"markdownProcessing": "Document is being cleaned, no Markdown yet.",
|
||||
"markdownPendingClean": "Document pending clean, no Markdown yet.",
|
||||
"markdownNotGenerated": "No Markdown generated for this document yet."
|
||||
"markdownNotGenerated": "No Markdown generated for this document yet.",
|
||||
"createGroupFailed": "Failed to create knowledge base group",
|
||||
"saveDifySettingsFailed": "Failed to save Dify settings",
|
||||
"executeJobFailed": "Failed to run job",
|
||||
"updateDocumentFailed": "Failed to update document",
|
||||
"apiNotReady": "Knowledge base API is not ready. Please try again later",
|
||||
"fileTooLarge": "File is too large for the current upload limit. Ask an admin to raise the limit, then retry",
|
||||
"uploadPathFileFailed": "Failed to upload path file",
|
||||
"markPathFileFailedStatusFailed": "Failed to record path file failure status",
|
||||
"submitPathUploadFailed": "Failed to submit path upload job",
|
||||
"submitCleanFailed": "Failed to submit clean job",
|
||||
"updateGroupFailed": "Failed to update knowledge base group",
|
||||
"deleteGroupFailed": "Failed to delete knowledge base group"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,16 +122,20 @@
|
||||
"cancel": "Cancel",
|
||||
"save": "Save",
|
||||
"saving": "Saving...",
|
||||
"clear": "Clear",
|
||||
"saveAs": "Save as {status}",
|
||||
"viewAllHistory": "View All History"
|
||||
},
|
||||
"filters": {
|
||||
"keywordPlaceholder": "Search equipment code or name",
|
||||
"recentKeywordPlaceholder": "Filter by code, fault, or repairer",
|
||||
"defaultHint": "By default, only open records (pending or in repair) from the last year are shown. Choose All Statuses and All Time to browse full history.",
|
||||
"timeRangeLabel": "Report Date",
|
||||
"timeRange3m": "Last 3 Months",
|
||||
"timeRange1y": "Last Year",
|
||||
"timeRangeAll": "All Time"
|
||||
},
|
||||
"recentTitle": "Recent Maintenance Records",
|
||||
"table": {
|
||||
"deviceCode": "Equipment Code",
|
||||
"deviceName": "Equipment Name",
|
||||
@@ -192,6 +196,7 @@
|
||||
"required": "Equipment code, report date, and fault description are required",
|
||||
"updated": "Maintenance record updated",
|
||||
"created": "Maintenance record added",
|
||||
"saved": "Maintenance record saved",
|
||||
"saveFailed": "Failed to save maintenance record",
|
||||
"deleteConfirm": "Delete the maintenance record for {deviceCode}?",
|
||||
"deleted": "Maintenance record deleted",
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
"uncategorized": "Knowledge Base Q&A"
|
||||
},
|
||||
"noAgents": "No agents available",
|
||||
"noFavorites": "No favorites yet",
|
||||
"noPublicAgents": "No public agents available, please contact admin.",
|
||||
"requestPermission": "Request Access",
|
||||
"startChat": "Start Conversation",
|
||||
@@ -102,8 +103,15 @@
|
||||
"feedback": "Feedback",
|
||||
"updates": "Recent Updates",
|
||||
"backToChat": "Back to Chat",
|
||||
"backShort": "Back",
|
||||
"logout": "Logout"
|
||||
},
|
||||
"kb": {
|
||||
"accessDenied": "Administrator access is required to open the knowledge base."
|
||||
},
|
||||
"routes": {
|
||||
"history": "Chat History"
|
||||
},
|
||||
"history": {
|
||||
"empty": "No chat history yet",
|
||||
"untitled": "Untitled Conversation"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"delete": "ลบ",
|
||||
"nav": {
|
||||
"dashboard": "แดชบอร์ด",
|
||||
"overview": "ภาพรวม",
|
||||
"approvals": "การอนุมัติผู้ใช้",
|
||||
"users": "การจัดการผู้ใช้",
|
||||
"departments": "การจัดการแผนก",
|
||||
@@ -27,7 +28,7 @@
|
||||
"permissions": "สิทธิ์แอปพลิเคชัน",
|
||||
"requests": "คำขอสิทธิ์",
|
||||
"reports": "รายงานข้อมูล",
|
||||
"schedules": "Schedule Management",
|
||||
"schedules": "การจัดการตารางงาน",
|
||||
"platformApps": "แอปแพลตฟอร์ม",
|
||||
"procurementContract": "ตรวจสอบสัญญาจัดซื้อ"
|
||||
},
|
||||
@@ -67,6 +68,36 @@
|
||||
}
|
||||
},
|
||||
"platformApps": {
|
||||
"subtitle": "จัดการเอกสารคู่มือเริ่มต้นของแอป (รองรับวิดีโอ PDF ฯลฯ)",
|
||||
"selectAgent": "เลือกแอป:",
|
||||
"addGuide": "เพิ่มคู่มือ",
|
||||
"editGuide": "แก้ไขคู่มือ",
|
||||
"selectAgentFirst": "กรุณาเลือกแอปก่อน",
|
||||
"emptyGuides": "แอปนี้ยังไม่มีเอกสารคู่มือเริ่มต้น",
|
||||
"colType": "ประเภท",
|
||||
"colFileName": "ชื่อเอกสาร",
|
||||
"colAgent": "แอป Agent",
|
||||
"colFileSize": "ขนาดไฟล์",
|
||||
"colSort": "ลำดับ",
|
||||
"colStatus": "สถานะ",
|
||||
"colActions": "การดำเนินการ",
|
||||
"statusEnabled": "เปิดใช้แล้ว",
|
||||
"statusDisabled": "ปิดใช้แล้ว",
|
||||
"confirmDelete": "ลบคู่มือนี้หรือไม่? การลบไม่สามารถกู้คืนได้",
|
||||
"uploadFile": "อัปโหลดไฟล์",
|
||||
"uploading": "กำลังอัปโหลด...",
|
||||
"uploadReady": "อัปโหลดไฟล์พร้อมแล้ว",
|
||||
"uploadFailed": "อัปโหลดล้มเหลว",
|
||||
"fileName": "ชื่อเอกสาร",
|
||||
"fileNamePlaceholder": "เช่น คู่มือผู้ช่วย HR",
|
||||
"remark": "หมายเหตุ",
|
||||
"remarkPlaceholder": "คำอธิบายสั้นๆ...",
|
||||
"sortOrder": "น้ำหนักการเรียง",
|
||||
"sortOrderHint": "ตัวเลขน้อยกว่าจะอยู่ก่อน",
|
||||
"status": "สถานะ",
|
||||
"enable": "เปิดใช้",
|
||||
"disable": "ปิดใช้",
|
||||
"save": "บันทึก",
|
||||
"guideUsage": "ประเภทการใช้งานเอกสาร",
|
||||
"generalGuide": "คู่มือทั่วไป",
|
||||
"trainingVideo": "วิดีโออบรมพนักงาน",
|
||||
@@ -211,6 +242,11 @@
|
||||
"api": "การรวม API (Dify)",
|
||||
"iframe": "ฝัง Iframe"
|
||||
},
|
||||
"difyAppType": "ประเภทแอป Dify",
|
||||
"difyAppTypes": {
|
||||
"chatflow": "Chatflow",
|
||||
"workflow": "Workflow"
|
||||
},
|
||||
"appId": "Dify App ID",
|
||||
"apiKey": "API Key",
|
||||
"apiKeyCreatePlaceholder": "Required when creating",
|
||||
@@ -386,7 +422,19 @@
|
||||
"uncategorized": "ไม่จัดหมวดหมู่",
|
||||
"memberCount": "แอปลูก {count} รายการ",
|
||||
"normalListHint": "เฉพาะแอปนี้"
|
||||
}
|
||||
},
|
||||
"suggestedQuestions": {
|
||||
"title": "คำถามแนะนำ",
|
||||
"add": "เพิ่มคำถาม",
|
||||
"stylePlain": "ไม่มีสไตล์",
|
||||
"styleStyled": "มีสไตล์",
|
||||
"empty": "ยังไม่ได้ตั้งค่าคำถามแนะนำ คลิก \"เพิ่มคำถาม\" แล้วระบบจะซิงค์ไปยังหน้าต้อนรับ Chat ของ Agent",
|
||||
"questionPlaceholder": "กรอกคำถาม เช่น ฉันมีวันลาเหลือกี่วัน?",
|
||||
"groupPlaceholderStyled": "ไม่บังคับ: ชื่อกลุ่ม เช่น การเข้างานและการลา",
|
||||
"groupPlaceholderPlain": "ไม่ต้องจัดกลุ่มเมื่อไม่มีสไตล์"
|
||||
},
|
||||
"createSuccess": "สร้างแอปสำเร็จ",
|
||||
"updateSuccess": "อัปเดตแอปสำเร็จ"
|
||||
},
|
||||
"question": {
|
||||
"title": "คำถามทั่วไป",
|
||||
@@ -547,7 +595,10 @@
|
||||
"nav": {
|
||||
"settings": "การตั้งค่า",
|
||||
"bindings": "การผูกบัญชี",
|
||||
"audits": "ตรวจสอบการเข้าสู่ระบบ"
|
||||
"audits": "ตรวจสอบการเข้าสู่ระบบ",
|
||||
"settingsPage": "การตั้งค่า WeCom",
|
||||
"bindingsPage": "การผูกบัญชี WeCom",
|
||||
"auditsPage": "ตรวจสอบ WeCom"
|
||||
},
|
||||
"overview": {
|
||||
"bound": "ผูก userid แล้ว",
|
||||
@@ -1347,6 +1398,7 @@
|
||||
"regionPreviewRecognized": "ระบุพื้นที่เนื้อหาสำเร็จ",
|
||||
"regionPreviewIncomplete": "ระบุจุดยึดไม่ครบ ระบบจะย้อนกลับอย่างปลอดภัย",
|
||||
"regionPreviewFailed": "แสดงตัวอย่างการระบุพื้นที่ไม่สำเร็จ",
|
||||
"regionSaved": "บันทึกการตั้งค่าพื้นที่เปรียบเทียบแล้ว"
|
||||
"regionSaved": "บันทึกการตั้งค่าพื้นที่เปรียบเทียบแล้ว",
|
||||
"defaultTemplateName": "สัญญาจัดซื้อมาตรฐาน"
|
||||
}
|
||||
}
|
||||
@@ -463,6 +463,7 @@
|
||||
"oaRequestMissing": "ยังไม่ได้รับเลขเอกสาร OA จึงไม่สามารถเปิดรายละเอียดได้",
|
||||
"devComingSoon": "ฟีเจอร์นี้กำลังพัฒนา",
|
||||
"previewUnavailable": "ยังไม่สามารถพรีวิวไฟล์ต้นทางได้ชั่วคราว",
|
||||
"sourcePreviewLinkMissing": "ไฟล์ต้นทางยังไม่มีลิงก์สำหรับพรีวิว",
|
||||
"invalidBrowserUrl": "กรุณาใส่ URL ที่ถูกต้อง เช่น https://example.com หรือ localhost:8891",
|
||||
"enterBrowserUrl": "กรุณาใส่ URL ก่อน",
|
||||
"queryLeaveBalance": "กำลังตรวจสอบยอดสิทธิ์ลาของคุณ โปรดรอสักครู่...",
|
||||
@@ -532,7 +533,9 @@
|
||||
"networkDisconnectedEmpty": "การเชื่อมต่อขาดหายก่อนได้รับคำตอบ โปรดลองใหม่อีกครั้ง",
|
||||
"partialInterrupted": "การสร้างคำตอบถูกขัดจังหวะ เนื้อหาด้านบนอาจไม่สมบูรณ์ โปรดถามใหม่",
|
||||
"upstreamDisconnected": "การเชื่อมต่อบริการ AI ขาดหาย โปรดลองใหม่อีกครั้ง",
|
||||
"generic": "คำขอล้มเหลว โปรดลองใหม่อีกครั้ง"
|
||||
"generic": "คำขอล้มเหลว โปรดลองใหม่อีกครั้ง",
|
||||
"contextTooLong": "บริบทการสนทนายาวเกินไป โมเดลไม่สามารถตอบต่อได้ กรุณาเริ่มแชทใหม่แล้วค้นหารหัสสินทรัพย์อีกครั้ง",
|
||||
"workflowFailed": "เวิร์กโฟลว์ล้มเหลว โปรดลองใหม่ภายหลัง"
|
||||
},
|
||||
"actions": {
|
||||
"copy": "คัดลอก",
|
||||
@@ -977,7 +980,37 @@
|
||||
"answer": "true",
|
||||
"explanation": "ข้อกำหนดของผลิตภัณฑ์ต้องครอบคลุมทั้งกฎหมายและความต้องการของลูกค้า"
|
||||
}
|
||||
]
|
||||
],
|
||||
"stepExamTitle": "ขั้นตอนที่ 3: สอบทีละข้อ",
|
||||
"stepResultTitle": "ขั้นตอนที่ 4: สรุปผล",
|
||||
"scoreShort": "{score} คะแนน",
|
||||
"passScoreShort": "{passScore} คะแนน",
|
||||
"currentScoreLabel": "คะแนนปัจจุบัน:",
|
||||
"passLineLabel": "เกณฑ์ผ่าน:",
|
||||
"yourAnswerLabel": "คำตอบของคุณ:",
|
||||
"correctAnswerLabel": "คำตอบที่ถูก:",
|
||||
"wrongFeedbackShort": "ตอบผิด",
|
||||
"finishAndViewResult": "จบการสอบและดูผล",
|
||||
"passTitleShort": "ยินดีด้วย คุณสอบผ่านแล้ว!",
|
||||
"failTitleShort": "เสียใจด้วย คุณยังไม่ผ่าน",
|
||||
"wrongCountShort": "ผิด",
|
||||
"syncedToHr": "คะแนนซิงค์ไปยังระบบ HR แล้ว",
|
||||
"clickPlayVideo": "คลิกเพื่อเล่นวิดีโอ",
|
||||
"agentDescription": "ฉันคือผู้ช่วยอบรมพนักงานใหม่ จะพาคุณเรียนวิดีโอ ทบทวนความรู้ สอบทีละข้อ และสรุปผลในแชทเดียวกัน",
|
||||
"defaultQuestions": {
|
||||
"employee": [
|
||||
"การอบรมพนักงานครั้งนี้เรียนเรื่องอะไรเป็นหลัก?",
|
||||
"ต้องผ่านขั้นตอนอะไรบ้างจึงจะจบการอบรม?",
|
||||
"กฎการผ่านการอบรมพนักงานคืออะไร?",
|
||||
"ก่อนเริ่มสอบต้องรู้อะไรบ้าง?"
|
||||
],
|
||||
"hr": [
|
||||
"ตอนนี้มีกี่คนเข้าร่วมการอบรม?",
|
||||
"อัตราผ่านการอบรมปัจจุบันเป็นเท่าใด?",
|
||||
"พนักงานคนไหนยังไม่จบการอบรม?",
|
||||
"อยากดูสถิติคะแนนอบรมเดือนนี้"
|
||||
]
|
||||
}
|
||||
},
|
||||
"procurementContract": {
|
||||
"modeCompare": "เปรียบเทียบสัญญา",
|
||||
@@ -1100,5 +1133,283 @@
|
||||
"attachmentAdded": "สัญญาที่ส่งกลับเพิ่มภาคผนวก {count} หน้า",
|
||||
"attachmentRemoved": "สัญญาที่ส่งกลับลดภาคผนวก {count} หน้า",
|
||||
"attachmentContentIgnored": "เนื้อหาภาคผนวกไม่รวมอยู่ในรายการความแตกต่าง"
|
||||
},
|
||||
"learningWindow": "คู่มือการเรียนรู้",
|
||||
"guide": {
|
||||
"collapseToc": "ยุบสารบัญ",
|
||||
"expandToc": "ขยายสารบัญ",
|
||||
"selectHint": "เลือกคู่มือทางซ้ายเพื่อดู"
|
||||
},
|
||||
"exitShort": "ออก",
|
||||
"recommendedQuestion": "คำถามแนะนำ",
|
||||
"faqGroup": "คำถามที่พบบ่อย",
|
||||
"toolRun": {
|
||||
"fallbackTitle": "ความคืบหน้างาน",
|
||||
"batch": "ชุดงาน: {runNo}",
|
||||
"status": "สถานะ: {status}",
|
||||
"errorMessage": "ข้อผิดพลาด: {message}",
|
||||
"waitingStart": "กำลังรอให้งานตรวจสอบเริ่มต้น...",
|
||||
"currentStep": "ขั้นตอนปัจจุบัน: {step}",
|
||||
"currentRow": "รายการปัจจุบัน: {rowId}",
|
||||
"stepStarted": "เริ่มขั้นตอน: {time}",
|
||||
"downloadExcel": "ดาวน์โหลด Excel",
|
||||
"downloading": "กำลังดาวน์โหลด...",
|
||||
"downloadFailed": "ดาวน์โหลด Excel ไม่สำเร็จ",
|
||||
"downloadFailedStatus": "ดาวน์โหลดล้มเหลว: {status}",
|
||||
"progress": "ความคืบหน้า {percent}%",
|
||||
"startedAt": "เริ่ม: {time}",
|
||||
"finishedAt": "เสร็จ: {time}",
|
||||
"total": "ทั้งหมด",
|
||||
"processed": "ดำเนินการแล้ว",
|
||||
"success": "สำเร็จ",
|
||||
"failed": "ล้มเหลว",
|
||||
"skipped": "ข้าม",
|
||||
"qualified": "ผ่านเกณฑ์",
|
||||
"unqualified": "ไม่ผ่านเกณฑ์",
|
||||
"manual": "ตรวจด้วยตนเอง",
|
||||
"kbSyncError": "ข้อผิดพลาดซิงค์คลังความรู้: {message}",
|
||||
"waitingHint": "เมื่อเริ่มตรวจสอบ ความคืบหน้าแบบเรียลไทม์จะแสดงที่นี่",
|
||||
"statusRunning": "กำลังทำงาน",
|
||||
"statusSuccess": "เสร็จสิ้น",
|
||||
"statusPartialFailed": "ล้มเหลวบางส่วน",
|
||||
"statusFailed": "ล้มเหลว",
|
||||
"statusCancelled": "ยกเลิกแล้ว",
|
||||
"statusWaiting": "รอ",
|
||||
"kbSynced": "ซิงค์คลังความรู้แล้ว",
|
||||
"kbSyncFailed": "ซิงค์คลังความรู้ล้มเหลว",
|
||||
"kbSyncing": "กำลังซิงค์คลังความรู้",
|
||||
"kbNotSynced": "ยังไม่ซิงค์คลังความรู้",
|
||||
"kbUnknown": "คลังความรู้: {status}",
|
||||
"kbStatusUnknown": "ไม่ทราบ",
|
||||
"queryFailed": "โหลดความคืบหน้างานไม่สำเร็จ",
|
||||
"lockWaiting": "กำลังดำเนินการงานอยู่ กรุณารอให้เสร็จก่อน",
|
||||
"runNotFound": "ไม่พบงานตรวจสอบที่เกี่ยวข้อง กรุณารีเฟรชภายหลังหรือดูบันทึกการรันตาราง"
|
||||
},
|
||||
"assetColumns": {
|
||||
"id": "ลำดับ",
|
||||
"assetId": "รหัสสินทรัพย์",
|
||||
"assetName": "ชื่อสินทรัพย์",
|
||||
"currencyAmount": "จำนวนเงิน (สกุลท้องถิ่น)",
|
||||
"specification": "รุ่น/สเปก",
|
||||
"accountPeriod": "ชุดบัญชี",
|
||||
"custodianPerson": "ผู้ดูแล",
|
||||
"custodianPersonFull": "ชื่อผู้ดูแล",
|
||||
"custodianDept": "แผนกผู้ดูแล",
|
||||
"custodianDeptFull": "ชื่อแผนกผู้ดูแล",
|
||||
"image": "รูปภาพ",
|
||||
"storageLocation": "สถานที่จัดเก็บ",
|
||||
"assetStatus": "สถานะสินทรัพย์",
|
||||
"residualValue": "มูลค่าคงเหลือ",
|
||||
"supplier": "ผู้จำหน่าย",
|
||||
"vendorAlias": "ผู้ขาย",
|
||||
"assetNature": "ลักษณะสินทรัพย์",
|
||||
"quantity": "จำนวน",
|
||||
"unit": "หน่วย",
|
||||
"acquisitionDate": "วันที่ได้มา",
|
||||
"acquisitionDateAlias": "วันที่รับมา",
|
||||
"accountingDate": "วันที่ลงบัญชี",
|
||||
"createdAt": "สร้างเมื่อ",
|
||||
"updatedAt": "อัปเดตเมื่อ",
|
||||
"snapshotTime": "เวลาสแนปช็อต",
|
||||
"empty": "ไม่มี",
|
||||
"view": "ดู"
|
||||
},
|
||||
"assetHistory": {
|
||||
"title": "ประวัติสินทรัพย์",
|
||||
"currentAsset": "สินทรัพย์ปัจจุบัน: {name}",
|
||||
"searching": "กำลังค้นหาไฟล์ประวัติบนแชร์ไดรฟ์...",
|
||||
"empty": "ไม่พบไฟล์ประวัติที่ตรงกัน",
|
||||
"modifiedAt": "แก้ไขเมื่อ: {time}",
|
||||
"sizeKb": "ขนาด: {size} KB",
|
||||
"matchReason": "วิธีจับคู่: {reason}",
|
||||
"viewFile": "ดูประวัติ",
|
||||
"searchingToast": "กำลังค้นหาประวัติสินทรัพย์ กรุณารอสักครู่...",
|
||||
"missingIdentifier": "สินทรัพย์นี้ไม่มีรหัสหรือชื่อสำหรับค้นหาประวัติ",
|
||||
"notFound": "ไม่พบไฟล์ประวัติของสินทรัพย์ {name} หากควรมี กรุณาติดต่อผู้ดูแลระบบ",
|
||||
"queryFailed": "ค้นหาประวัติล้มเหลว: {message}",
|
||||
"searchFailed": "ค้นหาประวัติสินทรัพย์ไม่สำเร็จ",
|
||||
"shareNotConfigured": "ยังไม่ได้ตั้งค่าโฟลเดอร์ประวัติสินทรัพย์ กรุณาติดต่อผู้ดูแลระบบ",
|
||||
"shareUnreachable": "เข้าถึงแชร์ไดรฟ์ประวัติสินทรัพย์ไม่ได้ กรุณาให้ผู้ดูแลตรวจสอบการเมานต์และสิทธิ์",
|
||||
"shareInvalid": "การตั้งค่าโฟลเดอร์ประวัติสินทรัพย์ไม่ถูกต้อง กรุณาให้ผู้ดูแลตรวจสอบพาธ"
|
||||
},
|
||||
"assetImage": {
|
||||
"searchingToast": "กำลังค้นหารูปภาพสินทรัพย์ กรุณารอสักครู่...",
|
||||
"missingIdentifier": "สินทรัพย์นี้ไม่มีรหัสหรือชื่อสำหรับค้นหารูปภาพ",
|
||||
"notFound": "ไม่พบรูปภาพของสินทรัพย์ {name} กรุณาให้ผู้ดูแลอัปโหลด",
|
||||
"queryFailed": "ค้นหารูปภาพล้มเหลว: {message}",
|
||||
"searchFailed": "ค้นหารูปภาพสินทรัพย์ถาวรไม่สำเร็จ",
|
||||
"libraryNotConfigured": "ยังไม่ได้ตั้งค่าคลังรูปภาพสินทรัพย์ถาวร กรุณาติดต่อผู้ดูแลระบบ",
|
||||
"noPhotoUploaded": "ผู้ดูแลอุปกรณ์ยังไม่ได้อัปโหลดรูปภาพ~"
|
||||
},
|
||||
"queryPreview": {
|
||||
"title": "ดูผลลัพธ์การค้นหาทั้งหมด",
|
||||
"viewAll": "ดูตัวอย่างทั้งหมด",
|
||||
"viewAllWithTotal": "ดูตัวอย่างทั้งหมด (ทั้งหมด {total} รายการ)",
|
||||
"agentNotReady": "Agent ยังไม่พร้อม โปรดลองใหม่ในภายหลัง",
|
||||
"loadFailed": "โหลดตัวอย่างทั้งหมดไม่สำเร็จ",
|
||||
"summary": "{total} รายการ · หน้า {page} / {pages}",
|
||||
"prev": "ก่อนหน้า",
|
||||
"next": "ถัดไป",
|
||||
"empty": "ไม่มีข้อมูลให้ดู"
|
||||
},
|
||||
"attachmentsUi": {
|
||||
"title": "ไฟล์แนบ",
|
||||
"uploadLocal": "อัปโหลดไฟล์ในเครื่อง",
|
||||
"pasteUrl": "วาง URL",
|
||||
"urlPlaceholder": "วาง URL ไฟล์แนบ (http/https)",
|
||||
"add": "เพิ่ม",
|
||||
"cancel": "ยกเลิก",
|
||||
"limitReached": "จำนวนไฟล์แนบถึงขีดจำกัดแล้ว ({limit})",
|
||||
"unsupportedType": "ประเภทไฟล์แนบไม่รองรับ: {name}",
|
||||
"typeNotAllowed": "แอปนี้ไม่อนุญาตอัปโหลดประเภทนี้: {type}",
|
||||
"tooLarge": "ไฟล์ใหญ่เกินไป (สูงสุด {limit}MB): {name}",
|
||||
"typeLimitReached": "จำนวนไฟล์ประเภทนี้ถึงขีดจำกัดแล้ว ({limit})",
|
||||
"httpOnly": "รองรับเฉพาะ URL http/https",
|
||||
"urlNotSupported": "แอปนี้ไม่รองรับไฟล์แนบแบบ URL",
|
||||
"unsupportedUrlType": "ประเภท URL ไฟล์แนบไม่รองรับ",
|
||||
"urlTypeNotAllowed": "แอปนี้ไม่อนุญาตประเภท URL นี้: {type}",
|
||||
"processFailed": "ประมวลผลไฟล์แนบล้มเหลว: {message}{suffix}"
|
||||
},
|
||||
"leave": {
|
||||
"types": {
|
||||
"401": "ลาคลอด (วัน)",
|
||||
"402": "ลาเลี้ยงดูบุตรบิดา (วัน)",
|
||||
"403": "ลาแต่งงาน (วัน)",
|
||||
"405": "ลาป่วยนอนรพ. (ชั่วโมง)",
|
||||
"406": "ลาป่วยจากงาน (วัน)",
|
||||
"408": "ลาเลี้ยงบุตร (ชั่วโมง)",
|
||||
"005": "ลากิจ (ชั่วโมง)",
|
||||
"006": "ลาป่วย (ชั่วโมง)",
|
||||
"007": "ลาไว้ทุกข์ (วัน)",
|
||||
"010": "ลาพักร้อน (วัน)",
|
||||
"021": "เดินทางธุรกิจ (ชั่วโมง)",
|
||||
"025": "ชดเชยเวลา (ชั่วโมง)",
|
||||
"ZZ01": "ลากลับบ้าน (ชั่วโมง)",
|
||||
"ZZ04": "ลากิจ (ชั่วโมงผู้จัดการ)",
|
||||
"ZZ05": "ลาป่วย (ชั่วโมงผู้จัดการ)",
|
||||
"ZZ07": "ลาไว้ทุกข์ (วันผู้จัดการ)",
|
||||
"ZZ08": "ลาคลอด (วันผู้จัดการ)",
|
||||
"ZZ09": "ลาเลี้ยงดูบุตรบิดา (วันผู้จัดการ)",
|
||||
"ZZ10": "ลาแต่งงาน (วันผู้จัดการ)",
|
||||
"035": "ลาอื่นๆ (ชั่วโมง)"
|
||||
}
|
||||
},
|
||||
"shippingNoticeMenu": {
|
||||
"upload": {
|
||||
"label": "เลือกไฟล์สต็อก",
|
||||
"message": "ต้องการอัปโหลด Excel สต็อก"
|
||||
},
|
||||
"paste": {
|
||||
"label": "วางสต็อก",
|
||||
"message": "วางตารางสต็อกขนาดเล็ก"
|
||||
},
|
||||
"retry_rpa": {
|
||||
"label": "ดึงสต็อกอีกครั้ง",
|
||||
"message": "ดึงสต็อกอีกครั้ง"
|
||||
},
|
||||
"confirm": {
|
||||
"label": "ยืนยัน",
|
||||
"message": "ยืนยัน"
|
||||
},
|
||||
"reparse": {
|
||||
"label": "แยกวิเคราะห์ใหม่",
|
||||
"message": "แยกวิเคราะห์ใหม่"
|
||||
},
|
||||
"reject": {
|
||||
"label": "ปฏิเสธ",
|
||||
"message": "ปฏิเสธ"
|
||||
}
|
||||
},
|
||||
"shippingNoticeTurn": {
|
||||
"createBatchSingle": "อัปโหลดใบแจ้งจัดส่ง: {fileName}",
|
||||
"createBatchMulti": "อัปโหลดใบแจ้งจัดส่ง {count} ไฟล์",
|
||||
"attachmentFallback": "ไฟล์แนบ",
|
||||
"confirmBatchSingle": "ยืนยันสร้างงาน: {intakeNo}",
|
||||
"confirmBatchMulti": "ยืนยันสร้างงาน: ใบแจ้งจัดส่ง {count} ไฟล์",
|
||||
"uploadInventory": "อัปโหลดไฟล์สต็อก: {fileName}",
|
||||
"replaceNotice": "อัปโหลดใบแจ้งจัดส่งใหม่: {fileName}",
|
||||
"applyMapping": "ใช้การจับคู่คอลัมน์สต็อก (งาน {taskId})",
|
||||
"withTaskId": "{text}\nรหัสงาน: {taskId}"
|
||||
},
|
||||
"shippingNoticeToast": {
|
||||
"noBatchToSwitch": "ไม่มีชุดงานให้สลับ",
|
||||
"batchOnlyOneTask": "ชุดงานปัจจุบันมีเพียง 1 รายการ ไม่ต้องสลับ",
|
||||
"taskNotFoundToSwitch": "ไม่พบงานที่จะสลับ",
|
||||
"alreadyLastTask": "อยู่รายการสุดท้ายแล้ว",
|
||||
"alreadyFirstTask": "อยู่รายการแรกแล้ว",
|
||||
"alreadyOnCurrentTask": "อยู่ที่งานปัจจุบันแล้ว",
|
||||
"switchTaskFailed": "สลับงานไม่สำเร็จ",
|
||||
"fileProcessFailed": "ประมวลผลไฟล์ไม่สำเร็จ",
|
||||
"localAttachmentOnly": "รองรับเฉพาะไฟล์แนบในเครื่องสำหรับโฟลว์อัตโนมัติ",
|
||||
"oneFileOnlyAutoFirst": "รองรับทีละหนึ่งไฟล์ จะประมวลผลไฟล์แรกโดยอัตโนมัติ",
|
||||
"missingTaskIdUploadInventory": "ไม่พบรหัสงาน กรุณาอัปโหลดไฟล์สต็อกก่อน",
|
||||
"missingTaskIdPreviousSteps": "ไม่พบรหัสงาน กรุณาทำขั้นตอนก่อนหน้าให้ครบก่อน",
|
||||
"missingTaskIdParseMatch": "ไม่พบรหัสงาน กรุณาแยกวิเคราะห์และจับคู่สต็อกให้ครบก่อน",
|
||||
"downloadExcelFailed": "ดาวน์โหลด Excel ไม่สำเร็จ",
|
||||
"autoCreateTaskFailed": "สร้างงานจัดส่งอัตโนมัติไม่สำเร็จ",
|
||||
"schemaPreviewMissing": "ไม่พบตัวอย่างหัวตาราง กรุณาอัปโหลดไฟล์สต็อกใหม่แล้วกด “แก้ไขการจับคู่”",
|
||||
"mappingFormIntro": "ใช้เมนูเลื่อนเลือกการจับคู่คอลัมน์สต็อก (ต้องเลือกจากหัวตาราง)",
|
||||
"selectSkuAndQty": "กรุณาเลือกคอลัมน์ SKU และจำนวนคงเหลือก่อน",
|
||||
"applyMappingFailed": "ใช้การจับคู่ไม่สำเร็จ",
|
||||
"updateParseFailed": "อัปเดตผลการแยกวิเคราะห์ไม่สำเร็จ",
|
||||
"addLineFailed": "เพิ่มรายการสั่งซื้อไม่สำเร็จ",
|
||||
"deleteLineFailed": "ลบรายการสั่งซื้อไม่สำเร็จ",
|
||||
"auditCommentHeaderEdit": "แก้ไขตารางคำสั่งในแชท",
|
||||
"auditCommentLineAdd": "เพิ่มแถวตารางคำสั่งในแชท",
|
||||
"auditCommentLineDelete": "ลบแถวตารางคำสั่งในแชท",
|
||||
"manualUploadedDefault": "อัปโหลดในระบบขนส่งเรียบร้อยแล้ว",
|
||||
"markManualUploadFailed": "ทำเครื่องหมายอัปโหลดด้วยตนเองไม่สำเร็จ",
|
||||
"actionFallback": "การดำเนินการ",
|
||||
"operationFailed": "ดำเนินการไม่สำเร็จ"
|
||||
},
|
||||
"shippingNoticeSanitize": {
|
||||
"retriggeredInventory": "เรียกดึงสต็อกอีกครั้งแล้ว",
|
||||
"triggeredInventory": "เริ่มดึงสต็อกแล้ว",
|
||||
"inventoryInProgress": "กำลังดึงสต็อก",
|
||||
"manualRetry": "ลองใหม่ด้วยตนเอง",
|
||||
"backToAlignConfirm": "กลับสู่ขั้นตอนยืนยันฟิลด์สต็อก โปรดตรวจชื่อคอลัมน์ที่ระบบตรวจพบ แล้วดำเนินการต่อ หรือแก้การจับคู่หากจำเป็น",
|
||||
"checkColumnsContinue": "โปรดตรวจชื่อคอลัมน์สต็อกที่ระบบตรวจพบ แล้วดำเนินการต่อ หรือแก้การจับคู่หากจำเป็น",
|
||||
"confirmHeadersFromSample": "โปรดยืนยันการจับคู่ฟิลด์จากหัวตารางและแถวตัวอย่าง",
|
||||
"uploadInCurrentChat": "อัปโหลดในแชทปัจจุบัน",
|
||||
"currentChat": "แชทปัจจุบัน",
|
||||
"toCurrentChatPrefix": "ไปยังแชทปัจจุบัน",
|
||||
"currentSystem": "ระบบปัจจุบัน",
|
||||
"taskIdLabel": "รหัสงาน: ",
|
||||
"taskIdWord": "รหัสงาน",
|
||||
"createTask": "สร้างงาน",
|
||||
"getTaskStatus": "ดูสถานะงาน",
|
||||
"parseNotice": "แยกวิเคราะห์ใบแจ้งจัดส่ง",
|
||||
"submitDecision": "ส่งผลการตัดสินใจ",
|
||||
"matchInventory": "จับคู่สต็อก",
|
||||
"generateExcel": "สร้าง Excel จัดส่ง",
|
||||
"uploadFreight": "อัปโหลดไประบบขนส่ง",
|
||||
"applyInventoryMapping": "ใช้การจับคู่ฟิลด์สต็อก",
|
||||
"getSchemaPreview": "อ่านตัวอย่างหัวตารางสต็อก",
|
||||
"schemaPreview": "ตัวอย่างหัวตารางสต็อก",
|
||||
"mapJson": "การจับคู่ฟิลด์",
|
||||
"sampleRows": "แถวตัวอย่าง",
|
||||
"retryRpa": "ดึงสต็อกอีกครั้ง",
|
||||
"retryUpload": "ลองอัปโหลดขนส่งอีกครั้ง",
|
||||
"structured": "เนื้อหาโครงสร้าง",
|
||||
"rawText": "ข้อความใบแจ้ง"
|
||||
},
|
||||
"shippingNoticeDecisionFormat": {
|
||||
"headerAtRow": "หัวตารางที่แถว {row}: {headers}",
|
||||
"currentHeaders": "หัวตารางปัจจุบัน: {headers}",
|
||||
"suggestedMapping": "การจับคู่คอลัมน์ที่แนะนำ:",
|
||||
"adjustHint": "หากต้องการปรับ โปรดระบุคอลัมน์ที่จะเปลี่ยน (เช่น available_qty ใช้ Qty Available)",
|
||||
"reuploadHint": "หรือคลิก “เลือกไฟล์สต็อก” เพื่ออัปโหลดใหม่",
|
||||
"nextMatch": "ถัดไป: จับคู่สต็อกกับความต้องการจัดส่ง",
|
||||
"reuploadOrPaste": "โปรดอัปโหลดหรือวาง Excel สต็อกใหม่",
|
||||
"taskIdLine": "รหัสงาน: {taskId}"
|
||||
},
|
||||
"shippingNoticeFieldAlignment": {
|
||||
"unrecognized": "(ไม่รู้จัก)",
|
||||
"unrecognizedOptional": "(ไม่รู้จัก / ไม่บังคับ)",
|
||||
"matchRule": "กฎการจับคู่: {rule}",
|
||||
"tableTitle": "ตารางจัดแนวฟิลด์:",
|
||||
"tableHeaderSystem": "ฟิลด์ระบบ",
|
||||
"tableHeaderInventory": "คอลัมน์สต็อก",
|
||||
"hints": "หมายเหตุ:"
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
"refresh": "รีเฟรช",
|
||||
"yes": "ใช่",
|
||||
"no": "ไม่",
|
||||
"app": {
|
||||
"title": "Hexin AI Workspace",
|
||||
"shortTitle": "AI Workspace",
|
||||
"remoteLogout": "คุณได้ออกจากระบบในแท็บอื่นแล้ว"
|
||||
},
|
||||
"sso": {
|
||||
"authorizing": "กำลังเปิดระบบภายนอก",
|
||||
"authorizingHint": "กำลังดำเนินการเข้าสู่ระบบแบบครั้งเดียวอย่างปลอดภัย โปรดรอสักครู่",
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
},
|
||||
"msg": {
|
||||
"fillContent": "กรุณากรอกเนื้อหาข้อเสนอแนะ",
|
||||
"submitFailed": "ส่งข้อเสนอแนะไม่สำเร็จ"
|
||||
"submitFailed": "ส่งข้อเสนอแนะไม่สำเร็จ",
|
||||
"submitSuccess": "ส่งข้อเสนอแนะสำเร็จ"
|
||||
},
|
||||
"cancel": "ยกเลิก",
|
||||
"submitting": "กำลังส่ง...",
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
"downloading": "กำลังดาวน์โหลด...",
|
||||
"tooLarge": "ไฟล์มีขนาดใหญ่เกินไป ไม่รองรับการพรีวิวออนไลน์ กรุณาคลิก \"ดาวน์โหลดไฟล์\" ด้านบนเพื่อรับไฟล์ต้นฉบับ",
|
||||
"previewFailed": "พรีวิวล้มเหลว: ",
|
||||
"imageCounter": "รูปที่ {current} / {total}",
|
||||
"zoomOut": "ซูมออก",
|
||||
"zoomIn": "ซูมเข้า",
|
||||
"resetZoom": "รีเซ็ตซูม",
|
||||
"prevImage": "รูปก่อนหน้า",
|
||||
"nextImage": "รูปถัดไป",
|
||||
"unsupportedRawPreview": "ไฟล์ต้นฉบับนี้ยังไม่รองรับการพรีวิวโดยตรง และได้ป้องกันการดาวน์โหลดอัตโนมัติแล้ว",
|
||||
"msg": {
|
||||
"downloadFailed": "ดาวน์โหลดล้มเหลว: {reason}",
|
||||
"unknownError": "ข้อผิดพลาดที่ไม่ทราบสาเหตุ"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"kbDifySettings": {
|
||||
"title": "ตั้งค่า Dify",
|
||||
"subtitle": "จัดการการเชื่อมต่อ Dify และค่าซิงค์เริ่มต้นของโมดูลคลังความรู้",
|
||||
@@ -391,8 +391,19 @@
|
||||
"markdownFailedRetry": "ทำความสะอาดล้มเหลว ยังไม่มี Markdown โปรดทำความสะอาดใหม่",
|
||||
"markdownProcessing": "กำลังทำความสะอาด ยังไม่มี Markdown",
|
||||
"markdownPendingClean": "รอทำความสะอาด ยังไม่มี Markdown",
|
||||
"markdownNotGenerated": "ยังไม่มี Markdown สำหรับเอกสารนี้"
|
||||
"markdownNotGenerated": "ยังไม่มี Markdown สำหรับเอกสารนี้",
|
||||
"createGroupFailed": "สร้างกลุ่มคลังความรู้ไม่สำเร็จ",
|
||||
"saveDifySettingsFailed": "บันทึกการตั้งค่า Dify ไม่สำเร็จ",
|
||||
"executeJobFailed": "รันงานไม่สำเร็จ",
|
||||
"updateDocumentFailed": "อัปเดตเอกสารไม่สำเร็จ",
|
||||
"apiNotReady": "API คลังความรู้ยังไม่พร้อม กรุณาลองใหม่ภายหลัง",
|
||||
"fileTooLarge": "ไฟล์ใหญ่เกินขีดจำกัดอัปโหลดปัจจุบัน กรุณาติดต่อผู้ดูแลเพื่อปรับขีดจำกัดแล้วลองใหม่",
|
||||
"uploadPathFileFailed": "อัปโหลดไฟล์ตามเส้นทางไม่สำเร็จ",
|
||||
"markPathFileFailedStatusFailed": "บันทึกสถานะไฟล์ล้มเหลวไม่สำเร็จ",
|
||||
"submitPathUploadFailed": "ส่งงานอัปโหลดตามเส้นทางไม่สำเร็จ",
|
||||
"submitCleanFailed": "ส่งงานทำความสะอาดไม่สำเร็จ",
|
||||
"updateGroupFailed": "อัปเดตกลุ่มคลังความรู้ไม่สำเร็จ",
|
||||
"deleteGroupFailed": "ลบกลุ่มคลังความรู้ไม่สำเร็จ"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,16 +122,20 @@
|
||||
"cancel": "ยกเลิก",
|
||||
"save": "บันทึก",
|
||||
"saving": "กำลังบันทึก...",
|
||||
"clear": "ล้าง",
|
||||
"saveAs": "บันทึกเป็น{status}",
|
||||
"viewAllHistory": "ดูประวัติทั้งหมด"
|
||||
},
|
||||
"filters": {
|
||||
"keywordPlaceholder": "ค้นหารหัสอุปกรณ์หรือชื่ออุปกรณ์",
|
||||
"recentKeywordPlaceholder": "กรองตามรหัส ปัญหา หรือผู้ซ่อม",
|
||||
"defaultHint": "ค่าเริ่มต้นแสดงเฉพาะรายการที่ยังไม่เสร็จ (รอซ่อม/กำลังซ่อม) ในช่วง 1 ปีล่าสุด หากต้องการดูประวัติทั้งหมด ให้เลือกทุกสถานะและทุกช่วงเวลา",
|
||||
"timeRangeLabel": "วันที่แจ้งซ่อม",
|
||||
"timeRange3m": "3 เดือนล่าสุด",
|
||||
"timeRange1y": "1 ปีล่าสุด",
|
||||
"timeRangeAll": "ทุกช่วงเวลา"
|
||||
},
|
||||
"recentTitle": "บันทึกซ่อมบำรุงล่าสุด",
|
||||
"table": {
|
||||
"deviceCode": "รหัสอุปกรณ์",
|
||||
"deviceName": "ชื่ออุปกรณ์",
|
||||
@@ -192,6 +196,7 @@
|
||||
"required": "ต้องระบุรหัสอุปกรณ์ วันที่แจ้งซ่อม และรายละเอียดปัญหา",
|
||||
"updated": "อัปเดตบันทึกซ่อมบำรุงแล้ว",
|
||||
"created": "เพิ่มบันทึกซ่อมบำรุงแล้ว",
|
||||
"saved": "บันทึกซ่อมบำรุงแล้ว",
|
||||
"saveFailed": "บันทึกข้อมูลซ่อมบำรุงไม่สำเร็จ",
|
||||
"deleteConfirm": "ลบบันทึกซ่อมบำรุงของ {deviceCode} หรือไม่?",
|
||||
"deleted": "ลบบันทึกซ่อมบำรุงแล้ว",
|
||||
|
||||
@@ -84,6 +84,34 @@
|
||||
"submit": "ส่งคำขอ"
|
||||
},
|
||||
"wecomEntryNotice": "เปิดมาจากข้อความ WeCom และเตรียมบริบทที่เกี่ยวข้องไว้ให้แล้ว",
|
||||
"mobileTabs": {
|
||||
"me": "ของฉัน",
|
||||
"history": "ประวัติแชท",
|
||||
"applications": "แอปพลิเคชัน"
|
||||
},
|
||||
"nav": {
|
||||
"profile": "โปรไฟล์",
|
||||
"admin": "คอนโซลผู้ดูแล",
|
||||
"applications": "แอปพลิเคชัน",
|
||||
"knowledgeBase": "คลังความรู้",
|
||||
"scheduleRuns": "บันทึกตารางงาน",
|
||||
"shippingNotice": "ใบแจ้งส่งสินค้า",
|
||||
"feedback": "ข้อเสนอแนะ",
|
||||
"updates": "อัปเดตล่าสุด",
|
||||
"backToChat": "กลับไปแชท",
|
||||
"backShort": "กลับ",
|
||||
"logout": "ออกจากระบบ"
|
||||
},
|
||||
"kb": {
|
||||
"accessDenied": "ต้องมีสิทธิ์ผู้ดูแลระบบจึงจะเข้าถึงคลังความรู้ได้"
|
||||
},
|
||||
"routes": {
|
||||
"history": "ประวัติแชท"
|
||||
},
|
||||
"history": {
|
||||
"empty": "ยังไม่มีประวัติแชท",
|
||||
"untitled": "บทสนทนาไม่มีชื่อ"
|
||||
},
|
||||
"shippingNotice": {
|
||||
"title": "ใบแจ้งส่งสินค้า",
|
||||
"subtitle": "พื้นที่ทำงานแบบอ่านอย่างเดียว โปรดดำเนินการต่อใน Chat",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"delete": "删除",
|
||||
"nav": {
|
||||
"dashboard": "仪表盘",
|
||||
"overview": "概览",
|
||||
"approvals": "用户审批",
|
||||
"users": "用户管理",
|
||||
"departments": "部门管理",
|
||||
@@ -67,6 +68,36 @@
|
||||
}
|
||||
},
|
||||
"platformApps": {
|
||||
"subtitle": "管理应用的新手指南资料(支持视频、PDF等)",
|
||||
"selectAgent": "选择应用:",
|
||||
"addGuide": "添加指南",
|
||||
"editGuide": "编辑指南",
|
||||
"selectAgentFirst": "请先选择一个应用",
|
||||
"emptyGuides": "该应用暂无新手指南资料",
|
||||
"colType": "类型",
|
||||
"colFileName": "资料名称",
|
||||
"colAgent": "Agent应用",
|
||||
"colFileSize": "文件大小",
|
||||
"colSort": "排序",
|
||||
"colStatus": "状态",
|
||||
"colActions": "操作",
|
||||
"statusEnabled": "已启用",
|
||||
"statusDisabled": "已禁用",
|
||||
"confirmDelete": "确定要删除该指南吗?删除后不可恢复。",
|
||||
"uploadFile": "上传文件",
|
||||
"uploading": "上传中...",
|
||||
"uploadReady": "已上传文件就绪",
|
||||
"uploadFailed": "上传失败",
|
||||
"fileName": "资料名称",
|
||||
"fileNamePlaceholder": "如:人事助手使用手册",
|
||||
"remark": "备注说明",
|
||||
"remarkPlaceholder": "简要说明...",
|
||||
"sortOrder": "排序权重",
|
||||
"sortOrderHint": "数值越小越靠前",
|
||||
"status": "状态",
|
||||
"enable": "启用",
|
||||
"disable": "禁用",
|
||||
"save": "保存",
|
||||
"guideUsage": "资料用途",
|
||||
"generalGuide": "通用指南",
|
||||
"trainingVideo": "员工培训视频",
|
||||
@@ -211,6 +242,11 @@
|
||||
"api": "API 集成 (Dify)",
|
||||
"iframe": "Iframe 嵌入"
|
||||
},
|
||||
"difyAppType": "Dify应用类型",
|
||||
"difyAppTypes": {
|
||||
"chatflow": "Chatflow",
|
||||
"workflow": "Workflow"
|
||||
},
|
||||
"appId": "Dify App ID",
|
||||
"apiKey": "API Key",
|
||||
"apiKeyCreatePlaceholder": "创建时必填",
|
||||
@@ -386,7 +422,19 @@
|
||||
"uncategorized": "未分类",
|
||||
"memberCount": "子应用 {count} 个",
|
||||
"normalListHint": "仅当前应用"
|
||||
}
|
||||
},
|
||||
"suggestedQuestions": {
|
||||
"title": "常见问题",
|
||||
"add": "添加问题",
|
||||
"stylePlain": "无样式",
|
||||
"styleStyled": "有样式",
|
||||
"empty": "暂未配置常见问题,点击“添加问题”后会同步到对应 Agent 的 Chat 欢迎页。",
|
||||
"questionPlaceholder": "请输入常见问题,例如:查询我有多少假期?",
|
||||
"groupPlaceholderStyled": "可选:分组标题,例如:考勤与休假",
|
||||
"groupPlaceholderPlain": "无样式下无需分组"
|
||||
},
|
||||
"createSuccess": "应用创建成功",
|
||||
"updateSuccess": "应用更新成功"
|
||||
},
|
||||
"question": {
|
||||
"title": "常用问题",
|
||||
@@ -547,7 +595,10 @@
|
||||
"nav": {
|
||||
"settings": "系统配置",
|
||||
"bindings": "绑定管理",
|
||||
"audits": "登录审计"
|
||||
"audits": "登录审计",
|
||||
"settingsPage": "企业微信配置",
|
||||
"bindingsPage": "企业微信绑定",
|
||||
"auditsPage": "企业微信审计"
|
||||
},
|
||||
"overview": {
|
||||
"bound": "已绑定 userid",
|
||||
@@ -1456,6 +1507,7 @@
|
||||
"regionPreviewRecognized": "正文区域识别成功",
|
||||
"regionPreviewIncomplete": "锚点识别不完整,实际比对将安全回退",
|
||||
"regionPreviewFailed": "区域识别预览失败",
|
||||
"regionSaved": "比对区域配置已保存"
|
||||
"regionSaved": "比对区域配置已保存",
|
||||
"defaultTemplateName": "标准采购合同"
|
||||
}
|
||||
}
|
||||
@@ -463,6 +463,7 @@
|
||||
"oaRequestMissing": "当前未获取到 OA 单据编号,暂时无法打开单据详情。",
|
||||
"devComingSoon": "该功能正在开发中",
|
||||
"previewUnavailable": "当前源文件暂时无法预览",
|
||||
"sourcePreviewLinkMissing": "当前源文件暂未返回可预览链接",
|
||||
"invalidBrowserUrl": "请输入有效的网址,例如 https://example.com 或 localhost:8891",
|
||||
"enterBrowserUrl": "请先输入可打开的网址。",
|
||||
"queryLeaveBalance": "正在查询您的假期余额,请稍候...",
|
||||
@@ -532,7 +533,9 @@
|
||||
"networkDisconnectedEmpty": "连接中断,未能获取回答,请稍后重试。",
|
||||
"partialInterrupted": "回答生成中断,以上内容可能不完整,请重新提问。",
|
||||
"upstreamDisconnected": "AI 服务连接中断,请稍后重试。",
|
||||
"generic": "请求失败,请稍后重试。"
|
||||
"generic": "请求失败,请稍后重试。",
|
||||
"contextTooLong": "当前会话上下文过长,模型无法继续回答。请新建对话后重新查询该资产编号。",
|
||||
"workflowFailed": "工作流执行失败,请稍后重试"
|
||||
},
|
||||
"actions": {
|
||||
"copy": "复制",
|
||||
@@ -977,7 +980,37 @@
|
||||
"answer": "true",
|
||||
"explanation": "产品要求必须同时覆盖法规和客户要求,这是质量体系基础。"
|
||||
}
|
||||
]
|
||||
],
|
||||
"stepExamTitle": "第三步:逐题考试",
|
||||
"stepResultTitle": "第四步:结算结果",
|
||||
"scoreShort": "{score} 分",
|
||||
"passScoreShort": "{passScore} 分",
|
||||
"currentScoreLabel": "当前分数:",
|
||||
"passLineLabel": "及格线:",
|
||||
"yourAnswerLabel": "你的答案:",
|
||||
"correctAnswerLabel": "正确答案:",
|
||||
"wrongFeedbackShort": "回答错误",
|
||||
"finishAndViewResult": "完成考试并查看结果",
|
||||
"passTitleShort": "恭喜,你已通过考核!",
|
||||
"failTitleShort": "很遗憾,考试未通过",
|
||||
"wrongCountShort": "答错",
|
||||
"syncedToHr": "成绩已同步至 HR 管理系统",
|
||||
"clickPlayVideo": "点击播放视频",
|
||||
"agentDescription": "我是你的新人培训助手,会在同一个聊天页面内带你完成视频学习、知识点复盘、逐题考试和结果复盘。",
|
||||
"defaultQuestions": {
|
||||
"employee": [
|
||||
"这次员工培训主要学习什么内容?",
|
||||
"完成培训需要经过哪些步骤?",
|
||||
"员工培训的通过规则是什么?",
|
||||
"开始考试前需要注意什么?"
|
||||
],
|
||||
"hr": [
|
||||
"现在有多少人参加了培训?",
|
||||
"当前培训通过率是多少?",
|
||||
"哪些员工还没有完成培训?",
|
||||
"我想查看本月培训成绩统计"
|
||||
]
|
||||
}
|
||||
},
|
||||
"procurementContract": {
|
||||
"modeCompare": "合同比对",
|
||||
@@ -1100,5 +1133,283 @@
|
||||
"attachmentAdded": "回传合同新增附件 {count} 页",
|
||||
"attachmentRemoved": "回传合同减少附件 {count} 页",
|
||||
"attachmentContentIgnored": "附件内容未列入差异"
|
||||
},
|
||||
"learningWindow": "学习之窗",
|
||||
"guide": {
|
||||
"collapseToc": "收起目录",
|
||||
"expandToc": "展开目录",
|
||||
"selectHint": "请选择左侧指南进行查阅"
|
||||
},
|
||||
"exitShort": "退出",
|
||||
"recommendedQuestion": "推荐问题",
|
||||
"faqGroup": "常见问题",
|
||||
"toolRun": {
|
||||
"fallbackTitle": "任务进度",
|
||||
"batch": "批次:{runNo}",
|
||||
"status": "状态:{status}",
|
||||
"errorMessage": "错误信息:{message}",
|
||||
"waitingStart": "正在等待检核任务启动...",
|
||||
"currentStep": "当前阶段:{step}",
|
||||
"currentRow": "当前记录:{rowId}",
|
||||
"stepStarted": "阶段开始:{time}",
|
||||
"downloadExcel": "下载 Excel",
|
||||
"downloading": "下载中...",
|
||||
"downloadFailed": "下载 Excel 失败",
|
||||
"downloadFailedStatus": "下载失败:{status}",
|
||||
"progress": "进度 {percent}%",
|
||||
"startedAt": "开始:{time}",
|
||||
"finishedAt": "完成:{time}",
|
||||
"total": "总数",
|
||||
"processed": "已处理",
|
||||
"success": "成功",
|
||||
"failed": "失败",
|
||||
"skipped": "跳过",
|
||||
"qualified": "合格笔数",
|
||||
"unqualified": "不合格笔数",
|
||||
"manual": "人工判定笔数",
|
||||
"kbSyncError": "知识库同步错误:{message}",
|
||||
"waitingHint": "检核启动后,这里会显示实时进度。",
|
||||
"statusRunning": "执行中",
|
||||
"statusSuccess": "已完成",
|
||||
"statusPartialFailed": "部分失败",
|
||||
"statusFailed": "失败",
|
||||
"statusCancelled": "已取消",
|
||||
"statusWaiting": "等待中",
|
||||
"kbSynced": "知识库已同步",
|
||||
"kbSyncFailed": "知识库同步失败",
|
||||
"kbSyncing": "知识库同步中",
|
||||
"kbNotSynced": "知识库未同步",
|
||||
"kbUnknown": "知识库:{status}",
|
||||
"kbStatusUnknown": "未知",
|
||||
"queryFailed": "任务进度查询失败",
|
||||
"lockWaiting": "当前任务执行中,请等待完成",
|
||||
"runNotFound": "暂未找到关联的检核任务,请稍后刷新或查看排程执行记录"
|
||||
},
|
||||
"assetColumns": {
|
||||
"id": "序号",
|
||||
"assetId": "资产编号",
|
||||
"assetName": "资产名称",
|
||||
"currencyAmount": "本币金额(元)",
|
||||
"specification": "规格型号",
|
||||
"accountPeriod": "账套",
|
||||
"custodianPerson": "保管人",
|
||||
"custodianPersonFull": "保管人姓名",
|
||||
"custodianDept": "保管部门",
|
||||
"custodianDeptFull": "保管部门名称",
|
||||
"image": "图片",
|
||||
"storageLocation": "存放位置名称",
|
||||
"assetStatus": "资产状态",
|
||||
"residualValue": "预留残值",
|
||||
"supplier": "供应商",
|
||||
"vendorAlias": "供应厂商",
|
||||
"assetNature": "资产性质",
|
||||
"quantity": "数量",
|
||||
"unit": "计量单位",
|
||||
"acquisitionDate": "取得时间",
|
||||
"acquisitionDateAlias": "取得日期",
|
||||
"accountingDate": "入账日期",
|
||||
"createdAt": "创建时间",
|
||||
"updatedAt": "更新时间",
|
||||
"snapshotTime": "快照时间",
|
||||
"empty": "无",
|
||||
"view": "查看"
|
||||
},
|
||||
"assetHistory": {
|
||||
"title": "资产履历",
|
||||
"currentAsset": "当前资产:{name}",
|
||||
"searching": "正在检索共享盘履历文件...",
|
||||
"empty": "未找到匹配的履历文件",
|
||||
"modifiedAt": "修改时间:{time}",
|
||||
"sizeKb": "大小:{size} KB",
|
||||
"matchReason": "匹配方式:{reason}",
|
||||
"viewFile": "查看履历",
|
||||
"searchingToast": "正在搜索该资产的履历资料,请耐心等待...",
|
||||
"missingIdentifier": "当前资产缺少可用于检索履历的编号或名称",
|
||||
"notFound": "未找到资产 {name} 的履历文件,如确认应有履历,请联系管理员补充。",
|
||||
"queryFailed": "履历查询失败:{message}",
|
||||
"searchFailed": "检索资产履历失败",
|
||||
"shareNotConfigured": "当前系统暂未配置资产履历文件目录,暂时无法查看履历,请联系管理员处理。",
|
||||
"shareUnreachable": "当前环境暂时无法访问资产履历共享盘,请联系管理员检查测试环境共享盘挂载或访问权限。",
|
||||
"shareInvalid": "当前环境的资产履历目录配置无效,请联系管理员检查共享盘目录配置。"
|
||||
},
|
||||
"assetImage": {
|
||||
"searchingToast": "正在搜索该资产的图片资料,请耐心等待...",
|
||||
"missingIdentifier": "当前资产缺少可用于检索图片的编号或名称",
|
||||
"notFound": "未找到资产 {name} 的图片文件,请联系管理员补充。",
|
||||
"queryFailed": "图片查询失败:{message}",
|
||||
"searchFailed": "检索固定资产图片失败",
|
||||
"libraryNotConfigured": "当前系统暂未配置固定资产图片文档库,暂时无法查看图片,请联系管理员处理。",
|
||||
"noPhotoUploaded": "设备管理员还未上传照片~"
|
||||
},
|
||||
"queryPreview": {
|
||||
"title": "查询结果全量预览",
|
||||
"viewAll": "查看全部预览",
|
||||
"viewAllWithTotal": "查看全部预览(共 {total} 条)",
|
||||
"agentNotReady": "当前 Agent 未就绪,请稍后重试",
|
||||
"loadFailed": "加载全量预览失败",
|
||||
"summary": "共 {total} 条,当前第 {page} / {pages} 页",
|
||||
"prev": "上一页",
|
||||
"next": "下一页",
|
||||
"empty": "暂无可预览数据"
|
||||
},
|
||||
"attachmentsUi": {
|
||||
"title": "附件",
|
||||
"uploadLocal": "上传本地文件",
|
||||
"pasteUrl": "粘贴 URL",
|
||||
"urlPlaceholder": "粘贴附件 URL(http/https)",
|
||||
"add": "添加",
|
||||
"cancel": "取消",
|
||||
"limitReached": "附件数量已达上限({limit})",
|
||||
"unsupportedType": "不支持的附件类型:{name}",
|
||||
"typeNotAllowed": "当前应用不支持上传此类型附件:{type}",
|
||||
"tooLarge": "附件过大(上限 {limit}MB):{name}",
|
||||
"typeLimitReached": "该类型附件数量已达上限({limit})",
|
||||
"httpOnly": "仅支持 http/https URL",
|
||||
"urlNotSupported": "当前应用不支持 URL 附件",
|
||||
"unsupportedUrlType": "不支持的 URL 附件类型",
|
||||
"urlTypeNotAllowed": "当前应用不支持该类型 URL 附件:{type}",
|
||||
"processFailed": "附件处理失败:{message}{suffix}"
|
||||
},
|
||||
"leave": {
|
||||
"types": {
|
||||
"401": "产假(天)",
|
||||
"402": "陪产假(天)",
|
||||
"403": "婚假(天)",
|
||||
"405": "住院病假(小时)",
|
||||
"406": "工伤假(天)",
|
||||
"408": "育儿假(小时)",
|
||||
"005": "事假(小时)",
|
||||
"006": "病假(小时)",
|
||||
"007": "丧假(天)",
|
||||
"010": "年假(天)",
|
||||
"021": "因公出差(小时)",
|
||||
"025": "调休假(小时)",
|
||||
"ZZ01": "返乡假(小时)",
|
||||
"ZZ04": "事假(经理专用小时)",
|
||||
"ZZ05": "病假(经理专用小时)",
|
||||
"ZZ07": "丧假(经理专用天)",
|
||||
"ZZ08": "产假(经理专用天)",
|
||||
"ZZ09": "陪产假(经理专用天)",
|
||||
"ZZ10": "婚假(经理专用天)",
|
||||
"035": "其他假(小时)"
|
||||
}
|
||||
},
|
||||
"shippingNoticeMenu": {
|
||||
"upload": {
|
||||
"label": "选择库存文件",
|
||||
"message": "我要上传库存 Excel"
|
||||
},
|
||||
"paste": {
|
||||
"label": "粘贴库存",
|
||||
"message": "我粘贴库存小表"
|
||||
},
|
||||
"retry_rpa": {
|
||||
"label": "重新获取库存",
|
||||
"message": "重新获取库存"
|
||||
},
|
||||
"confirm": {
|
||||
"label": "确认",
|
||||
"message": "确认"
|
||||
},
|
||||
"reparse": {
|
||||
"label": "重新解析",
|
||||
"message": "重新解析"
|
||||
},
|
||||
"reject": {
|
||||
"label": "驳回",
|
||||
"message": "驳回"
|
||||
}
|
||||
},
|
||||
"shippingNoticeTurn": {
|
||||
"createBatchSingle": "上传发货通知:{fileName}",
|
||||
"createBatchMulti": "上传 {count} 份发货通知",
|
||||
"attachmentFallback": "附件",
|
||||
"confirmBatchSingle": "确认建单:{intakeNo}",
|
||||
"confirmBatchMulti": "确认建单:{count} 份发货通知",
|
||||
"uploadInventory": "上传库存文件:{fileName}",
|
||||
"replaceNotice": "重新上传发货通知:{fileName}",
|
||||
"applyMapping": "应用库存列映射(任务 {taskId})",
|
||||
"withTaskId": "{text}\n任务编号:{taskId}"
|
||||
},
|
||||
"shippingNoticeToast": {
|
||||
"noBatchToSwitch": "当前没有可切换的批次",
|
||||
"batchOnlyOneTask": "当前批次只有 1 票,无需切换",
|
||||
"taskNotFoundToSwitch": "未找到要切换的任务",
|
||||
"alreadyLastTask": "已经是最后一票",
|
||||
"alreadyFirstTask": "已经是第一票",
|
||||
"alreadyOnCurrentTask": "已在当前任务",
|
||||
"switchTaskFailed": "切换任务失败",
|
||||
"fileProcessFailed": "文件处理失败",
|
||||
"localAttachmentOnly": "当前仅支持本地附件触发自动流程",
|
||||
"oneFileOnlyAutoFirst": "一次仅支持处理一个文件,将自动处理第一个",
|
||||
"missingTaskIdUploadInventory": "未找到任务编号,请先上传库存文件",
|
||||
"missingTaskIdPreviousSteps": "未找到任务编号,请先完成前面的步骤",
|
||||
"missingTaskIdParseMatch": "未找到任务编号,请先完成解析与库存匹配",
|
||||
"downloadExcelFailed": "下载 Excel 失败",
|
||||
"autoCreateTaskFailed": "自动创建发货任务失败",
|
||||
"schemaPreviewMissing": "未找到表头预览,请重新上传库存文件后再点击“修改映射”",
|
||||
"mappingFormIntro": "请用下拉框选择库存列映射(必须从表头中选择)。",
|
||||
"selectSkuAndQty": "请先选择 SKU 列 与 可用数量列",
|
||||
"applyMappingFailed": "应用映射失败",
|
||||
"updateParseFailed": "更新解析结果失败",
|
||||
"addLineFailed": "新增订单行失败",
|
||||
"deleteLineFailed": "删除订单行失败",
|
||||
"auditCommentHeaderEdit": "聊天区订单表修订",
|
||||
"auditCommentLineAdd": "聊天区订单表新增行",
|
||||
"auditCommentLineDelete": "聊天区订单表删除行",
|
||||
"manualUploadedDefault": "我已在货代系统完成上传",
|
||||
"markManualUploadFailed": "标记手工上传失败",
|
||||
"actionFallback": "操作",
|
||||
"operationFailed": "操作失败"
|
||||
},
|
||||
"shippingNoticeSanitize": {
|
||||
"retriggeredInventory": "已重新触发库存获取。",
|
||||
"triggeredInventory": "已触发库存获取。",
|
||||
"inventoryInProgress": "库存获取进行中。",
|
||||
"manualRetry": "手动重试",
|
||||
"backToAlignConfirm": "已回到库存字段确认步骤。请检查系统识别的库存列名,确认无误后继续;如有问题请修改映射。",
|
||||
"checkColumnsContinue": "请检查系统识别的库存列名,确认无误后继续;如有问题请修改映射。",
|
||||
"confirmHeadersFromSample": "请根据库存表头和样例行确认字段对应关系。",
|
||||
"uploadInCurrentChat": "在当前对话中上传",
|
||||
"currentChat": "当前对话",
|
||||
"toCurrentChatPrefix": "到当前对话",
|
||||
"currentSystem": "当前系统",
|
||||
"taskIdLabel": "任务编号:",
|
||||
"taskIdWord": "任务编号",
|
||||
"createTask": "新建任务",
|
||||
"getTaskStatus": "查询任务状态",
|
||||
"parseNotice": "解析发货通知",
|
||||
"submitDecision": "提交处理结果",
|
||||
"matchInventory": "匹配库存",
|
||||
"generateExcel": "生成发货 Excel",
|
||||
"uploadFreight": "上传货代系统",
|
||||
"applyInventoryMapping": "应用库存字段映射",
|
||||
"getSchemaPreview": "读取库存表头预览",
|
||||
"schemaPreview": "库存表头预览",
|
||||
"mapJson": "字段映射",
|
||||
"sampleRows": "样例行",
|
||||
"retryRpa": "重新获取库存",
|
||||
"retryUpload": "重试上传货代",
|
||||
"structured": "结构化内容",
|
||||
"rawText": "通知原文"
|
||||
},
|
||||
"shippingNoticeDecisionFormat": {
|
||||
"headerAtRow": "表头在第 {row} 行:{headers}",
|
||||
"currentHeaders": "当前表头:{headers}",
|
||||
"suggestedMapping": "建议列映射:",
|
||||
"adjustHint": "如需调整,请说明要改的列(例如:available_qty 改用 Qty Available)。",
|
||||
"reuploadHint": "也可点击「选择库存文件」重新上传。",
|
||||
"nextMatch": "下一步:匹配库存与发货需求。",
|
||||
"reuploadOrPaste": "请重新上传或粘贴库存 Excel。",
|
||||
"taskIdLine": "任务编号:{taskId}"
|
||||
},
|
||||
"shippingNoticeFieldAlignment": {
|
||||
"unrecognized": "(未识别)",
|
||||
"unrecognizedOptional": "(未识别/可选)",
|
||||
"matchRule": "匹配规则:{rule}",
|
||||
"tableTitle": "字段对齐表:",
|
||||
"tableHeaderSystem": "系统字段",
|
||||
"tableHeaderInventory": "库存列",
|
||||
"hints": "提示:"
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
"refresh": "刷新",
|
||||
"yes": "是",
|
||||
"no": "否",
|
||||
"app": {
|
||||
"title": "和信AI智能工作台",
|
||||
"shortTitle": "AI工作台",
|
||||
"remoteLogout": "您已在其他标签页退出登录"
|
||||
},
|
||||
"sso": {
|
||||
"authorizing": "正在进入第三方系统",
|
||||
"authorizingHint": "正在安全地完成统一登录,请稍候。",
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
},
|
||||
"msg": {
|
||||
"fillContent": "请填写反馈内容",
|
||||
"submitFailed": "提交反馈失败"
|
||||
"submitFailed": "提交反馈失败",
|
||||
"submitSuccess": "反馈提交成功"
|
||||
},
|
||||
"cancel": "取消",
|
||||
"submitting": "提交中...",
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
"downloading": "下载中...",
|
||||
"tooLarge": "文件较大,暂不支持在线预览。",
|
||||
"previewFailed": "预览失败:",
|
||||
"imageCounter": "第 {current} / {total} 张",
|
||||
"zoomOut": "缩小",
|
||||
"zoomIn": "放大",
|
||||
"resetZoom": "重置缩放",
|
||||
"prevImage": "上一张",
|
||||
"nextImage": "下一张",
|
||||
"unsupportedRawPreview": "当前原始文件暂不支持直接预览,已阻止浏览器自动下载",
|
||||
"msg": {
|
||||
"downloadFailed": "下载失败: {reason}",
|
||||
"unknownError": "未知错误"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"kbDifySettings": {
|
||||
"title": "Dify 设置",
|
||||
"subtitle": "管理知识库模块使用的 Dify 连接和默认同步参数。",
|
||||
@@ -391,8 +391,19 @@
|
||||
"markdownFailedRetry": "当前文档清洗失败,尚未生成 Markdown,请重新清洗后重试",
|
||||
"markdownProcessing": "当前文档正在清洗中,暂未生成 Markdown,请稍后再试",
|
||||
"markdownPendingClean": "当前文档待清洗,暂未生成 Markdown,请先发起清洗",
|
||||
"markdownNotGenerated": "当前文档尚未生成 Markdown"
|
||||
"markdownNotGenerated": "当前文档尚未生成 Markdown",
|
||||
"createGroupFailed": "创建知识库分组失败",
|
||||
"saveDifySettingsFailed": "保存 Dify 设置失败",
|
||||
"executeJobFailed": "执行任务失败",
|
||||
"updateDocumentFailed": "更新文档失败",
|
||||
"apiNotReady": "知识库接口暂未就绪,请稍后再试",
|
||||
"fileTooLarge": "文件过大,超过当前上传限制,请联系管理员放宽限制后重试",
|
||||
"uploadPathFileFailed": "上传路径文件失败",
|
||||
"markPathFileFailedStatusFailed": "记录路径文件失败状态失败",
|
||||
"submitPathUploadFailed": "提交路径上传任务失败",
|
||||
"submitCleanFailed": "提交清洗任务失败",
|
||||
"updateGroupFailed": "更新知识库分组失败",
|
||||
"deleteGroupFailed": "删除知识库分组失败"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,16 +122,20 @@
|
||||
"cancel": "取消",
|
||||
"save": "保存",
|
||||
"saving": "保存中...",
|
||||
"clear": "清空",
|
||||
"saveAs": "保存为{status}",
|
||||
"viewAllHistory": "查看全部历史"
|
||||
},
|
||||
"filters": {
|
||||
"keywordPlaceholder": "搜索设备编号、设备名称",
|
||||
"recentKeywordPlaceholder": "筛选设备编号、故障、维修人",
|
||||
"defaultHint": "默认显示近一年内未完成(待维修、维修中)的记录;查全部历史请选择「全部状态」和「全部时间」。",
|
||||
"timeRangeLabel": "报修时间",
|
||||
"timeRange3m": "近 3 个月",
|
||||
"timeRange1y": "近 1 年",
|
||||
"timeRangeAll": "全部时间"
|
||||
},
|
||||
"recentTitle": "最近维修记录",
|
||||
"table": {
|
||||
"deviceCode": "设备编号",
|
||||
"deviceName": "设备名称",
|
||||
@@ -192,6 +196,7 @@
|
||||
"required": "设备编号、报修日期和故障描述不能为空",
|
||||
"updated": "维修记录已更新",
|
||||
"created": "维修记录已新增",
|
||||
"saved": "维修记录已保存",
|
||||
"saveFailed": "保存维修记录失败",
|
||||
"deleteConfirm": "确认删除 {deviceCode} 的维修记录?",
|
||||
"deleted": "维修记录已删除",
|
||||
|
||||
@@ -103,8 +103,15 @@
|
||||
"feedback": "意见反馈",
|
||||
"updates": "最近更新",
|
||||
"backToChat": "返回聊天",
|
||||
"backShort": "返",
|
||||
"logout": "退出登录"
|
||||
},
|
||||
"kb": {
|
||||
"accessDenied": "需要管理员权限才能访问知识库。"
|
||||
},
|
||||
"routes": {
|
||||
"history": "聊天历史"
|
||||
},
|
||||
"history": {
|
||||
"empty": "暂无历史会话",
|
||||
"untitled": "未命名对话"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"delete": "刪除",
|
||||
"nav": {
|
||||
"dashboard": "儀表盤",
|
||||
"overview": "概覽",
|
||||
"approvals": "用戶審批",
|
||||
"users": "用戶管理",
|
||||
"departments": "部門管理",
|
||||
@@ -67,6 +68,36 @@
|
||||
}
|
||||
},
|
||||
"platformApps": {
|
||||
"subtitle": "管理應用的新手指南資料(支援視頻、PDF 等)",
|
||||
"selectAgent": "選擇應用:",
|
||||
"addGuide": "新增指南",
|
||||
"editGuide": "編輯指南",
|
||||
"selectAgentFirst": "請先選擇一個應用",
|
||||
"emptyGuides": "該應用暫無新手指南資料",
|
||||
"colType": "類型",
|
||||
"colFileName": "資料名稱",
|
||||
"colAgent": "Agent 應用",
|
||||
"colFileSize": "檔案大小",
|
||||
"colSort": "排序",
|
||||
"colStatus": "狀態",
|
||||
"colActions": "操作",
|
||||
"statusEnabled": "已啟用",
|
||||
"statusDisabled": "已停用",
|
||||
"confirmDelete": "確定要刪除該指南嗎?刪除後不可恢復。",
|
||||
"uploadFile": "上傳檔案",
|
||||
"uploading": "上傳中...",
|
||||
"uploadReady": "已上傳檔案就緒",
|
||||
"uploadFailed": "上傳失敗",
|
||||
"fileName": "資料名稱",
|
||||
"fileNamePlaceholder": "如:人事助手使用手冊",
|
||||
"remark": "備註說明",
|
||||
"remarkPlaceholder": "簡要說明...",
|
||||
"sortOrder": "排序權重",
|
||||
"sortOrderHint": "數值越小越靠前",
|
||||
"status": "狀態",
|
||||
"enable": "啟用",
|
||||
"disable": "停用",
|
||||
"save": "儲存",
|
||||
"guideUsage": "資料用途",
|
||||
"generalGuide": "通用指南",
|
||||
"trainingVideo": "員工培訓視頻",
|
||||
@@ -211,6 +242,11 @@
|
||||
"api": "API 集成 (Dify)",
|
||||
"iframe": "Iframe 嵌入"
|
||||
},
|
||||
"difyAppType": "Dify 應用類型",
|
||||
"difyAppTypes": {
|
||||
"chatflow": "Chatflow",
|
||||
"workflow": "Workflow"
|
||||
},
|
||||
"appId": "Dify App ID",
|
||||
"apiKey": "API Key",
|
||||
"apiKeyCreatePlaceholder": "建立時必填",
|
||||
@@ -386,7 +422,19 @@
|
||||
"uncategorized": "未分類",
|
||||
"memberCount": "子應用 {count} 個",
|
||||
"normalListHint": "僅目前應用"
|
||||
}
|
||||
},
|
||||
"suggestedQuestions": {
|
||||
"title": "常見問題",
|
||||
"add": "新增問題",
|
||||
"stylePlain": "無樣式",
|
||||
"styleStyled": "有樣式",
|
||||
"empty": "暫未配置常見問題,點擊「新增問題」後會同步到對應 Agent 的 Chat 歡迎頁。",
|
||||
"questionPlaceholder": "請輸入常見問題,例如:查詢我有多少假期?",
|
||||
"groupPlaceholderStyled": "可選:分組標題,例如:考勤與休假",
|
||||
"groupPlaceholderPlain": "無樣式下無需分組"
|
||||
},
|
||||
"createSuccess": "應用建立成功",
|
||||
"updateSuccess": "應用更新成功"
|
||||
},
|
||||
"question": {
|
||||
"title": "常用問題",
|
||||
@@ -547,7 +595,10 @@
|
||||
"nav": {
|
||||
"settings": "系統配置",
|
||||
"bindings": "綁定管理",
|
||||
"audits": "登入審計"
|
||||
"audits": "登入審計",
|
||||
"settingsPage": "企業微信配置",
|
||||
"bindingsPage": "企業微信綁定",
|
||||
"auditsPage": "企業微信審計"
|
||||
},
|
||||
"overview": {
|
||||
"bound": "已綁定 userid",
|
||||
@@ -1347,6 +1398,7 @@
|
||||
"regionPreviewRecognized": "正文區域識別成功",
|
||||
"regionPreviewIncomplete": "錨點識別不完整,實際比對將安全回退",
|
||||
"regionPreviewFailed": "區域識別預覽失敗",
|
||||
"regionSaved": "比對區域設定已儲存"
|
||||
"regionSaved": "比對區域設定已儲存",
|
||||
"defaultTemplateName": "標準採購合同"
|
||||
}
|
||||
}
|
||||
@@ -463,6 +463,7 @@
|
||||
"oaRequestMissing": "目前未取得 OA 單據編號,暫時無法開啟單據詳情。",
|
||||
"devComingSoon": "該功能正在開發中",
|
||||
"previewUnavailable": "目前源文件暫時無法預覽",
|
||||
"sourcePreviewLinkMissing": "目前源文件尚未回傳可預覽連結",
|
||||
"invalidBrowserUrl": "請輸入有效網址,例如 https://example.com 或 localhost:8891",
|
||||
"enterBrowserUrl": "請先輸入可開啟的網址。",
|
||||
"queryLeaveBalance": "正在查詢您的假期餘額,請稍候...",
|
||||
@@ -532,7 +533,9 @@
|
||||
"networkDisconnectedEmpty": "連線中斷,未能取得回答,請稍後重試。",
|
||||
"partialInterrupted": "回答生成中斷,以上內容可能不完整,請重新提問。",
|
||||
"upstreamDisconnected": "AI 服務連線中斷,請稍後重試。",
|
||||
"generic": "請求失敗,請稍後重試。"
|
||||
"generic": "請求失敗,請稍後重試。",
|
||||
"contextTooLong": "當前會話上下文過長,模型無法繼續回答。請新建對話後重新查詢該資產編號。",
|
||||
"workflowFailed": "工作流執行失敗,請稍後重試"
|
||||
},
|
||||
"actions": {
|
||||
"copy": "複製",
|
||||
@@ -977,7 +980,37 @@
|
||||
"answer": "true",
|
||||
"explanation": "產品要求必須同時覆蓋法規和客戶要求,這是品質體系基礎。"
|
||||
}
|
||||
]
|
||||
],
|
||||
"stepExamTitle": "第三步:逐題考試",
|
||||
"stepResultTitle": "第四步:結算結果",
|
||||
"scoreShort": "{score} 分",
|
||||
"passScoreShort": "{passScore} 分",
|
||||
"currentScoreLabel": "當前分數:",
|
||||
"passLineLabel": "及格線:",
|
||||
"yourAnswerLabel": "你的答案:",
|
||||
"correctAnswerLabel": "正確答案:",
|
||||
"wrongFeedbackShort": "回答錯誤",
|
||||
"finishAndViewResult": "完成考試並查看結果",
|
||||
"passTitleShort": "恭喜,你已通過考核!",
|
||||
"failTitleShort": "很遺憾,考試未通過",
|
||||
"wrongCountShort": "答錯",
|
||||
"syncedToHr": "成績已同步至 HR 管理系統",
|
||||
"clickPlayVideo": "點擊播放影片",
|
||||
"agentDescription": "我是你的新人培訓助手,會在同一個聊天頁面內帶你完成影片學習、知識點複盤、逐題考試和結果複盤。",
|
||||
"defaultQuestions": {
|
||||
"employee": [
|
||||
"這次員工培訓主要學習什麼內容?",
|
||||
"完成培訓需要經過哪些步驟?",
|
||||
"員工培訓的通過規則是什麼?",
|
||||
"開始考試前需要注意什麼?"
|
||||
],
|
||||
"hr": [
|
||||
"現在有多少人參加了培訓?",
|
||||
"當前培訓通過率是多少?",
|
||||
"哪些員工還沒有完成培訓?",
|
||||
"我想查看本月培訓成績統計"
|
||||
]
|
||||
}
|
||||
},
|
||||
"procurementContract": {
|
||||
"modeCompare": "合同比對",
|
||||
@@ -1100,5 +1133,283 @@
|
||||
"attachmentAdded": "回傳合約新增附件 {count} 頁",
|
||||
"attachmentRemoved": "回傳合約減少附件 {count} 頁",
|
||||
"attachmentContentIgnored": "附件內容未列入差異"
|
||||
},
|
||||
"learningWindow": "學習之窗",
|
||||
"guide": {
|
||||
"collapseToc": "收起目錄",
|
||||
"expandToc": "展開目錄",
|
||||
"selectHint": "請選擇左側指南進行查閱"
|
||||
},
|
||||
"exitShort": "退出",
|
||||
"recommendedQuestion": "推薦問題",
|
||||
"faqGroup": "常見問題",
|
||||
"toolRun": {
|
||||
"fallbackTitle": "任務進度",
|
||||
"batch": "批次:{runNo}",
|
||||
"status": "狀態:{status}",
|
||||
"errorMessage": "錯誤資訊:{message}",
|
||||
"waitingStart": "正在等待檢核任務啟動...",
|
||||
"currentStep": "當前階段:{step}",
|
||||
"currentRow": "當前記錄:{rowId}",
|
||||
"stepStarted": "階段開始:{time}",
|
||||
"downloadExcel": "下載 Excel",
|
||||
"downloading": "下載中...",
|
||||
"downloadFailed": "下載 Excel 失敗",
|
||||
"downloadFailedStatus": "下載失敗:{status}",
|
||||
"progress": "進度 {percent}%",
|
||||
"startedAt": "開始:{time}",
|
||||
"finishedAt": "完成:{time}",
|
||||
"total": "總數",
|
||||
"processed": "已處理",
|
||||
"success": "成功",
|
||||
"failed": "失敗",
|
||||
"skipped": "跳過",
|
||||
"qualified": "合格筆數",
|
||||
"unqualified": "不合格筆數",
|
||||
"manual": "人工判定筆數",
|
||||
"kbSyncError": "知識庫同步錯誤:{message}",
|
||||
"waitingHint": "檢核啟動後,這裡會顯示即時進度。",
|
||||
"statusRunning": "執行中",
|
||||
"statusSuccess": "已完成",
|
||||
"statusPartialFailed": "部分失敗",
|
||||
"statusFailed": "失敗",
|
||||
"statusCancelled": "已取消",
|
||||
"statusWaiting": "等待中",
|
||||
"kbSynced": "知識庫已同步",
|
||||
"kbSyncFailed": "知識庫同步失敗",
|
||||
"kbSyncing": "知識庫同步中",
|
||||
"kbNotSynced": "知識庫未同步",
|
||||
"kbUnknown": "知識庫:{status}",
|
||||
"kbStatusUnknown": "未知",
|
||||
"queryFailed": "任務進度查詢失敗",
|
||||
"lockWaiting": "當前任務執行中,請等待完成",
|
||||
"runNotFound": "暫未找到關聯的檢核任務,請稍後重新整理或查看排程執行記錄"
|
||||
},
|
||||
"assetColumns": {
|
||||
"id": "序號",
|
||||
"assetId": "資產編號",
|
||||
"assetName": "資產名稱",
|
||||
"currencyAmount": "本幣金額(元)",
|
||||
"specification": "規格型號",
|
||||
"accountPeriod": "帳套",
|
||||
"custodianPerson": "保管人",
|
||||
"custodianPersonFull": "保管人姓名",
|
||||
"custodianDept": "保管部門",
|
||||
"custodianDeptFull": "保管部門名稱",
|
||||
"image": "圖片",
|
||||
"storageLocation": "存放位置名稱",
|
||||
"assetStatus": "資產狀態",
|
||||
"residualValue": "預留殘值",
|
||||
"supplier": "供應商",
|
||||
"vendorAlias": "供應廠商",
|
||||
"assetNature": "資產性質",
|
||||
"quantity": "數量",
|
||||
"unit": "計量單位",
|
||||
"acquisitionDate": "取得時間",
|
||||
"acquisitionDateAlias": "取得日期",
|
||||
"accountingDate": "入帳日期",
|
||||
"createdAt": "建立時間",
|
||||
"updatedAt": "更新時間",
|
||||
"snapshotTime": "快照時間",
|
||||
"empty": "無",
|
||||
"view": "查看"
|
||||
},
|
||||
"assetHistory": {
|
||||
"title": "資產履歷",
|
||||
"currentAsset": "當前資產:{name}",
|
||||
"searching": "正在檢索共用磁碟履歷檔案...",
|
||||
"empty": "未找到符合的履歷檔案",
|
||||
"modifiedAt": "修改時間:{time}",
|
||||
"sizeKb": "大小:{size} KB",
|
||||
"matchReason": "比對方式:{reason}",
|
||||
"viewFile": "查看履歷",
|
||||
"searchingToast": "正在搜尋該資產的履歷資料,請耐心等待...",
|
||||
"missingIdentifier": "當前資產缺少可用於檢索履歷的編號或名稱",
|
||||
"notFound": "未找到資產 {name} 的履歷檔案,如確認應有履歷,請聯絡管理員補充。",
|
||||
"queryFailed": "履歷查詢失敗:{message}",
|
||||
"searchFailed": "檢索資產履歷失敗",
|
||||
"shareNotConfigured": "當前系統暫未設定資產履歷檔案目錄,暫時無法查看履歷,請聯絡管理員處理。",
|
||||
"shareUnreachable": "當前環境暫時無法存取資產履歷共用磁碟,請聯絡管理員檢查測試環境掛載或存取權限。",
|
||||
"shareInvalid": "當前環境的資產履歷目錄設定無效,請聯絡管理員檢查共用磁碟目錄設定。"
|
||||
},
|
||||
"assetImage": {
|
||||
"searchingToast": "正在搜尋該資產的圖片資料,請耐心等待...",
|
||||
"missingIdentifier": "當前資產缺少可用於檢索圖片的編號或名稱",
|
||||
"notFound": "未找到資產 {name} 的圖片檔案,請聯絡管理員補充。",
|
||||
"queryFailed": "圖片查詢失敗:{message}",
|
||||
"searchFailed": "檢索固定資產圖片失敗",
|
||||
"libraryNotConfigured": "當前系統暫未設定固定資產圖片文件庫,暫時無法查看圖片,請聯絡管理員處理。",
|
||||
"noPhotoUploaded": "設備管理員尚未上傳照片~"
|
||||
},
|
||||
"queryPreview": {
|
||||
"title": "查詢結果全量預覽",
|
||||
"viewAll": "查看全部預覽",
|
||||
"viewAllWithTotal": "查看全部預覽(共 {total} 條)",
|
||||
"agentNotReady": "當前 Agent 未就緒,請稍後重試",
|
||||
"loadFailed": "載入全量預覽失敗",
|
||||
"summary": "共 {total} 條,當前第 {page} / {pages} 頁",
|
||||
"prev": "上一頁",
|
||||
"next": "下一頁",
|
||||
"empty": "暫無可預覽資料"
|
||||
},
|
||||
"attachmentsUi": {
|
||||
"title": "附件",
|
||||
"uploadLocal": "上傳本機檔案",
|
||||
"pasteUrl": "貼上 URL",
|
||||
"urlPlaceholder": "貼上附件 URL(http/https)",
|
||||
"add": "新增",
|
||||
"cancel": "取消",
|
||||
"limitReached": "附件數量已達上限({limit})",
|
||||
"unsupportedType": "不支援的附件類型:{name}",
|
||||
"typeNotAllowed": "當前應用不支援上傳此類型附件:{type}",
|
||||
"tooLarge": "附件過大(上限 {limit}MB):{name}",
|
||||
"typeLimitReached": "該類型附件數量已達上限({limit})",
|
||||
"httpOnly": "僅支援 http/https URL",
|
||||
"urlNotSupported": "當前應用不支援 URL 附件",
|
||||
"unsupportedUrlType": "不支援的 URL 附件類型",
|
||||
"urlTypeNotAllowed": "當前應用不支援該類型 URL 附件:{type}",
|
||||
"processFailed": "附件處理失敗:{message}{suffix}"
|
||||
},
|
||||
"leave": {
|
||||
"types": {
|
||||
"401": "產假(天)",
|
||||
"402": "陪產假(天)",
|
||||
"403": "婚假(天)",
|
||||
"405": "住院病假(小時)",
|
||||
"406": "工傷假(天)",
|
||||
"408": "育兒假(小時)",
|
||||
"005": "事假(小時)",
|
||||
"006": "病假(小時)",
|
||||
"007": "喪假(天)",
|
||||
"010": "年假(天)",
|
||||
"021": "因公出差(小時)",
|
||||
"025": "調休假(小時)",
|
||||
"ZZ01": "返鄉假(小時)",
|
||||
"ZZ04": "事假(經理專用小時)",
|
||||
"ZZ05": "病假(經理專用小時)",
|
||||
"ZZ07": "喪假(經理專用天)",
|
||||
"ZZ08": "產假(經理專用天)",
|
||||
"ZZ09": "陪產假(經理專用天)",
|
||||
"ZZ10": "婚假(經理專用天)",
|
||||
"035": "其他假(小時)"
|
||||
}
|
||||
},
|
||||
"shippingNoticeMenu": {
|
||||
"upload": {
|
||||
"label": "選擇庫存檔案",
|
||||
"message": "我要上傳庫存 Excel"
|
||||
},
|
||||
"paste": {
|
||||
"label": "貼上庫存",
|
||||
"message": "我貼上庫存小表"
|
||||
},
|
||||
"retry_rpa": {
|
||||
"label": "重新取得庫存",
|
||||
"message": "重新取得庫存"
|
||||
},
|
||||
"confirm": {
|
||||
"label": "確認",
|
||||
"message": "確認"
|
||||
},
|
||||
"reparse": {
|
||||
"label": "重新解析",
|
||||
"message": "重新解析"
|
||||
},
|
||||
"reject": {
|
||||
"label": "駁回",
|
||||
"message": "駁回"
|
||||
}
|
||||
},
|
||||
"shippingNoticeTurn": {
|
||||
"createBatchSingle": "上傳出貨通知:{fileName}",
|
||||
"createBatchMulti": "上傳 {count} 份出貨通知",
|
||||
"attachmentFallback": "附件",
|
||||
"confirmBatchSingle": "確認建單:{intakeNo}",
|
||||
"confirmBatchMulti": "確認建單:{count} 份出貨通知",
|
||||
"uploadInventory": "上傳庫存檔案:{fileName}",
|
||||
"replaceNotice": "重新上傳出貨通知:{fileName}",
|
||||
"applyMapping": "套用庫存欄位對應(任務 {taskId})",
|
||||
"withTaskId": "{text}\n任務編號:{taskId}"
|
||||
},
|
||||
"shippingNoticeToast": {
|
||||
"noBatchToSwitch": "目前沒有可切換的批次",
|
||||
"batchOnlyOneTask": "目前批次只有 1 票,無需切換",
|
||||
"taskNotFoundToSwitch": "找不到要切換的任務",
|
||||
"alreadyLastTask": "已經是最後一票",
|
||||
"alreadyFirstTask": "已經是第一票",
|
||||
"alreadyOnCurrentTask": "已在目前任務",
|
||||
"switchTaskFailed": "切換任務失敗",
|
||||
"fileProcessFailed": "檔案處理失敗",
|
||||
"localAttachmentOnly": "目前僅支援本機附件觸發自動流程",
|
||||
"oneFileOnlyAutoFirst": "一次僅支援處理一個檔案,將自動處理第一個",
|
||||
"missingTaskIdUploadInventory": "找不到任務編號,請先上傳庫存檔案",
|
||||
"missingTaskIdPreviousSteps": "找不到任務編號,請先完成前面的步驟",
|
||||
"missingTaskIdParseMatch": "找不到任務編號,請先完成解析與庫存比對",
|
||||
"downloadExcelFailed": "下載 Excel 失敗",
|
||||
"autoCreateTaskFailed": "自動建立出貨任務失敗",
|
||||
"schemaPreviewMissing": "找不到表頭預覽,請重新上傳庫存檔案後再點「修改對應」",
|
||||
"mappingFormIntro": "請用下拉選單選擇庫存欄位對應(必須從表頭中選擇)。",
|
||||
"selectSkuAndQty": "請先選擇 SKU 欄與可用數量欄",
|
||||
"applyMappingFailed": "套用對應失敗",
|
||||
"updateParseFailed": "更新解析結果失敗",
|
||||
"addLineFailed": "新增訂單列失敗",
|
||||
"deleteLineFailed": "刪除訂單列失敗",
|
||||
"auditCommentHeaderEdit": "聊天區訂單表修訂",
|
||||
"auditCommentLineAdd": "聊天區訂單表新增列",
|
||||
"auditCommentLineDelete": "聊天區訂單表刪除列",
|
||||
"manualUploadedDefault": "我已在貨代系統完成上傳",
|
||||
"markManualUploadFailed": "標記手動上傳失敗",
|
||||
"actionFallback": "操作",
|
||||
"operationFailed": "操作失敗"
|
||||
},
|
||||
"shippingNoticeSanitize": {
|
||||
"retriggeredInventory": "已重新觸發庫存取得。",
|
||||
"triggeredInventory": "已觸發庫存取得。",
|
||||
"inventoryInProgress": "庫存取得進行中。",
|
||||
"manualRetry": "手動重試",
|
||||
"backToAlignConfirm": "已回到庫存欄位確認步驟。請檢查系統辨識的庫存欄名,確認無誤後繼續;如有問題請修改對應。",
|
||||
"checkColumnsContinue": "請檢查系統辨識的庫存欄名,確認無誤後繼續;如有問題請修改對應。",
|
||||
"confirmHeadersFromSample": "請根據庫存表頭與範例列確認欄位對應關係。",
|
||||
"uploadInCurrentChat": "在目前對話中上傳",
|
||||
"currentChat": "目前對話",
|
||||
"toCurrentChatPrefix": "到目前對話",
|
||||
"currentSystem": "目前系統",
|
||||
"taskIdLabel": "任務編號:",
|
||||
"taskIdWord": "任務編號",
|
||||
"createTask": "新建任務",
|
||||
"getTaskStatus": "查詢任務狀態",
|
||||
"parseNotice": "解析出貨通知",
|
||||
"submitDecision": "提交處理結果",
|
||||
"matchInventory": "比對庫存",
|
||||
"generateExcel": "產生出貨 Excel",
|
||||
"uploadFreight": "上傳貨代系統",
|
||||
"applyInventoryMapping": "套用庫存欄位對應",
|
||||
"getSchemaPreview": "讀取庫存表頭預覽",
|
||||
"schemaPreview": "庫存表頭預覽",
|
||||
"mapJson": "欄位對應",
|
||||
"sampleRows": "範例列",
|
||||
"retryRpa": "重新取得庫存",
|
||||
"retryUpload": "重試上傳貨代",
|
||||
"structured": "結構化內容",
|
||||
"rawText": "通知原文"
|
||||
},
|
||||
"shippingNoticeDecisionFormat": {
|
||||
"headerAtRow": "表頭在第 {row} 行:{headers}",
|
||||
"currentHeaders": "目前表頭:{headers}",
|
||||
"suggestedMapping": "建議欄位對應:",
|
||||
"adjustHint": "如需調整,請說明要改的欄(例如:available_qty 改用 Qty Available)。",
|
||||
"reuploadHint": "也可點「選擇庫存檔案」重新上傳。",
|
||||
"nextMatch": "下一步:比對庫存與出貨需求。",
|
||||
"reuploadOrPaste": "請重新上傳或貼上庫存 Excel。",
|
||||
"taskIdLine": "任務編號:{taskId}"
|
||||
},
|
||||
"shippingNoticeFieldAlignment": {
|
||||
"unrecognized": "(未辨識)",
|
||||
"unrecognizedOptional": "(未辨識/可選)",
|
||||
"matchRule": "比對規則:{rule}",
|
||||
"tableTitle": "欄位對齊表:",
|
||||
"tableHeaderSystem": "系統欄位",
|
||||
"tableHeaderInventory": "庫存欄",
|
||||
"hints": "提示:"
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
"refresh": "刷新",
|
||||
"yes": "是",
|
||||
"no": "否",
|
||||
"app": {
|
||||
"title": "和信AI智慧工作台",
|
||||
"shortTitle": "AI工作台",
|
||||
"remoteLogout": "您已在其他分頁退出登入"
|
||||
},
|
||||
"sso": {
|
||||
"authorizing": "正在進入第三方系統",
|
||||
"authorizingHint": "正在安全地完成統一登入,請稍候。",
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
},
|
||||
"msg": {
|
||||
"fillContent": "請填寫反饋內容",
|
||||
"submitFailed": "提交反饋失敗"
|
||||
"submitFailed": "提交反饋失敗",
|
||||
"submitSuccess": "反饋提交成功"
|
||||
},
|
||||
"cancel": "取消",
|
||||
"submitting": "提交中...",
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
"downloading": "下載中...",
|
||||
"tooLarge": "檔案較大,暫不支援線上預覽,請直接點擊上方「下載檔案」取得原始檔案。",
|
||||
"previewFailed": "預覽失敗:",
|
||||
"imageCounter": "第 {current} / {total} 張",
|
||||
"zoomOut": "縮小",
|
||||
"zoomIn": "放大",
|
||||
"resetZoom": "重設縮放",
|
||||
"prevImage": "上一張",
|
||||
"nextImage": "下一張",
|
||||
"unsupportedRawPreview": "目前原始檔案暫不支援直接預覽,已阻止瀏覽器自動下載",
|
||||
"msg": {
|
||||
"downloadFailed": "下載失敗: {reason}",
|
||||
"unknownError": "未知錯誤"
|
||||
|
||||
Loaded 100 of 105 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user