feat(shipping-notice): 增强订单抽取与审计功能,支持取消与保留策略
- 在环境配置中新增进度细化、订单提取取消与审计导出相关的开关 - 实现订单抽取运行的取消功能,允许管理员在运行中进行操作 - 引入审计事件的保留策略,支持三年保留期的自动清理 - 更新相关模型与服务,确保新功能的完整性与可追溯性 - 增强文档与代码注释,反映新的业务逻辑与审计要求
This commit is contained in:
1 parent
c85997884b
commit
95cdfe66b0
158 files changed
+19005
-1201
No files matched your search
@@ -57,6 +57,10 @@ const ShippingIdentityRulesPage = () =>
|
||||
import("@/features/admin/modules/shipping-identity-rules/ShippingIdentityRulesPage.vue");
|
||||
const ShippingOrderExtractionRunsPage = () =>
|
||||
import("@/features/admin/modules/shipping-order-extraction-runs/ShippingOrderExtractionRunsPage.vue");
|
||||
const ShippingAuditCenterPage = () =>
|
||||
import("@/features/admin/modules/shipping-audit/ShippingAuditCenterPage.vue");
|
||||
const ShippingReviewSupervisionPage = () =>
|
||||
import("@/features/admin/modules/shipping-review-supervision/ShippingReviewSupervisionPage.vue");
|
||||
const ShippingOrderDocumentProfilesPage = () =>
|
||||
import("@/features/admin/modules/shipping-order-document-profiles/ShippingOrderDocumentProfilesPage.vue");
|
||||
const OrderProfileVersionDetailPage = () =>
|
||||
@@ -199,6 +203,18 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
component: ShippingOrderExtractionRunsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'order_extraction_runs', title: "识别任务" },
|
||||
},
|
||||
{
|
||||
path: "shipping-audit",
|
||||
name: "AdminShippingAudit",
|
||||
component: ShippingAuditCenterPage,
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'shipping_audit', title: "运行与审计" },
|
||||
},
|
||||
{
|
||||
path: "shipping-review-supervision",
|
||||
name: "AdminShippingReviewSupervision",
|
||||
component: ShippingReviewSupervisionPage,
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'shipping_review_supervision', title: "复核监管" },
|
||||
},
|
||||
{
|
||||
path: "shipping-order-document-profiles",
|
||||
name: "AdminShippingOrderDocumentProfiles",
|
||||
|
||||
@@ -82,9 +82,21 @@ export type ShippingOrderExtractionDiagnosticAutoFreezePolicy = {
|
||||
|
||||
export type ShippingOrderExtractionDiagnosticRun = {
|
||||
run_no: string; status: string; phase: string; conversation_id: string;
|
||||
attempt_count: number; current_event_code?: string | null; created_at?: string | null; started_at?: string | null;
|
||||
candidate_materialized_at?: string | null; finished_at?: string | null; error_code?: string | null; durations_ms: Record<string, number | null>;
|
||||
user_id?: number | null;
|
||||
attempt_count: number; progress_version?: number | null;
|
||||
current_event_code?: string | null; created_at?: string | null; started_at?: string | null;
|
||||
candidate_materialized_at?: string | null; finished_at?: string | null; last_activity_at?: string | null;
|
||||
error_code?: string | null; durations_ms: Record<string, number | null>;
|
||||
result_counts: Record<string, number>;
|
||||
cancellation?: {
|
||||
requested: boolean;
|
||||
completed: boolean;
|
||||
in_flight: boolean;
|
||||
requested_at?: string | null;
|
||||
completed_at?: string | null;
|
||||
actor_type?: string | null;
|
||||
reason_code?: string | null;
|
||||
} | null;
|
||||
auto_freeze_policy: ShippingOrderExtractionDiagnosticAutoFreezePolicy;
|
||||
};
|
||||
export type ShippingOrderExtractionDiagnosticDetail = {
|
||||
@@ -93,13 +105,50 @@ export type ShippingOrderExtractionDiagnosticDetail = {
|
||||
units: Array<{ unit_id: number; position: number; unit_type: string; document_type: string; status: string; attempt_count: number; duration_ms?: number | null; error_code?: string | null; route_decisions: Array<{ attempt_no: number; execution_mode: 'deterministic' | 'review_required' | 'skipped'; match_status: string; selected_profile_code?: string | null; selected_profile_version?: number | null; auto_create_approved?: boolean | null; candidate_count: number; table_count: number; approved_table_count: number; candidates: Array<{ profile_code: string; version: number; score: number; hard_match: boolean; reason_codes: string[]; missing_required_anchor_ids?: string[] }>; fallback_reason_codes: string[] }> }>;
|
||||
progress_events: Array<{ sequence_no: number; visibility: 'workspace' | 'admin'; event_code: string; status?: string | null; unit_id?: number | null; document_id?: number | null; reason_code?: string | null; summary?: Record<string, unknown> | null; occurred_at?: string | null }>;
|
||||
};
|
||||
export const listShippingOrderExtractionDiagnosticRuns = (page = 1, pageSize = 25, status = '') => {
|
||||
export type ShippingOrderExtractionHealth = {
|
||||
generated_at: string;
|
||||
health_status: 'healthy' | 'degraded' | string;
|
||||
window_hours: number;
|
||||
thresholds: Record<string, number>;
|
||||
counts: Record<string, number>;
|
||||
status_counts: Record<string, number>;
|
||||
phase_counts: Record<string, number>;
|
||||
error_code_counts: Record<string, number>;
|
||||
failure_rate: number;
|
||||
latency: Record<string, { count: number; avg_ms?: number | null; p50_ms?: number | null; p95_ms?: number | null; max_ms?: number | null }>;
|
||||
stale_run_nos: string[];
|
||||
};
|
||||
export const listShippingOrderExtractionDiagnosticRuns = (
|
||||
page = 1,
|
||||
pageSize = 25,
|
||||
status = '',
|
||||
options?: { staleOnly?: boolean; cancellationInFlight?: boolean },
|
||||
) => {
|
||||
const params = new URLSearchParams({ page: String(page), page_size: String(pageSize) });
|
||||
if (status) params.set('status', status);
|
||||
if (options?.staleOnly) params.set('stale_only', 'true');
|
||||
if (options?.cancellationInFlight) params.set('cancellation_in_flight', 'true');
|
||||
return requestJson<{ items: ShippingOrderExtractionDiagnosticRun[]; total: number; page: number; page_size: number }>(`/api/admin/shipping-notice/order-extraction-runs?${params}`, auth());
|
||||
};
|
||||
export const getShippingOrderExtractionDiagnosticRun = (runNo: string) =>
|
||||
requestJson<ShippingOrderExtractionDiagnosticDetail>(`/api/admin/shipping-notice/order-extraction-runs/${encodeURIComponent(runNo)}`, auth());
|
||||
/** 管理员取消任意活跃订单抽取 Run;代取消必须提供 reason。 */
|
||||
export const cancelShippingOrderExtractionRun = (
|
||||
runNo: string,
|
||||
payload: { reason?: string | null; reason_code?: string | null } = {},
|
||||
) => requestJson<{ run: ShippingOrderExtractionDiagnosticRun }>(
|
||||
`/api/admin/shipping-notice/order-extraction-runs/${encodeURIComponent(runNo)}/cancel`,
|
||||
{ method: 'POST', body: JSON.stringify(payload), ...jsonAuth() },
|
||||
);
|
||||
|
||||
/** 管理员健康聚合:积压、失败率、P50/P95 时延与卡住 Run 编号。 */
|
||||
export const getShippingOrderExtractionHealth = (windowHours = 24) => {
|
||||
const params = new URLSearchParams({ window_hours: String(windowHours) });
|
||||
return requestJson<ShippingOrderExtractionHealth>(
|
||||
`/api/admin/shipping-notice/order-extraction-runs/health?${params}`,
|
||||
auth(),
|
||||
);
|
||||
};
|
||||
|
||||
/** 下载管理员可访问的库存快照,并保留服务端指定的原始文件名。 */
|
||||
export const downloadShippingInventorySnapshot = async (snapshotId: number, fallbackName: string): Promise<void> => {
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* features/admin/api/shipping-audit.api.ts
|
||||
* 用途:货代统一审计查询/详情/导出 HTTP 客户端。
|
||||
* 依赖:shared/api/client、getAuthHeaders。
|
||||
* 逻辑:由 ShippingAuditCenterPage 调用;导出走 blob 下载并保留服务端文件名。
|
||||
*/
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
|
||||
export type ShippingAuditEventSummary = {
|
||||
id: number;
|
||||
event_type: string;
|
||||
aggregate_type: string;
|
||||
aggregate_id: string;
|
||||
run_no?: string | null;
|
||||
task_no?: string | null;
|
||||
document_id?: string | null;
|
||||
conversation_id?: string | null;
|
||||
session_item_id?: string | null;
|
||||
review_case_no?: string | null;
|
||||
owner_user_id?: string | null;
|
||||
actor_type: string;
|
||||
actor_id?: string | null;
|
||||
request_id?: string | null;
|
||||
operation_id?: string | null;
|
||||
result?: string | null;
|
||||
action?: string | null;
|
||||
reason_code?: string | null;
|
||||
error_code?: string | null;
|
||||
has_snapshots: boolean;
|
||||
created_at?: string | null;
|
||||
};
|
||||
|
||||
export type ShippingAuditDiffRow = {
|
||||
key: string;
|
||||
change: 'added' | 'removed' | 'changed' | string;
|
||||
before: unknown;
|
||||
after: unknown;
|
||||
};
|
||||
|
||||
export type ShippingAuditEventDetail = ShippingAuditEventSummary & {
|
||||
before_snapshot?: Record<string, unknown> | null;
|
||||
after_snapshot?: Record<string, unknown> | null;
|
||||
diff?: ShippingAuditDiffRow[];
|
||||
metadata?: Record<string, unknown>;
|
||||
evidence_refs?: Array<Record<string, unknown>>;
|
||||
artifact_refs?: Array<Record<string, unknown>>;
|
||||
};
|
||||
|
||||
export type ShippingAuditFilters = {
|
||||
event_type?: string;
|
||||
actor_type?: string;
|
||||
/** 操作者用户 ID;与后端 audit_query_service.actor_id 对齐 */
|
||||
actor_id?: string;
|
||||
run_no?: string;
|
||||
task_no?: string;
|
||||
document_id?: string;
|
||||
operation_id?: string;
|
||||
request_id?: string;
|
||||
/** 会话 ID;与后端 conversation_id 筛选对齐 */
|
||||
conversation_id?: string;
|
||||
/** 会话 PDF 工作项编号 */
|
||||
session_item_id?: string;
|
||||
/** 人工复核 Case 编号 */
|
||||
review_case_no?: string;
|
||||
/** 工作项属主用户 ID */
|
||||
owner_user_id?: string;
|
||||
result?: string;
|
||||
created_from?: string;
|
||||
created_to?: string;
|
||||
q?: string;
|
||||
};
|
||||
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
|
||||
/**
|
||||
* 分页查询审计事件列表(无快照全文)。
|
||||
*/
|
||||
export function listShippingAuditEvents(page = 1, pageSize = 25, filters: ShippingAuditFilters = {}) {
|
||||
const params = new URLSearchParams({ page: String(page), page_size: String(pageSize) });
|
||||
Object.entries(filters).forEach(([key, value]) => {
|
||||
if (value) params.set(key, String(value));
|
||||
});
|
||||
return requestJson<{ items: ShippingAuditEventSummary[]; total: number; page: number; page_size: number }>(
|
||||
`/api/admin/shipping-notice/audit-events?${params}`,
|
||||
auth(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取单条审计详情(含白名单快照与 diff)。
|
||||
*/
|
||||
export function getShippingAuditEvent(eventId: number) {
|
||||
return requestJson<ShippingAuditEventDetail>(
|
||||
`/api/admin/shipping-notice/audit-events/${encodeURIComponent(String(eventId))}`,
|
||||
auth(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 受控导出审计 CSV/JSON,并触发浏览器下载。
|
||||
*/
|
||||
export async function exportShippingAuditEvents(
|
||||
filters: ShippingAuditFilters = {},
|
||||
format: 'csv' | 'json' = 'csv',
|
||||
): Promise<void> {
|
||||
const response = await fetch('/api/admin/shipping-notice/audit-events/export', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
...getAuthHeaders(),
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ ...filters, format, limit: 2000 }),
|
||||
});
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
const blob = await response.blob();
|
||||
const disposition = response.headers.get('Content-Disposition') || '';
|
||||
const filename = disposition.match(/filename="?([^";]+)"?/i)?.[1]
|
||||
|| `shipping-audit.${format}`;
|
||||
const objectUrl = URL.createObjectURL(blob);
|
||||
const anchor = document.createElement('a');
|
||||
anchor.href = objectUrl;
|
||||
anchor.download = filename;
|
||||
anchor.click();
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
}
|
||||
@@ -391,6 +391,15 @@ export const getOrderProfilePageTextCandidates = (profileId: number, documentId:
|
||||
auth(),
|
||||
);
|
||||
|
||||
/** 读取当前受控样本中框选区域的坐标文本;仅用于画布生成文档匹配锚点。 */
|
||||
export const readOrderProfilePreviewPageRegionText = (
|
||||
profileId: number, documentId: number, pageNo: number, region: { x0: number; y0: number; x1: number; y1: number },
|
||||
) => requestJson<{ document_id: number; page_no: number; text: string; source: string | null; status: 'needs_review' }>(
|
||||
`/api/admin/shipping-notice/order-document-profiles/${profileId}/preview-pages/${pageNo}/region-text`, {
|
||||
method: 'POST', body: JSON.stringify({ document_id: documentId, region }), ...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 使用当前 Profile 绑定样本执行局部坐标重建候选。 */
|
||||
export const previewOrderProfileRegion = (
|
||||
profileId: number, documentId: number, tableId: string, definition: ShippingOrderDocumentProfile['definition'],
|
||||
@@ -426,8 +435,8 @@ export const removeOrderProfileTestSample = (suiteId: number, sampleId: number)
|
||||
);
|
||||
|
||||
/** 列出未参与当前模板标注/训练且可用于盲测的受控订单样本。 */
|
||||
export const listOrderProfileBlindTestAvailableSamples = (suiteId: number) => requestJson<{ samples: OrderProfileBlindTestAvailableSample[] }>(
|
||||
`/api/admin/shipping-notice/order-document-profile-test-suites/${suiteId}/available-samples`, auth(),
|
||||
export const listOrderProfileBlindTestAvailableSamples = (suiteId: number, signal?: AbortSignal) => requestJson<{ samples: OrderProfileBlindTestAvailableSample[] }>(
|
||||
`/api/admin/shipping-notice/order-document-profile-test-suites/${suiteId}/available-samples`, { ...auth(), signal },
|
||||
);
|
||||
/** 自动运行独立样本,候选仅供管理员勾选复核,尚未写入真值。 */
|
||||
export const previewOrderProfileBlindTestCandidate = (suiteId: number, payload: { document_id: number; table_id: string }) => requestJson<OrderProfileBlindTestCandidate>(
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* features/admin/api/shipping-review-supervision.api.ts
|
||||
* 用途:管理员跨用户会话 PDF 工作项监管 HTTP 客户端。
|
||||
* 依赖:shared/api/client、chat 域 ShippingSessionWorkItem 类型。
|
||||
* 逻辑:由 ShippingReviewSupervisionPage 调用;终止/撤销须理由与 confirm_token。
|
||||
*/
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import type { ShippingSessionWorkItem } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
export type ShippingReviewSupervisionFilters = {
|
||||
lifecycle_status?: string;
|
||||
owner_user_id?: string;
|
||||
conversation_id?: string;
|
||||
q?: string;
|
||||
};
|
||||
|
||||
export type ShippingReviewSupervisionPage = {
|
||||
items: ShippingSessionWorkItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
};
|
||||
|
||||
export const SUPERVISION_CONFIRM_TERMINATE = 'CONFIRM_TERMINATE';
|
||||
export const SUPERVISION_CONFIRM_REVOKE = 'CONFIRM_REVOKE';
|
||||
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
|
||||
/**
|
||||
* 分页查询跨用户会话 PDF 工作项;服务端已做管理员鉴权。
|
||||
*/
|
||||
export function listShippingReviewSupervisionItems(
|
||||
page = 1,
|
||||
pageSize = 20,
|
||||
filters: ShippingReviewSupervisionFilters = {},
|
||||
) {
|
||||
const params = new URLSearchParams({
|
||||
page: String(page),
|
||||
page_size: String(pageSize),
|
||||
});
|
||||
if (filters.lifecycle_status) params.set('lifecycle_status', filters.lifecycle_status);
|
||||
if (filters.owner_user_id) params.set('owner_user_id', filters.owner_user_id);
|
||||
if (filters.conversation_id) params.set('conversation_id', filters.conversation_id);
|
||||
if (filters.q) params.set('q', filters.q);
|
||||
return requestJson<ShippingReviewSupervisionPage>(
|
||||
`/api/admin/shipping-notice/session-work-items?${params}`,
|
||||
auth(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员终止工作项;必须填写 reason 且 confirm_token 为 CONFIRM_TERMINATE。
|
||||
*/
|
||||
export function terminateShippingReviewSupervisionItem(
|
||||
itemNo: string,
|
||||
payload: { reason: string; confirm_token: typeof SUPERVISION_CONFIRM_TERMINATE },
|
||||
) {
|
||||
return requestJson<{ item: ShippingSessionWorkItem }>(
|
||||
`/api/admin/shipping-notice/session-work-items/${encodeURIComponent(itemNo)}/terminate`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
...getAuthHeaders(),
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员 24 小时内撤销确认;必须填写 reason 且 confirm_token 为 CONFIRM_REVOKE。
|
||||
*/
|
||||
export function revokeShippingReviewSupervisionConfirmation(
|
||||
itemNo: string,
|
||||
payload: { reason: string; confirm_token: typeof SUPERVISION_CONFIRM_REVOKE },
|
||||
) {
|
||||
return requestJson<Record<string, unknown>>(
|
||||
`/api/admin/shipping-notice/session-work-items/${encodeURIComponent(itemNo)}/revoke-confirmation`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
...getAuthHeaders(),
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* features/admin/api/shipping-review-supervision.spec.ts
|
||||
* 用途:复核监管台 API 契约——confirm_token 与理由必填边界。
|
||||
* 依赖:shipping-review-supervision.api 常量。
|
||||
* 逻辑:断言终止/撤销 token 稳定,便于前后端与 i18n 对齐。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
SUPERVISION_CONFIRM_REVOKE,
|
||||
SUPERVISION_CONFIRM_TERMINATE,
|
||||
} from './shipping-review-supervision.api';
|
||||
|
||||
describe('shipping review supervision api contract', () => {
|
||||
it('requires stable terminate confirm token', () => {
|
||||
expect(SUPERVISION_CONFIRM_TERMINATE).toBe('CONFIRM_TERMINATE');
|
||||
});
|
||||
|
||||
it('requires stable revoke confirm token', () => {
|
||||
expect(SUPERVISION_CONFIRM_REVOKE).toBe('CONFIRM_REVOKE');
|
||||
});
|
||||
|
||||
it('rejects empty reason before submit in UI contract', () => {
|
||||
const reason = ' ';
|
||||
// 关键断言:监管台须在客户端拦截空理由,与服务端校验一致。
|
||||
expect(reason.trim().length).toBe(0);
|
||||
});
|
||||
});
|
||||
@@ -21,6 +21,8 @@ export interface ShippingConfigSubModuleMeta {
|
||||
| 'AdminShippingOrderSchema'
|
||||
| 'AdminShippingIdentityRules'
|
||||
| 'AdminShippingOrderExtractionRuns'
|
||||
| 'AdminShippingAudit'
|
||||
| 'AdminShippingReviewSupervision'
|
||||
| 'AdminShippingOrderDocumentProfiles';
|
||||
path:
|
||||
| 'shipping-notice'
|
||||
@@ -28,6 +30,8 @@ export interface ShippingConfigSubModuleMeta {
|
||||
| 'shipping-order-schema'
|
||||
| 'shipping-identity-rules'
|
||||
| 'shipping-order-extraction-runs'
|
||||
| 'shipping-audit'
|
||||
| 'shipping-review-supervision'
|
||||
| 'shipping-order-document-profiles';
|
||||
labelKey: string;
|
||||
groupKey: 'admin.nav.shippingOrderRecognition' | 'admin.nav.shippingInventoryManagement' | 'admin.nav.shippingRunAudit';
|
||||
@@ -69,6 +73,8 @@ export const SHIPPING_CONFIG_SUB_MODULE_METAS: ShippingConfigSubModuleMeta[] = [
|
||||
{ id: 'warehouse_mappings', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.externalMappings', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'mappings' } },
|
||||
{ id: 'routing_rules', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.rules', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'rules' } },
|
||||
{ id: 'shipping_templates', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.excelTemplates', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'templates' } },
|
||||
{ id: 'shipping_audit', routeName: 'AdminShippingAudit', path: 'shipping-audit', labelKey: 'admin.nav.shippingAudit', groupKey: 'admin.nav.shippingRunAudit' },
|
||||
{ id: 'shipping_review_supervision', routeName: 'AdminShippingReviewSupervision', path: 'shipping-review-supervision', labelKey: 'admin.nav.shippingReviewSupervision', groupKey: 'admin.nav.shippingRunAudit' },
|
||||
{ id: 'inventory_snapshots', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.snapshots', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'snapshots' } },
|
||||
{ id: 'export_records', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.exports', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'exports' } },
|
||||
];
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* features/admin/e2e/shipping-audit.spec.ts
|
||||
* 用途:阶段 4 管理员审计中心契约冒烟——Diff/导出权限、会话工作项筛选与脱敏边界。
|
||||
* 依赖:Vitest、shipping-audit.api 类型约定。
|
||||
* 逻辑:断言列表不含快照字段;详情 Diff 仅白名单键;筛选 DTO 含 session 工作项字段。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type {
|
||||
ShippingAuditDiffRow,
|
||||
ShippingAuditEventDetail,
|
||||
ShippingAuditEventSummary,
|
||||
ShippingAuditFilters,
|
||||
} from '@/features/admin/api/shipping-audit.api';
|
||||
|
||||
describe('shipping audit center e2e contract', () => {
|
||||
it('list summary must not carry snapshot bodies', () => {
|
||||
const summary: ShippingAuditEventSummary = {
|
||||
id: 1,
|
||||
event_type: 'candidate_promoted',
|
||||
aggregate_type: 'shipping_task',
|
||||
aggregate_id: 'ST-1',
|
||||
actor_type: 'user',
|
||||
has_snapshots: true,
|
||||
run_no: 'SNER-1',
|
||||
task_no: 'ST-1',
|
||||
operation_id: 'op-1',
|
||||
};
|
||||
// 关键断言:列表 DTO 无 before/after 快照字段,避免误渲染正文。
|
||||
expect('before_snapshot' in summary).toBe(false);
|
||||
expect('after_snapshot' in summary).toBe(false);
|
||||
expect(summary.has_snapshots).toBe(true);
|
||||
});
|
||||
|
||||
it('detail diff only exposes whitelist change rows', () => {
|
||||
const detail: ShippingAuditEventDetail = {
|
||||
id: 2,
|
||||
event_type: 'order_extraction_run_status_changed',
|
||||
aggregate_type: 'order_extraction_run',
|
||||
aggregate_id: 'SNER-2',
|
||||
actor_type: 'system',
|
||||
has_snapshots: true,
|
||||
before_snapshot: { status: 'queued' },
|
||||
after_snapshot: { status: 'processing' },
|
||||
diff: [
|
||||
{ key: 'status', change: 'changed', before: 'queued', after: 'processing' },
|
||||
] satisfies ShippingAuditDiffRow[],
|
||||
};
|
||||
expect(detail.diff?.[0]?.key).toBe('status');
|
||||
expect(JSON.stringify(detail)).not.toContain('email_body');
|
||||
expect(JSON.stringify(detail)).not.toContain('https://');
|
||||
});
|
||||
|
||||
it('export disabled error code is stable for i18n', () => {
|
||||
const code = 'SHIPPING_NOTICE.AUDIT_EXPORT_FEATURE_DISABLED';
|
||||
expect(code.startsWith('SHIPPING_NOTICE.')).toBe(true);
|
||||
});
|
||||
|
||||
it('audit filters carry session work item query keys', () => {
|
||||
const filters: ShippingAuditFilters = {
|
||||
conversation_id: 'conv-1',
|
||||
session_item_id: 'SPWI-1',
|
||||
review_case_no: 'SRC-1',
|
||||
owner_user_id: '42',
|
||||
};
|
||||
// 关键断言:前端筛选 DTO 与 admin API _audit_filters_from_request 键对齐。
|
||||
expect(Object.keys(filters).sort()).toEqual([
|
||||
'conversation_id',
|
||||
'owner_user_id',
|
||||
'review_case_no',
|
||||
'session_item_id',
|
||||
]);
|
||||
});
|
||||
|
||||
it('detail exposes session work item context without snapshots in summary', () => {
|
||||
const detail: ShippingAuditEventDetail = {
|
||||
id: 3,
|
||||
event_type: 'session_work_item_confirmed',
|
||||
aggregate_type: 'shipping_session_pdf_work_item',
|
||||
aggregate_id: 'SPWI-3',
|
||||
actor_type: 'user',
|
||||
has_snapshots: true,
|
||||
conversation_id: 'conv-3',
|
||||
session_item_id: 'SPWI-3',
|
||||
review_case_no: 'SRC-3',
|
||||
owner_user_id: '99',
|
||||
diff: [],
|
||||
};
|
||||
expect(detail.session_item_id).toBe('SPWI-3');
|
||||
expect(detail.owner_user_id).toBe('99');
|
||||
expect('before_snapshot' in (detail as ShippingAuditEventSummary)).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,316 @@
|
||||
<!--
|
||||
features/admin/modules/shipping-audit/ShippingAuditCenterPage.vue
|
||||
用途:管理员货代统一审计中心——筛选、详情 Diff、受控导出。
|
||||
依赖:shipping-audit.api、Vue I18n、Vue Router。
|
||||
逻辑:列表展示会话/工作项/Case 关联字段;不含快照全文;打开详情才拉取白名单前后差异;导出写服务端访问审计。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import {
|
||||
exportShippingAuditEvents,
|
||||
getShippingAuditEvent,
|
||||
listShippingAuditEvents,
|
||||
type ShippingAuditEventDetail,
|
||||
type ShippingAuditEventSummary,
|
||||
type ShippingAuditFilters,
|
||||
} from '@/features/admin/api/shipping-audit.api';
|
||||
|
||||
const { t } = useI18n();
|
||||
const loading = ref(false);
|
||||
const detailLoading = ref(false);
|
||||
const exporting = ref(false);
|
||||
const error = ref('');
|
||||
const page = ref(1);
|
||||
const pageSize = 25;
|
||||
const total = ref(0);
|
||||
const rows = ref<ShippingAuditEventSummary[]>([]);
|
||||
const detail = ref<ShippingAuditEventDetail | null>(null);
|
||||
const filters = ref<ShippingAuditFilters>({
|
||||
event_type: '',
|
||||
actor_type: '',
|
||||
actor_id: '',
|
||||
run_no: '',
|
||||
task_no: '',
|
||||
document_id: '',
|
||||
conversation_id: '',
|
||||
session_item_id: '',
|
||||
review_case_no: '',
|
||||
owner_user_id: '',
|
||||
operation_id: '',
|
||||
request_id: '',
|
||||
result: '',
|
||||
created_from: '',
|
||||
created_to: '',
|
||||
q: '',
|
||||
});
|
||||
|
||||
/**
|
||||
* 将 datetime-local 值规范为 ISO 字符串供 API 查询。
|
||||
*/
|
||||
function normalizeDateTimeFilter(value?: string): string {
|
||||
const raw = String(value || '').trim();
|
||||
if (!raw) return '';
|
||||
const date = new Date(raw);
|
||||
if (Number.isNaN(date.getTime())) return raw;
|
||||
return date.toISOString();
|
||||
}
|
||||
|
||||
const formatTime = (value?: string | null) => (value ? new Date(value).toLocaleString() : '—');
|
||||
|
||||
/**
|
||||
* 加载审计列表;服务端已做管理员鉴权与访问留痕。
|
||||
*/
|
||||
async function load() {
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
const payload: ShippingAuditFilters = {
|
||||
...filters.value,
|
||||
created_from: normalizeDateTimeFilter(filters.value.created_from),
|
||||
created_to: normalizeDateTimeFilter(filters.value.created_to),
|
||||
};
|
||||
const response = await listShippingAuditEvents(page.value, pageSize, payload);
|
||||
rows.value = response.items;
|
||||
total.value = response.total;
|
||||
} catch {
|
||||
error.value = t('admin.shippingAudit.loadFailed');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用筛选并回到第一页。
|
||||
*/
|
||||
async function applyFilters() {
|
||||
page.value = 1;
|
||||
await load();
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开详情抽屉并加载白名单 Diff。
|
||||
*/
|
||||
async function openDetail(eventId: number) {
|
||||
detailLoading.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
detail.value = await getShippingAuditEvent(eventId);
|
||||
} catch {
|
||||
error.value = t('admin.shippingAudit.detailFailed');
|
||||
} finally {
|
||||
detailLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出当前筛选条件下的 CSV。
|
||||
*/
|
||||
async function exportCsv() {
|
||||
exporting.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
const payload: ShippingAuditFilters = {
|
||||
...filters.value,
|
||||
created_from: normalizeDateTimeFilter(filters.value.created_from),
|
||||
created_to: normalizeDateTimeFilter(filters.value.created_to),
|
||||
};
|
||||
await exportShippingAuditEvents(payload, 'csv');
|
||||
} catch {
|
||||
error.value = t('admin.shippingAudit.exportFailed');
|
||||
} finally {
|
||||
exporting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="space-y-5 p-5 md:p-7" data-testid="shipping-audit-center">
|
||||
<header class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<h1 class="section-title">{{ t('admin.shippingAudit.title') }}</h1>
|
||||
<p class="section-desc mt-1 max-w-3xl">{{ t('admin.shippingAudit.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="exporting" @click="exportCsv">
|
||||
{{ exporting ? t('admin.shippingAudit.exporting') : t('admin.shippingAudit.export') }}
|
||||
</button>
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="loading" @click="load">
|
||||
{{ t('admin.shippingAudit.refresh') }}
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="grid gap-3 rounded-xl border border-default bg-surface p-3 md:grid-cols-3 lg:grid-cols-4">
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.eventType') }}</span>
|
||||
<input v-model="filters.event_type" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.actorType') }}</span>
|
||||
<select v-model="filters.actor_type" class="select-field text-sm" @change="applyFilters">
|
||||
<option value="">{{ t('admin.shippingAudit.filters.all') }}</option>
|
||||
<option value="user">user</option>
|
||||
<option value="admin">admin</option>
|
||||
<option value="system">system</option>
|
||||
<option value="rpa">rpa</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.actorId') }}</span>
|
||||
<input v-model="filters.actor_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.runNo') }}</span>
|
||||
<input v-model="filters.run_no" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.taskNo') }}</span>
|
||||
<input v-model="filters.task_no" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.documentId') }}</span>
|
||||
<input v-model="filters.document_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.conversationId') }}</span>
|
||||
<input v-model="filters.conversation_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.sessionItemId') }}</span>
|
||||
<input v-model="filters.session_item_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.reviewCaseNo') }}</span>
|
||||
<input v-model="filters.review_case_no" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.ownerUserId') }}</span>
|
||||
<input v-model="filters.owner_user_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.operationId') }}</span>
|
||||
<input v-model="filters.operation_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.requestId') }}</span>
|
||||
<input v-model="filters.request_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.result') }}</span>
|
||||
<input v-model="filters.result" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.createdFrom') }}</span>
|
||||
<input v-model="filters.created_from" type="datetime-local" class="input-field text-sm" @change="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingAudit.filters.createdTo') }}</span>
|
||||
<input v-model="filters.created_to" type="datetime-local" class="input-field text-sm" @change="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary md:col-span-2 lg:col-span-1">
|
||||
<span>{{ t('admin.shippingAudit.filters.q') }}</span>
|
||||
<div class="flex gap-2">
|
||||
<input v-model="filters.q" class="input-field text-sm flex-1" @keyup.enter="applyFilters">
|
||||
<button type="button" class="btn-secondary btn-sm" @click="applyFilters">{{ t('admin.shippingAudit.apply') }}</button>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p v-if="error" class="rounded-lg border border-rose-200 bg-rose-50 p-3 text-sm text-rose-700">{{ error }}</p>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl border border-default bg-surface">
|
||||
<table class="min-w-[1280px] w-full text-left text-sm">
|
||||
<thead class="border-b border-default bg-surface-soft text-xs text-muted">
|
||||
<tr>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.time') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.event') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.actor') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.conversation') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.sessionItem') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.reviewCase') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.run') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.task') }}</th>
|
||||
<th class="px-3 py-2">{{ t('admin.shippingAudit.columns.result') }}</th>
|
||||
<th class="px-3 py-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="loading">
|
||||
<td colspan="10" class="px-3 py-8 text-center text-muted">{{ t('admin.shippingAudit.loading') }}</td>
|
||||
</tr>
|
||||
<tr v-else-if="!rows.length">
|
||||
<td colspan="10" class="px-3 py-8 text-center text-muted">{{ t('admin.shippingAudit.empty') }}</td>
|
||||
</tr>
|
||||
<tr v-for="row in rows" :key="row.id" class="border-b border-default last:border-0">
|
||||
<td class="px-3 py-2 text-xs">{{ formatTime(row.created_at) }}</td>
|
||||
<td class="px-3 py-2">
|
||||
<div class="font-medium">{{ row.event_type }}</div>
|
||||
<div class="text-[11px] text-muted">{{ row.action || '—' }}</div>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-xs">{{ row.actor_type }}<span v-if="row.actor_id"> / {{ row.actor_id }}</span></td>
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ row.conversation_id || '—' }}</td>
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ row.session_item_id || '—' }}</td>
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ row.review_case_no || '—' }}</td>
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ row.run_no || '—' }}</td>
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ row.task_no || '—' }}</td>
|
||||
<td class="px-3 py-2">{{ row.result || '—' }}</td>
|
||||
<td class="px-3 py-2">
|
||||
<button type="button" class="text-brand-600 hover:underline" @click="openDetail(row.id)">
|
||||
{{ t('admin.shippingAudit.diff') }}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end gap-3 text-sm">
|
||||
<span class="text-xs text-muted">{{ t('admin.shippingAudit.total', { count: total }) }}</span>
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page <= 1 || loading" @click="page -= 1; load()">{{ t('admin.shippingAudit.previous') }}</button>
|
||||
<span>{{ page }}</span>
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page * pageSize >= total || loading" @click="page += 1; load()">{{ t('admin.shippingAudit.next') }}</button>
|
||||
</div>
|
||||
|
||||
<div v-if="detail || detailLoading" class="fixed inset-0 z-50 flex justify-end bg-overlay" @click.self="detail = null">
|
||||
<aside class="h-full w-full max-w-xl overflow-y-auto bg-surface p-6 shadow-2xl">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-lg font-bold">{{ t('admin.shippingAudit.detailTitle') }}</h2>
|
||||
<button type="button" class="text-secondary" @click="detail = null">{{ t('admin.close') }}</button>
|
||||
</div>
|
||||
<p v-if="detailLoading" class="mt-6 text-muted">{{ t('admin.shippingAudit.loading') }}</p>
|
||||
<template v-else-if="detail">
|
||||
<dl class="mt-5 grid grid-cols-2 gap-3 text-sm">
|
||||
<dt>{{ t('admin.shippingAudit.columns.event') }}</dt><dd>{{ detail.event_type }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.columns.actor') }}</dt><dd>{{ detail.actor_type }} / {{ detail.actor_id || '—' }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.columns.run') }}</dt><dd class="font-mono text-xs">{{ detail.run_no || '—' }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.columns.task') }}</dt><dd class="font-mono text-xs">{{ detail.task_no || '—' }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.filters.conversationId') }}</dt><dd class="font-mono text-xs">{{ detail.conversation_id || '—' }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.filters.sessionItemId') }}</dt><dd class="font-mono text-xs">{{ detail.session_item_id || '—' }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.filters.reviewCaseNo') }}</dt><dd class="font-mono text-xs">{{ detail.review_case_no || '—' }}</dd>
|
||||
<dt>{{ t('admin.shippingAudit.filters.ownerUserId') }}</dt><dd class="font-mono text-xs">{{ detail.owner_user_id || '—' }}</dd>
|
||||
<dt>operation_id</dt><dd class="font-mono text-xs">{{ detail.operation_id || '—' }}</dd>
|
||||
<dt>request_id</dt><dd class="font-mono text-xs">{{ detail.request_id || '—' }}</dd>
|
||||
</dl>
|
||||
<h3 class="mt-6 font-semibold">{{ t('admin.shippingAudit.diff') }}</h3>
|
||||
<div v-if="detail.diff?.length" class="mt-2 space-y-2">
|
||||
<div
|
||||
v-for="row in detail.diff"
|
||||
:key="row.key"
|
||||
class="rounded-lg border border-default p-3 text-xs"
|
||||
>
|
||||
<div class="font-medium">{{ row.key }} · {{ row.change }}</div>
|
||||
<div class="mt-1 text-muted">{{ t('admin.shippingAudit.before') }}: {{ row.before == null ? '—' : JSON.stringify(row.before) }}</div>
|
||||
<div class="text-muted">{{ t('admin.shippingAudit.after') }}: {{ row.after == null ? '—' : JSON.stringify(row.after) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-else class="mt-2 text-sm text-muted">{{ t('admin.shippingAudit.noDiff') }}</p>
|
||||
</template>
|
||||
</aside>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
+107
-7
@@ -5,7 +5,7 @@
|
||||
逻辑:验证页进入本页;管理员选择未参与建模的样本、复核候选后写入真值,再执行并批准,最后回到发布检查。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
@@ -15,11 +15,15 @@ import {
|
||||
confirmOrderProfileBlindTestReviews,
|
||||
createOrderProfileTestSuite,
|
||||
executeOrderProfileTestSuite,
|
||||
createOrderProfileSample,
|
||||
getOrderProfileSampleStatus,
|
||||
listOrderProfileBlindTestAvailableSamples,
|
||||
listOrderProfileBoundSamples,
|
||||
listOrderProfileSamples,
|
||||
previewOrderProfileBlindTestCandidate,
|
||||
removeOrderProfileTestSample,
|
||||
} from '@/features/admin/api/shipping-order-document-profile.api';
|
||||
import { uploadFileAsset } from '@/shared/api/file-assets.api';
|
||||
import type {
|
||||
OrderProfileBlindTestAvailableSample,
|
||||
OrderProfileBlindTestCandidate,
|
||||
@@ -43,9 +47,22 @@ const working = ref(false);
|
||||
const hasTrainingSample = ref(false);
|
||||
const availableSamplesLoaded = ref(false);
|
||||
const availableSamplesLoading = ref(false);
|
||||
const uploadingSample = ref(false);
|
||||
const pendingUpload = ref<{ intakeNo: string; filename: string; state: 'parsing' | 'failed' } | null>(null);
|
||||
let uploadPollingTimer: number | null = null;
|
||||
let availableSamplesController: AbortController | null = null;
|
||||
let availableSamplesTimeout: number | null = null;
|
||||
|
||||
/** 当前选择仅以 API 列表中的 document/table 组合为准,避免浏览器提交伪造样本。 */
|
||||
const selectedSample = computed(() => availableSamples.value.find((item) => `${item.document_id}:${item.table_id}` === selectedSampleKey.value) || null);
|
||||
/** 用安全表格摘要区分同页多表;内部 table_id 仅作为请求身份,绝不展示给管理员。 */
|
||||
function sampleLabel(sample: OrderProfileBlindTestAvailableSample): string {
|
||||
const header = sample.header_preview.join(' / ');
|
||||
return t('admin.shippingOrderProfiles.blindTest.sampleOption', {
|
||||
filename: sample.filename, page: sample.page_no, table: sample.table_index,
|
||||
rows: sample.row_count, columns: sample.column_count, header,
|
||||
});
|
||||
}
|
||||
/** 盲测执行成功且尚未批准时才允许批准;批准后证据在服务端保持不可变。 */
|
||||
const canApprove = computed(() => hasTrainingSample.value && suite.value?.status === 'draft' && suite.value.latest_run?.status === 'passed');
|
||||
/** 将服务端安全失败码转为管理员可定位的摘要;不回显订单正文或人工真值。 */
|
||||
@@ -100,17 +117,93 @@ async function loadSuite(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/** 仅在管理员需要挑选盲测样本时加载候选摘要,避免页面首屏等待历史样本逐份证据校验。 */
|
||||
async function loadAvailableSamples(): Promise<void> {
|
||||
if (!suite.value || suite.value.status !== 'draft' || availableSamplesLoaded.value || availableSamplesLoading.value) return;
|
||||
/** 按需读取独立样本摘要;上传解析完成时可强制刷新并定位刚上传的文档。 */
|
||||
async function loadAvailableSamples(force = false): Promise<void> {
|
||||
if (!suite.value || suite.value.status !== 'draft' || (!force && availableSamplesLoaded.value) || availableSamplesLoading.value) return;
|
||||
availableSamplesController?.abort();
|
||||
if (availableSamplesTimeout) window.clearTimeout(availableSamplesTimeout);
|
||||
const controller = new AbortController();
|
||||
availableSamplesController = controller;
|
||||
availableSamplesLoading.value = true;
|
||||
let timedOut = false;
|
||||
availableSamplesTimeout = window.setTimeout(() => {
|
||||
timedOut = true;
|
||||
controller.abort();
|
||||
}, 15_000);
|
||||
try {
|
||||
availableSamples.value = (await listOrderProfileBlindTestAvailableSamples(suite.value.id)).samples;
|
||||
availableSamples.value = (await listOrderProfileBlindTestAvailableSamples(suite.value.id, controller.signal)).samples;
|
||||
availableSamplesLoaded.value = true;
|
||||
} catch (error) {
|
||||
if (timedOut) {
|
||||
message.error(t('admin.shippingOrderProfiles.blindTest.loadIndependentSamplesTimedOut'));
|
||||
} else if (!controller.signal.aborted) {
|
||||
report(error);
|
||||
}
|
||||
} finally {
|
||||
if (availableSamplesController === controller) {
|
||||
availableSamplesController = null;
|
||||
availableSamplesLoading.value = false;
|
||||
}
|
||||
if (availableSamplesTimeout) window.clearTimeout(availableSamplesTimeout);
|
||||
availableSamplesTimeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 停止上传样本的后台轮询,避免离开盲测页后继续向已卸载页面写入状态。 */
|
||||
function stopUploadPolling(): void {
|
||||
if (uploadPollingTimer) window.clearTimeout(uploadPollingTimer);
|
||||
uploadPollingTimer = null;
|
||||
}
|
||||
|
||||
/** 上传完成后精确选中同一 Intake 的首个可盲测表格,仍必须经过管理员预览和复核。 */
|
||||
async function pollUploadedSample(intakeNo: string): Promise<void> {
|
||||
try {
|
||||
const result = await getOrderProfileSampleStatus(intakeNo);
|
||||
if (result.parse_status === 'parsed' && result.document_count > 0) {
|
||||
const uploaded = (await listOrderProfileSamples()).find((item) => item.intake_no === intakeNo);
|
||||
await loadAvailableSamples(true);
|
||||
const selected = uploaded && availableSamples.value.find((item) => item.document_id === uploaded.document_id);
|
||||
if (selected) {
|
||||
selectedSampleKey.value = `${selected.document_id}:${selected.table_id}`;
|
||||
pendingUpload.value = null;
|
||||
message.success(t('admin.shippingOrderProfiles.wizard.sampleReady'));
|
||||
} else {
|
||||
pendingUpload.value = { intakeNo, filename: pendingUpload.value?.filename || '', state: 'failed' };
|
||||
message.error(t('admin.shippingOrderProfiles.blindTest.noIndependentSamples'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (['failed', 'error'].includes(result.parse_status)) {
|
||||
pendingUpload.value = { intakeNo, filename: pendingUpload.value?.filename || '', state: 'failed' };
|
||||
return;
|
||||
}
|
||||
uploadPollingTimer = window.setTimeout(() => void pollUploadedSample(intakeNo), 1500);
|
||||
} catch {
|
||||
uploadPollingTimer = window.setTimeout(() => void pollUploadedSample(intakeNo), 2000);
|
||||
}
|
||||
}
|
||||
|
||||
/** 上传 PDF/EML 到隔离模板样本池;上传后不会自动写入盲测真值。 */
|
||||
async function uploadIndependentSample(event: Event): Promise<void> {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const file = input.files?.[0];
|
||||
input.value = '';
|
||||
if (!file || uploadingSample.value) return;
|
||||
if (!/\.(pdf|eml)$/i.test(file.name)) {
|
||||
message.error(t('admin.shippingOrderProfiles.sampleFileTypeInvalid'));
|
||||
return;
|
||||
}
|
||||
stopUploadPolling();
|
||||
uploadingSample.value = true;
|
||||
try {
|
||||
const asset = await uploadFileAsset(file);
|
||||
const intake = await createOrderProfileSample(asset.asset_no);
|
||||
pendingUpload.value = { intakeNo: intake.intake_no, filename: file.name, state: 'parsing' };
|
||||
void pollUploadedSample(intake.intake_no);
|
||||
} catch (error) {
|
||||
report(error);
|
||||
} finally {
|
||||
availableSamplesLoading.value = false;
|
||||
uploadingSample.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,6 +332,11 @@ function goToPublishCheck(): void {
|
||||
}
|
||||
|
||||
onMounted(loadSuite);
|
||||
onBeforeUnmount(() => {
|
||||
stopUploadPolling();
|
||||
availableSamplesController?.abort();
|
||||
if (availableSamplesTimeout) window.clearTimeout(availableSamplesTimeout);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -261,7 +359,8 @@ onMounted(loadSuite);
|
||||
<h2>{{ t('admin.shippingOrderProfiles.blindTest.selectIndependentSample') }}</h2>
|
||||
<p v-if="!availableSamplesLoaded">{{ t('admin.shippingOrderProfiles.blindTest.loadIndependentSamplesHint') }}</p>
|
||||
<p v-else-if="!availableSamples.length">{{ t('admin.shippingOrderProfiles.blindTest.noIndependentSamples') }}</p>
|
||||
<div class="sample-picker"><button v-if="!availableSamplesLoaded" type="button" class="btn-secondary" :disabled="availableSamplesLoading" @click="loadAvailableSamples">{{ availableSamplesLoading ? t('admin.shippingOrderProfiles.blindTest.loadingIndependentSamples') : t('admin.shippingOrderProfiles.blindTest.loadIndependentSamples') }}</button><template v-else-if="availableSamples.length"><select v-model="selectedSampleKey" class="select-field"><option value="">{{ t('admin.shippingOrderProfiles.blindTest.selectSamplePlaceholder') }}</option><option v-for="sample in availableSamples" :key="`${sample.document_id}:${sample.table_id}`" :value="`${sample.document_id}:${sample.table_id}`">{{ sample.filename }} · P{{ sample.page_no }}</option></select><button type="button" class="btn-primary" :disabled="!selectedSample || working" @click="previewSample">{{ t('admin.shippingOrderProfiles.blindTest.addCurrentSample') }}</button></template></div>
|
||||
<div class="sample-picker"><label class="btn-secondary upload-sample"><input type="file" accept=".pdf,.eml,application/pdf,message/rfc822" :disabled="uploadingSample" @change="uploadIndependentSample"><span>{{ uploadingSample ? t('admin.shippingOrderProfiles.wizard.uploading') : t('admin.shippingOrderProfiles.wizard.uploadNewSample') }}</span></label><button v-if="!availableSamplesLoaded" type="button" class="btn-secondary" :disabled="availableSamplesLoading" @click="() => void loadAvailableSamples()">{{ availableSamplesLoading ? t('admin.shippingOrderProfiles.blindTest.loadingIndependentSamples') : t('admin.shippingOrderProfiles.blindTest.loadIndependentSamples') }}</button><template v-else-if="availableSamples.length"><select v-model="selectedSampleKey" class="select-field"><option value="">{{ t('admin.shippingOrderProfiles.blindTest.selectSamplePlaceholder') }}</option><option v-for="sample in availableSamples" :key="`${sample.document_id}:${sample.table_id}`" :value="`${sample.document_id}:${sample.table_id}`">{{ sampleLabel(sample) }}</option></select><button type="button" class="btn-primary" :disabled="!selectedSample || working" @click="previewSample">{{ t('admin.shippingOrderProfiles.blindTest.addCurrentSample') }}</button></template></div>
|
||||
<p v-if="pendingUpload" class="upload-status" :class="{ failed: pendingUpload.state === 'failed' }">{{ pendingUpload.filename }} · {{ pendingUpload.state === 'parsing' ? t('admin.shippingOrderProfiles.wizard.sampleParsing') : t('admin.shippingOrderProfiles.wizard.sampleParseFailed') }}</p>
|
||||
</section>
|
||||
|
||||
<section v-if="candidate" class="card candidate-card">
|
||||
@@ -296,6 +395,7 @@ header { align-items: flex-start; margin-bottom: 24px; } h1, h2, h3, p { margin:
|
||||
.card { display: grid; gap: 14px; margin-top: 14px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); padding: 18px; }
|
||||
.status { color: var(--status-warning-fg); font-weight: 700; } .status.approved { color: var(--status-success-fg); } .status.superseded { color: var(--status-error-fg); }
|
||||
.sample-picker .select-field { min-width: 260px; } .candidate-card .input-field { padding: 8px; border-radius: 6px; } textarea.input-field { min-height: 72px; font-family: ui-monospace, monospace; }
|
||||
.upload-sample { position: relative; cursor: pointer; }.upload-sample input { position: absolute; width: 1px; height: 1px; opacity: 0; }.upload-status { margin: 10px 0 0; color: var(--status-info-fg); font-size: .85rem; }.upload-status.failed { color: var(--status-error-fg); }
|
||||
.candidate-card { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } .candidate-card > h2, .candidate-card > p, .candidate-card > button { grid-column: 1 / -1; }
|
||||
.review-item { display: grid; gap: 8px; border: 1px solid var(--border-default); border-radius: 8px; padding: 12px; } code { overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text-primary); font-size: 12px; } label { display: flex; gap: 6px; align-items: center; }
|
||||
ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; } li { border-top: 1px solid var(--border-default); padding-top: 8px; }
|
||||
|
||||
+205
-12
@@ -32,6 +32,7 @@ import {
|
||||
previewOrderProfileOrderFieldValues,
|
||||
releaseOrderDocumentProfileEditLease,
|
||||
renewOrderDocumentProfileEditLease,
|
||||
readOrderProfilePreviewPageRegionText,
|
||||
suggestOrderProfileHeader,
|
||||
suggestOrderProfileOrderFields,
|
||||
saveOrderDocumentProfileDraft,
|
||||
@@ -41,6 +42,7 @@ import type {
|
||||
CoordinateReconstructionPreview,
|
||||
OrderFieldValuePreview,
|
||||
OrderProfileCanvasRegion,
|
||||
OrderProfileDocumentMatchAnchor,
|
||||
OrderProfileFieldRegion,
|
||||
OrderProfileRelativeRegion,
|
||||
OrderProfileBoundSample,
|
||||
@@ -120,6 +122,9 @@ let resolveRouteLeave: ((allowed: boolean) => void) | null = null;
|
||||
const suggestingRegions = ref(false);
|
||||
const suggestionProgress = ref("");
|
||||
const creationKind = ref<OrderProfileCanvasRegion["kind"] | null>(null);
|
||||
const pendingDocumentAnchorLabel = ref<OrderProfileCanvasRegion | null>(null);
|
||||
const pendingOrderFieldAnchor = ref<OrderProfileCanvasRegion | null>(null);
|
||||
const documentAnchorNotice = ref('');
|
||||
const history = ref<OrderProfileCanvasRegion[][]>([]);
|
||||
const future = ref<OrderProfileCanvasRegion[][]>([]);
|
||||
const editLeaseToken = ref<string | null>(null);
|
||||
@@ -146,6 +151,14 @@ const form = reactive({
|
||||
changeNote: "",
|
||||
});
|
||||
const regions = ref<OrderProfileCanvasRegion[]>([]);
|
||||
/** 文档匹配锚点独立于字段坐标;必须以固定标签和固定值关系区分模板。 */
|
||||
const documentMatch = reactive({
|
||||
requiredAnchors: [] as OrderProfileDocumentMatchAnchor[],
|
||||
optionalAnchors: [] as OrderProfileDocumentMatchAnchor[],
|
||||
minimumScore: 0.9,
|
||||
minimumMargin: 0.15,
|
||||
});
|
||||
const documentMatchDirty = ref(false);
|
||||
const lineFields = computed<ShippingOrderFieldConfig[]>(
|
||||
() =>
|
||||
schemas.value
|
||||
@@ -180,7 +193,9 @@ const selectedRegion = computed(
|
||||
/** 当前样本值只能来自本次按画布坐标回读的结果,禁止回退到旧的自动建议缓存。 */
|
||||
const selectedRegionSampleValue = computed(() => {
|
||||
const region = selectedRegion.value;
|
||||
if (region?.kind !== 'order_field' || !region.fieldCode) return null;
|
||||
if (!region || !['order_field', 'header_field'].includes(region.kind)) return null;
|
||||
if (region.suggestedValue) return region.suggestedValue;
|
||||
if (!region.fieldCode) return null;
|
||||
return orderFieldValuePreviews.value.find((item) => item.field_code === region.fieldCode)?.value || null;
|
||||
});
|
||||
/** 右侧选区值与画布标签共享同一个读取状态,禁止以旧建议值回退。 */
|
||||
@@ -199,6 +214,7 @@ const selectedRegionKindLabel = computed(() => {
|
||||
const translationKeys: Record<NonNullable<OrderProfileCanvasRegion['kind']>, string> = {
|
||||
order_anchor: 'orderAnchor', order_field: 'orderField', header_field: 'header',
|
||||
header: 'header', line: 'line', field: 'field', exclusion: 'exclusion',
|
||||
document_anchor_label: 'documentMatchAnchorLabel', document_anchor_value: 'documentMatchAnchorValue',
|
||||
};
|
||||
const translationKey = translationKeys[kind];
|
||||
return t(`admin.shippingOrderProfiles.workbench.${translationKey}`);
|
||||
@@ -260,7 +276,7 @@ const selectedFieldHeaderSuggestion = computed(() => {
|
||||
)
|
||||
: null;
|
||||
});
|
||||
const dirty = computed(() => history.value.length > 0);
|
||||
const dirty = computed(() => history.value.length > 0 || documentMatchDirty.value);
|
||||
/** 当前标注样本可同时作为训练证据;盲测样本仍由独立工作台维护。 */
|
||||
const currentSampleIsTraining = computed(() => boundSamples.value.some(
|
||||
(item) => item.sample_role === 'training' && item.document_id === form.documentId && item.table_id === form.tableId,
|
||||
@@ -362,6 +378,7 @@ const redo = () => {
|
||||
const addRegion = (
|
||||
kind: OrderProfileCanvasRegion["kind"],
|
||||
drawnRegion?: OrderProfileRelativeRegion,
|
||||
selectedText?: string | null,
|
||||
) => {
|
||||
checkpoint();
|
||||
const effectiveKind = kind === "header" ? "header_field" : kind;
|
||||
@@ -432,7 +449,7 @@ const addRegion = (
|
||||
const item: OrderProfileCanvasRegion = {
|
||||
id: `${effectiveKind}_${pageNo.value}_${sequence}`,
|
||||
kind: effectiveKind,
|
||||
label: t(`admin.shippingOrderProfiles.workbench.regionLabels.${effectiveKind}`, {
|
||||
label: selectedText || t(`admin.shippingOrderProfiles.workbench.regionLabels.${effectiveKind}`, {
|
||||
count: sequence,
|
||||
}),
|
||||
region,
|
||||
@@ -444,6 +461,7 @@ const addRegion = (
|
||||
? `order_field_${pageNo.value}_${sequence}`
|
||||
: null,
|
||||
fieldCode: null,
|
||||
suggestedValue: selectedText || null,
|
||||
pageNo: pageNo.value,
|
||||
};
|
||||
if (effectiveKind === "order_field" && selectedOrderAnchor) {
|
||||
@@ -456,14 +474,124 @@ const addRegion = (
|
||||
};
|
||||
/** 进入画布绘制模式;下一次拖拽创建对应区域,避免先生成默认框再反复移动。 */
|
||||
const startDrawing = (kind: OrderProfileCanvasRegion["kind"]) => {
|
||||
if (kind === 'document_anchor_label') pendingDocumentAnchorLabel.value = null;
|
||||
if (kind === 'order_anchor') pendingOrderFieldAnchor.value = null;
|
||||
creationKind.value = creationKind.value === kind ? null : kind;
|
||||
};
|
||||
/** 应用画布拖出的区域并退出绘制模式;字段自动归属当前或首个物理行。 */
|
||||
const createDrawnRegion = (region: OrderProfileRelativeRegion) => {
|
||||
/** 读取画布框内的冻结文字;空框只保留在本地,绝不触发一个必填项不完整的自动保存。 */
|
||||
const readDocumentAnchorText = async (region: OrderProfileRelativeRegion): Promise<string | null> => {
|
||||
if (!active.value || !form.documentId) return null;
|
||||
try {
|
||||
const result = await readOrderProfilePreviewPageRegionText(active.value.id, form.documentId, pageNo.value, region);
|
||||
return result.text.trim() || null;
|
||||
} catch (error) {
|
||||
fail(error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
/** 应用画布拖出的区域并退出绘制模式;匹配锚点从框内坐标文本建立,字段自动归属当前或首个物理行。 */
|
||||
const createDrawnRegion = async (region: OrderProfileRelativeRegion) => {
|
||||
const kind = creationKind.value;
|
||||
creationKind.value = null;
|
||||
if (kind === 'document_anchor_label') {
|
||||
const label = await readDocumentAnchorText(region);
|
||||
if (!label) {
|
||||
documentAnchorNotice.value = t('admin.shippingOrderProfiles.workbench.documentMatchAnchorTextMissing');
|
||||
creationKind.value = 'document_anchor_label';
|
||||
return;
|
||||
}
|
||||
// The first box is only a pending local gesture. Do not autosave a half-built
|
||||
// anchor because the v2 contract correctly requires both label and fixed value.
|
||||
history.value.push(snapshot());
|
||||
future.value = [];
|
||||
const id = `document_anchor_${pageNo.value}_${documentMatch.requiredAnchors.length + 1}`;
|
||||
const labelRegion: OrderProfileCanvasRegion = {
|
||||
id: `${id}_label`, kind, label, region, parentId: id, pageNo: pageNo.value,
|
||||
};
|
||||
regions.value.push(labelRegion);
|
||||
documentAnchorNotice.value = '';
|
||||
pendingDocumentAnchorLabel.value = labelRegion;
|
||||
selectedId.value = labelRegion.id;
|
||||
creationKind.value = 'document_anchor_value';
|
||||
return;
|
||||
}
|
||||
if (kind === 'document_anchor_value' && pendingDocumentAnchorLabel.value) {
|
||||
const value = await readDocumentAnchorText(region);
|
||||
if (!value) {
|
||||
documentAnchorNotice.value = t('admin.shippingOrderProfiles.workbench.documentMatchAnchorTextMissing');
|
||||
creationKind.value = 'document_anchor_value';
|
||||
return;
|
||||
}
|
||||
const labelRegion = pendingDocumentAnchorLabel.value;
|
||||
const anchorId = labelRegion.parentId!;
|
||||
const valueRegion: OrderProfileCanvasRegion = {
|
||||
id: `${anchorId}_value`, kind, label: value, region, parentId: anchorId, pageNo: pageNo.value,
|
||||
};
|
||||
regions.value.push(valueRegion);
|
||||
documentAnchorNotice.value = '';
|
||||
documentMatch.requiredAnchors.push({
|
||||
anchor_id: anchorId,
|
||||
label: labelRegion.label, value, value_position: region.y0 >= labelRegion.region.y1 ? 'below' : 'right',
|
||||
page_no: pageNo.value,
|
||||
label_region: labelRegion.region,
|
||||
value_region: valueRegion.region,
|
||||
minimum_evidence_level: 'coordinate',
|
||||
});
|
||||
pendingDocumentAnchorLabel.value = null;
|
||||
documentMatchDirty.value = true;
|
||||
selectedId.value = valueRegion.id;
|
||||
markLocalChange();
|
||||
schedulePreview();
|
||||
scheduleAutosave();
|
||||
return;
|
||||
}
|
||||
if (kind === 'order_anchor') {
|
||||
const label = await readDocumentAnchorText(region);
|
||||
if (!label) {
|
||||
documentAnchorNotice.value = t('admin.shippingOrderProfiles.workbench.documentMatchAnchorTextMissing');
|
||||
creationKind.value = 'order_anchor';
|
||||
return;
|
||||
}
|
||||
history.value.push(snapshot());
|
||||
future.value = [];
|
||||
const sequence = pageRegions.value.filter((item) => item.kind === 'order_anchor').length + 1;
|
||||
const orderFieldId = `order_field_${pageNo.value}_${sequence}`;
|
||||
const anchor: OrderProfileCanvasRegion = {
|
||||
id: `${orderFieldId}_anchor`, kind, label, region, orderFieldId, pageNo: pageNo.value,
|
||||
};
|
||||
regions.value.push(anchor);
|
||||
pendingOrderFieldAnchor.value = anchor;
|
||||
selectedId.value = anchor.id;
|
||||
documentAnchorNotice.value = t('admin.shippingOrderProfiles.workbench.orderFieldAnchorNext');
|
||||
creationKind.value = 'order_field';
|
||||
return;
|
||||
}
|
||||
if (kind === 'order_field' && pendingOrderFieldAnchor.value) {
|
||||
const value = await readDocumentAnchorText(region);
|
||||
if (!value) {
|
||||
documentAnchorNotice.value = t('admin.shippingOrderProfiles.workbench.documentMatchAnchorTextMissing');
|
||||
creationKind.value = 'order_field';
|
||||
return;
|
||||
}
|
||||
const anchor = pendingOrderFieldAnchor.value;
|
||||
const valueRegion: OrderProfileCanvasRegion = {
|
||||
id: anchor.orderFieldId!, kind, label: value, region, parentId: anchor.id,
|
||||
orderFieldId: anchor.orderFieldId, valueMode: 'single_line', suggestedValue: value, pageNo: pageNo.value,
|
||||
};
|
||||
regions.value.push(valueRegion);
|
||||
pendingOrderFieldAnchor.value = null;
|
||||
documentAnchorNotice.value = '';
|
||||
selectedId.value = valueRegion.id;
|
||||
markLocalChange();
|
||||
schedulePreview();
|
||||
scheduleAutosave();
|
||||
return;
|
||||
}
|
||||
if (kind) {
|
||||
addRegion(kind, region);
|
||||
const selectedText = kind === 'header_field'
|
||||
? await readDocumentAnchorText(region)
|
||||
: null;
|
||||
addRegion(kind, region, selectedText);
|
||||
schedulePreview();
|
||||
}
|
||||
};
|
||||
@@ -501,12 +629,20 @@ const removeSelected = () => {
|
||||
checkpoint();
|
||||
const removedId = selectedRegion.value.id;
|
||||
const removesSharedAnchor = selectedRegion.value.kind === "order_anchor";
|
||||
const documentAnchorId = ['document_anchor_label', 'document_anchor_value'].includes(selectedRegion.value.kind)
|
||||
? selectedRegion.value.parentId
|
||||
: null;
|
||||
// Removing a shared label removes dependent value boxes; removing one value box
|
||||
// preserves the label and any sibling customer/address field.
|
||||
regions.value = regions.value.filter(
|
||||
(item) => item.id !== removedId && item.parentId !== removedId &&
|
||||
(!removesSharedAnchor || item.parentId !== removedId),
|
||||
(!removesSharedAnchor || item.parentId !== removedId) && item.parentId !== documentAnchorId,
|
||||
);
|
||||
if (documentAnchorId) {
|
||||
documentMatch.requiredAnchors = documentMatch.requiredAnchors.filter((item) => item.anchor_id !== documentAnchorId);
|
||||
documentMatch.optionalAnchors = documentMatch.optionalAnchors.filter((item) => item.anchor_id !== documentAnchorId);
|
||||
documentMatchDirty.value = true;
|
||||
}
|
||||
selectedId.value = null;
|
||||
schedulePreview();
|
||||
};
|
||||
@@ -535,6 +671,15 @@ const updateRegion = (id: string, region: OrderProfileRelativeRegion) => {
|
||||
const normalized = normalizedCanvasRegion(region);
|
||||
if (!normalized) return;
|
||||
item.region = normalized;
|
||||
if (item.parentId && ['document_anchor_label', 'document_anchor_value'].includes(item.kind)) {
|
||||
const anchor = documentMatch.requiredAnchors.find((entry) => entry.anchor_id === item.parentId)
|
||||
|| documentMatch.optionalAnchors.find((entry) => entry.anchor_id === item.parentId);
|
||||
if (anchor) {
|
||||
if (item.kind === 'document_anchor_label') anchor.label_region = normalized;
|
||||
else anchor.value_region = normalized;
|
||||
documentMatchDirty.value = true;
|
||||
}
|
||||
}
|
||||
schedulePreview();
|
||||
scheduleOrderFieldSuggestionValues();
|
||||
};
|
||||
@@ -670,10 +815,10 @@ const definition = () => {
|
||||
document_match: {
|
||||
document_type: "purchase_order" as const,
|
||||
page_pattern: "one_or_more" as const,
|
||||
required_anchors: [],
|
||||
optional_anchors: [],
|
||||
minimum_score: 0.9,
|
||||
minimum_margin: 0.15,
|
||||
required_anchors: documentMatch.requiredAnchors.map((item) => ({ ...item })),
|
||||
optional_anchors: documentMatch.optionalAnchors.map((item) => ({ ...item })),
|
||||
minimum_score: documentMatch.minimumScore,
|
||||
minimum_margin: documentMatch.minimumMargin,
|
||||
},
|
||||
table_regions: tableRegions,
|
||||
order_field_layouts: regions.value
|
||||
@@ -807,6 +952,7 @@ const save = async (automatic = false) => {
|
||||
if (localChangeVersion === savingChangeVersion) {
|
||||
history.value = [];
|
||||
future.value = [];
|
||||
documentMatchDirty.value = false;
|
||||
}
|
||||
saveState.value = 'saved';
|
||||
autosaveFailures = 0;
|
||||
@@ -1248,6 +1394,16 @@ const mergeEquivalentOrderAnchors = (items: OrderProfileCanvasRegion[]) => {
|
||||
/** 从 v2 定义恢复区域,供草稿重开后继续在画布上编辑。 */
|
||||
const restoreRegions = (profile: ShippingOrderDocumentProfile) => {
|
||||
const restored: OrderProfileCanvasRegion[] = [
|
||||
...(profile.definition.document_match.required_anchors || []).flatMap<OrderProfileCanvasRegion>((anchor) => {
|
||||
if (!anchor.label_region || !anchor.value_region || !anchor.page_no) return [];
|
||||
return [{
|
||||
id: `${anchor.anchor_id}_label`, kind: 'document_anchor_label', label: anchor.label,
|
||||
region: anchor.label_region, parentId: anchor.anchor_id, pageNo: anchor.page_no,
|
||||
}, {
|
||||
id: `${anchor.anchor_id}_value`, kind: 'document_anchor_value', label: anchor.value,
|
||||
region: anchor.value_region, parentId: anchor.anchor_id, pageNo: anchor.page_no,
|
||||
}];
|
||||
}),
|
||||
...(profile.definition.draft_unbound_order_field_layouts || []).flatMap<OrderProfileCanvasRegion>((item) => {
|
||||
const pageNo = item.page_scope === "exact_page" ? item.page_no || 1 : 1;
|
||||
if (!item.anchor?.region || (!item.value_region && !item.absolute_value_region)) {
|
||||
@@ -1436,6 +1592,11 @@ const edit = async (profile: ShippingOrderDocumentProfile) => {
|
||||
form.displayName = profile.display_name;
|
||||
form.schemaId = profile.schema_version_id;
|
||||
form.changeNote = profile.change_note || "";
|
||||
documentMatch.requiredAnchors = (profile.definition.document_match.required_anchors || []).map((item) => ({ ...item }));
|
||||
documentMatch.optionalAnchors = (profile.definition.document_match.optional_anchors || []).map((item) => ({ ...item }));
|
||||
documentMatch.minimumScore = profile.definition.document_match.minimum_score;
|
||||
documentMatch.minimumMargin = profile.definition.document_match.minimum_margin;
|
||||
documentMatchDirty.value = false;
|
||||
regions.value = restoreRegions(profile);
|
||||
history.value = [];
|
||||
future.value = [];
|
||||
@@ -1604,7 +1765,13 @@ const handleShortcut = (event: KeyboardEvent) => {
|
||||
documentCanvas.value?.resetZoom();
|
||||
return;
|
||||
}
|
||||
if (event.key.toLowerCase() === "g") {
|
||||
event.preventDefault();
|
||||
void suggestRegions();
|
||||
return;
|
||||
}
|
||||
const kindByKey: Record<string, OrderProfileCanvasRegion["kind"]> = {
|
||||
m: "document_anchor_label",
|
||||
h: "header_field",
|
||||
l: "line",
|
||||
f: "field",
|
||||
@@ -1768,13 +1935,27 @@ onBeforeUnmount(() => {
|
||||
<header>
|
||||
<span>{{ t("admin.shippingOrderProfiles.workbench.currentConfiguration") }}</span>
|
||||
</header>
|
||||
<section class="document-match-editor">
|
||||
<div class="document-match-editor__heading">
|
||||
<div>
|
||||
<strong>{{ t('admin.shippingOrderProfiles.workbench.documentMatchAnchorTool') }}</strong>
|
||||
<p>{{ t('admin.shippingOrderProfiles.workbench.documentMatchAnchorHint') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="!documentMatch.requiredAnchors.length" class="document-match-editor__warning">{{ t('admin.shippingOrderProfiles.workbench.documentMatchAnchorEmpty') }}</p>
|
||||
<p v-if="documentAnchorNotice" class="document-match-editor__warning">{{ documentAnchorNotice }}</p>
|
||||
<article v-for="(anchor, index) in documentMatch.requiredAnchors" :key="`required-${index}`" class="document-match-editor__row">
|
||||
<b>{{ t('common.required') }}</b>
|
||||
<span>{{ anchor.label }}</span><span>{{ anchor.value }}</span>
|
||||
</article>
|
||||
</section>
|
||||
<section v-if="selectedRegion" class="editor">
|
||||
<div class="selected-region-meta">
|
||||
<span>{{ t('admin.shippingOrderProfiles.workbench.selectedRegion') }}</span>
|
||||
<strong>{{ selectedRegionKindLabel }}</strong>
|
||||
<small>{{ selectedRegionGeometry }}</small>
|
||||
</div>
|
||||
<section v-if="selectedRegion.kind === 'order_field'" class="sample-value-card">
|
||||
<section v-if="['order_field', 'header_field'].includes(selectedRegion.kind)" class="sample-value-card">
|
||||
<span>{{ t('admin.shippingOrderProfiles.workbench.currentSampleValue') }}</span>
|
||||
<strong :class="{ empty: !selectedRegionSampleValue }">
|
||||
{{ selectedRegionSampleDisplay }}
|
||||
@@ -2187,6 +2368,18 @@ onBeforeUnmount(() => {
|
||||
margin: 0 0.8rem;
|
||||
padding: 0.8rem 0;
|
||||
}
|
||||
.document-match-editor {
|
||||
border-bottom: 1px solid #cbd5e1;
|
||||
padding: 0.85rem;
|
||||
background: #f8fafc;
|
||||
}
|
||||
.document-match-editor__heading { display: flex; gap: 0.5rem; align-items: start; }
|
||||
.document-match-editor__heading strong { font-size: 0.84rem; }
|
||||
.document-match-editor__heading p { margin: 0.3rem 0 0; font-size: 0.72rem; color: #64748b; }
|
||||
.document-match-editor__warning { margin: 0.6rem 0; color: #b45309; font-size: 0.75rem; }
|
||||
.document-match-editor__row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr); gap: 0.35rem; align-items: center; margin-top: 0.45rem; }
|
||||
.document-match-editor__row b { font-size: 0.7rem; color: #0f766e; }
|
||||
.document-match-editor__row span { overflow: hidden; color: #475569; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.selected-region-meta { display: grid; gap: .2rem; margin-bottom: .8rem; border-bottom: 1px solid #dbe4ef; padding-bottom: .75rem; }
|
||||
.selected-region-meta span { color: #64748b; font-size: .7rem; font-weight: 700; }
|
||||
.selected-region-meta strong { color: #0f172a; font-size: .82rem; }
|
||||
|
||||
+36
-2
@@ -2,7 +2,7 @@
|
||||
features/admin/modules/shipping-order-document-profiles/OrderProfileLibraryPage.vue
|
||||
用途:按 profile_code 聚合展示订单文档模板族,是创建和继续编辑的唯一首页。
|
||||
依赖:Profile family API、Vue Router、Vue I18n。
|
||||
逻辑:列表只选择下一步路由;草稿进入编辑页,已发布版本创建新草稿,历史版本进入只读版本中心。
|
||||
逻辑:列表只选择下一步路由;草稿可继续编辑或删除,已发布版本创建新草稿,历史版本进入只读版本中心。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
@@ -10,7 +10,8 @@ import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { cloneOrderDocumentProfile, listOrderDocumentProfileFamilies } from '@/features/admin/api/shipping-order-document-profile.api';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { cloneOrderDocumentProfile, deleteOrderDocumentProfile, listOrderDocumentProfileFamilies } from '@/features/admin/api/shipping-order-document-profile.api';
|
||||
import type { OrderProfileVersionFamilySummary } from '@/features/admin/types/shipping-order-document-profile.types';
|
||||
|
||||
const { t } = useI18n();
|
||||
@@ -19,6 +20,13 @@ const message = useMessage();
|
||||
const loading = ref(false);
|
||||
const query = ref('');
|
||||
const families = ref<OrderProfileVersionFamilySummary[]>([]);
|
||||
const deletingDraft = ref<OrderProfileVersionFamilySummary | null>(null);
|
||||
const deleteConfirmOpen = computed({
|
||||
get: () => deletingDraft.value !== null,
|
||||
set: (visible: boolean) => {
|
||||
if (!visible) deletingDraft.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const filteredFamilies = computed(() => {
|
||||
const keyword = query.value.trim().toLowerCase();
|
||||
@@ -55,6 +63,26 @@ async function createNewVersion(item: OrderProfileVersionFamilySummary): Promise
|
||||
}
|
||||
}
|
||||
|
||||
/** 打开系统内确认框,避免浏览器原生弹窗中断管理员的模板管理流程。 */
|
||||
function requestDeleteDraft(item: OrderProfileVersionFamilySummary): void {
|
||||
if (item.draft_profile_id) deletingDraft.value = item;
|
||||
}
|
||||
|
||||
/** 删除已确认的草稿;服务端仍拒绝删除已发布或退役的历史版本。 */
|
||||
async function confirmDeleteDraft(): Promise<void> {
|
||||
const item = deletingDraft.value;
|
||||
if (!item?.draft_profile_id) return;
|
||||
try {
|
||||
await deleteOrderDocumentProfile(item.draft_profile_id);
|
||||
message.success(t('admin.shippingOrderProfiles.deleted'));
|
||||
await loadFamilies();
|
||||
} catch (error) {
|
||||
message.error(error instanceof BusinessError ? error.message : t('admin.shippingOrderProfiles.library.loadFailed'));
|
||||
} finally {
|
||||
deletingDraft.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 进入不可变历史详情,不允许在此页面把版本伪装成新草稿。 */
|
||||
function viewVersion(item: OrderProfileVersionFamilySummary): void {
|
||||
router.push({ name: 'AdminShippingOrderDocumentProfileVersionDetail', params: { profileCode: item.profile_code, version: item.default_version } });
|
||||
@@ -103,6 +131,7 @@ onMounted(loadFamilies);
|
||||
</td>
|
||||
<td class="profile-library__actions">
|
||||
<button v-if="item.draft_profile_id" class="btn-ghost btn-sm" type="button" @click="continueEditing(item)">{{ t('admin.shippingOrderProfiles.versionCenter.continueEditing') }}</button>
|
||||
<button v-if="item.draft_profile_id" class="btn-danger btn-sm" type="button" @click="requestDeleteDraft(item)">{{ t('admin.delete') }}</button>
|
||||
<button v-else-if="item.published_profile_id" class="btn-secondary btn-sm" type="button" @click="createNewVersion(item)">{{ t('admin.shippingOrderProfiles.newVersion') }}</button>
|
||||
<button class="btn-ghost btn-sm" type="button" @click="viewVersion(item)">{{ t('admin.shippingOrderProfiles.versionCenter.viewVersion') }}</button>
|
||||
</td>
|
||||
@@ -111,6 +140,11 @@ onMounted(loadFamilies);
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<DeleteConfirmDialog
|
||||
v-model="deleteConfirmOpen"
|
||||
:message="t('admin.shippingOrderProfiles.deleteConfirm')"
|
||||
@confirm="confirmDeleteDraft"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
+18
-21
@@ -7,7 +7,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ArrowLeft, ArrowRight, BoxSelect, Copy, Eraser, Minus, Plus, Redo2, RotateCcw, Save, ScanLine, Sparkles, TableProperties, Trash2 } from 'lucide-vue-next';
|
||||
import { Anchor, ArrowLeft, ArrowRight, Columns3, Copy, Eraser, Minus, Plus, Redo2, RotateCcw, Rows3, Save, TableProperties, Tag, TextCursorInput, Trash2, WandSparkles } from 'lucide-vue-next';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import type { OrderProfileCanvasRegion, OrderProfilePreviewPageGrant } from '@/features/admin/types/shipping-order-document-profile.types';
|
||||
|
||||
@@ -59,7 +59,6 @@ const loading = ref(false);
|
||||
const canvas = ref<HTMLElement | null>(null);
|
||||
const viewport = ref<HTMLElement | null>(null);
|
||||
const zoom = ref(1);
|
||||
const toolsOpen = ref(true);
|
||||
const zoomPercent = computed(() => Math.round(zoom.value * 100));
|
||||
const pageInput = ref(props.pageNo);
|
||||
type ResizeHandle = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
||||
@@ -238,18 +237,16 @@ onBeforeUnmount(() => { endMove(); endPan(); endCreation(); URL.revokeObjectURL(
|
||||
<div v-if="loading" class="canvas-state">{{ t('admin.shippingOrderProfiles.workbench.loadingPage') }}</div>
|
||||
<div v-else-if="!imageUrl" class="canvas-state">{{ t('admin.shippingOrderProfiles.workbench.selectBoundPdf') }}</div>
|
||||
<div v-else class="canvas-work-area" :class="{ readonly: readonlyMode }">
|
||||
<aside v-if="!readonlyMode" class="annotation-tools" :class="{ collapsed: !toolsOpen }">
|
||||
<button type="button" class="tools-toggle" :aria-expanded="toolsOpen" :aria-label="toolsOpen ? t('admin.shippingOrderProfiles.workbench.hideAnnotationTools') : t('admin.shippingOrderProfiles.workbench.showAnnotationTools')" @click="toolsOpen = !toolsOpen"><BoxSelect /><span v-if="toolsOpen">{{ t('admin.shippingOrderProfiles.workbench.annotationTools') }}</span></button>
|
||||
<template v-if="toolsOpen">
|
||||
<button type="button" :title="t('admin.shippingOrderProfiles.workbench.drawOrderAnchor')" :class="{ active: creationKind === 'order_anchor' }" @click="emit('draw', 'order_anchor')"><BoxSelect /><span>{{ t('admin.shippingOrderProfiles.workbench.orderAnchorTool') }}</span></button>
|
||||
<button type="button" :title="t('admin.shippingOrderProfiles.workbench.drawOrderField')" :class="{ active: creationKind === 'order_field' }" @click="emit('draw', 'order_field')"><BoxSelect /><span>{{ t('admin.shippingOrderProfiles.workbench.orderField') }}</span></button>
|
||||
<button type="button" :title="t('admin.shippingOrderProfiles.workbench.drawHeader')" :class="{ active: creationKind === 'header_field' }" @click="emit('draw', 'header_field')"><TableProperties /><span>{{ t('admin.shippingOrderProfiles.workbench.headerTool') }}</span></button>
|
||||
<button type="button" :title="t('admin.shippingOrderProfiles.workbench.drawLine')" :class="{ active: creationKind === 'line' }" @click="emit('draw', 'line')"><ScanLine /><span>{{ t('admin.shippingOrderProfiles.workbench.lineTool') }}</span></button>
|
||||
<button type="button" :title="t('admin.shippingOrderProfiles.workbench.drawField')" :class="{ active: creationKind === 'field' }" @click="emit('draw', 'field')"><BoxSelect /><span>{{ t('admin.shippingOrderProfiles.workbench.fieldTool') }}</span></button>
|
||||
<button type="button" :title="t('admin.shippingOrderProfiles.workbench.drawExclusion')" :class="{ active: creationKind === 'exclusion' }" @click="emit('draw', 'exclusion')"><Eraser /><span>{{ t('admin.shippingOrderProfiles.workbench.exclusionTool') }}</span></button>
|
||||
<button type="button" class="suggest" :disabled="autoSuggestDisabled || suggesting" @click="emit('suggest')"><Sparkles /><span>{{ suggesting ? t('admin.shippingOrderProfiles.workbench.autoSuggestRunning') : t('admin.shippingOrderProfiles.workbench.autoSuggest') }}</span></button>
|
||||
<p v-if="suggestionProgress" class="suggestion-progress" :class="{ failed: !suggesting }">{{ suggestionProgress }}</p>
|
||||
</template>
|
||||
<aside v-if="!readonlyMode" class="annotation-tools">
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawDocumentMatchAnchorShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawDocumentMatchAnchorShortcut')" :class="{ active: creationKind === 'document_anchor_label' || creationKind === 'document_anchor_value' }" @click="emit('draw', 'document_anchor_label')"><Anchor /></button>
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawOrderAnchorShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawOrderAnchorShortcut')" :class="{ active: creationKind === 'order_anchor' }" @click="emit('draw', 'order_anchor')"><Tag /></button>
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawOrderFieldShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawOrderFieldShortcut')" :class="{ active: creationKind === 'order_field' }" @click="emit('draw', 'order_field')"><TextCursorInput /></button>
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawHeaderShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawHeaderShortcut')" :class="{ active: creationKind === 'header_field' }" @click="emit('draw', 'header_field')"><TableProperties /></button>
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawLineShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawLineShortcut')" :class="{ active: creationKind === 'line' }" @click="emit('draw', 'line')"><Rows3 /></button>
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawFieldShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawFieldShortcut')" :class="{ active: creationKind === 'field' }" @click="emit('draw', 'field')"><Columns3 /></button>
|
||||
<button type="button" :aria-label="t('admin.shippingOrderProfiles.workbench.drawExclusionShortcut')" :title="t('admin.shippingOrderProfiles.workbench.drawExclusionShortcut')" :class="{ active: creationKind === 'exclusion' }" @click="emit('draw', 'exclusion')"><Eraser /></button>
|
||||
<button type="button" class="suggest" :aria-label="t('admin.shippingOrderProfiles.workbench.autoSuggestShortcut')" :title="t('admin.shippingOrderProfiles.workbench.autoSuggestShortcut')" :disabled="autoSuggestDisabled || suggesting" @click="emit('suggest')"><WandSparkles /></button>
|
||||
<p v-if="suggestionProgress" class="suggestion-progress" :class="{ failed: !suggesting }">{{ suggestionProgress }}</p>
|
||||
</aside>
|
||||
<div ref="viewport" class="canvas-viewport" :class="{ panning: !creationKind || readonlyMode }" @wheel.prevent="handleWheel">
|
||||
<div ref="canvas" class="canvas-stage" :class="{ drawing: creationKind && !readonlyMode }" :style="{ '--canvas-zoom': zoom }" @pointerdown="beginCreation">
|
||||
@@ -312,13 +309,10 @@ onBeforeUnmount(() => { endMove(); endPan(); endCreation(); URL.revokeObjectURL(
|
||||
.canvas-stage img { display: block; width: 100%; user-select: none; }
|
||||
.canvas-stage.drawing { cursor: crosshair; }
|
||||
.creation-region { position: absolute; z-index: 5; box-sizing: border-box; border: 2px dashed #34d399; background: rgb(16 185 129 / .18); pointer-events: none; }
|
||||
.annotation-tools { display: grid; align-content: start; gap: .3rem; flex: 0 0 7rem; padding: .35rem; border: 1px solid rgb(71 85 105 / .9); border-radius: .5rem; background: rgb(15 23 42 / .94); box-shadow: 0 8px 24px rgb(15 23 42 / .3); }
|
||||
.annotation-tools.collapsed { flex-basis: 2.45rem; padding: .3rem; }
|
||||
.annotation-tools button { display: flex; min-height: 2rem; align-items: center; gap: .4rem; border: 1px solid transparent; border-radius: .35rem; background: #1e293b; padding: .35rem .45rem; color: #e2e8f0; font-size: .7rem; text-align: left; white-space: nowrap; }
|
||||
.annotation-tools { display: grid; align-content: start; gap: .3rem; flex: 0 0 2.65rem; padding: .3rem; border: 1px solid rgb(71 85 105 / .9); border-radius: .5rem; background: rgb(15 23 42 / .94); box-shadow: 0 8px 24px rgb(15 23 42 / .3); }
|
||||
.annotation-tools button { display: grid; min-height: 2rem; place-items: center; border: 1px solid transparent; border-radius: .35rem; background: #1e293b; padding: .35rem; color: #e2e8f0; }
|
||||
.annotation-tools button:hover, .annotation-tools button.active { border-color: #38bdf8; background: #0c4a6e; color: #f0f9ff; }
|
||||
.annotation-tools .tools-toggle { justify-content: center; }
|
||||
.annotation-tools.collapsed .tools-toggle { padding-inline: 0; }
|
||||
.annotation-tools .suggest { border-color: #0ea5e9; background: #0284c7; font-weight: 700; }
|
||||
.annotation-tools .suggest { border-color: #0ea5e9; background: #0284c7; }
|
||||
.annotation-tools button:disabled { cursor: not-allowed; opacity: .45; }
|
||||
.suggestion-progress { margin: .1rem; color: #bae6fd; font-size: .66rem; line-height: 1.35; }
|
||||
.suggestion-progress.failed { color: #fca5a5; }
|
||||
@@ -340,6 +334,10 @@ onBeforeUnmount(() => { endMove(); endPan(); endCreation(); URL.revokeObjectURL(
|
||||
.region-order_field .region-label, .region-order_field .resize-handle { background: #15803d; }
|
||||
.region-order_anchor { z-index: 2; border: 1.5px solid #a855f7; background: rgb(168 85 247 / .08); }
|
||||
.region-order_anchor .region-label, .region-order_anchor .resize-handle { background: #7e22ce; }
|
||||
.region-document_anchor_label { z-index: 2; border: 1.5px solid #0ea5e9; background: rgb(14 165 233 / .1); }
|
||||
.region-document_anchor_label .region-label, .region-document_anchor_label .resize-handle { background: #0369a1; }
|
||||
.region-document_anchor_value { z-index: 2; border: 1.5px solid #f97316; background: rgb(249 115 22 / .1); }
|
||||
.region-document_anchor_value .region-label, .region-document_anchor_value .resize-handle { background: #c2410c; }
|
||||
.region-line { z-index: 0; border-color: #a78bfa; background: rgb(167 139 250 / .1); pointer-events: none; }
|
||||
.region-line .region-label, .region-line .line-hit-edge, .region-line.selected .resize-handle { pointer-events: auto; }
|
||||
.region-line .region-label, .region-line .resize-handle { background: #6d28d9; }
|
||||
@@ -370,5 +368,4 @@ onBeforeUnmount(() => { endMove(); endPan(); endCreation(); URL.revokeObjectURL(
|
||||
.annotation-tools { flex-basis: 2.45rem; }
|
||||
.annotation-tools button span, .suggestion-progress { display: none; }
|
||||
}
|
||||
.tools-toggle span { display: none; }
|
||||
</style>
|
||||
+260
-20
@@ -1,30 +1,40 @@
|
||||
<!--
|
||||
features/admin/modules/shipping-order-extraction-runs/ShippingOrderExtractionRunsPage.vue
|
||||
用途:为所有管理员提供订单识别异步 Run 的只读诊断视图。
|
||||
依赖:admin.api 的脱敏诊断 DTO、Vue Composition API、Vue I18n。
|
||||
逻辑:列表按状态筛选并按需加载单条详情;页面不提供重试、取消或任何业务数据修改入口。
|
||||
用途:管理员订单识别运行诊断——健康聚合、积压/取消中筛选、只读详情与活跃 Run 取消。
|
||||
依赖:admin.api 脱敏诊断/健康/取消 DTO、Vue Composition API、Vue I18n。
|
||||
逻辑:健康面板 + 列表筛选;详情仍只读;取消走 admin cancel API 且强制填写原因。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import {
|
||||
cancelShippingOrderExtractionRun,
|
||||
getShippingOrderExtractionDiagnosticRun,
|
||||
getShippingOrderExtractionHealth,
|
||||
listShippingOrderExtractionDiagnosticRuns,
|
||||
type ShippingOrderExtractionDiagnosticDetail,
|
||||
type ShippingOrderExtractionDiagnosticRun,
|
||||
type ShippingOrderExtractionHealth,
|
||||
} from '@/features/admin/api/admin.api';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const loading = ref(false);
|
||||
const healthLoading = ref(false);
|
||||
const detailLoading = ref(false);
|
||||
const cancellingRunNo = ref('');
|
||||
const pendingCancelRunNo = ref('');
|
||||
const cancelReason = ref('');
|
||||
const page = ref(1);
|
||||
const pageSize = 25;
|
||||
const total = ref(0);
|
||||
const status = ref('');
|
||||
const staleOnly = ref(false);
|
||||
const cancellationInFlight = ref(false);
|
||||
const rows = ref<ShippingOrderExtractionDiagnosticRun[]>([]);
|
||||
const health = ref<ShippingOrderExtractionHealth | null>(null);
|
||||
const detail = ref<ShippingOrderExtractionDiagnosticDetail | null>(null);
|
||||
const error = ref('');
|
||||
|
||||
@@ -33,12 +43,72 @@ const formatDuration = (value?: number | null) => value == null ? '-' : `${(valu
|
||||
const translateAutoFreezeReason = (code: string) =>
|
||||
t(`admin.shippingOrderExtractionRuns.autoFreezeReasonCodes.${code}`, code);
|
||||
|
||||
/**
|
||||
* 判断管理员是否可对 Run 发起取消(活跃且未完成取消)。
|
||||
*/
|
||||
const canCancelRun = (row: ShippingOrderExtractionDiagnosticRun) => (
|
||||
['queued', 'processing'].includes(row.status)
|
||||
&& !row.cancellation?.completed
|
||||
&& !row.cancellation?.in_flight
|
||||
);
|
||||
|
||||
/** 展开/收起列表行取消表单。 */
|
||||
const beginCancelRun = (runNo: string) => {
|
||||
if (pendingCancelRunNo.value === runNo) {
|
||||
pendingCancelRunNo.value = '';
|
||||
cancelReason.value = '';
|
||||
return;
|
||||
}
|
||||
pendingCancelRunNo.value = runNo;
|
||||
cancelReason.value = '';
|
||||
};
|
||||
|
||||
/**
|
||||
* 管理员取消 Run;后端强制要求 reason。
|
||||
*/
|
||||
const submitCancelRun = async (runNo: string) => {
|
||||
const reason = String(cancelReason.value || '').trim();
|
||||
if (!reason || cancellingRunNo.value) return;
|
||||
cancellingRunNo.value = runNo;
|
||||
error.value = '';
|
||||
try {
|
||||
await cancelShippingOrderExtractionRun(runNo, { reason, reason_code: 'admin_cancelled' });
|
||||
pendingCancelRunNo.value = '';
|
||||
cancelReason.value = '';
|
||||
await refreshAll();
|
||||
} catch {
|
||||
error.value = t('admin.shippingOrderExtractionRuns.cancelFailed');
|
||||
} finally {
|
||||
cancellingRunNo.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载健康聚合;失败不阻断列表。 */
|
||||
const loadHealth = async () => {
|
||||
healthLoading.value = true;
|
||||
try {
|
||||
health.value = await getShippingOrderExtractionHealth(24);
|
||||
} catch {
|
||||
health.value = null;
|
||||
} finally {
|
||||
healthLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载安全摘要;服务端已完成管理员鉴权、审计及敏感字段剔除。 */
|
||||
const load = async () => {
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
const response = await listShippingOrderExtractionDiagnosticRuns(page.value, pageSize, status.value);
|
||||
const response = await listShippingOrderExtractionDiagnosticRuns(
|
||||
page.value,
|
||||
pageSize,
|
||||
status.value,
|
||||
{
|
||||
staleOnly: staleOnly.value,
|
||||
cancellationInFlight: cancellationInFlight.value,
|
||||
},
|
||||
);
|
||||
rows.value = response.items;
|
||||
total.value = response.total;
|
||||
} catch {
|
||||
@@ -48,6 +118,10 @@ const load = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const refreshAll = async () => {
|
||||
await Promise.all([loadHealth(), load()]);
|
||||
};
|
||||
|
||||
/** 按需打开一条 Run 的脱敏执行尝试和节点生命周期,不预取详情以减少诊断审计噪声。 */
|
||||
const openDetail = async (runNo: string) => {
|
||||
detailLoading.value = true;
|
||||
@@ -73,13 +147,13 @@ const closeDetail = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const applyStatus = async () => {
|
||||
const applyFilters = async () => {
|
||||
page.value = 1;
|
||||
await load();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
void refreshAll();
|
||||
const runNo = String(route.query.runNo || '').trim();
|
||||
if (runNo) void openDetail(runNo);
|
||||
});
|
||||
@@ -104,43 +178,173 @@ watch(
|
||||
<h1 class="section-title">{{ t('admin.shippingOrderExtractionRuns.title') }}</h1>
|
||||
<p class="section-desc mt-1 max-w-3xl">{{ t('admin.shippingOrderExtractionRuns.subtitle') }}</p>
|
||||
</div>
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="loading" @click="load">
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="loading || healthLoading" @click="refreshAll">
|
||||
{{ t('admin.shippingOrderExtractionRuns.refresh') }}
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div
|
||||
class="grid gap-3 rounded-xl border border-default bg-surface p-4 md:grid-cols-4"
|
||||
data-testid="shipping-order-extraction-health"
|
||||
>
|
||||
<div v-if="healthLoading" class="md:col-span-4 text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.loading') }}</div>
|
||||
<template v-else-if="health">
|
||||
<div>
|
||||
<div class="text-xs text-muted">{{ t('admin.shippingOrderExtractionRuns.healthStatus') }}</div>
|
||||
<div class="mt-1 text-lg font-semibold" :class="health.health_status === 'healthy' ? 'text-emerald-700' : 'text-amber-700'">
|
||||
{{ t(`admin.shippingOrderExtractionRuns.healthStatuses.${health.health_status}`, health.health_status) }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-muted">{{ t('admin.shippingOrderExtractionRuns.activeCount') }}</div>
|
||||
<div class="mt-1 text-lg font-semibold">{{ health.counts.active || 0 }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-muted">{{ t('admin.shippingOrderExtractionRuns.staleCount') }}</div>
|
||||
<div class="mt-1 text-lg font-semibold">{{ health.counts.stale || 0 }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-muted">{{ t('admin.shippingOrderExtractionRuns.failureRate') }}</div>
|
||||
<div class="mt-1 text-lg font-semibold">{{ Math.round((health.failure_rate || 0) * 100) }}%</div>
|
||||
</div>
|
||||
<div class="md:col-span-4 text-xs text-secondary">
|
||||
{{ t('admin.shippingOrderExtractionRuns.latencySummary', {
|
||||
p50: formatDuration(health.latency?.total?.p50_ms),
|
||||
p95: formatDuration(health.latency?.total?.p95_ms),
|
||||
max: formatDuration(health.latency?.total?.max_ms),
|
||||
}) }}
|
||||
<span v-if="health.stale_run_nos?.length" class="ml-2">
|
||||
{{ t('admin.shippingOrderExtractionRuns.staleRuns', { runs: health.stale_run_nos.slice(0, 5).join(', ') }) }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="md:col-span-4 text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.healthUnavailable') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-3 rounded-xl border border-default bg-surface p-3">
|
||||
<label class="flex items-center gap-2 text-sm text-secondary">
|
||||
{{ t('admin.shippingOrderExtractionRuns.status') }}
|
||||
<select v-model="status" class="select-field py-1.5" @change="applyStatus">
|
||||
<select v-model="status" class="select-field py-1.5" @change="applyFilters">
|
||||
<option value="">{{ t('admin.shippingOrderExtractionRuns.allStatuses') }}</option>
|
||||
<option v-for="value in ['queued', 'processing', 'completed', 'partially_completed', 'review_required', 'failed', 'cancelled']" :key="value" :value="value">
|
||||
{{ t(`admin.shippingOrderExtractionRuns.statuses.${value}`) }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 text-sm text-secondary">
|
||||
<input v-model="staleOnly" type="checkbox" class="rounded border-default" @change="applyFilters">
|
||||
{{ t('admin.shippingOrderExtractionRuns.staleOnly') }}
|
||||
</label>
|
||||
<label class="flex items-center gap-2 text-sm text-secondary">
|
||||
<input v-model="cancellationInFlight" type="checkbox" class="rounded border-default" @change="applyFilters">
|
||||
{{ t('admin.shippingOrderExtractionRuns.cancellationInFlight') }}
|
||||
</label>
|
||||
<span class="text-xs text-muted">{{ t('admin.shippingOrderExtractionRuns.total', { count: total }) }}</span>
|
||||
</div>
|
||||
|
||||
<p v-if="error" class="rounded-lg border border-rose-200 bg-rose-50 p-3 text-sm text-rose-700">{{ error }}</p>
|
||||
<div class="overflow-x-auto rounded-xl border border-default bg-surface">
|
||||
<table class="min-w-[940px] w-full text-left text-sm">
|
||||
<table class="min-w-[1040px] w-full text-left text-sm">
|
||||
<thead class="border-b border-default bg-surface-soft text-xs text-muted"><tr>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.runNo') }}</th><th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.status') }}</th><th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.stage') }}</th><th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.attempts') }}</th><th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.createdAt') }}</th><th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.totalDuration') }}</th><th class="px-4 py-3"></th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.runNo') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.status') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.stage') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.cancellation') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.attempts') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.createdAt') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.totalDuration') }}</th>
|
||||
<th class="px-4 py-3">{{ t('admin.shippingOrderExtractionRuns.actions') }}</th>
|
||||
</tr></thead>
|
||||
<tbody><tr v-if="loading"><td colspan="7" class="px-4 py-8 text-center text-muted">{{ t('admin.shippingOrderExtractionRuns.loading') }}</td></tr>
|
||||
<tr v-else-if="!rows.length"><td colspan="7" class="px-4 py-8 text-center text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</td></tr>
|
||||
<tr v-for="row in rows" :key="row.run_no" class="border-b border-default last:border-0"><td class="px-4 py-3 font-mono text-xs">{{ row.run_no }}</td><td class="px-4 py-3">{{ t(`admin.shippingOrderExtractionRuns.statuses.${row.status}`) }}</td><td class="px-4 py-3">{{ row.current_event_code || '-' }}</td><td class="px-4 py-3">{{ row.attempt_count }}</td><td class="px-4 py-3">{{ formatTime(row.created_at) }}</td><td class="px-4 py-3">{{ formatDuration(row.durations_ms.total) }}</td><td class="px-4 py-3"><button type="button" class="text-brand-600 hover:underline" @click="openDetail(row.run_no)">{{ t('admin.shippingOrderExtractionRuns.viewDetail') }}</button></td></tr>
|
||||
<tbody>
|
||||
<tr v-if="loading"><td colspan="9" class="px-4 py-8 text-center text-muted">{{ t('admin.shippingOrderExtractionRuns.loading') }}</td></tr>
|
||||
<tr v-else-if="!rows.length"><td colspan="9" class="px-4 py-8 text-center text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</td></tr>
|
||||
<tr v-for="row in rows" :key="row.run_no" class="border-b border-default last:border-0">
|
||||
<td class="px-4 py-3 font-mono text-xs">{{ row.run_no }}</td>
|
||||
<td class="px-4 py-3">{{ t(`admin.shippingOrderExtractionRuns.statuses.${row.status}`) }}</td>
|
||||
<td class="px-4 py-3">{{ row.current_event_code || '-' }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span v-if="row.cancellation?.in_flight" class="rounded-full bg-amber-100 px-2 py-0.5 text-xs text-amber-800">
|
||||
{{ t('admin.shippingOrderExtractionRuns.cancellationStates.in_flight') }}
|
||||
</span>
|
||||
<span v-else-if="row.cancellation?.completed" class="text-xs text-muted">
|
||||
{{ t('admin.shippingOrderExtractionRuns.cancellationStates.completed') }}
|
||||
</span>
|
||||
<span v-else class="text-xs text-muted">—</span>
|
||||
</td>
|
||||
<td class="px-4 py-3">{{ row.attempt_count }}</td>
|
||||
<td class="px-4 py-3">{{ formatTime(row.created_at) }}</td>
|
||||
<td class="px-4 py-3">{{ formatDuration(row.durations_ms.total ?? row.durations_ms.elapsed_active) }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex flex-col gap-2">
|
||||
<button type="button" class="text-left text-brand-600 hover:underline" @click="openDetail(row.run_no)">{{ t('admin.shippingOrderExtractionRuns.viewDetail') }}</button>
|
||||
<template v-if="canCancelRun(row)">
|
||||
<div
|
||||
v-if="pendingCancelRunNo === row.run_no"
|
||||
class="min-w-[220px] space-y-1.5 rounded-md border border-rose-200 bg-rose-50/60 p-2 dark:border-rose-900/40 dark:bg-rose-950/20"
|
||||
>
|
||||
<label class="block text-[11px] text-secondary">{{ t('chat.shippingOrderExtractionCancel.reasonRequired') }}</label>
|
||||
<textarea v-model="cancelReason" rows="2" class="input-field w-full py-1 text-xs" />
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs font-medium text-rose-700 hover:underline"
|
||||
:disabled="cancellingRunNo === row.run_no || !cancelReason.trim()"
|
||||
@click="submitCancelRun(row.run_no)"
|
||||
>
|
||||
{{ cancellingRunNo === row.run_no
|
||||
? t('chat.shippingOrderExtractionCancel.submitting')
|
||||
: t('admin.shippingOrderExtractionRuns.cancelRun') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-muted hover:underline"
|
||||
:disabled="cancellingRunNo === row.run_no"
|
||||
@click="pendingCancelRunNo = ''; cancelReason = ''"
|
||||
>
|
||||
{{ t('admin.cancel') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
class="text-left text-xs font-medium text-rose-700 hover:underline"
|
||||
:disabled="Boolean(cancellingRunNo)"
|
||||
@click="beginCancelRun(row.run_no)"
|
||||
>
|
||||
{{ t('admin.shippingOrderExtractionRuns.cancelRun') }}
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-3 text-sm"><button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page <= 1 || loading" @click="page -= 1; load()">{{ t('admin.shippingOrderExtractionRuns.previous') }}</button><span>{{ page }}</span><button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page * pageSize >= total || loading" @click="page += 1; load()">{{ t('admin.shippingOrderExtractionRuns.next') }}</button></div>
|
||||
<div class="flex items-center justify-end gap-3 text-sm">
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page <= 1 || loading" @click="page -= 1; load()">{{ t('admin.shippingOrderExtractionRuns.previous') }}</button>
|
||||
<span>{{ page }}</span>
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page * pageSize >= total || loading" @click="page += 1; load()">{{ t('admin.shippingOrderExtractionRuns.next') }}</button>
|
||||
</div>
|
||||
|
||||
<div v-if="detail || detailLoading" class="fixed inset-0 z-50 flex justify-end bg-overlay" @click.self="closeDetail">
|
||||
<aside class="h-full w-full max-w-2xl overflow-y-auto bg-surface p-6 shadow-2xl">
|
||||
<div class="flex items-center justify-between"><h2 class="text-lg font-bold">{{ t('admin.shippingOrderExtractionRuns.detailTitle') }}</h2><button type="button" class="text-secondary" @click="closeDetail">{{ t('admin.close') }}</button></div>
|
||||
<p v-if="detailLoading" class="mt-6 text-muted">{{ t('admin.shippingOrderExtractionRuns.loading') }}</p>
|
||||
<template v-else-if="detail"><dl class="mt-5 grid grid-cols-2 gap-3 text-sm"><dt>{{ t('admin.shippingOrderExtractionRuns.runNo') }}</dt><dd class="font-mono text-xs">{{ detail.run.run_no }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.currentEvent') }}</dt><dd class="font-mono text-xs">{{ detail.run.current_event_code || '-' }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.candidateMaterializedAt') }}</dt><dd>{{ formatTime(detail.run.candidate_materialized_at) }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.errorCode') }}</dt><dd>{{ detail.run.error_code || '-' }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.totalDuration') }}</dt><dd>{{ formatDuration(detail.run.durations_ms.total) }}</dd></dl>
|
||||
<template v-else-if="detail">
|
||||
<dl class="mt-5 grid grid-cols-2 gap-3 text-sm">
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.runNo') }}</dt><dd class="font-mono text-xs">{{ detail.run.run_no }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.currentEvent') }}</dt><dd class="font-mono text-xs">{{ detail.run.current_event_code || '-' }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.cancellation') }}</dt>
|
||||
<dd>
|
||||
<template v-if="detail.run.cancellation?.in_flight">{{ t('admin.shippingOrderExtractionRuns.cancellationStates.in_flight') }}</template>
|
||||
<template v-else-if="detail.run.cancellation?.completed">{{ t('admin.shippingOrderExtractionRuns.cancellationStates.completed') }}</template>
|
||||
<template v-else>—</template>
|
||||
</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.candidateMaterializedAt') }}</dt><dd>{{ formatTime(detail.run.candidate_materialized_at) }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.errorCode') }}</dt><dd>{{ detail.run.error_code || '-' }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.totalDuration') }}</dt><dd>{{ formatDuration(detail.run.durations_ms.total) }}</dd>
|
||||
</dl>
|
||||
<section class="mt-6 rounded-lg border border-default p-4 text-sm">
|
||||
<div class="font-semibold">{{ t('admin.shippingOrderExtractionRuns.autoFreezePolicy') }}</div>
|
||||
<dl class="mt-3 grid grid-cols-2 gap-x-3 gap-y-2">
|
||||
@@ -173,11 +377,47 @@ watch(
|
||||
<div v-else class="mt-2 text-xs text-muted">{{ t('admin.shippingOrderExtractionRuns.autoFreezeNoBlockingReasons') }}</div>
|
||||
</div>
|
||||
</section>
|
||||
<h3 class="mt-7 font-semibold">{{ t('admin.shippingOrderExtractionRuns.jobAttempts') }}</h3><div class="mt-2 space-y-2"><div v-for="job in detail.job_attempts" :key="job.job_id" class="rounded-lg border border-default p-3 text-sm"><b>#{{ job.job_id }}</b> · {{ job.status }} · {{ t('admin.shippingOrderExtractionRuns.attempts') }} {{ job.attempts }}/{{ job.max_attempts }} · {{ formatDuration(job.duration_ms) }}</div><p v-if="!detail.job_attempts.length" class="text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</p></div>
|
||||
<h3 class="mt-7 font-semibold">{{ t('admin.shippingOrderExtractionRuns.units') }}</h3><div class="mt-2 space-y-2"><div v-for="unit in detail.units" :key="unit.unit_id" class="rounded-lg border border-default p-3 text-sm"><b>#{{ unit.position + 1 }} {{ unit.unit_type }}</b> · {{ unit.status }} · {{ t('admin.shippingOrderExtractionRuns.attempts') }} {{ unit.attempt_count }} · {{ formatDuration(unit.duration_ms) }}<span v-if="unit.error_code" class="ml-2 font-mono text-xs text-danger">{{ unit.error_code }}</span>
|
||||
<section v-for="route in unit.route_decisions" :key="`${unit.unit_id}:${route.attempt_no}`" class="mt-3 rounded border border-default bg-surface-soft p-3 text-xs"><h4 class="font-semibold text-primary">{{ t('admin.shippingOrderExtractionRuns.routeDecision') }} #{{ route.attempt_no }}</h4><dl class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1"><dt>{{ t('admin.shippingOrderExtractionRuns.executionMode') }}</dt><dd>{{ t(`admin.shippingOrderExtractionRuns.executionModes.${route.execution_mode}`) }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.matchStatus') }}</dt><dd>{{ t(`admin.shippingOrderExtractionRuns.matchStatuses.${route.match_status}`) }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.selectedProfile') }}</dt><dd>{{ route.selected_profile_code ? `${route.selected_profile_code} V${route.selected_profile_version}` : '-' }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.autoCreateApproved') }}</dt><dd>{{ route.auto_create_approved == null ? '-' : t(route.auto_create_approved ? 'admin.shippingOrderExtractionRuns.yes' : 'admin.shippingOrderExtractionRuns.no') }}</dd><dt>{{ t('admin.shippingOrderExtractionRuns.fallbackReasons') }}</dt><dd>{{ route.fallback_reason_codes.length ? route.fallback_reason_codes.map(code => t(`admin.shippingOrderExtractionRuns.reasonCodes.${code}`)).join(';') : '-' }}</dd></dl><div v-if="route.candidates.length" class="mt-3"><p class="font-medium">{{ t('admin.shippingOrderExtractionRuns.candidates') }}</p><div v-for="candidate in route.candidates" :key="`${candidate.profile_code}:${candidate.version}`" class="mt-1 flex flex-wrap gap-x-2 text-muted"><span>{{ candidate.profile_code }} V{{ candidate.version }}</span><span>{{ candidate.score.toFixed(2) }}</span><span>{{ candidate.hard_match ? t('admin.shippingOrderExtractionRuns.hardMatch') : t('admin.shippingOrderExtractionRuns.hardMismatch') }}</span><span v-if="candidate.missing_required_anchor_ids?.length">{{ t('admin.shippingOrderExtractionRuns.missingAnchors', { ids: candidate.missing_required_anchor_ids.join(', ') }) }}</span></div></div></section>
|
||||
</div><p v-if="!detail.units.length" class="text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</p></div>
|
||||
<h3 class="mt-7 font-semibold">{{ t('admin.shippingOrderExtractionRuns.lifecycle') }}</h3><div class="mt-2 space-y-2"><div v-for="event in detail.progress_events" :key="`${event.sequence_no}:${event.event_code}`" class="rounded-lg border border-default p-3 text-sm"><b>{{ event.event_code }}</b><span class="ml-2 text-secondary">{{ event.status || '-' }}</span><span class="ml-2 font-mono text-xs text-muted">{{ t(`admin.shippingOrderExtractionRuns.visibilities.${event.visibility}`) }}</span><span v-if="event.reason_code" class="ml-2 font-mono text-xs text-muted">{{ event.reason_code }}</span><time class="ml-2 text-xs text-muted">{{ formatTime(event.occurred_at) }}</time></div><p v-if="!detail.progress_events.length" class="text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</p></div>
|
||||
<h3 class="mt-7 font-semibold">{{ t('admin.shippingOrderExtractionRuns.jobAttempts') }}</h3>
|
||||
<div class="mt-2 space-y-2">
|
||||
<div v-for="job in detail.job_attempts" :key="job.job_id" class="rounded-lg border border-default p-3 text-sm">
|
||||
<b>#{{ job.job_id }}</b> · {{ job.status }} · {{ t('admin.shippingOrderExtractionRuns.attempts') }} {{ job.attempts }}/{{ job.max_attempts }} · {{ formatDuration(job.duration_ms) }}
|
||||
</div>
|
||||
<p v-if="!detail.job_attempts.length" class="text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</p>
|
||||
</div>
|
||||
<h3 class="mt-7 font-semibold">{{ t('admin.shippingOrderExtractionRuns.units') }}</h3>
|
||||
<div class="mt-2 space-y-2">
|
||||
<div v-for="unit in detail.units" :key="unit.unit_id" class="rounded-lg border border-default p-3 text-sm">
|
||||
<b>#{{ unit.position + 1 }} {{ unit.unit_type }}</b> · {{ unit.status }} · {{ t('admin.shippingOrderExtractionRuns.attempts') }} {{ unit.attempt_count }} · {{ formatDuration(unit.duration_ms) }}
|
||||
<span v-if="unit.error_code" class="ml-2 font-mono text-xs text-danger">{{ unit.error_code }}</span>
|
||||
<section v-for="routeItem in unit.route_decisions" :key="`${unit.unit_id}:${routeItem.attempt_no}`" class="mt-3 rounded border border-default bg-surface-soft p-3 text-xs">
|
||||
<h4 class="font-semibold text-primary">{{ t('admin.shippingOrderExtractionRuns.routeDecision') }} #{{ routeItem.attempt_no }}</h4>
|
||||
<dl class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1">
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.executionMode') }}</dt>
|
||||
<dd>{{ t(`admin.shippingOrderExtractionRuns.executionModes.${routeItem.execution_mode}`) }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.matchStatus') }}</dt>
|
||||
<dd>{{ t(`admin.shippingOrderExtractionRuns.matchStatuses.${routeItem.match_status}`) }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.selectedProfile') }}</dt>
|
||||
<dd>{{ routeItem.selected_profile_code ? `${routeItem.selected_profile_code} V${routeItem.selected_profile_version}` : '-' }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.autoCreateApproved') }}</dt>
|
||||
<dd>{{ routeItem.auto_create_approved == null ? '-' : t(routeItem.auto_create_approved ? 'admin.shippingOrderExtractionRuns.yes' : 'admin.shippingOrderExtractionRuns.no') }}</dd>
|
||||
<dt>{{ t('admin.shippingOrderExtractionRuns.fallbackReasons') }}</dt>
|
||||
<dd>{{ routeItem.fallback_reason_codes.length ? routeItem.fallback_reason_codes.map(code => t(`admin.shippingOrderExtractionRuns.reasonCodes.${code}`)).join(';') : '-' }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
<p v-if="!detail.units.length" class="text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</p>
|
||||
</div>
|
||||
<h3 class="mt-7 font-semibold">{{ t('admin.shippingOrderExtractionRuns.lifecycle') }}</h3>
|
||||
<div class="mt-2 space-y-2">
|
||||
<div v-for="event in detail.progress_events" :key="`${event.sequence_no}:${event.event_code}`" class="rounded-lg border border-default p-3 text-sm">
|
||||
<b>{{ event.event_code }}</b>
|
||||
<span class="ml-2 text-secondary">{{ event.status || '-' }}</span>
|
||||
<span class="ml-2 font-mono text-xs text-muted">{{ t(`admin.shippingOrderExtractionRuns.visibilities.${event.visibility}`) }}</span>
|
||||
<span v-if="event.reason_code" class="ml-2 font-mono text-xs text-muted">{{ event.reason_code }}</span>
|
||||
<time class="ml-2 text-xs text-muted">{{ formatTime(event.occurred_at) }}</time>
|
||||
</div>
|
||||
<p v-if="!detail.progress_events.length" class="text-sm text-muted">{{ t('admin.shippingOrderExtractionRuns.empty') }}</p>
|
||||
</div>
|
||||
</template>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
+339
@@ -0,0 +1,339 @@
|
||||
<!--
|
||||
features/admin/modules/shipping-review-supervision/ShippingReviewSupervisionPage.vue
|
||||
用途:管理员跨用户会话 PDF 工作项监管台——筛选、终止、撤销确认。
|
||||
依赖:shipping-review-supervision.api、Vue I18n、useMessage。
|
||||
逻辑:终止/撤销须填写理由与 confirm_token;成功后刷新列表。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { ShippingSessionWorkItem } from '@/features/chat/types/shipping.api.types';
|
||||
import {
|
||||
SUPERVISION_CONFIRM_REVOKE,
|
||||
SUPERVISION_CONFIRM_TERMINATE,
|
||||
listShippingReviewSupervisionItems,
|
||||
revokeShippingReviewSupervisionConfirmation,
|
||||
terminateShippingReviewSupervisionItem,
|
||||
type ShippingReviewSupervisionFilters,
|
||||
} from '@/features/admin/api/shipping-review-supervision.api';
|
||||
|
||||
type SupervisionAction = 'terminate' | 'revoke';
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const msg = useMessage();
|
||||
const loading = ref(false);
|
||||
const submitting = ref(false);
|
||||
const error = ref('');
|
||||
const page = ref(1);
|
||||
const pageSize = 20;
|
||||
const total = ref(0);
|
||||
const rows = ref<ShippingSessionWorkItem[]>([]);
|
||||
const filters = ref<ShippingReviewSupervisionFilters>({
|
||||
lifecycle_status: '',
|
||||
owner_user_id: '',
|
||||
conversation_id: '',
|
||||
q: '',
|
||||
});
|
||||
const actionDialogOpen = ref(false);
|
||||
const actionKind = ref<SupervisionAction>('terminate');
|
||||
const actionTarget = ref<ShippingSessionWorkItem | null>(null);
|
||||
const actionReason = ref('');
|
||||
const actionConfirmChecked = ref(false);
|
||||
const reasonMissing = ref(false);
|
||||
const confirmMissing = ref(false);
|
||||
|
||||
const formatTime = (value?: string | null) => (value ? new Date(value).toLocaleString() : '—');
|
||||
|
||||
/**
|
||||
* 解析生命周期状态文案。
|
||||
*/
|
||||
function lifecycleLabel(status: string): string {
|
||||
const key = `chat.shippingSessionWorkItem.status.${status}`;
|
||||
return te(key) ? t(key) : status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载监管列表。
|
||||
*/
|
||||
async function load() {
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
const response = await listShippingReviewSupervisionItems(page.value, pageSize, filters.value);
|
||||
rows.value = response.items;
|
||||
total.value = response.total;
|
||||
} catch {
|
||||
error.value = t('admin.shippingReviewSupervision.loadFailed');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function applyFilters() {
|
||||
page.value = 1;
|
||||
await load();
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开终止或撤销确认弹窗。
|
||||
*/
|
||||
function openAction(kind: SupervisionAction, item: ShippingSessionWorkItem) {
|
||||
actionKind.value = kind;
|
||||
actionTarget.value = item;
|
||||
actionReason.value = '';
|
||||
actionConfirmChecked.value = false;
|
||||
reasonMissing.value = false;
|
||||
confirmMissing.value = false;
|
||||
actionDialogOpen.value = true;
|
||||
}
|
||||
|
||||
function closeActionDialog() {
|
||||
actionDialogOpen.value = false;
|
||||
actionTarget.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交监管写操作;校验理由与 confirm_token。
|
||||
*/
|
||||
async function submitAction() {
|
||||
const item = actionTarget.value;
|
||||
if (!item?.item_no) return;
|
||||
const reason = actionReason.value.trim();
|
||||
if (!reason) {
|
||||
reasonMissing.value = true;
|
||||
return;
|
||||
}
|
||||
if (!actionConfirmChecked.value) {
|
||||
confirmMissing.value = true;
|
||||
return;
|
||||
}
|
||||
submitting.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
if (actionKind.value === 'terminate') {
|
||||
await terminateShippingReviewSupervisionItem(item.item_no, {
|
||||
reason,
|
||||
confirm_token: SUPERVISION_CONFIRM_TERMINATE,
|
||||
});
|
||||
msg.success(t('admin.shippingReviewSupervision.terminateSuccess'));
|
||||
} else {
|
||||
await revokeShippingReviewSupervisionConfirmation(item.item_no, {
|
||||
reason,
|
||||
confirm_token: SUPERVISION_CONFIRM_REVOKE,
|
||||
});
|
||||
msg.success(t('admin.shippingReviewSupervision.revokeSuccess'));
|
||||
}
|
||||
closeActionDialog();
|
||||
await load();
|
||||
} catch (err) {
|
||||
const message = err instanceof BusinessError ? err.message : t('admin.shippingReviewSupervision.actionFailed');
|
||||
msg.error(message);
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const canTerminate = (item: ShippingSessionWorkItem) =>
|
||||
item.lifecycle_status !== 'closed' && (item.available_actions || []).includes('admin_terminate');
|
||||
|
||||
const canRevoke = (item: ShippingSessionWorkItem) =>
|
||||
item.lifecycle_status === 'closed'
|
||||
&& item.closed_reason === 'confirmed'
|
||||
&& (item.available_actions || []).includes('admin_revoke_confirmation');
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="space-y-5 p-5 md:p-7" data-testid="shipping-review-supervision-page">
|
||||
<header class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<h1 class="section-title">{{ t('admin.shippingReviewSupervision.title') }}</h1>
|
||||
<p class="section-desc mt-1 max-w-3xl">{{ t('admin.shippingReviewSupervision.subtitle') }}</p>
|
||||
</div>
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="loading" @click="load">
|
||||
{{ t('admin.shippingReviewSupervision.refresh') }}
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="grid gap-3 rounded-xl border border-default bg-surface p-3 md:grid-cols-2 lg:grid-cols-4">
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingReviewSupervision.filters.lifecycleStatus') }}</span>
|
||||
<select v-model="filters.lifecycle_status" class="input-field text-sm">
|
||||
<option value="">{{ t('admin.shippingReviewSupervision.filters.all') }}</option>
|
||||
<option value="pending_review">{{ lifecycleLabel('pending_review') }}</option>
|
||||
<option value="extracting">{{ lifecycleLabel('extracting') }}</option>
|
||||
<option value="reparse_failed">{{ lifecycleLabel('reparse_failed') }}</option>
|
||||
<option value="closed">{{ lifecycleLabel('closed') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingReviewSupervision.filters.ownerUserId') }}</span>
|
||||
<input v-model="filters.owner_user_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingReviewSupervision.filters.conversationId') }}</span>
|
||||
<input v-model="filters.conversation_id" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
<label class="space-y-1 text-xs text-secondary">
|
||||
<span>{{ t('admin.shippingReviewSupervision.filters.q') }}</span>
|
||||
<input v-model="filters.q" class="input-field text-sm" @keyup.enter="applyFilters">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2">
|
||||
<button type="button" class="btn-primary btn-sm" :disabled="loading" @click="applyFilters">
|
||||
{{ t('admin.shippingReviewSupervision.apply') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p v-if="error" class="text-sm text-rose-600 dark:text-rose-400">{{ error }}</p>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl border border-default bg-surface">
|
||||
<table class="min-w-full text-left text-sm">
|
||||
<thead class="border-b border-default bg-muted/40 text-xs text-secondary">
|
||||
<tr>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.itemNo') }}</th>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.owner') }}</th>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.conversation') }}</th>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.document') }}</th>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.status') }}</th>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.updated') }}</th>
|
||||
<th class="px-3 py-2 font-medium">{{ t('admin.shippingReviewSupervision.columns.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="loading">
|
||||
<td colspan="7" class="px-3 py-6 text-center text-secondary">{{ t('admin.shippingReviewSupervision.loading') }}</td>
|
||||
</tr>
|
||||
<tr v-else-if="!rows.length">
|
||||
<td colspan="7" class="px-3 py-6 text-center text-secondary">{{ t('admin.shippingReviewSupervision.empty') }}</td>
|
||||
</tr>
|
||||
<tr v-for="item in rows" :key="item.item_no" class="border-b border-default last:border-0">
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ item.item_no }}</td>
|
||||
<td class="px-3 py-2">{{ item.owner_user_id }}</td>
|
||||
<td class="max-w-40 truncate px-3 py-2 font-mono text-xs" :title="item.conversation_id">{{ item.conversation_id }}</td>
|
||||
<td class="max-w-48 truncate px-3 py-2" :title="item.current_document_filename || ''">
|
||||
{{ item.current_document_filename || '—' }}
|
||||
</td>
|
||||
<td class="px-3 py-2">
|
||||
<span class="rounded-full bg-muted px-2 py-0.5 text-xs">{{ lifecycleLabel(String(item.lifecycle_status)) }}</span>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-xs text-secondary">{{ formatTime(item.updated_at) }}</td>
|
||||
<td class="px-3 py-2">
|
||||
<div class="flex flex-wrap gap-1">
|
||||
<button
|
||||
v-if="canTerminate(item)"
|
||||
type="button"
|
||||
class="btn-danger btn-xs"
|
||||
data-testid="supervision-terminate-btn"
|
||||
@click="openAction('terminate', item)"
|
||||
>
|
||||
{{ t('admin.shippingReviewSupervision.terminate') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="canRevoke(item)"
|
||||
type="button"
|
||||
class="btn-secondary btn-xs"
|
||||
data-testid="supervision-revoke-btn"
|
||||
@click="openAction('revoke', item)"
|
||||
>
|
||||
{{ t('admin.shippingReviewSupervision.revoke') }}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<footer class="flex items-center justify-between text-sm text-secondary">
|
||||
<span>{{ t('admin.shippingReviewSupervision.total', { count: total }) }}</span>
|
||||
<div class="flex gap-2">
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="loading || page <= 1" @click="page -= 1; load()">
|
||||
{{ t('admin.shippingReviewSupervision.previous') }}
|
||||
</button>
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="loading || page * pageSize >= total" @click="page += 1; load()">
|
||||
{{ t('admin.shippingReviewSupervision.next') }}
|
||||
</button>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="actionDialogOpen && actionTarget"
|
||||
class="dialog-overlay z-50 flex items-center justify-center p-4"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
data-testid="supervision-action-dialog"
|
||||
@click.self="closeActionDialog"
|
||||
>
|
||||
<div class="dialog-panel w-full max-w-md space-y-4 p-5">
|
||||
<header>
|
||||
<h2 class="text-base font-semibold text-primary">
|
||||
{{ actionKind === 'terminate'
|
||||
? t('admin.shippingReviewSupervision.terminateTitle')
|
||||
: t('admin.shippingReviewSupervision.revokeTitle') }}
|
||||
</h2>
|
||||
<p class="mt-2 text-sm text-secondary">
|
||||
{{ actionKind === 'terminate'
|
||||
? t('admin.shippingReviewSupervision.terminateImpact', { itemNo: actionTarget.item_no })
|
||||
: t('admin.shippingReviewSupervision.revokeImpact', { itemNo: actionTarget.item_no }) }}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<label class="block space-y-1 text-sm">
|
||||
<span class="text-secondary">{{ t('admin.shippingReviewSupervision.reasonLabel') }}</span>
|
||||
<textarea
|
||||
v-model="actionReason"
|
||||
rows="3"
|
||||
class="input-field w-full resize-y text-sm"
|
||||
data-testid="supervision-reason-input"
|
||||
@input="reasonMissing = false"
|
||||
/>
|
||||
<p v-if="reasonMissing" class="text-xs text-rose-600 dark:text-rose-400">
|
||||
{{ t('admin.shippingReviewSupervision.reasonRequired') }}
|
||||
</p>
|
||||
</label>
|
||||
|
||||
<label class="flex items-start gap-2 text-sm">
|
||||
<input
|
||||
v-model="actionConfirmChecked"
|
||||
type="checkbox"
|
||||
class="mt-0.5"
|
||||
data-testid="supervision-confirm-checkbox"
|
||||
@change="confirmMissing = false"
|
||||
>
|
||||
<span class="text-secondary">
|
||||
{{ actionKind === 'terminate'
|
||||
? t('admin.shippingReviewSupervision.confirmTerminate')
|
||||
: t('admin.shippingReviewSupervision.confirmRevoke') }}
|
||||
</span>
|
||||
</label>
|
||||
<p v-if="confirmMissing" class="text-xs text-rose-600 dark:text-rose-400">
|
||||
{{ t('admin.shippingReviewSupervision.confirmRequired') }}
|
||||
</p>
|
||||
|
||||
<footer class="flex justify-end gap-2">
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="submitting" @click="closeActionDialog">
|
||||
{{ t('common.deleteDialog.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
:class="actionKind === 'terminate' ? 'btn-danger btn-sm' : 'btn-primary btn-sm'"
|
||||
:disabled="submitting"
|
||||
data-testid="supervision-action-submit"
|
||||
@click="submitAction"
|
||||
>
|
||||
{{ submitting ? t('admin.shippingReviewSupervision.submitting') : t('admin.shippingReviewSupervision.submit') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</section>
|
||||
</template>
|
||||
@@ -16,6 +16,8 @@ const shippingRoutes = adminRoutes[0].children?.filter((route) =>
|
||||
|| route.name === 'AdminShippingOrderSchema'
|
||||
|| route.name === 'AdminShippingIdentityRules'
|
||||
|| route.name === 'AdminShippingOrderExtractionRuns'
|
||||
|| route.name === 'AdminShippingAudit'
|
||||
|| route.name === 'AdminShippingReviewSupervision'
|
||||
|| route.name === 'AdminShippingOrderDocumentProfiles',
|
||||
) ?? [];
|
||||
|
||||
@@ -44,10 +46,12 @@ describe('shipping configuration navigation contract', () => {
|
||||
{ id: 'warehouse_mappings', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.externalMappings', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'mappings' } },
|
||||
{ id: 'routing_rules', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.rules', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'rules' } },
|
||||
{ id: 'shipping_templates', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.excelTemplates', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'templates' } },
|
||||
{ id: 'shipping_audit', routeName: 'AdminShippingAudit', path: 'shipping-audit', labelKey: 'admin.nav.shippingAudit', groupKey: 'admin.nav.shippingRunAudit' },
|
||||
{ id: 'shipping_review_supervision', routeName: 'AdminShippingReviewSupervision', path: 'shipping-review-supervision', labelKey: 'admin.nav.shippingReviewSupervision', groupKey: 'admin.nav.shippingRunAudit' },
|
||||
{ id: 'inventory_snapshots', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.snapshots', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'snapshots' } },
|
||||
{ id: 'export_records', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.exports', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'exports' } },
|
||||
]);
|
||||
expect(shippingRoutes).toHaveLength(6);
|
||||
expect(shippingRoutes).toHaveLength(8);
|
||||
});
|
||||
|
||||
it('keeps exactly three ordered accordion groups', () => {
|
||||
@@ -68,6 +72,8 @@ describe('shipping configuration navigation contract', () => {
|
||||
expect.objectContaining({ requiresAdmin: true, adminModule: 'shipping_inventory', adminSubModule: 'order_schema' }),
|
||||
expect.objectContaining({ requiresAdmin: true, adminModule: 'shipping_inventory', adminSubModule: 'identity_rules' }),
|
||||
expect.objectContaining({ requiresAdmin: true, adminModule: 'shipping_inventory', adminSubModule: 'order_extraction_runs' }),
|
||||
expect.objectContaining({ requiresAdmin: true, adminModule: 'shipping_inventory', adminSubModule: 'shipping_audit' }),
|
||||
expect.objectContaining({ requiresAdmin: true, adminModule: 'shipping_inventory', adminSubModule: 'shipping_review_supervision' }),
|
||||
expect.objectContaining({ requiresAdmin: true, adminModule: 'shipping_inventory', adminSubModule: 'order_document_profiles' }),
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -27,6 +27,8 @@ export type ShippingConfigSubModuleId =
|
||||
| 'order_document_profiles'
|
||||
| 'identity_rules'
|
||||
| 'order_extraction_runs'
|
||||
| 'shipping_audit'
|
||||
| 'shipping_review_supervision'
|
||||
| 'inventory_fields'
|
||||
| 'connections'
|
||||
| 'inventory_sites'
|
||||
|
||||
@@ -26,6 +26,7 @@ export type OrderProfileGovernanceErrorCode =
|
||||
|
||||
export interface OrderProfileRelativeRegion { x0: number; y0: number; x1: number; y1: number; }
|
||||
export interface OrderProfileAnchorRelativeRegion { x0: number; y0: number; x1: number; y1: number; }
|
||||
export interface OrderProfileDocumentMatchAnchor { anchor_id: string; label: string; value: string; value_position: 'right' | 'below'; page_no?: number | null; label_region?: OrderProfileRelativeRegion | null; value_region?: OrderProfileRelativeRegion | null; minimum_evidence_level: OrderProfileEvidenceLevel; }
|
||||
export interface OrderProfileAnchorRule { anchor_id: string; text: string; aliases?: string[]; match_mode: 'exact' | 'contains'; region?: OrderProfileRelativeRegion | null; minimum_evidence_level: OrderProfileEvidenceLevel; }
|
||||
export interface OrderProfileFieldRegion { field_id: string; field_code: string; region: OrderProfileRelativeRegion; extractor_key: OrderProfileExtractorKey; allowed_sources: OrderProfileAllowedSource[]; minimum_evidence_level: OrderProfileEvidenceLevel; target_fields?: Array<{ field_id: string; field_code: string }>; }
|
||||
export interface OrderProfileOrderFieldLayout { layout_id: string; field_id: string; field_code: string; page_scope: 'first_page' | 'all_pages' | 'exact_page'; page_no?: number | null; anchor?: OrderProfileAnchorRule | null; value_region?: OrderProfileAnchorRelativeRegion | null; absolute_value_region?: OrderProfileRelativeRegion | null; fallback_value_region?: OrderProfileRelativeRegion | null; value_mode: 'single_line' | 'multi_line' | 'right_of_anchor' | 'below_anchor'; stop_anchors: OrderProfileAnchorRule[]; normalizer_key?: string | null; required: boolean; minimum_evidence_level: OrderProfileEvidenceLevel; }
|
||||
@@ -33,7 +34,7 @@ export interface OrderProfileDraftUnboundOrderFieldLayout { layout_id: string; l
|
||||
export interface OrderProfileHeaderLayout { layout_id: string; region: OrderProfileRelativeRegion; field_regions: OrderProfileFieldRegion[]; }
|
||||
export interface OrderProfileLineLayout { layout_id: string; row_offset: number; role: 'main' | 'continuation'; region: OrderProfileRelativeRegion; field_regions: OrderProfileFieldRegion[]; new_line_anchor?: OrderProfileAnchorRule | null; continuation_conditions: OrderProfileAnchorRule[]; required_fields: string[]; allowed_empty_fields: string[]; }
|
||||
export interface OrderProfileTableRegion { region_id: string; page_scope: 'first_page' | 'all_pages' | 'continuation_pages' | 'exact_page'; page_no?: number | null; region: OrderProfileRelativeRegion; header_layouts: OrderProfileHeaderLayout[]; line_layouts: OrderProfileLineLayout[]; continuation_rule: { allow_cross_page: boolean; required_anchor_ids: string[] }; termination_rules: Array<{ rule_id: string; anchor: OrderProfileAnchorRule }>; exclusion_regions: OrderProfileRelativeRegion[]; draft_unbound_field_regions?: Array<{ region_id: string; parent_layout_id: string; label: string; region: OrderProfileRelativeRegion }>; }
|
||||
export interface OrderProfileDocumentMatch { document_type: 'purchase_order'; page_pattern: 'one_or_more'; required_anchors: OrderProfileAnchorRule[]; optional_anchors: OrderProfileAnchorRule[]; minimum_score: number; minimum_margin: number; }
|
||||
export interface OrderProfileDocumentMatch { document_type: 'purchase_order'; page_pattern: 'one_or_more'; required_anchors: OrderProfileDocumentMatchAnchor[]; optional_anchors: OrderProfileDocumentMatchAnchor[]; minimum_score: number; minimum_margin: number; }
|
||||
|
||||
/** 阶段 3 重构前仅用于让旧工作台编译;不能作为 v2 API 请求或持久化定义。 */
|
||||
export interface OrderProfileColumnRule { column_index: number; extractor_key: 'direct' | 'temp_internal_parts'; target_field_codes: string[]; target_fields?: Array<{ field_id: string; field_code: string }>; }
|
||||
@@ -390,7 +391,16 @@ export interface OrderProfileBlindTestInput {
|
||||
expected_order_fields?: Record<string, unknown>;
|
||||
}
|
||||
/** 盲测工作台的独立候选样本;已排除当前模板的标注和训练证据。 */
|
||||
export interface OrderProfileBlindTestAvailableSample { document_id: number; table_id: string; page_no: number; filename: string; }
|
||||
export interface OrderProfileBlindTestAvailableSample {
|
||||
document_id: number;
|
||||
table_id: string;
|
||||
page_no: number;
|
||||
filename: string;
|
||||
table_index: number;
|
||||
row_count: number;
|
||||
column_count: number;
|
||||
header_preview: string[];
|
||||
}
|
||||
export interface OrderProfileBlindTestCandidate {
|
||||
document_id: number; table_id: string; rows: Array<Record<string, unknown>>;
|
||||
order_fields: Array<{ field_code: string; value: unknown; status: 'confirmed' | 'needs_review' | 'unavailable'; page_no: number | null; issues: string[] }>;
|
||||
@@ -399,7 +409,7 @@ export interface OrderProfileBlindTestCandidate {
|
||||
/** 工作台的本地几何状态;保存前转为 v2 相对区域定义。 */
|
||||
export interface OrderProfileCanvasRegion {
|
||||
id: string;
|
||||
kind: 'header' | 'header_field' | 'line' | 'field' | 'order_anchor' | 'order_field' | 'exclusion';
|
||||
kind: 'header' | 'header_field' | 'line' | 'field' | 'order_anchor' | 'order_field' | 'exclusion' | 'document_anchor_label' | 'document_anchor_value';
|
||||
label: string;
|
||||
region: OrderProfileRelativeRegion;
|
||||
fieldCode?: string | null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/chat/api/shipping.api.ts
|
||||
* 用途:封装发货通知相关 HTTP API,包括任务/批次查询、人工决策与 Excel 导出。
|
||||
* 用途:封装发货通知相关 HTTP API,包括任务/批次查询、人工决策、订单抽取取消/时间线与 Excel 导出。
|
||||
* 依赖:统一 requestJson / BusinessError、shipping.api.types 类型定义。
|
||||
* 逻辑:上游由 useChatShipping、shipping-task-center 与 shipping/* handler 调用;
|
||||
* 「我的待办」列表/徽标见 features/workspace/api/shipping-tasks.api.ts。
|
||||
@@ -25,6 +25,7 @@ import type {
|
||||
ShippingTaskPage,
|
||||
ShippingTaskSummary,
|
||||
ShippingCustomerOption,
|
||||
ShippingOrderExtractionDocumentResult,
|
||||
ShippingOrderExtractionRun,
|
||||
ShippingOrderExtractionProgressEvent,
|
||||
ShippingOrderExtractionRunCreateResponse,
|
||||
@@ -33,6 +34,9 @@ import type {
|
||||
ShippingOrderReviewEvidence,
|
||||
ShippingOrderReviewReparseResponse,
|
||||
ShippingOrderReviewRun,
|
||||
ShippingSessionWorkItem,
|
||||
ShippingSessionWorkItemSummary,
|
||||
ShippingSessionWorkItemVersion,
|
||||
ShippingTaskUiState,
|
||||
} from '../types/shipping.api.types';
|
||||
|
||||
@@ -191,6 +195,34 @@ export const retryWorkspaceShippingOrderExtractionRun = (runNo: string) =>
|
||||
jsonPost(),
|
||||
);
|
||||
|
||||
/** 请求取消整批订单抽取;排队项立即取消,执行中项进入正在取消。 */
|
||||
export const cancelWorkspaceShippingOrderExtractionRun = (
|
||||
runNo: string,
|
||||
payload?: { reason?: string | null; reason_code?: string | null; operation_id?: string | null },
|
||||
) => requestJson<{ run: ShippingOrderExtractionRun }>(
|
||||
`/api/workspace/shipping-notice/order-extraction-runs/${encodeURIComponent(runNo)}/cancel`,
|
||||
jsonPost(payload || {}),
|
||||
);
|
||||
|
||||
/** 请求取消单个 PDF Unit。 */
|
||||
export const cancelWorkspaceShippingOrderExtractionDocument = (
|
||||
runNo: string,
|
||||
documentId: number,
|
||||
payload?: { reason?: string | null; reason_code?: string | null; operation_id?: string | null },
|
||||
) => requestJson<{
|
||||
run: ShippingOrderExtractionRun | null;
|
||||
document: ShippingOrderExtractionDocumentResult | null;
|
||||
}>(
|
||||
`/api/workspace/shipping-notice/order-extraction-runs/${encodeURIComponent(runNo)}/documents/${encodeURIComponent(String(documentId))}/cancel`,
|
||||
jsonPost(payload || {}),
|
||||
);
|
||||
|
||||
/** 获取用户可见 Run 时间线(含取消与重试事件)。 */
|
||||
export const listWorkspaceShippingOrderExtractionTimeline = (runNo: string) =>
|
||||
requestJson<{ items: ShippingOrderExtractionProgressEvent[] }>(
|
||||
`/api/workspace/shipping-notice/order-extraction-runs/${encodeURIComponent(runNo)}/timeline`,
|
||||
);
|
||||
|
||||
/** 使用当前发布的 Schema、绑定和布局快照创建原始文件的新版订单识别 Run。 */
|
||||
export const reparseWorkspaceShippingOrderExtractionRun = (
|
||||
runNo: string,
|
||||
@@ -340,19 +372,72 @@ export const markWorkspaceShippingOrderExtractionRunSeen = (runNo: string) =>
|
||||
jsonPost(),
|
||||
);
|
||||
|
||||
/** 拉取会话级 PDF 工作项工作台;右侧「本次处理」唯一列表事实源。 */
|
||||
export const listWorkspaceShippingSessionWorkItems = (
|
||||
conversationId: string,
|
||||
options?: { open_only?: boolean; signal?: AbortSignal },
|
||||
) => {
|
||||
const params = new URLSearchParams({ conversation_id: conversationId });
|
||||
if (options?.open_only) params.set('open_only', 'true');
|
||||
return requestJson<ShippingSessionWorkItemSummary>(
|
||||
`/api/workspace/shipping-notice/session-work-items?${params.toString()}`,
|
||||
{ signal: options?.signal },
|
||||
);
|
||||
};
|
||||
|
||||
/** 读取单条工作项的版本历史时间线。 */
|
||||
export const listWorkspaceShippingSessionWorkItemVersions = (itemNo: string) =>
|
||||
requestJson<{ item_no: string; versions: ShippingSessionWorkItemVersion[] }>(
|
||||
`/api/workspace/shipping-notice/session-work-items/${encodeURIComponent(itemNo)}/versions`,
|
||||
);
|
||||
|
||||
/** 关闭(取消)会话 PDF 工作项;需携带 reason 与可选乐观锁版本。 */
|
||||
export const closeWorkspaceShippingSessionWorkItem = (
|
||||
itemNo: string,
|
||||
payload: { reason: string; expected_lock_version?: number | null },
|
||||
) => requestJson<{ item: ShippingSessionWorkItem }>(
|
||||
`/api/workspace/shipping-notice/session-work-items/${encodeURIComponent(itemNo)}/close`,
|
||||
jsonPost(payload),
|
||||
);
|
||||
|
||||
/** 按会话恢复订单抽取 Run,刷新页面后不依赖聊天 SSE 历史。 */
|
||||
export const listWorkspaceShippingOrderExtractionRuns = (
|
||||
conversationId: string,
|
||||
conversationId?: string | null,
|
||||
limit = 50,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
const params = new URLSearchParams({ conversation_id: conversationId, limit: String(limit) });
|
||||
const params = new URLSearchParams({ limit: String(limit) });
|
||||
if (conversationId) params.set('conversation_id', conversationId);
|
||||
return requestJson<{ items: ShippingOrderExtractionRun[] }>(
|
||||
`/api/workspace/shipping-notice/order-extraction-runs?${params.toString()}`,
|
||||
{ signal },
|
||||
);
|
||||
};
|
||||
|
||||
/** 任务中心续办:分页列出当前用户订单抽取 Run(可按状态过滤)。 */
|
||||
export const listWorkspaceShippingOrderExtractionRunsPage = (params?: {
|
||||
status?: string;
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
conversation_id?: string;
|
||||
signal?: AbortSignal;
|
||||
}) => {
|
||||
const sp = new URLSearchParams();
|
||||
if (params?.status) sp.set('status', params.status);
|
||||
if (params?.page) sp.set('page', String(params.page));
|
||||
if (params?.page_size) sp.set('page_size', String(params.page_size));
|
||||
if (params?.conversation_id) sp.set('conversation_id', params.conversation_id);
|
||||
return requestJson<{
|
||||
items: ShippingOrderExtractionRun[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}>(
|
||||
`/api/workspace/shipping-notice/order-extraction-runs?${sp.toString()}`,
|
||||
{ signal: params?.signal },
|
||||
);
|
||||
};
|
||||
|
||||
/** 批量归档任务,适用于外部上传中或已上传而禁止平台单方作废的任务。 */
|
||||
export const archiveWorkspaceShippingTasks = (taskNos: string[]) =>
|
||||
requestJson<ShippingTaskBatchDispositionResponse>(
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingSessionSummaryPanel、chat.context。
|
||||
|
||||
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;右侧摘要只读展示后端 ui_state/summary。
|
||||
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;
|
||||
* 右侧「本次处理」由 conversationId 驱动 session-work-items,extractionRunNo 仅作进度装饰。
|
||||
|
||||
*/
|
||||
|
||||
@@ -139,19 +140,13 @@ const activeExtractionRunNo = computed(() => {
|
||||
|
||||
|
||||
const showShippingSessionSummary = computed(() => (
|
||||
|
||||
page.isShippingNoticeAgent
|
||||
|
||||
&& Boolean(
|
||||
|
||||
page.shippingBatchSummary
|
||||
|
||||
page.conversationId
|
||||
|| page.shippingBatchSummary
|
||||
|| page.shippingConversationWorkspace?.batches?.length
|
||||
|
||||
|| activeExtractionRunNo.value
|
||||
|
||||
)
|
||||
|
||||
));
|
||||
|
||||
const embeddedIframeSrc = computed(() => {
|
||||
@@ -664,6 +659,8 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
v-if="showShippingSessionSummary"
|
||||
|
||||
:conversation-id="page.conversationId"
|
||||
|
||||
:conversation-workspace="page.shippingConversationWorkspace"
|
||||
|
||||
:active-batch-no="page.activeShippingBatchNo"
|
||||
@@ -676,6 +673,8 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
:extraction-run-no="activeExtractionRunNo"
|
||||
|
||||
:refresh-trigger="page.sessionWorkItemsRefreshTrigger"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
/**
|
||||
* features/chat/components/ShippingSessionSummaryPanel.spec.ts
|
||||
* 用途:验证右侧「本次处理」以 session-work-items 为列表事实源。
|
||||
* 依赖:Vitest、Vue Test Utils、vue-i18n、vue-router、shipping.api mock。
|
||||
* 逻辑:断言两次重识别后仍展示 2 条 open 项;已关闭分组默认折叠。
|
||||
*/
|
||||
import { mount, flushPromises } from '@vue/test-utils';
|
||||
import { describe, expect, it, vi, beforeEach } from 'vitest';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import { createRouter, createMemoryHistory } from 'vue-router';
|
||||
import chatZhCn from '@/locales/zh-CN/chat.json';
|
||||
import ShippingSessionSummaryPanel from './ShippingSessionSummaryPanel.vue';
|
||||
import type { ShippingSessionWorkItemSummary } from '../types/shipping.api.types';
|
||||
|
||||
vi.mock('@/features/chat/api/shipping.api', () => ({
|
||||
listWorkspaceShippingSessionWorkItems: vi.fn(),
|
||||
listWorkspaceShippingSessionWorkItemVersions: vi.fn(),
|
||||
getWorkspaceShippingOrderExtractionRun: vi.fn(),
|
||||
closeWorkspaceShippingSessionWorkItem: vi.fn(),
|
||||
markWorkspaceShippingOrderReviewNonOrder: vi.fn(),
|
||||
reparseWorkspaceShippingOrderReviewDocument: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/shared/composables/useMessage', () => ({
|
||||
useMessage: () => ({
|
||||
success: vi.fn(),
|
||||
error: vi.fn(),
|
||||
warning: vi.fn(),
|
||||
info: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
import {
|
||||
getWorkspaceShippingOrderExtractionRun,
|
||||
listWorkspaceShippingSessionWorkItems,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: 'zh-CN',
|
||||
messages: { 'zh-CN': { chat: chatZhCn } },
|
||||
});
|
||||
|
||||
const router = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: [{ path: '/chat/:agentId', name: 'Chat', component: { template: '<div />' } }],
|
||||
});
|
||||
|
||||
const buildWorkbench = (patch: Partial<ShippingSessionWorkItemSummary> = {}): ShippingSessionWorkItemSummary => ({
|
||||
conversation_id: 'conv-1',
|
||||
open_count: 2,
|
||||
closed_count: 1,
|
||||
pending_review_count: 2,
|
||||
extracting_count: 0,
|
||||
open_items: [
|
||||
{
|
||||
item_no: 'SWI-001',
|
||||
conversation_id: 'conv-1',
|
||||
owner_user_id: 1,
|
||||
root_document_id: 10,
|
||||
current_document_id: 10,
|
||||
current_document_filename: 'PO-A.pdf',
|
||||
current_run_no: 'SNER-1',
|
||||
current_case_no: 'SNRC-1',
|
||||
current_version_no: 1,
|
||||
lifecycle_status: 'pending_review',
|
||||
lock_version: 1,
|
||||
available_actions: [
|
||||
'enter_manual_review',
|
||||
'view_version_history',
|
||||
'request_reparse',
|
||||
'mark_non_order',
|
||||
'cancel',
|
||||
'replace_file',
|
||||
],
|
||||
},
|
||||
{
|
||||
item_no: 'SWI-002',
|
||||
conversation_id: 'conv-1',
|
||||
owner_user_id: 1,
|
||||
root_document_id: 11,
|
||||
current_document_id: 11,
|
||||
current_document_filename: 'PO-B.pdf',
|
||||
current_run_no: 'SNER-2',
|
||||
current_case_no: 'SNRC-2',
|
||||
current_version_no: 2,
|
||||
lifecycle_status: 'pending_review',
|
||||
lock_version: 2,
|
||||
version_replaced: true,
|
||||
available_actions: [
|
||||
'enter_manual_review',
|
||||
'view_version_history',
|
||||
'request_reparse',
|
||||
'mark_non_order',
|
||||
'cancel',
|
||||
'replace_file',
|
||||
],
|
||||
},
|
||||
],
|
||||
closed_items: [
|
||||
{
|
||||
item_no: 'SWI-003',
|
||||
conversation_id: 'conv-1',
|
||||
owner_user_id: 1,
|
||||
root_document_id: 12,
|
||||
current_document_id: 12,
|
||||
current_document_filename: 'PO-C.pdf',
|
||||
current_version_no: 1,
|
||||
lifecycle_status: 'closed',
|
||||
closed_reason: 'confirmed',
|
||||
lock_version: 1,
|
||||
available_actions: ['view_version_history'],
|
||||
},
|
||||
],
|
||||
closed_collapsed: true,
|
||||
max_open_items: 50,
|
||||
truncated: false,
|
||||
...patch,
|
||||
});
|
||||
|
||||
describe('ShippingSessionSummaryPanel', () => {
|
||||
beforeEach(() => {
|
||||
vi.mocked(listWorkspaceShippingSessionWorkItems).mockReset();
|
||||
vi.mocked(getWorkspaceShippingOrderExtractionRun).mockReset();
|
||||
vi.mocked(getWorkspaceShippingOrderExtractionRun).mockResolvedValue(null as never);
|
||||
});
|
||||
|
||||
it('shows two open work items after two reparses mock', async () => {
|
||||
vi.mocked(listWorkspaceShippingSessionWorkItems).mockResolvedValue(buildWorkbench());
|
||||
const wrapper = mount(ShippingSessionSummaryPanel, {
|
||||
props: {
|
||||
conversationId: 'conv-1',
|
||||
conversationWorkspace: null,
|
||||
activeBatchNo: '',
|
||||
batchSummary: null,
|
||||
batchTasks: [],
|
||||
activeTaskDetail: null,
|
||||
},
|
||||
global: { plugins: [i18n, router] },
|
||||
});
|
||||
await flushPromises();
|
||||
const rows = wrapper.findAll('[data-testid^="shipping-session-work-item-"]');
|
||||
expect(rows.length).toBe(2);
|
||||
expect(wrapper.text()).toContain('PO-A.pdf');
|
||||
expect(wrapper.text()).toContain('PO-B.pdf');
|
||||
expect(wrapper.text()).toContain('V2');
|
||||
expect(wrapper.text()).toContain('已生成新版本');
|
||||
expect(wrapper.findAll('[data-testid="shipping-session-action-cancel"]').length).toBe(2);
|
||||
expect(wrapper.findAll('[data-testid="shipping-session-action-non-order"]').length).toBe(2);
|
||||
expect(wrapper.findAll('[data-testid="shipping-session-action-reparse"]').length).toBe(2);
|
||||
expect(wrapper.findAll('[data-testid="shipping-session-action-replace"]').length).toBe(2);
|
||||
});
|
||||
|
||||
it('keeps closed section collapsed by default', async () => {
|
||||
vi.mocked(listWorkspaceShippingSessionWorkItems).mockResolvedValue(buildWorkbench());
|
||||
const wrapper = mount(ShippingSessionSummaryPanel, {
|
||||
props: {
|
||||
conversationId: 'conv-1',
|
||||
conversationWorkspace: null,
|
||||
activeBatchNo: '',
|
||||
batchSummary: null,
|
||||
batchTasks: [],
|
||||
activeTaskDetail: null,
|
||||
},
|
||||
global: { plugins: [i18n, router] },
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find('[data-testid="shipping-session-closed-section"]').exists()).toBe(true);
|
||||
expect(wrapper.text()).toContain('已完成 1 项');
|
||||
expect(wrapper.text()).not.toContain('PO-C.pdf');
|
||||
await wrapper.find('[data-testid="shipping-session-closed-section"] button').trigger('click');
|
||||
expect(wrapper.text()).toContain('PO-C.pdf');
|
||||
});
|
||||
});
|
||||
@@ -1,329 +1,284 @@
|
||||
/**
|
||||
* features/chat/components/ShippingSessionSummaryPanel.vue
|
||||
* 用途:聊天页右侧「本次处理」唯一状态面——每 PDF 实时状态、异常原因与复核/已有任务深链。
|
||||
* 依赖:vue-i18n、vue-router、lucide、shipping.api(含 extraction documents)。
|
||||
* 逻辑:合并批次 Task 行与抽取 Run 文档行;open_existing 分流为「重复处理中 + 查看已有任务」。
|
||||
* 用途:聊天页右侧「本次处理」面板——以会话级 PDF 工作项 API 为唯一列表事实源。
|
||||
* 依赖:vue-i18n、vue-router、shipping.api session-work-items / 复核处置、useMessage。
|
||||
* 逻辑:conversationId 驱动 listWorkspaceShippingSessionWorkItems 轮询;extractionRunNo 仅作 Run 级处理事项装饰;
|
||||
* 按 available_actions 渲染人工复核/版本历史/取消/非订单/重识别/替换文件入口。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ChevronDown, ChevronRight, ExternalLink } from 'lucide-vue-next';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import {
|
||||
getWorkspaceShippingOrderReviewRun,
|
||||
listWorkspaceShippingOrderExtractionDocuments,
|
||||
closeWorkspaceShippingSessionWorkItem,
|
||||
getWorkspaceShippingOrderExtractionRun,
|
||||
listWorkspaceShippingSessionWorkItemVersions,
|
||||
listWorkspaceShippingSessionWorkItems,
|
||||
markWorkspaceShippingOrderReviewNonOrder,
|
||||
reparseWorkspaceShippingOrderReviewDocument,
|
||||
type ShippingBatchSummary,
|
||||
type ShippingConversationWorkspace,
|
||||
type ShippingTaskDetail,
|
||||
type ShippingTaskSummary,
|
||||
type ShippingTaskUiState,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
import type { ShippingOrderExtractionDocumentResult } from '@/features/chat/types/shipping.api.types';
|
||||
import type {
|
||||
ShippingOrderExtractionRun,
|
||||
ShippingSessionWorkItem,
|
||||
ShippingSessionWorkItemSummary,
|
||||
ShippingSessionWorkItemVersion,
|
||||
} from '@/features/chat/types/shipping.api.types';
|
||||
import {
|
||||
listDisplayableHandlingAffectedRefs,
|
||||
type ShippingHandlingAffectedRef,
|
||||
type ShippingHandlingRefTarget,
|
||||
} from '@/features/chat/shipping/orderExtractionHandlingRefs';
|
||||
|
||||
const props = defineProps<{
|
||||
/** 当前聊天会话 ID;工作项列表的唯一驱动键。 */
|
||||
conversationId?: string | null;
|
||||
conversationWorkspace: ShippingConversationWorkspace | null;
|
||||
activeBatchNo: string;
|
||||
batchSummary: ShippingBatchSummary | null;
|
||||
batchTasks: ShippingTaskSummary[];
|
||||
activeTaskDetail: ShippingTaskDetail | null;
|
||||
/** 当前会话活跃抽取 Run;有值时右侧轮询每 PDF 状态 */
|
||||
/** 可选:当前活跃抽取 Run,仅用于 Run 级 handling_items 装饰,不驱动 PDF 列表。 */
|
||||
extractionRunNo?: string | null;
|
||||
/** 父级递增以触发立即刷新(终态/重识别/会话恢复后)。 */
|
||||
refreshTrigger?: number;
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const { t, te, locale } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const msg = useMessage();
|
||||
const collapsed = ref(false);
|
||||
const extractionDocs = ref<ShippingOrderExtractionDocumentResult[]>([]);
|
||||
const docsLoading = ref(false);
|
||||
let docsTimer: ReturnType<typeof setInterval> | null = null;
|
||||
const openOnlyFilter = ref(false);
|
||||
const closedExpanded = ref(false);
|
||||
const workbench = ref<ShippingSessionWorkItemSummary | null>(null);
|
||||
const workItemsLoading = ref(false);
|
||||
const actionBusyItemNo = ref<string | null>(null);
|
||||
const extractionRun = ref<ShippingOrderExtractionRun | null>(null);
|
||||
const versionHistoryItemNo = ref<string | null>(null);
|
||||
const versionHistoryItems = ref<ShippingSessionWorkItemVersion[]>([]);
|
||||
const versionHistoryLoading = ref(false);
|
||||
let workItemsTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
let workItemsPollGeneration = 0;
|
||||
let workItemsRequestController: AbortController | null = null;
|
||||
|
||||
const workspaceBatches = computed(() => props.conversationWorkspace?.batches || []);
|
||||
const activeBatchNo = computed(() =>
|
||||
String(props.activeBatchNo || props.batchSummary?.batch_no || workspaceBatches.value[0]?.batch_no || '').trim(),
|
||||
);
|
||||
const FOREGROUND_POLL_MS = 2000;
|
||||
const BACKGROUND_POLL_MS = 8000;
|
||||
|
||||
/**
|
||||
* 判断文档是否为「打开已有任务」分流。
|
||||
* 按页面可见性选择工作项轮询间隔。
|
||||
*/
|
||||
function isOpenExistingDoc(doc: ShippingOrderExtractionDocumentResult): boolean {
|
||||
const taskNo = String(doc.existing_task_no || '').trim();
|
||||
return Boolean(
|
||||
taskNo
|
||||
&& (
|
||||
doc.duplicate_resolution === 'open_existing'
|
||||
|| doc.available_actions.includes('open_existing')
|
||||
),
|
||||
);
|
||||
function resolveWorkItemsPollMs(): number {
|
||||
if (typeof document !== 'undefined' && document.visibilityState === 'hidden') {
|
||||
return BACKGROUND_POLL_MS;
|
||||
}
|
||||
return FOREGROUND_POLL_MS;
|
||||
}
|
||||
|
||||
const processSummary = computed(() => {
|
||||
const summary = props.batchSummary?.process_summary || props.conversationWorkspace?.summary || null;
|
||||
const fromDocs = extractionDocs.value;
|
||||
const total = Number(
|
||||
(summary as { total?: number } | null)?.total
|
||||
|| props.batchSummary?.file_count
|
||||
|| props.batchTasks.length
|
||||
|| fromDocs.length
|
||||
|| 0,
|
||||
const normalizedConversationId = computed(() => String(props.conversationId || '').trim());
|
||||
|
||||
const handlingItems = computed(() => (
|
||||
Array.isArray(extractionRun.value?.handling_items)
|
||||
? extractionRun.value!.handling_items!.filter((item) => String(item.category || '').trim())
|
||||
: []
|
||||
));
|
||||
|
||||
const openItems = computed((): ShippingSessionWorkItem[] => workbench.value?.open_items || []);
|
||||
const closedItems = computed((): ShippingSessionWorkItem[] => workbench.value?.closed_items || []);
|
||||
|
||||
const displayOpenItems = computed(() => {
|
||||
if (!openOnlyFilter.value) return openItems.value;
|
||||
return openItems.value.filter((item) =>
|
||||
item.lifecycle_status === 'pending_review' || item.lifecycle_status === 'reparse_failed',
|
||||
);
|
||||
const reviewFromDocs = fromDocs.filter((d) =>
|
||||
!isOpenExistingDoc(d)
|
||||
&& (
|
||||
d.status === 'review_required'
|
||||
|| d.available_actions.some((a) => a === 'review_candidate' || a === 'manual_review')
|
||||
),
|
||||
).length;
|
||||
const openExistingFromDocs = fromDocs.filter((d) => isOpenExistingDoc(d)).length;
|
||||
return {
|
||||
total,
|
||||
completed: Number((summary as { completed?: number } | null)?.completed || 0),
|
||||
running: Number((summary as { running?: number } | null)?.running || 0),
|
||||
failed: Number((summary as { failed?: number } | null)?.failed
|
||||
|| fromDocs.filter((d) => d.status === 'failed').length
|
||||
|| 0),
|
||||
needsHuman: Number(
|
||||
(summary as { needs_human?: number } | null)?.needs_human
|
||||
|| props.conversationWorkspace?.summary?.needs_human
|
||||
|| reviewFromDocs
|
||||
|| 0,
|
||||
),
|
||||
openExisting: openExistingFromDocs,
|
||||
pending: Number((summary as { pending?: number } | null)?.pending || 0),
|
||||
};
|
||||
});
|
||||
|
||||
type SummaryRow = {
|
||||
key: string;
|
||||
fileName: string;
|
||||
taskNo: string;
|
||||
runNo: string;
|
||||
caseNo: string;
|
||||
index: number;
|
||||
total: number;
|
||||
stage: string;
|
||||
message: string;
|
||||
entrySurface: string;
|
||||
/** exception=需人工异常;duplicate=已识别重复关联;none=无标签 */
|
||||
badge: 'exception' | 'duplicate' | 'none';
|
||||
kind: 'task' | 'document';
|
||||
};
|
||||
const processSummary = computed(() => ({
|
||||
total: Number(workbench.value?.open_count || 0) + Number(workbench.value?.closed_count || 0),
|
||||
completed: Number(workbench.value?.closed_count || 0),
|
||||
running: Number(workbench.value?.extracting_count || 0),
|
||||
needsHuman: Number(workbench.value?.pending_review_count || 0),
|
||||
failed: openItems.value.filter((item) => item.lifecycle_status === 'reparse_failed').length,
|
||||
pending: 0,
|
||||
openExisting: 0,
|
||||
pendingConfirmation: 0,
|
||||
cancelled: 0,
|
||||
}));
|
||||
|
||||
/**
|
||||
* 将 Task ui_state 映射为右侧行。
|
||||
* 解析 Run 级处理事项标题。
|
||||
*/
|
||||
function mapTaskRow(task: ShippingTaskSummary, index: number, total: number): SummaryRow {
|
||||
const uiState: ShippingTaskUiState | null | undefined =
|
||||
(props.activeTaskDetail?.task_no === task.task_no ? props.activeTaskDetail.ui_state : null)
|
||||
|| task.ui_state;
|
||||
const summary = uiState?.summary;
|
||||
const kind = String(uiState?.checkpoint_kind || summary?.checkpoint_kind || '');
|
||||
const stage = String(summary?.stage || summary?.title || task.process_status || '').trim();
|
||||
let normalizedStage = stage;
|
||||
if (kind === 'wait_manual_upload') normalizedStage = t('chat.shippingSessionSummary.waitingUpload');
|
||||
else if (kind === 'auto_continue') normalizedStage = t('chat.shippingSessionSummary.autoProcessing');
|
||||
else if (kind === 'must_human') normalizedStage = stage || t('chat.shippingSessionSummary.needsReview');
|
||||
return {
|
||||
key: `task:${task.task_no || index}`,
|
||||
fileName: String(task.source_file_name || '').trim(),
|
||||
taskNo: String(task.task_no || '').trim(),
|
||||
runNo: '',
|
||||
caseNo: '',
|
||||
index: Number(task.batch_index || index + 1),
|
||||
total: Number(task.batch_total || total || 1),
|
||||
stage: normalizedStage,
|
||||
message: String(summary?.message || summary?.current_todo || summary?.pause_reason || '').trim(),
|
||||
entrySurface: String(summary?.entry_surface || 'none').trim(),
|
||||
badge: (
|
||||
summary?.pause_reason
|
||||
|| task.pending_human_reason
|
||||
|| task.error_message
|
||||
|| kind === 'must_human'
|
||||
|| ['rejected', 'upload_failed'].includes(String(task.process_status || ''))
|
||||
) ? 'exception' : 'none',
|
||||
kind: 'task',
|
||||
};
|
||||
function handlingTitle(category: string): string {
|
||||
const key = `chat.shippingOrderExtractionHandling.category.${category}`;
|
||||
return te(key) ? t(key) : category;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 reason_code / review_details 拼成用户可读原因。
|
||||
* 解析原因码文案。
|
||||
*/
|
||||
function formatDocumentReason(doc: ShippingOrderExtractionDocumentResult): string {
|
||||
const reasonKey = `chat.shippingOrderExtractionReason.${doc.reason_code || ''}`;
|
||||
const reasonText = doc.reason_code && te(reasonKey)
|
||||
? t(reasonKey)
|
||||
: String(doc.reason_code || doc.activity_event_code || '').trim();
|
||||
const detailParts: string[] = [];
|
||||
for (const detail of (doc.review_details || []).slice(0, 2)) {
|
||||
const fieldCode = String(detail.field_code || '').trim();
|
||||
const fieldKey = `chat.shippingOrderExtractionReviewField.${fieldCode || 'unknown'}`;
|
||||
const fieldLabel = te(fieldKey) ? t(fieldKey) : (fieldCode || t('chat.shippingOrderExtractionReviewField.unknown'));
|
||||
const detailReasonKey = `chat.shippingOrderExtractionReason.${detail.reason_code || ''}`;
|
||||
const detailReason = detail.reason_code && te(detailReasonKey)
|
||||
? t(detailReasonKey)
|
||||
: String(detail.reason_code || '').trim();
|
||||
detailParts.push(
|
||||
t('chat.shippingOrderExtractionReviewDetail', {
|
||||
line: detail.line_number,
|
||||
field: fieldLabel,
|
||||
}) + (detailReason ? `(${detailReason})` : ''),
|
||||
);
|
||||
}
|
||||
if (reasonText && detailParts.length) return `${reasonText};${detailParts.join(';')}`;
|
||||
if (detailParts.length) return detailParts.join(';');
|
||||
return reasonText;
|
||||
function handlingReasonLabel(code: string): string {
|
||||
const key = `chat.shippingOrderExtractionReason.${code}`;
|
||||
if (te(key)) return t(key);
|
||||
const freezeKey = `chat.shippingOrderExtractionHandling.reason.${code}`;
|
||||
return te(freezeKey) ? t(freezeKey) : code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将抽取文档映射为建单前右侧行;open_existing 走任务深链。
|
||||
* 解析工作项生命周期状态文案。
|
||||
*/
|
||||
function mapDocumentRow(
|
||||
doc: ShippingOrderExtractionDocumentResult,
|
||||
index: number,
|
||||
total: number,
|
||||
runNo: string,
|
||||
caseNo = '',
|
||||
): SummaryRow {
|
||||
const existingTaskNo = String(doc.existing_task_no || '').trim();
|
||||
const openExisting = isOpenExistingDoc(doc);
|
||||
const needsReview = !openExisting && (
|
||||
doc.status === 'review_required'
|
||||
|| doc.available_actions.some((a) => a === 'review_candidate' || a === 'manual_review')
|
||||
|| Boolean(caseNo)
|
||||
);
|
||||
const failed = doc.status === 'failed';
|
||||
const reasonText = formatDocumentReason(doc);
|
||||
let stage = t('chat.shippingSessionSummary.autoProcessing');
|
||||
let entrySurface = 'none';
|
||||
let message = reasonText;
|
||||
let taskNo = '';
|
||||
if (openExisting && existingTaskNo) {
|
||||
stage = t('chat.shippingSessionSummary.duplicateProcessing');
|
||||
entrySurface = 'task_workbench';
|
||||
taskNo = existingTaskNo;
|
||||
message = reasonText
|
||||
? `${t('chat.shippingSessionSummary.existingTaskNo', { taskNo: existingTaskNo })} · ${reasonText}`
|
||||
: t('chat.shippingSessionSummary.existingTaskNo', { taskNo: existingTaskNo });
|
||||
} else if (needsReview) {
|
||||
stage = t('chat.shippingSessionSummary.needsReview');
|
||||
entrySurface = 'review_workbench';
|
||||
} else if (failed) {
|
||||
stage = t('chat.shippingOrderExtractionDocumentStatus.failed');
|
||||
}
|
||||
return {
|
||||
key: `doc:${doc.unit_id || doc.document_id || index}`,
|
||||
fileName: String(doc.file_name || '').trim(),
|
||||
taskNo,
|
||||
runNo,
|
||||
caseNo,
|
||||
index: index + 1,
|
||||
total,
|
||||
stage,
|
||||
message,
|
||||
entrySurface,
|
||||
badge: openExisting ? 'duplicate' : (needsReview || failed ? 'exception' : 'none'),
|
||||
kind: 'document',
|
||||
};
|
||||
function lifecycleStatusLabel(status: string): string {
|
||||
const key = `chat.shippingSessionWorkItem.status.${status}`;
|
||||
return te(key) ? t(key) : status;
|
||||
}
|
||||
|
||||
const caseNoByDocumentId = ref<Record<number, string>>({});
|
||||
|
||||
const taskRows = computed((): SummaryRow[] => {
|
||||
const runNo = String(props.extractionRunNo || '').trim();
|
||||
// [STEP 1] 建单前:有抽取 Run 时优先展示每 PDF 文档行(含复核/已有任务深链)。
|
||||
if (runNo && extractionDocs.value.length) {
|
||||
return extractionDocs.value.map((doc, index) =>
|
||||
mapDocumentRow(
|
||||
doc,
|
||||
index,
|
||||
extractionDocs.value.length,
|
||||
runNo,
|
||||
caseNoByDocumentId.value[Number(doc.document_id)] || '',
|
||||
));
|
||||
}
|
||||
// [STEP 2] 建单后:展示 Task 行。
|
||||
const tasks = props.batchTasks.length
|
||||
? props.batchTasks
|
||||
: (workspaceBatches.value.find((b) => b.batch_no === activeBatchNo.value)?.tasks || []);
|
||||
if (tasks.length) {
|
||||
return tasks.map((task, index) => mapTaskRow(task, index, processSummary.value.total || tasks.length));
|
||||
}
|
||||
return [];
|
||||
});
|
||||
/**
|
||||
* 解析工作项关闭原因文案。
|
||||
*/
|
||||
function closedReasonLabel(reason?: string | null): string {
|
||||
const normalized = String(reason || '').trim();
|
||||
if (!normalized) return '';
|
||||
const key = `chat.shippingSessionWorkItem.closedReason.${normalized}`;
|
||||
return te(key) ? t(key) : normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取当前 Run 文档与复核 Case,保证右侧可深链 case_no/run_no/existing_task_no。
|
||||
* 格式化 updated_at 为「更新于 HH:mm」。
|
||||
*/
|
||||
async function refreshExtractionDocs() {
|
||||
const runNo = String(props.extractionRunNo || '').trim();
|
||||
if (!runNo || docsLoading.value) return;
|
||||
docsLoading.value = true;
|
||||
function formatUpdatedLabel(value?: string | null): string {
|
||||
const date = new Date(String(value || ''));
|
||||
if (Number.isNaN(date.getTime())) return '';
|
||||
const time = new Intl.DateTimeFormat(String(locale.value || 'zh-CN'), {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false,
|
||||
}).format(date);
|
||||
return t('chat.shippingOrderExtractionDocumentTiming.updated', { time });
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取会话工作台与可选 Run 装饰数据。
|
||||
*/
|
||||
async function refreshWorkItems() {
|
||||
const conversationId = normalizedConversationId.value;
|
||||
if (!conversationId || workItemsLoading.value) return;
|
||||
workItemsLoading.value = true;
|
||||
workItemsRequestController?.abort();
|
||||
const controller = new AbortController();
|
||||
workItemsRequestController = controller;
|
||||
try {
|
||||
const [docsResponse, reviewResponse] = await Promise.all([
|
||||
listWorkspaceShippingOrderExtractionDocuments(runNo),
|
||||
getWorkspaceShippingOrderReviewRun(runNo).catch(() => null),
|
||||
const [summaryResponse, runResponse] = await Promise.all([
|
||||
listWorkspaceShippingSessionWorkItems(conversationId, {
|
||||
open_only: openOnlyFilter.value,
|
||||
signal: controller.signal,
|
||||
}),
|
||||
(() => {
|
||||
const runNo = String(props.extractionRunNo || '').trim();
|
||||
return runNo ? getWorkspaceShippingOrderExtractionRun(runNo).catch(() => null) : Promise.resolve(null);
|
||||
})(),
|
||||
]);
|
||||
extractionDocs.value = docsResponse.items || [];
|
||||
const mapping: Record<number, string> = {};
|
||||
for (const item of reviewResponse?.items || []) {
|
||||
const docId = Number(item.document_id);
|
||||
const caseNo = String(item.case_no || '').trim();
|
||||
if (docId && caseNo) mapping[docId] = caseNo;
|
||||
if (controller.signal.aborted) return;
|
||||
workbench.value = summaryResponse;
|
||||
extractionRun.value = runResponse;
|
||||
if (!closedExpanded.value) {
|
||||
closedExpanded.value = false;
|
||||
}
|
||||
caseNoByDocumentId.value = mapping;
|
||||
} catch {
|
||||
/* 右侧失败不打断聊天 */
|
||||
} finally {
|
||||
docsLoading.value = false;
|
||||
if (workItemsRequestController === controller) {
|
||||
workItemsRequestController = null;
|
||||
}
|
||||
workItemsLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function stopDocsPolling() {
|
||||
if (docsTimer) clearInterval(docsTimer);
|
||||
docsTimer = null;
|
||||
function stopWorkItemsPolling() {
|
||||
if (workItemsTimer) clearTimeout(workItemsTimer);
|
||||
workItemsTimer = null;
|
||||
workItemsRequestController?.abort();
|
||||
workItemsRequestController = null;
|
||||
workItemsPollGeneration += 1;
|
||||
}
|
||||
|
||||
function restartDocsPolling() {
|
||||
stopDocsPolling();
|
||||
const runNo = String(props.extractionRunNo || '').trim();
|
||||
if (!runNo) {
|
||||
extractionDocs.value = [];
|
||||
return;
|
||||
}
|
||||
void refreshExtractionDocs();
|
||||
docsTimer = setInterval(() => void refreshExtractionDocs(), 2000);
|
||||
}
|
||||
|
||||
watch(() => props.extractionRunNo, () => restartDocsPolling(), { immediate: true });
|
||||
onBeforeUnmount(stopDocsPolling);
|
||||
|
||||
/**
|
||||
* 打开任务处理工作台。
|
||||
* 可见性感知的工作项轮询;前台 2s,后台 8s。
|
||||
*/
|
||||
async function openTaskWorkbench(taskNo: string) {
|
||||
const normalized = String(taskNo || '').trim();
|
||||
if (!normalized) return;
|
||||
await router.push({
|
||||
path: '/workspace/shipping-notice/my-tasks',
|
||||
query: { task_no: normalized },
|
||||
function scheduleWorkItemsPoll(generation: number, delayMs: number) {
|
||||
if (workItemsTimer) clearTimeout(workItemsTimer);
|
||||
workItemsTimer = setTimeout(async () => {
|
||||
if (generation !== workItemsPollGeneration) return;
|
||||
await refreshWorkItems();
|
||||
if (generation !== workItemsPollGeneration) return;
|
||||
if (!normalizedConversationId.value) return;
|
||||
scheduleWorkItemsPoll(generation, resolveWorkItemsPollMs());
|
||||
}, delayMs);
|
||||
}
|
||||
|
||||
function restartWorkItemsPolling() {
|
||||
stopWorkItemsPolling();
|
||||
const conversationId = normalizedConversationId.value;
|
||||
if (!conversationId) {
|
||||
workbench.value = null;
|
||||
extractionRun.value = null;
|
||||
return;
|
||||
}
|
||||
const generation = workItemsPollGeneration;
|
||||
void refreshWorkItems().then(() => {
|
||||
if (generation !== workItemsPollGeneration) return;
|
||||
scheduleWorkItemsPoll(generation, resolveWorkItemsPollMs());
|
||||
});
|
||||
}
|
||||
|
||||
function onVisibilityChange() {
|
||||
if (typeof document === 'undefined' || document.visibilityState !== 'visible') return;
|
||||
if (!normalizedConversationId.value) return;
|
||||
scheduleWorkItemsPoll(workItemsPollGeneration, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开人工复核(Chat order-review 模式);携带 case_no 精确定位 PDF。
|
||||
* 打开版本历史面板并拉取时间线。
|
||||
*/
|
||||
async function openReview(runNo: string, caseNo = '') {
|
||||
const normalized = String(runNo || '').trim();
|
||||
if (!normalized) return;
|
||||
async function openVersionHistory(item: ShippingSessionWorkItem) {
|
||||
const itemNo = String(item.item_no || '').trim();
|
||||
if (!itemNo) return;
|
||||
if (versionHistoryItemNo.value === itemNo) {
|
||||
versionHistoryItemNo.value = null;
|
||||
versionHistoryItems.value = [];
|
||||
return;
|
||||
}
|
||||
versionHistoryItemNo.value = itemNo;
|
||||
versionHistoryLoading.value = true;
|
||||
try {
|
||||
const response = await listWorkspaceShippingSessionWorkItemVersions(itemNo);
|
||||
versionHistoryItems.value = response.versions || [];
|
||||
} catch {
|
||||
versionHistoryItems.value = [];
|
||||
} finally {
|
||||
versionHistoryLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开人工复核(Chat order-review 模式);使用行内 case_no / run_no。
|
||||
*/
|
||||
async function openManualReview(item: ShippingSessionWorkItem) {
|
||||
const runNo = String(item.current_run_no || '').trim();
|
||||
if (!runNo) return;
|
||||
const caseNo = String(item.current_case_no || '').trim();
|
||||
const query: Record<string, string> = {
|
||||
...Object.fromEntries(
|
||||
Object.entries(route.query).filter(([, v]) => typeof v === 'string') as Array<[string, string]>,
|
||||
),
|
||||
mode: 'order-review',
|
||||
run_no: normalized,
|
||||
run_no: runNo,
|
||||
};
|
||||
const caseNormalized = String(caseNo || '').trim();
|
||||
if (caseNormalized) query.case_no = caseNormalized;
|
||||
if (caseNo) query.case = caseNo;
|
||||
await router.push({
|
||||
name: 'Chat',
|
||||
params: { agentId: String(route.params.agentId || '') },
|
||||
@@ -332,19 +287,171 @@ async function openReview(runNo: string, caseNo = '') {
|
||||
}
|
||||
|
||||
/**
|
||||
* 按 entry_surface 分发深链;复核必须有 run_no,禁止空 task 跳转。
|
||||
* 按 Run 级处理事项受影响对象跳转。
|
||||
*/
|
||||
async function openEntrySurface(row: SummaryRow) {
|
||||
if (row.entrySurface === 'review_workbench') {
|
||||
const runNo = row.runNo || String(props.extractionRunNo || '');
|
||||
if (!runNo) return;
|
||||
await openReview(runNo, row.caseNo);
|
||||
async function openAffectedRef(target: ShippingHandlingRefTarget, runNo?: string) {
|
||||
if (target.kind === 'task') {
|
||||
await router.push({
|
||||
name: 'workspace-shipping-tasks',
|
||||
params: { taskNo: target.taskNo },
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (row.entrySurface === 'task_workbench' && row.taskNo) {
|
||||
await openTaskWorkbench(row.taskNo);
|
||||
if (target.kind === 'review') {
|
||||
const normalizedRun = String(runNo || props.extractionRunNo || '').trim();
|
||||
if (!normalizedRun) return;
|
||||
await openManualReview({
|
||||
item_no: '',
|
||||
conversation_id: normalizedConversationId.value,
|
||||
owner_user_id: 0,
|
||||
root_document_id: 0,
|
||||
current_document_id: 0,
|
||||
current_run_no: normalizedRun,
|
||||
current_case_no: target.documentId ? '' : '',
|
||||
current_version_no: 1,
|
||||
lifecycle_status: 'pending_review',
|
||||
lock_version: 1,
|
||||
available_actions: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按处理事项主动作打开复核入口。
|
||||
*/
|
||||
async function openHandlingAction(
|
||||
action?: string | null,
|
||||
refs?: Array<Record<string, unknown>> | null,
|
||||
) {
|
||||
const runNo = String(props.extractionRunNo || '').trim();
|
||||
if (!runNo) return;
|
||||
const rows = listDisplayableHandlingAffectedRefs(refs as ShippingHandlingAffectedRef[] | undefined);
|
||||
const first = rows[0];
|
||||
if (first) {
|
||||
await openAffectedRef(first.target, runNo);
|
||||
return;
|
||||
}
|
||||
const normalized = String(action || '').trim();
|
||||
if (
|
||||
normalized === 'enter_manual_review'
|
||||
|| normalized === 'review_candidate'
|
||||
|| normalized === 'view_details'
|
||||
|| !normalized
|
||||
) {
|
||||
await router.push({
|
||||
name: 'Chat',
|
||||
params: { agentId: String(route.params.agentId || '') },
|
||||
query: {
|
||||
...Object.fromEntries(
|
||||
Object.entries(route.query).filter(([, v]) => typeof v === 'string') as Array<[string, string]>,
|
||||
),
|
||||
mode: 'order-review',
|
||||
run_no: runNo,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示并收集操作原因;取消输入时返回 null。
|
||||
*/
|
||||
function promptActionReason(messageKey: string): string | null {
|
||||
const reason = window.prompt(t(messageKey));
|
||||
if (reason == null) return null;
|
||||
const trimmed = reason.trim();
|
||||
if (!trimmed) {
|
||||
msg.warning(t('chat.shippingSessionWorkItem.reasonRequired'));
|
||||
return null;
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行工作项写操作后刷新列表;失败用业务错误提示。
|
||||
*/
|
||||
async function runWorkItemAction(item: ShippingSessionWorkItem, action: () => Promise<unknown>) {
|
||||
const itemNo = String(item.item_no || '').trim();
|
||||
if (!itemNo || actionBusyItemNo.value) return;
|
||||
actionBusyItemNo.value = itemNo;
|
||||
try {
|
||||
await action();
|
||||
await refreshWorkItems();
|
||||
} catch (error) {
|
||||
const message = error instanceof BusinessError ? error.message : t('errors.generic');
|
||||
msg.error(message);
|
||||
} finally {
|
||||
actionBusyItemNo.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消本次处理(关闭工作项)。
|
||||
*/
|
||||
async function cancelWorkItem(item: ShippingSessionWorkItem) {
|
||||
const reason = promptActionReason('chat.shippingSessionWorkItem.cancelReasonPrompt');
|
||||
if (!reason) return;
|
||||
await runWorkItemAction(item, () => closeWorkspaceShippingSessionWorkItem(String(item.item_no), {
|
||||
reason,
|
||||
expected_lock_version: item.lock_version,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记非订单并关闭当前 Case/工作项。
|
||||
*/
|
||||
async function markNonOrderFromPanel(item: ShippingSessionWorkItem) {
|
||||
const caseNo = String(item.current_case_no || '').trim();
|
||||
if (!caseNo) {
|
||||
msg.warning(t('chat.shippingSessionWorkItem.caseRequired'));
|
||||
return;
|
||||
}
|
||||
const reason = promptActionReason('chat.shippingSessionWorkItem.nonOrderReasonPrompt');
|
||||
if (!reason) return;
|
||||
await runWorkItemAction(item, () => markWorkspaceShippingOrderReviewNonOrder(caseNo, 'non_order', reason));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单文件重新识别。
|
||||
*/
|
||||
async function reparseFromPanel(item: ShippingSessionWorkItem) {
|
||||
const caseNo = String(item.current_case_no || '').trim();
|
||||
if (!caseNo) {
|
||||
msg.warning(t('chat.shippingSessionWorkItem.caseRequired'));
|
||||
return;
|
||||
}
|
||||
const reason = promptActionReason('chat.shippingSessionWorkItem.reparseReasonPrompt');
|
||||
if (!reason) return;
|
||||
await runWorkItemAction(item, () => reparseWorkspaceShippingOrderReviewDocument(caseNo, 'other', reason));
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换文件:进入人工复核页完成上传替代流程。
|
||||
*/
|
||||
async function replaceFileFromPanel(item: ShippingSessionWorkItem) {
|
||||
await openManualReview(item);
|
||||
}
|
||||
|
||||
function itemHasAction(item: ShippingSessionWorkItem, action: string): boolean {
|
||||
return Array.isArray(item.available_actions) && item.available_actions.includes(action);
|
||||
}
|
||||
|
||||
watch(normalizedConversationId, () => restartWorkItemsPolling(), { immediate: true });
|
||||
watch(openOnlyFilter, () => { void refreshWorkItems(); });
|
||||
watch(() => props.refreshTrigger, () => {
|
||||
if (!normalizedConversationId.value) return;
|
||||
scheduleWorkItemsPoll(workItemsPollGeneration, 0);
|
||||
});
|
||||
watch(() => props.extractionRunNo, () => { void refreshWorkItems(); });
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
if (typeof document !== 'undefined') {
|
||||
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||
}
|
||||
stopWorkItemsPolling();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -362,7 +469,7 @@ async function openEntrySurface(row: SummaryRow) {
|
||||
{{ t('chat.shippingSessionSummary.title') }}
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-secondary">
|
||||
{{ t('chat.shippingSessionSummary.pdfCount', { count: processSummary.total || taskRows.length }) }}
|
||||
{{ t('chat.shippingSessionSummary.pdfCount', { count: processSummary.total || displayOpenItems.length }) }}
|
||||
</div>
|
||||
</div>
|
||||
<ChevronDown v-if="!collapsed" class="h-4 w-4 shrink-0 text-muted" />
|
||||
@@ -370,6 +477,56 @@ async function openEntrySurface(row: SummaryRow) {
|
||||
</button>
|
||||
|
||||
<div v-if="!collapsed" class="min-h-0 flex-1 overflow-auto p-3">
|
||||
<label class="mb-3 flex cursor-pointer items-center gap-2 text-[11px] text-secondary">
|
||||
<input
|
||||
v-model="openOnlyFilter"
|
||||
type="checkbox"
|
||||
class="rounded border-default"
|
||||
data-testid="shipping-session-open-only-filter"
|
||||
/>
|
||||
{{ t('chat.shippingSessionWorkItem.openOnlyFilter') }}
|
||||
</label>
|
||||
|
||||
<div
|
||||
v-if="handlingItems.length"
|
||||
class="mb-3 space-y-1.5"
|
||||
data-testid="shipping-session-handling-items"
|
||||
>
|
||||
<div class="text-[11px] font-medium text-secondary">
|
||||
{{ t('chat.shippingOrderExtractionHandling.title') }}
|
||||
</div>
|
||||
<div
|
||||
v-for="item in handlingItems"
|
||||
:key="item.category"
|
||||
class="rounded-md border border-default bg-surface-muted/60 px-2 py-1.5 text-xs"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<div class="min-w-0 font-medium text-primary">
|
||||
{{ handlingTitle(item.category) }}
|
||||
<span class="ml-1 text-secondary">
|
||||
{{ t('chat.shippingOrderExtractionHandling.count', { count: item.count }) }}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="shrink-0 rounded-md border border-default px-2 py-0.5 text-[11px] font-medium text-primary hover:bg-surface"
|
||||
@click="openHandlingAction(item.primary_action, item.affected_refs)"
|
||||
>
|
||||
{{ te(`chat.shippingOrderExtractionAction.${item.primary_action || 'view_details'}`)
|
||||
? t(`chat.shippingOrderExtractionAction.${item.primary_action || 'view_details'}`)
|
||||
: t('chat.shippingOrderExtractionAction.view_details') }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="(item.reason_codes || []).length"
|
||||
class="mt-1 text-[11px] text-secondary"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionHandling.reasonPrefix') }}
|
||||
{{ (item.reason_codes || []).slice(0, 4).map(handlingReasonLabel).join(';') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 flex flex-wrap gap-1.5 text-[11px]">
|
||||
<span class="rounded-md bg-emerald-50 px-2 py-0.5 text-emerald-700 dark:bg-emerald-950/40 dark:text-emerald-200">
|
||||
{{ t('chat.shippingSessionSummary.completed', { count: processSummary.completed }) }}
|
||||
@@ -383,12 +540,6 @@ async function openEntrySurface(row: SummaryRow) {
|
||||
>
|
||||
{{ t('chat.shippingSessionSummary.needsHuman', { count: processSummary.needsHuman }) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="processSummary.openExisting > 0"
|
||||
class="rounded-md bg-violet-50 px-2 py-0.5 text-violet-700 dark:bg-violet-950/40 dark:text-violet-200"
|
||||
>
|
||||
{{ t('chat.shippingSessionSummary.openExistingCount', { count: processSummary.openExisting }) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="processSummary.failed > 0"
|
||||
class="rounded-md bg-rose-50 px-2 py-0.5 text-rose-700 dark:bg-rose-950/40 dark:text-rose-200"
|
||||
@@ -397,76 +548,173 @@ async function openEntrySurface(row: SummaryRow) {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div v-if="!taskRows.length" class="text-xs text-muted">
|
||||
{{ docsLoading ? t('chat.shippingOrderExtractionDocumentsLoading') : t('chat.shippingSessionSummary.empty') }}
|
||||
<div v-if="!displayOpenItems.length && !closedItems.length" class="text-xs text-muted">
|
||||
{{ workItemsLoading
|
||||
? t('chat.shippingSessionWorkItem.loading')
|
||||
: t('chat.shippingSessionSummary.empty') }}
|
||||
</div>
|
||||
|
||||
<ul v-else class="space-y-2">
|
||||
<ul v-if="displayOpenItems.length" class="space-y-2" data-testid="shipping-session-open-items">
|
||||
<li
|
||||
v-for="row in taskRows"
|
||||
:key="row.key"
|
||||
v-for="item in displayOpenItems"
|
||||
:key="item.item_no"
|
||||
class="rounded-lg border border-default bg-surface-soft/80 px-2.5 py-2"
|
||||
:data-testid="`shipping-session-work-item-${item.item_no}`"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<div class="min-w-0">
|
||||
<div class="truncate text-xs font-semibold text-primary">
|
||||
{{ row.fileName || row.taskNo || t('chat.shippingSessionSummary.unnamedPdf') }}
|
||||
{{ item.current_document_filename || t('chat.shippingSessionSummary.unnamedPdf') }}
|
||||
</div>
|
||||
<div class="mt-0.5 text-[11px] text-muted">
|
||||
{{ t('chat.shippingSessionSummary.progressIndex', {
|
||||
current: row.index,
|
||||
total: row.total || processSummary.total || 1,
|
||||
}) }}
|
||||
<!-- 重复态任务号已在原因行「已有任务 SN-xxx」展示,序号行不再重复 -->
|
||||
<span
|
||||
v-if="row.taskNo && row.badge !== 'duplicate'"
|
||||
class="ml-1 font-mono"
|
||||
>{{ row.taskNo }}</span>
|
||||
{{ t('chat.shippingSessionWorkItem.versionLabel', { version: item.current_version_no }) }}
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
v-if="row.badge === 'duplicate'"
|
||||
class="shrink-0 rounded-full bg-violet-100 px-1.5 py-0.5 text-[10px] font-medium text-violet-800 dark:bg-violet-900/50 dark:text-violet-100"
|
||||
class="shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium"
|
||||
:class="{
|
||||
'bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-100':
|
||||
item.lifecycle_status === 'pending_review' || item.lifecycle_status === 'reparse_failed',
|
||||
'bg-sky-100 text-sky-800 dark:bg-sky-900/50 dark:text-sky-100':
|
||||
item.lifecycle_status === 'extracting',
|
||||
}"
|
||||
>
|
||||
{{ t('chat.shippingSessionSummary.duplicateBadge') }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="row.badge === 'exception'"
|
||||
class="shrink-0 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-800 dark:bg-amber-900/50 dark:text-amber-100"
|
||||
>
|
||||
{{ t('chat.shippingSessionSummary.exception') }}
|
||||
{{ lifecycleStatusLabel(String(item.lifecycle_status || '')) }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="row.stage" class="mt-1 text-[11px] text-secondary">
|
||||
{{ row.stage }}
|
||||
<div v-if="item.version_replaced" class="mt-1 text-[11px] text-secondary">
|
||||
{{ t('chat.shippingSessionWorkItem.versionReplaced') }}
|
||||
</div>
|
||||
<div v-if="row.message" class="mt-0.5 line-clamp-3 text-[11px] text-muted">
|
||||
{{ row.message }}
|
||||
<div v-if="item.updated_at" class="mt-0.5 text-[11px] text-muted">
|
||||
{{ formatUpdatedLabel(item.updated_at) }}
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-2">
|
||||
<button
|
||||
v-if="row.entrySurface === 'review_workbench'"
|
||||
v-if="itemHasAction(item, 'enter_manual_review') && item.current_run_no"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 text-[11px] font-medium text-brand-700 hover:underline"
|
||||
@click="openEntrySurface(row)"
|
||||
:disabled="actionBusyItemNo === item.item_no"
|
||||
data-testid="shipping-session-action-review"
|
||||
@click="openManualReview(item)"
|
||||
>
|
||||
<ExternalLink class="h-3 w-3" />
|
||||
{{ t('chat.shippingSessionSummary.openReview') }}
|
||||
{{ t('chat.shippingSessionWorkItem.enterManualReview') }}
|
||||
</button>
|
||||
<button
|
||||
v-else-if="row.entrySurface === 'task_workbench' && row.taskNo"
|
||||
v-if="itemHasAction(item, 'request_reparse') && item.current_case_no"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 text-[11px] font-medium text-brand-700 hover:underline disabled:opacity-50"
|
||||
:disabled="actionBusyItemNo === item.item_no"
|
||||
data-testid="shipping-session-action-reparse"
|
||||
@click="reparseFromPanel(item)"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.requestReparse') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="itemHasAction(item, 'mark_non_order') && item.current_case_no"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 text-[11px] font-medium text-brand-700 hover:underline disabled:opacity-50"
|
||||
:disabled="actionBusyItemNo === item.item_no"
|
||||
data-testid="shipping-session-action-non-order"
|
||||
@click="markNonOrderFromPanel(item)"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.markNonOrder') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="itemHasAction(item, 'replace_file') && item.current_run_no"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 text-[11px] font-medium text-brand-700 hover:underline disabled:opacity-50"
|
||||
:disabled="actionBusyItemNo === item.item_no"
|
||||
data-testid="shipping-session-action-replace"
|
||||
@click="replaceFileFromPanel(item)"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.replaceFile') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="itemHasAction(item, 'cancel')"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 text-[11px] font-medium text-rose-700 hover:underline disabled:opacity-50"
|
||||
:disabled="actionBusyItemNo === item.item_no"
|
||||
data-testid="shipping-session-action-cancel"
|
||||
@click="cancelWorkItem(item)"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.cancelProcessing') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="itemHasAction(item, 'view_version_history')"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 text-[11px] font-medium text-brand-700 hover:underline"
|
||||
@click="openTaskWorkbench(row.taskNo)"
|
||||
data-testid="shipping-session-action-versions"
|
||||
@click="openVersionHistory(item)"
|
||||
>
|
||||
<ExternalLink class="h-3 w-3" />
|
||||
{{ row.kind === 'document'
|
||||
? t('chat.shippingSessionSummary.openExistingTask')
|
||||
: t('chat.shippingSessionSummary.openTask') }}
|
||||
{{ t('chat.shippingSessionWorkItem.viewVersionHistory') }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="versionHistoryItemNo === item.item_no"
|
||||
class="mt-2 rounded-md border border-default bg-surface-muted/40 p-2"
|
||||
data-testid="shipping-session-version-history"
|
||||
>
|
||||
<div class="text-[11px] font-medium text-secondary">
|
||||
{{ t('chat.shippingSessionWorkItem.versionHistoryTitle') }}
|
||||
</div>
|
||||
<div v-if="versionHistoryLoading" class="mt-1 text-[11px] text-muted">
|
||||
{{ t('chat.shippingSessionWorkItem.loading') }}
|
||||
</div>
|
||||
<ul v-else-if="versionHistoryItems.length" class="mt-1 space-y-1">
|
||||
<li
|
||||
v-for="version in versionHistoryItems"
|
||||
:key="version.case_no"
|
||||
class="text-[11px] text-primary"
|
||||
>
|
||||
{{ version.version_label || version.case_no }}
|
||||
<span v-if="version.is_current" class="ml-1 text-brand-700">
|
||||
({{ t('chat.shippingSessionWorkItem.currentVersion') }})
|
||||
</span>
|
||||
<span v-else-if="version.is_readonly" class="ml-1 text-muted">
|
||||
({{ t('chat.shippingSessionWorkItem.readonlyVersion') }})
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-else class="mt-1 text-[11px] text-muted">
|
||||
{{ t('chat.shippingSessionWorkItem.noVersions') }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div
|
||||
v-if="closedItems.length"
|
||||
class="mt-3"
|
||||
data-testid="shipping-session-closed-section"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full items-center justify-between gap-2 rounded-md border border-default bg-surface-muted/50 px-2 py-1.5 text-left text-[11px] font-medium text-secondary hover:bg-surface"
|
||||
@click="closedExpanded = !closedExpanded"
|
||||
>
|
||||
<span>{{ t('chat.shippingSessionWorkItem.completedCollapsed', { count: closedItems.length }) }}</span>
|
||||
<ChevronDown v-if="closedExpanded" class="h-3.5 w-3.5 shrink-0" />
|
||||
<ChevronRight v-else class="h-3.5 w-3.5 shrink-0" />
|
||||
</button>
|
||||
<ul v-if="closedExpanded" class="mt-2 space-y-2">
|
||||
<li
|
||||
v-for="item in closedItems"
|
||||
:key="`closed:${item.item_no}`"
|
||||
class="rounded-lg border border-default bg-surface-soft/60 px-2.5 py-2 opacity-80"
|
||||
>
|
||||
<div class="truncate text-xs font-semibold text-primary">
|
||||
{{ item.current_document_filename || t('chat.shippingSessionSummary.unnamedPdf') }}
|
||||
</div>
|
||||
<div class="mt-0.5 text-[11px] text-muted">
|
||||
{{ t('chat.shippingSessionWorkItem.versionLabel', { version: item.current_version_no }) }}
|
||||
<span v-if="item.closed_reason" class="ml-1">
|
||||
· {{ closedReasonLabel(item.closed_reason) }}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
@@ -126,6 +126,8 @@ const showActions = computed(() => (
|
||||
));
|
||||
const shippingOrderExtractionState = computed(() => message.shipping_order_extraction_state);
|
||||
const retryingOrderExtraction = ref(false);
|
||||
const refreshingOrderExtraction = ref(false);
|
||||
const cancellingOrderExtraction = ref(false);
|
||||
const shippingOrderExtractionRunNo = computed(() => {
|
||||
const payload = message.payload && typeof message.payload === 'object'
|
||||
? message.payload as Record<string, unknown>
|
||||
@@ -142,6 +144,26 @@ const retryShippingOrderExtraction = async () => {
|
||||
retryingOrderExtraction.value = false;
|
||||
}
|
||||
};
|
||||
/** 只读刷新 Run 投影,不改变后台业务状态。 */
|
||||
const refreshShippingOrderExtraction = async () => {
|
||||
if (!shippingOrderExtractionRunNo.value || refreshingOrderExtraction.value) return;
|
||||
refreshingOrderExtraction.value = true;
|
||||
try {
|
||||
await shippingHandlers.refreshOrderExtractionRun(shippingOrderExtractionRunNo.value);
|
||||
} finally {
|
||||
refreshingOrderExtraction.value = false;
|
||||
}
|
||||
};
|
||||
/** 请求取消整批;确认后走请求语义,不伪造即时终态。 */
|
||||
const cancelShippingOrderExtraction = async (reason?: string) => {
|
||||
if (!shippingOrderExtractionRunNo.value || cancellingOrderExtraction.value) return;
|
||||
cancellingOrderExtraction.value = true;
|
||||
try {
|
||||
await shippingHandlers.cancelOrderExtractionRun(shippingOrderExtractionRunNo.value, reason || null);
|
||||
} finally {
|
||||
cancellingOrderExtraction.value = false;
|
||||
}
|
||||
};
|
||||
const isLastMessage = computed(() => index === messageCount - 1 || (message.role === 'assistant' && isLatestAssistantMessage));
|
||||
const isCopied = computed(() => copiedIndex === index);
|
||||
const renderedMarkdown = computed(() => (
|
||||
@@ -668,7 +690,12 @@ function handleInlineDownload(file: InlineDownloadFile): void {
|
||||
v-if="shippingOrderExtractionState"
|
||||
:state="shippingOrderExtractionState"
|
||||
:run-no="shippingOrderExtractionRunNo"
|
||||
:retrying="retryingOrderExtraction"
|
||||
:refreshing="refreshingOrderExtraction"
|
||||
:cancelling="cancellingOrderExtraction"
|
||||
@retry="retryShippingOrderExtraction"
|
||||
@refresh="refreshShippingOrderExtraction"
|
||||
@cancel="cancelShippingOrderExtraction"
|
||||
/>
|
||||
<LeaveMessageBlock
|
||||
v-if="isLeaveMessage"
|
||||
|
||||
@@ -16,6 +16,9 @@ export interface ShippingMessageHandlers {
|
||||
addLine: (msg: ChatMessage, line: Partial<ShippingNoticeLine>) => Promise<boolean>;
|
||||
removeLine: (msg: ChatMessage, lineIndex: number) => Promise<boolean>;
|
||||
retryOrderExtractionRun: (runNo: string) => Promise<boolean>;
|
||||
refreshOrderExtractionRun: (runNo: string) => Promise<boolean>;
|
||||
cancelOrderExtractionRun: (runNo: string, reason?: string | null) => Promise<boolean>;
|
||||
cancelOrderExtractionUnit: (runNo: string, documentId: number, reason?: string | null) => Promise<boolean>;
|
||||
reparseOrderExtractionRun: (runNo: string, reason: 'rule_updated' | 'field_mapping_error' | 'document_quality' | 'other') => Promise<boolean>;
|
||||
resolveCandidateDuplicate: (candidateNo: string, action: import('../../types/shipping.types').ShippingDuplicateAction, targetTaskNo: string | undefined, reason: string | undefined, done: (success: boolean) => void) => Promise<void>;
|
||||
promoteCandidate: (candidateNo: string, done: (success: boolean) => void) => Promise<void>;
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
<!--
|
||||
features/chat/components/shipping-review/ReviewActionConfirmDialog.vue
|
||||
用途:复核页破坏性/不可逆操作的二次确认弹窗(确认建单、重识别、非订单、质量异常、替代 PDF)。
|
||||
依赖:vue-i18n、dialog-overlay / dialog-panel 设计系统样式。
|
||||
逻辑:ShippingOrderReviewView 以 v-model 控制显隐;质量异常须选原因码,other 时备注必填;
|
||||
非订单/重识别将说明写入 comment,并附带稳定 reasonCode。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
export type ReviewConfirmAction = 'confirm' | 'reparse' | 'non_order' | 'replace' | 'quality_issue';
|
||||
|
||||
/** 确认弹窗提交载荷:稳定原因码 + 自由说明,供后端审计复盘。 */
|
||||
export type ReviewConfirmPayload = {
|
||||
reasonCode: string;
|
||||
comment: string;
|
||||
};
|
||||
|
||||
const QUALITY_REASON_CODES = [
|
||||
'blurred',
|
||||
'incomplete_pages',
|
||||
'password_protected',
|
||||
'corrupted',
|
||||
'wrong_orientation',
|
||||
'unsupported_layout',
|
||||
'missing_order_table',
|
||||
'other',
|
||||
] as const;
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
action: ReviewConfirmAction;
|
||||
confirmLoading?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
confirmLoading: false,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'confirm', payload: ReviewConfirmPayload): void;
|
||||
(e: 'cancel'): void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const reasonCode = ref('other');
|
||||
const comment = ref('');
|
||||
const reasonMissing = ref(false);
|
||||
const commentMissing = ref(false);
|
||||
|
||||
/** 非订单 / 重识别 / 质量异常需要说明或原因选择。 */
|
||||
const needsDispositionInput = computed(
|
||||
() => props.action === 'non_order' || props.action === 'reparse' || props.action === 'quality_issue',
|
||||
);
|
||||
|
||||
const title = computed(() => t(`chat.shippingOrderReview.confirmDialog.${props.action}.title`));
|
||||
const impact = computed(() => t(`chat.shippingOrderReview.confirmDialog.${props.action}.impact`));
|
||||
const confirmText = computed(() => t(`chat.shippingOrderReview.confirmDialog.${props.action}.confirm`));
|
||||
const confirmTone = computed(() => (props.action === 'confirm' ? 'primary' : 'danger'));
|
||||
const confirmButtonClass = computed(() =>
|
||||
confirmTone.value === 'primary' ? 'btn-primary btn-sm' : 'btn-danger btn-sm',
|
||||
);
|
||||
|
||||
/**
|
||||
* 质量异常原因码的展示文案。
|
||||
* @param code - 后端允许的 quality reason 码
|
||||
*/
|
||||
const qualityReasonLabel = (code: string) =>
|
||||
t(`chat.shippingOrderReview.confirmDialog.qualityReasons.${code}`);
|
||||
|
||||
/** 关闭弹窗并同步 v-model。 */
|
||||
const closeDialog = () => {
|
||||
emit('update:modelValue', false);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('cancel');
|
||||
closeDialog();
|
||||
};
|
||||
|
||||
/**
|
||||
* 按 action 组装原因码与备注后触发确认。
|
||||
* 核心逻辑:质量异常 `other` 强制备注;非订单/重识别使用稳定 reasonCode + 自由 comment。
|
||||
*/
|
||||
const handleConfirm = () => {
|
||||
reasonMissing.value = false;
|
||||
commentMissing.value = false;
|
||||
const trimmedComment = comment.value.trim();
|
||||
|
||||
if (props.action === 'quality_issue') {
|
||||
if (!reasonCode.value) {
|
||||
reasonMissing.value = true;
|
||||
return;
|
||||
}
|
||||
if (reasonCode.value === 'other' && !trimmedComment) {
|
||||
commentMissing.value = true;
|
||||
return;
|
||||
}
|
||||
emit('confirm', { reasonCode: reasonCode.value, comment: trimmedComment });
|
||||
closeDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
if (props.action === 'non_order' || props.action === 'reparse') {
|
||||
if (!trimmedComment) {
|
||||
commentMissing.value = true;
|
||||
return;
|
||||
}
|
||||
const code = props.action === 'non_order' ? 'non_order' : 'document_quality';
|
||||
emit('confirm', { reasonCode: code, comment: trimmedComment });
|
||||
closeDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
emit('confirm', { reasonCode: '', comment: '' });
|
||||
closeDialog();
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(open) => {
|
||||
if (!open) {
|
||||
reasonCode.value = 'other';
|
||||
comment.value = '';
|
||||
reasonMissing.value = false;
|
||||
commentMissing.value = false;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const onKeydown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape' && props.modelValue) handleCancel();
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(open) => {
|
||||
if (typeof document === 'undefined') return;
|
||||
if (open) document.addEventListener('keydown', onKeydown);
|
||||
else document.removeEventListener('keydown', onKeydown);
|
||||
},
|
||||
);
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (typeof document !== 'undefined') document.removeEventListener('keydown', onKeydown);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="modelValue"
|
||||
class="dialog-overlay z-50 flex items-center justify-center p-4"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
:aria-label="title"
|
||||
data-testid="review-action-confirm-dialog"
|
||||
@click.self="handleCancel"
|
||||
>
|
||||
<div class="dialog-panel w-full max-w-md space-y-4 p-5">
|
||||
<header>
|
||||
<h2 class="text-base font-semibold text-primary">{{ title }}</h2>
|
||||
<p class="mt-2 text-sm text-secondary">{{ impact }}</p>
|
||||
</header>
|
||||
|
||||
<template v-if="needsDispositionInput">
|
||||
<label v-if="action === 'quality_issue'" class="block space-y-1 text-sm">
|
||||
<span class="text-secondary">{{ t('chat.shippingOrderReview.confirmDialog.reasonCodeLabel') }}</span>
|
||||
<select
|
||||
v-model="reasonCode"
|
||||
class="select-field w-full text-sm"
|
||||
data-testid="review-action-reason-code"
|
||||
@change="reasonMissing = false"
|
||||
>
|
||||
<option v-for="code in QUALITY_REASON_CODES" :key="code" :value="code">
|
||||
{{ qualityReasonLabel(code) }}
|
||||
</option>
|
||||
</select>
|
||||
<p v-if="reasonMissing" class="text-xs text-rose-600 dark:text-rose-400">
|
||||
{{ t('chat.shippingOrderReview.confirmDialog.reasonCodeRequired') }}
|
||||
</p>
|
||||
</label>
|
||||
|
||||
<label class="block space-y-1 text-sm">
|
||||
<span class="text-secondary">{{ t('chat.shippingOrderReview.confirmDialog.reasonLabel') }}</span>
|
||||
<textarea
|
||||
v-model="comment"
|
||||
rows="3"
|
||||
class="input-field w-full resize-y text-sm"
|
||||
:placeholder="t('chat.shippingOrderReview.confirmDialog.reasonPlaceholder')"
|
||||
data-testid="review-action-reason"
|
||||
@input="commentMissing = false"
|
||||
/>
|
||||
<p v-if="commentMissing" class="text-xs text-rose-600 dark:text-rose-400">
|
||||
{{ t('chat.shippingOrderReview.confirmDialog.reasonRequired') }}
|
||||
</p>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<footer class="flex justify-end gap-2 pt-1">
|
||||
<button type="button" class="btn-secondary btn-sm" :disabled="confirmLoading" @click="handleCancel">
|
||||
{{ t('common.deleteDialog.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
:class="confirmButtonClass"
|
||||
:disabled="confirmLoading"
|
||||
data-testid="review-action-confirm-submit"
|
||||
@click="handleConfirm"
|
||||
>
|
||||
{{ confirmLoading ? t('chat.shippingOrderReview.saving') : confirmText }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@
|
||||
逻辑:预览失败独立显示,不影响同页草稿编辑;缺少可靠 bbox 时只保留页码定位。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import * as pdfjs from 'pdfjs-dist';
|
||||
import workerUrl from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
|
||||
import type { ShippingOrderReviewEvidence } from '../../types/shipping.api.types';
|
||||
@@ -21,6 +21,8 @@ const props = defineProps<{
|
||||
const canvas = ref<HTMLCanvasElement | null>(null);
|
||||
const loading = ref(false);
|
||||
const failed = ref(false);
|
||||
const scale = ref(1.5);
|
||||
const zoomLabel = computed(() => `${Math.round(scale.value * 100)}%`);
|
||||
|
||||
/** 将当前页渲染到 canvas;高亮以 PDF viewport 为基准,绝不猜测不可靠坐标。 */
|
||||
const render = async () => {
|
||||
@@ -31,7 +33,7 @@ const render = async () => {
|
||||
const document = await pdfjs.getDocument(props.src).promise;
|
||||
const pageNo = Math.min(Math.max(props.evidence?.page_no || 1, 1), document.numPages);
|
||||
const page = await document.getPage(pageNo);
|
||||
const viewport = page.getViewport({ scale: 1.4 });
|
||||
const viewport = page.getViewport({ scale: scale.value });
|
||||
await nextTick();
|
||||
if (!canvas.value) return;
|
||||
canvas.value.width = Math.ceil(viewport.width);
|
||||
@@ -60,14 +62,25 @@ const render = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
watch(() => [props.src, props.evidence?.evidence_id], () => { void render(); }, { immediate: true });
|
||||
const zoomIn = () => { scale.value = Math.min(scale.value + 0.25, 3); };
|
||||
const zoomOut = () => { scale.value = Math.max(scale.value - 0.25, 0.75); };
|
||||
const fitWidth = () => { scale.value = 1.75; };
|
||||
|
||||
watch(() => [props.src, props.evidence?.evidence_id, scale.value], () => { void render(); }, { immediate: true });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="relative flex min-h-[360px] items-center justify-center overflow-auto bg-slate-100 p-3 dark:bg-slate-950">
|
||||
<div class="relative flex min-h-[180px] flex-1 flex-col overflow-hidden bg-slate-100 xl:min-h-[360px] dark:bg-slate-950">
|
||||
<div class="flex shrink-0 items-center justify-end gap-1 border-b border-slate-200 bg-white/95 px-2 py-1.5 text-xs dark:border-slate-800 dark:bg-slate-900/95">
|
||||
<button type="button" class="rounded border px-2 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" @click="zoomOut">−</button>
|
||||
<button type="button" class="min-w-12 rounded border px-2 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" @click="fitWidth">{{ zoomLabel }}</button>
|
||||
<button type="button" class="rounded border px-2 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" @click="zoomIn">+</button>
|
||||
</div>
|
||||
<div class="relative flex min-h-0 flex-1 items-start justify-center overflow-auto p-4">
|
||||
<!-- Keep the canvas mounted while PDF.js is loading; otherwise nextTick cannot obtain a render target. -->
|
||||
<canvas ref="canvas" :aria-label="title" class="max-w-full bg-white shadow" :class="{ invisible: loading || failed }" />
|
||||
<canvas ref="canvas" :aria-label="title" class="bg-white shadow" :class="{ invisible: loading || failed }" />
|
||||
<span v-if="loading" class="absolute text-sm text-slate-500">{{ loadingText }}</span>
|
||||
<span v-else-if="failed" class="absolute text-sm text-rose-600">{{ unavailableText }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,135 @@
|
||||
<!--
|
||||
features/chat/components/shipping-review/ReviewVersionHistoryPanel.vue
|
||||
用途:复核页工作项版本历史时间线;支持只读跳转至历史 Case。
|
||||
依赖:vue-i18n、ShippingSessionWorkItemVersion 类型。
|
||||
逻辑:ShippingOrderReviewView 传入 versions;emit select 供父级切换 case_no。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { ShippingSessionWorkItemVersion } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
const props = defineProps<{
|
||||
itemNo?: string | null;
|
||||
versions: ShippingSessionWorkItemVersion[];
|
||||
loading?: boolean;
|
||||
activeCaseNo?: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'select', caseNo: string, readonly: boolean): void;
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
|
||||
/**
|
||||
* 解析 Case 状态为结果文案。
|
||||
*/
|
||||
function resultLabel(status?: string | null): string {
|
||||
const normalized = String(status || '').trim();
|
||||
if (!normalized) return '—';
|
||||
const key = `chat.shippingOrderReview.caseStatuses.${normalized}`;
|
||||
return te(key) ? t(key) : normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化时间戳为本地化短日期时间。
|
||||
*/
|
||||
function formatTime(value?: string | null): string {
|
||||
const date = new Date(String(value || ''));
|
||||
if (Number.isNaN(date.getTime())) return '—';
|
||||
return date.toLocaleString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转至指定版本;历史版本以只读模式打开。
|
||||
*/
|
||||
function selectVersion(version: ShippingSessionWorkItemVersion) {
|
||||
const caseNo = String(version.case_no || '').trim();
|
||||
if (!caseNo) return;
|
||||
emit('select', caseNo, Boolean(version.is_readonly));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section
|
||||
class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
data-testid="review-version-history-panel"
|
||||
:aria-label="t('chat.shippingOrderReview.versionHistory.title')"
|
||||
>
|
||||
<header class="mb-3 flex items-center justify-between gap-2">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.versionHistory.title') }}</h2>
|
||||
<p v-if="itemNo" class="mt-0.5 text-xs text-slate-500 dark:text-slate-400">
|
||||
{{ t('chat.shippingOrderReview.versionHistory.itemNo', { itemNo }) }}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="py-4 text-sm text-slate-500">{{ t('chat.shippingSessionWorkItem.loading') }}</div>
|
||||
<p v-else-if="!versions.length" class="py-4 text-sm text-slate-500">
|
||||
{{ t('chat.shippingSessionWorkItem.noVersions') }}
|
||||
</p>
|
||||
|
||||
<ol v-else class="space-y-2">
|
||||
<li
|
||||
v-for="version in versions"
|
||||
:key="version.case_no"
|
||||
class="rounded-lg border p-3 text-sm"
|
||||
:class="activeCaseNo === version.case_no
|
||||
? 'border-sky-500 bg-sky-50 dark:border-sky-700 dark:bg-sky-950/30'
|
||||
: 'border-slate-200 dark:border-slate-700'"
|
||||
:data-testid="`review-version-row-${version.case_no}`"
|
||||
>
|
||||
<div class="flex flex-wrap items-start justify-between gap-2">
|
||||
<div class="min-w-0">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="font-medium">
|
||||
{{ version.version_label || t('chat.shippingSessionWorkItem.versionLabel', { version: '?' }) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="version.is_current"
|
||||
class="rounded-full bg-emerald-100 px-2 py-0.5 text-[11px] text-emerald-800 dark:bg-emerald-950 dark:text-emerald-100"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.currentVersion') }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="version.is_readonly"
|
||||
class="rounded-full bg-slate-100 px-2 py-0.5 text-[11px] text-slate-600 dark:bg-slate-800 dark:text-slate-300"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.readonlyVersion') }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="mt-1 truncate text-xs text-slate-500 dark:text-slate-400">
|
||||
{{ version.document_filename || version.case_no }}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
v-if="activeCaseNo !== version.case_no"
|
||||
type="button"
|
||||
class="shrink-0 rounded border border-slate-200 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
@click="selectVersion(version)"
|
||||
>
|
||||
{{ version.is_readonly
|
||||
? t('chat.shippingOrderReview.versionHistory.viewReadonly')
|
||||
: t('chat.shippingOrderReview.versionHistory.open') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<dl class="mt-2 grid gap-1 text-xs text-slate-600 dark:text-slate-400 sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="inline">{{ t('chat.shippingOrderReview.versionHistory.result') }}:</dt>
|
||||
<dd class="inline">{{ resultLabel(version.case_status) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="inline">{{ t('chat.shippingOrderReview.versionHistory.createdAt') }}:</dt>
|
||||
<dd class="inline">{{ formatTime(version.created_at) }}</dd>
|
||||
</div>
|
||||
<div v-if="version.confirmed_at">
|
||||
<dt class="inline">{{ t('chat.shippingOrderReview.versionHistory.confirmedAt') }}:</dt>
|
||||
<dd class="inline">{{ formatTime(version.confirmed_at) }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
</template>
|
||||
@@ -3,7 +3,7 @@
|
||||
* features/chat/components/shipping/ShippingOrderDocumentResultItem.vue
|
||||
* 用途:渲染单个 PDF 的订单抽取结果摘要,供详情抽屉按文档逐项展示。
|
||||
* 依赖:订单抽取文档 DTO、vue-i18n。
|
||||
* 逻辑:只显示用户可理解的业务字段;人工复核由上层统一跳转独立工作台。
|
||||
* 逻辑:只显示用户可理解的业务字段;reason_code 优先 i18n,缺失时对 SHIPPING_NOTICE.* 回退通用提示;人工复核由上层统一跳转。
|
||||
*/
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -52,11 +52,16 @@ const activityTimeLabel = computed(() => {
|
||||
if (props.document.started_at) return t('chat.shippingOrderExtractionDocumentTiming.started', { time: formatTime(props.document.started_at) });
|
||||
return '';
|
||||
});
|
||||
const reasonLabel = computed(() => (
|
||||
props.document.reason_code
|
||||
? t(`chat.shippingOrderExtractionReason.${props.document.reason_code}`)
|
||||
: ''
|
||||
));
|
||||
const reasonLabel = computed(() => {
|
||||
const code = String(props.document.reason_code || '').trim();
|
||||
if (!code) return '';
|
||||
const key = `chat.shippingOrderExtractionReason.${code}`;
|
||||
if (te(key)) return t(key);
|
||||
if (code.startsWith('SHIPPING_NOTICE.')) {
|
||||
return t('chat.shippingOrderExtractionTechnicalFailureUserHint');
|
||||
}
|
||||
return code;
|
||||
});
|
||||
const emailSupplementLabel = computed(() => {
|
||||
const status = props.document.email_supplement?.status || 'none';
|
||||
const key = `chat.shippingOrderExtractionEmailSupplement.${status}`;
|
||||
|
||||
+139
-14
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* features/chat/components/shipping/ShippingOrderExtractionCard.spec.ts
|
||||
* 用途:覆盖聊天主区一句过程通知卡(无逐 PDF 列表、无复核按钮、无重复统计)。
|
||||
* 用途:覆盖批次进度卡摘要、阶段、健康提醒与刷新/取消/重试动作。
|
||||
* 依赖:Vitest、Vue Test Utils、vue-i18n、本域组件与 DTO 类型。
|
||||
* 逻辑:断言 processNotice 文案与技术失败重试;复核深链由右侧摘要面板承担。
|
||||
* 逻辑:断言过程通知、摘要计数、取消确认与重试;逐 PDF 深链仍由右侧面板承担。
|
||||
*/
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
@@ -29,15 +29,19 @@ const buildState = (patch: Partial<ShippingOrderExtractionState> = {}): Shipping
|
||||
processingDocuments: 1,
|
||||
completedDocuments: 1,
|
||||
reviewRequiredDocuments: 1,
|
||||
failedDocuments: 1,
|
||||
failedDocuments: 0,
|
||||
cancelledDocuments: 0,
|
||||
candidateCount: 2,
|
||||
},
|
||||
currentActivity: {
|
||||
unitId: 12,
|
||||
fileName: 'PO-450003.pdf',
|
||||
eventCode: 'profile_matching',
|
||||
eventCode: 'extracting',
|
||||
userVisibleStage: 'extracting',
|
||||
elapsedSeconds: 75,
|
||||
},
|
||||
availableActions: [],
|
||||
availableActions: ['refresh_status', 'cancel_run'],
|
||||
healthTips: [{ code: 'processing_slow', thresholdSeconds: 60, idleOrElapsedSeconds: 90 }],
|
||||
terminal: false,
|
||||
refreshFailed: false,
|
||||
errorCode: null,
|
||||
@@ -47,15 +51,16 @@ const buildState = (patch: Partial<ShippingOrderExtractionState> = {}): Shipping
|
||||
});
|
||||
|
||||
describe('ShippingOrderExtractionCard', () => {
|
||||
it('renders one-line process notice without per-PDF list, review CTA, or count stats', () => {
|
||||
it('renders batch summary, current stage, health tip and action buttons', () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState(), runNo: 'SNER-1' },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
expect(wrapper.text()).toContain('正在处理附件');
|
||||
expect(wrapper.text()).toContain('右侧');
|
||||
expect(wrapper.text()).not.toContain('自动推进');
|
||||
expect(wrapper.text()).not.toContain('进入人工复核');
|
||||
expect(wrapper.text()).toContain('PO-450003.pdf');
|
||||
expect(wrapper.text()).toContain('提取订单字段中');
|
||||
expect(wrapper.text()).toContain('处理时间偏长');
|
||||
expect(wrapper.text()).toContain('刷新状态');
|
||||
expect(wrapper.text()).toContain('取消本次识别');
|
||||
expect(wrapper.findAll('[data-testid="shipping-order-document-result"]').length).toBe(0);
|
||||
});
|
||||
|
||||
@@ -75,6 +80,8 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
openedExistingCount: 2,
|
||||
},
|
||||
availableActions: ['view_details'],
|
||||
healthTips: [],
|
||||
currentActivity: null,
|
||||
}),
|
||||
runNo: 'SNER-DUP',
|
||||
},
|
||||
@@ -85,7 +92,123 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
expect(wrapper.text()).not.toContain('需人工处理');
|
||||
});
|
||||
|
||||
it('emits retry for failed attachments only', async () => {
|
||||
it('does not label generated candidates as manual-review exceptions', () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
state: buildState({
|
||||
status: 'review_required',
|
||||
summary: {
|
||||
totalDocuments: 2,
|
||||
pendingDocuments: 0,
|
||||
processingDocuments: 0,
|
||||
completedDocuments: 2,
|
||||
reviewRequiredDocuments: 0,
|
||||
failedDocuments: 0,
|
||||
candidateCount: 2,
|
||||
},
|
||||
availableActions: ['view_details', 'review_candidate'],
|
||||
primaryNotice: 'candidate_confirmation',
|
||||
handlingItems: [{
|
||||
category: 'candidate_confirmation',
|
||||
count: 2,
|
||||
reasonCodes: [],
|
||||
affectedRefs: [],
|
||||
primaryAction: 'review_candidate',
|
||||
}],
|
||||
healthTips: [],
|
||||
currentActivity: null,
|
||||
}),
|
||||
runNo: 'SNER-CANDIDATES',
|
||||
},
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
stubs: { 'router-link': true },
|
||||
},
|
||||
});
|
||||
// 关键断言:成功候选可待人工确认,但绝不能提示为识别异常。
|
||||
expect(wrapper.text()).toContain('订单候选已生成');
|
||||
expect(wrapper.text()).toContain('候选待人工确认');
|
||||
expect(wrapper.text()).not.toContain('部分附件需人工处理');
|
||||
});
|
||||
|
||||
it('renders mixed handling items with reasons instead of a vague needs-action notice', () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
state: buildState({
|
||||
status: 'partially_completed',
|
||||
summary: {
|
||||
totalDocuments: 3,
|
||||
pendingDocuments: 0,
|
||||
processingDocuments: 0,
|
||||
completedDocuments: 1,
|
||||
reviewRequiredDocuments: 1,
|
||||
failedDocuments: 1,
|
||||
candidateCount: 1,
|
||||
},
|
||||
availableActions: ['enter_manual_review', 'retry_failed_attachments', 'view_details'],
|
||||
primaryNotice: 'technical_failure',
|
||||
handlingItems: [
|
||||
{
|
||||
category: 'technical_failure',
|
||||
count: 1,
|
||||
reasonCodes: ['document_unreadable'],
|
||||
affectedRefs: [],
|
||||
primaryAction: 'retry_failed_attachments',
|
||||
},
|
||||
{
|
||||
category: 'candidate_missing_info',
|
||||
count: 1,
|
||||
reasonCodes: ['required_field_missing'],
|
||||
affectedRefs: [],
|
||||
primaryAction: 'review_candidate',
|
||||
},
|
||||
{
|
||||
category: 'auto_freeze_blocked',
|
||||
count: 1,
|
||||
reasonCodes: ['profile_manual_confirmation_required'],
|
||||
affectedRefs: [{ type: 'task', task_no: 'ST-88', candidate_no: 'C-9' }],
|
||||
primaryAction: 'view_details',
|
||||
},
|
||||
],
|
||||
healthTips: [],
|
||||
currentActivity: null,
|
||||
terminal: true,
|
||||
}),
|
||||
runNo: 'SNER-MIXED',
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
expect(wrapper.text()).toContain('部分附件处理失败');
|
||||
expect(wrapper.text()).toContain('订单待补信息');
|
||||
expect(wrapper.text()).toContain('自动冻结受阻');
|
||||
expect(wrapper.text()).toContain('文件损坏、加密或无法读取');
|
||||
expect(wrapper.text()).toContain('影响对象:');
|
||||
expect(wrapper.text()).toContain('ST-88');
|
||||
expect(wrapper.findAll('[data-testid="shipping-order-extraction-handling-item"]').length).toBe(3);
|
||||
});
|
||||
|
||||
it('emits cancel after confirmation', async () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
state: buildState({
|
||||
availableActions: ['cancel_run', 'refresh_status'],
|
||||
}),
|
||||
runNo: 'SNER-1',
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
const cancelBtn = wrapper.findAll('button').find((b) => b.text().includes('取消本次识别'));
|
||||
expect(cancelBtn).toBeTruthy();
|
||||
await cancelBtn!.trigger('click');
|
||||
expect(wrapper.text()).toContain('确认取消本次识别');
|
||||
const textarea = wrapper.find('textarea');
|
||||
await textarea.setValue('不再需要识别');
|
||||
const confirmBtn = wrapper.findAll('button').find((b) => b.text() === '取消本次识别');
|
||||
await confirmBtn!.trigger('click');
|
||||
expect(wrapper.emitted('cancel')?.[0]).toEqual(['不再需要识别']);
|
||||
});
|
||||
|
||||
it('emits retry for failed attachments', async () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
state: buildState({
|
||||
@@ -99,12 +222,14 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
failedDocuments: 1,
|
||||
candidateCount: 0,
|
||||
},
|
||||
healthTips: [],
|
||||
}),
|
||||
runNo: 'SNER-2',
|
||||
runNo: 'SNER-1',
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await wrapper.get('button').trigger('click');
|
||||
expect(wrapper.emitted('retry')).toBeTruthy();
|
||||
const retryBtn = wrapper.findAll('button').find((b) => b.text().includes('重试失败附件'));
|
||||
await retryBtn!.trigger('click');
|
||||
expect(wrapper.emitted('retry')?.length).toBe(1);
|
||||
});
|
||||
});
|
||||
@@ -1,30 +1,55 @@
|
||||
/**
|
||||
* features/chat/components/shipping/ShippingOrderExtractionCard.vue
|
||||
* 用途:聊天主区一句过程通知——不重复右侧统计,无逐 PDF 列表、无复核按钮。
|
||||
* 依赖:订单抽取 Run 状态卡 DTO、vue-i18n。
|
||||
* 逻辑:右侧 ShippingSessionSummaryPanel 为唯一状态与跳转面;纯 open_existing 时用重复关联文案。
|
||||
* 用途:聊天主区批次进度卡——摘要计数、Run 级处理事项、当前文件阶段、健康提醒与动作。
|
||||
* 依赖:订单抽取 Run 状态卡 DTO、orderExtractionProgressDisplay、vue-router、vue-i18n。
|
||||
* 逻辑:事实一律来自后端 handling_items / primary_notice;右侧 ShippingSessionSummaryPanel 承接逐 PDF 明细。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { CircleCheck, CircleX, LoaderCircle, TriangleAlert } from 'lucide-vue-next';
|
||||
import type { ShippingOrderExtractionState } from '../../types/chat.types';
|
||||
import type {
|
||||
ShippingOrderExtractionHandlingItemState,
|
||||
ShippingOrderExtractionState,
|
||||
} from '../../types/chat.types';
|
||||
import {
|
||||
formatOrderExtractionElapsed,
|
||||
resolveOrderExtractionUserStageKey,
|
||||
} from '../../shipping/orderExtractionProgressDisplay';
|
||||
import {
|
||||
listDisplayableHandlingAffectedRefs,
|
||||
type ShippingHandlingAffectedRef,
|
||||
type ShippingHandlingRefTarget,
|
||||
} from '../../shipping/orderExtractionHandlingRefs';
|
||||
|
||||
const props = defineProps<{
|
||||
state: ShippingOrderExtractionState;
|
||||
runNo?: string;
|
||||
retrying?: boolean;
|
||||
refreshing?: boolean;
|
||||
cancelling?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
retry: [];
|
||||
refresh: [];
|
||||
cancel: [reason?: string];
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const confirmCancelOpen = ref(false);
|
||||
const cancelReason = ref('');
|
||||
|
||||
const handlingItems = computed(() => props.state.handlingItems || []);
|
||||
|
||||
/**
|
||||
* 是否为「仅重复关联已有任务、无需人工复核」终态通知。
|
||||
*/
|
||||
const isDuplicateOnlyNotice = computed(() => {
|
||||
if (handlingItems.value.length > 0) return false;
|
||||
const opened = Math.max(0, Number(props.state.summary.openedExistingCount || 0));
|
||||
if (opened <= 0) return false;
|
||||
const review = Math.max(0, Number(props.state.summary.reviewRequiredDocuments || 0));
|
||||
@@ -32,10 +57,25 @@ const isDuplicateOnlyNotice = computed(() => {
|
||||
return review === 0 && failed === 0;
|
||||
});
|
||||
|
||||
/**
|
||||
* 是否为纯候选确认场景;优先信任后端 primary_notice,避免用摘要计数掩盖混合原因。
|
||||
*/
|
||||
const isCandidateConfirmationNotice = computed(() => (
|
||||
props.state.primaryNotice === 'candidate_confirmation'
|
||||
|| (
|
||||
!props.state.primaryNotice
|
||||
&& handlingItems.value.length === 1
|
||||
&& handlingItems.value[0]?.category === 'candidate_confirmation'
|
||||
)
|
||||
));
|
||||
|
||||
const toneClass = computed(() => {
|
||||
if (isDuplicateOnlyNotice.value) {
|
||||
return 'border-violet-200 bg-violet-50/80 text-violet-950 dark:border-violet-800 dark:bg-violet-950/35 dark:text-violet-100';
|
||||
}
|
||||
if (isCandidateConfirmationNotice.value) {
|
||||
return 'border-teal-200 bg-teal-50/80 text-teal-950 dark:border-teal-800 dark:bg-teal-950/35 dark:text-teal-100';
|
||||
}
|
||||
switch (props.state.status) {
|
||||
case 'completed':
|
||||
return 'border-emerald-200 bg-emerald-50/80 text-emerald-950 dark:border-emerald-800 dark:bg-emerald-950/35 dark:text-emerald-100';
|
||||
@@ -50,13 +90,42 @@ const toneClass = computed(() => {
|
||||
}
|
||||
});
|
||||
|
||||
const stageLabel = computed(() => {
|
||||
const key = resolveOrderExtractionUserStageKey(
|
||||
props.state.currentActivity?.userVisibleStage || props.state.userVisibleStage,
|
||||
props.state.currentActivity?.eventCode || props.state.status,
|
||||
);
|
||||
return te(key) ? t(key) : '';
|
||||
});
|
||||
|
||||
const elapsedLabel = computed(() =>
|
||||
formatOrderExtractionElapsed(props.state.currentActivity?.elapsedSeconds),
|
||||
);
|
||||
|
||||
/**
|
||||
* 一句过程通知;纯重复关联不误报「需人工处理」。
|
||||
* 将处理事项类别映射为一句过程通知文案。
|
||||
* @param category - 后端 primary_notice / handling item category
|
||||
*/
|
||||
function noticeForCategory(category: string): string {
|
||||
const key = `chat.shippingOrderExtractionHandling.primaryNotice.${category}`;
|
||||
return te(key) ? t(key) : t('chat.shippingSessionSummary.processNoticeNeedsAction');
|
||||
}
|
||||
|
||||
/**
|
||||
* 一句过程通知;有 handling_items 时以后端类别为准,不再笼统写「需人工处理」。
|
||||
*/
|
||||
const compactLine = computed(() => {
|
||||
if (props.state.cancellation?.requested && !props.state.cancellation?.completedAt && !props.state.terminal) {
|
||||
return t('chat.shippingOrderExtractionUserStage.cancellation_requested');
|
||||
}
|
||||
if (isDuplicateOnlyNotice.value) {
|
||||
return t('chat.shippingSessionSummary.processNoticeDuplicateLinked');
|
||||
}
|
||||
const notice = String(props.state.primaryNotice || '').trim();
|
||||
if (notice) return noticeForCategory(notice);
|
||||
if (handlingItems.value[0]?.category) {
|
||||
return noticeForCategory(handlingItems.value[0].category);
|
||||
}
|
||||
switch (props.state.status) {
|
||||
case 'completed':
|
||||
return t('chat.shippingSessionSummary.processNoticeCompleted');
|
||||
@@ -66,8 +135,23 @@ const compactLine = computed(() => {
|
||||
case 'failed':
|
||||
case 'cancelled':
|
||||
return t('chat.shippingSessionSummary.processNoticeFailed');
|
||||
default:
|
||||
default: {
|
||||
if (props.state.status === 'queued' || props.state.status === 'processing') {
|
||||
const parts: string[] = [];
|
||||
const fileName = String(props.state.currentActivity?.fileName || '').trim();
|
||||
if (fileName) {
|
||||
parts.push(t('chat.shippingOrderExtractionCurrentFile', {
|
||||
fileName: fileName || t('chat.shippingOrderExtractionUnknownDocument'),
|
||||
}));
|
||||
}
|
||||
const stage = stageLabel.value;
|
||||
if (stage) parts.push(stage);
|
||||
const elapsed = elapsedLabel.value;
|
||||
if (elapsed) parts.push(t('chat.shippingOrderExtractionElapsed', { elapsed }));
|
||||
if (parts.length) return parts.join(' · ');
|
||||
}
|
||||
return t('chat.shippingSessionSummary.processNoticeProcessing');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -81,6 +165,133 @@ const showRetry = computed(() => (
|
||||
props.state.availableActions.includes('retry_failed_attachments')
|
||||
|| props.state.summary.failedDocuments > 0
|
||||
));
|
||||
const showRefresh = computed(() => props.state.availableActions.includes('refresh_status'));
|
||||
const showCancel = computed(() => (
|
||||
props.state.availableActions.includes('cancel_run')
|
||||
&& !(props.state.cancellation?.requested && !props.state.cancellation?.completedAt)
|
||||
));
|
||||
const healthTips = computed(() => props.state.healthTips || []);
|
||||
|
||||
/**
|
||||
* 解析处理事项标题。
|
||||
* @param item - 后端 handling item
|
||||
*/
|
||||
function handlingTitle(item: ShippingOrderExtractionHandlingItemState): string {
|
||||
const key = `chat.shippingOrderExtractionHandling.category.${item.category}`;
|
||||
return te(key) ? t(key) : item.category;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析原因码文案;未知码回退为原文。
|
||||
* @param code - 原因码
|
||||
*/
|
||||
function reasonLabel(code: string): string {
|
||||
const key = `chat.shippingOrderExtractionReason.${code}`;
|
||||
if (te(key)) return t(key);
|
||||
const freezeKey = `chat.shippingOrderExtractionHandling.reason.${code}`;
|
||||
return te(freezeKey) ? t(freezeKey) : code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开订单复核工作台(Chat order-review 模式)。
|
||||
* @param options.documentId - 可选,定位到具体 PDF(由右侧 case 映射承接时仍打开 Run 复核)
|
||||
* @param options.candidateNo - 可选,写入 query 供复核页筛选
|
||||
*/
|
||||
async function openOrderReview(options?: { documentId?: number; candidateNo?: string }) {
|
||||
const runNo = String(props.runNo || '').trim();
|
||||
if (!runNo) return;
|
||||
const query: Record<string, string> = {
|
||||
...Object.fromEntries(
|
||||
Object.entries(route.query).filter(([, v]) => typeof v === 'string') as Array<[string, string]>,
|
||||
),
|
||||
mode: 'order-review',
|
||||
run_no: runNo,
|
||||
};
|
||||
const candidateNo = String(options?.candidateNo || '').trim();
|
||||
if (candidateNo) query.candidate = candidateNo;
|
||||
const documentId = Number(options?.documentId || 0);
|
||||
if (documentId > 0) query.document_id = String(documentId);
|
||||
await router.push({
|
||||
name: 'Chat',
|
||||
params: { agentId: String(route.params.agentId || '') },
|
||||
query,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开任务工作台,定位自动冻结受阻等任务号。
|
||||
*/
|
||||
async function openTaskWorkbench(taskNo: string) {
|
||||
const normalized = String(taskNo || '').trim();
|
||||
if (!normalized) return;
|
||||
await router.push({
|
||||
name: 'workspace-shipping-tasks',
|
||||
params: { taskNo: normalized },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 按受影响对象引用跳转到任务或复核入口。
|
||||
*/
|
||||
async function openAffectedRef(target: ShippingHandlingRefTarget) {
|
||||
if (target.kind === 'task') {
|
||||
await openTaskWorkbench(target.taskNo);
|
||||
return;
|
||||
}
|
||||
if (target.kind === 'review') {
|
||||
await openOrderReview({
|
||||
documentId: target.documentId,
|
||||
candidateNo: target.candidateNo,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出事项下可展示的受影响对象。
|
||||
*/
|
||||
function affectedRows(item: ShippingOrderExtractionHandlingItemState) {
|
||||
return listDisplayableHandlingAffectedRefs(item.affectedRefs as ShippingHandlingAffectedRef[]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按处理事项主动作跳转或触发重试;优先跳到首个受影响对象。
|
||||
* @param item - 处理事项
|
||||
*/
|
||||
async function handleHandlingAction(item: ShippingOrderExtractionHandlingItemState) {
|
||||
const action = String(item.primaryAction || '').trim();
|
||||
if (action === 'retry_failed_attachments') {
|
||||
emit('retry');
|
||||
return;
|
||||
}
|
||||
const first = affectedRows(item)[0];
|
||||
if (first && first.target.kind !== 'none') {
|
||||
await openAffectedRef(first.target);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
action === 'enter_manual_review'
|
||||
|| action === 'review_candidate'
|
||||
|| action === 'view_details'
|
||||
) {
|
||||
await openOrderReview();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认后发出取消事件;取消是请求语义,由后端检查点生效。
|
||||
*/
|
||||
function confirmCancel() {
|
||||
confirmCancelOpen.value = false;
|
||||
const reason = String(cancelReason.value || '').trim();
|
||||
cancelReason.value = '';
|
||||
emit('cancel', reason || undefined);
|
||||
}
|
||||
|
||||
/** 打开取消确认并清空上次填写的原因。 */
|
||||
function openCancelConfirm() {
|
||||
cancelReason.value = '';
|
||||
confirmCancelOpen.value = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -95,7 +306,7 @@ const showRetry = computed(() => (
|
||||
class="mt-0.5 h-4 w-4 shrink-0 animate-spin"
|
||||
/>
|
||||
<CircleCheck
|
||||
v-else-if="state.status === 'completed' || isDuplicateOnlyNotice"
|
||||
v-else-if="state.status === 'completed' || isDuplicateOnlyNotice || isCandidateConfirmationNotice"
|
||||
class="mt-0.5 h-4 w-4 shrink-0"
|
||||
/>
|
||||
<TriangleAlert
|
||||
@@ -106,23 +317,175 @@ const showRetry = computed(() => (
|
||||
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-sm font-medium">{{ compactLine }}</div>
|
||||
|
||||
<div
|
||||
v-if="state.summary.totalDocuments > 0"
|
||||
class="mt-1.5 flex flex-wrap gap-1.5 text-[11px] opacity-90"
|
||||
data-testid="shipping-order-extraction-summary"
|
||||
>
|
||||
<span>{{ t('chat.shippingOrderExtractionSummary.total', { count: state.summary.totalDocuments }) }}</span>
|
||||
<span v-if="state.summary.processingDocuments > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.processing', { count: state.summary.processingDocuments }) }}
|
||||
</span>
|
||||
<span v-if="state.summary.pendingDocuments > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.pending', { count: state.summary.pendingDocuments }) }}
|
||||
</span>
|
||||
<span v-if="state.summary.completedDocuments > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.completed', { count: state.summary.completedDocuments }) }}
|
||||
</span>
|
||||
<span v-if="state.summary.reviewRequiredDocuments > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.reviewRequired', { count: state.summary.reviewRequiredDocuments }) }}
|
||||
</span>
|
||||
<span v-if="state.summary.failedDocuments > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.failed', { count: state.summary.failedDocuments }) }}
|
||||
</span>
|
||||
<span v-if="(state.summary.cancelledDocuments || 0) > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.cancelled', { count: state.summary.cancelledDocuments }) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="handlingItems.length"
|
||||
class="mt-2 space-y-1.5"
|
||||
data-testid="shipping-order-extraction-handling-items"
|
||||
>
|
||||
<div class="text-[11px] font-medium opacity-90">
|
||||
{{ t('chat.shippingOrderExtractionHandling.title') }}
|
||||
</div>
|
||||
<div
|
||||
v-for="item in handlingItems"
|
||||
:key="item.category"
|
||||
class="rounded-md border border-current/15 bg-black/5 px-2 py-1.5 text-xs dark:bg-white/5"
|
||||
data-testid="shipping-order-extraction-handling-item"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<div class="min-w-0 font-medium">
|
||||
{{ handlingTitle(item) }}
|
||||
<span class="ml-1 opacity-80">{{ t('chat.shippingOrderExtractionHandling.count', { count: item.count }) }}</span>
|
||||
</div>
|
||||
<button
|
||||
v-if="item.primaryAction"
|
||||
type="button"
|
||||
class="shrink-0 rounded-md border border-current/20 px-2 py-0.5 text-[11px] font-medium hover:bg-black/5 dark:hover:bg-white/5"
|
||||
@click="handleHandlingAction(item)"
|
||||
>
|
||||
{{ te(`chat.shippingOrderExtractionAction.${item.primaryAction}`)
|
||||
? t(`chat.shippingOrderExtractionAction.${item.primaryAction}`)
|
||||
: t('chat.shippingOrderExtractionAction.view_details') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="item.reasonCodes.length" class="mt-1 opacity-80">
|
||||
{{ t('chat.shippingOrderExtractionHandling.reasonPrefix') }}
|
||||
{{ item.reasonCodes.slice(0, 4).map(reasonLabel).join(';') }}
|
||||
</div>
|
||||
<div
|
||||
v-if="affectedRows(item).length"
|
||||
class="mt-1.5 flex flex-wrap gap-1"
|
||||
data-testid="shipping-order-extraction-affected-refs"
|
||||
>
|
||||
<span class="opacity-80">{{ t('chat.shippingOrderExtractionHandling.affectedPrefix') }}</span>
|
||||
<button
|
||||
v-for="row in affectedRows(item)"
|
||||
:key="row.key"
|
||||
type="button"
|
||||
class="rounded border border-current/20 px-1.5 py-0.5 text-[11px] font-medium underline-offset-2 hover:underline"
|
||||
@click="openAffectedRef(row.target)"
|
||||
>
|
||||
{{ row.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="state.currentActivity?.fileName" class="mt-1 text-xs opacity-80">
|
||||
{{ t('chat.shippingOrderExtractionCurrentFile', {
|
||||
fileName: state.currentActivity.fileName || t('chat.shippingOrderExtractionUnknownDocument'),
|
||||
}) }}
|
||||
<span v-if="activityKey"> · {{ t(activityKey) }}</span>
|
||||
<span v-if="stageLabel"> · {{ stageLabel }}</span>
|
||||
<span v-else-if="activityKey"> · {{ t(activityKey) }}</span>
|
||||
<span v-if="elapsedLabel"> · {{ t('chat.shippingOrderExtractionElapsed', { elapsed: elapsedLabel }) }}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-for="tip in healthTips"
|
||||
:key="tip.code"
|
||||
class="mt-1 text-xs font-medium opacity-90"
|
||||
data-testid="shipping-order-extraction-health-tip"
|
||||
>
|
||||
{{ t(`chat.shippingOrderExtractionHealthTip.${tip.code}`) }}
|
||||
</div>
|
||||
|
||||
<div v-if="state.refreshFailed" class="mt-1 text-xs font-medium opacity-90">
|
||||
{{ t('chat.shippingOrderExtractionRefreshFailed') }}
|
||||
</div>
|
||||
<button
|
||||
v-if="showRetry"
|
||||
type="button"
|
||||
class="mt-2 inline-flex items-center rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5"
|
||||
@click="emit('retry')"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionAction.retry_failed_attachments') }}
|
||||
</button>
|
||||
|
||||
<div v-if="confirmCancelOpen" class="mt-2 rounded-md border border-current/20 bg-black/5 p-2 text-xs dark:bg-white/5">
|
||||
<div class="font-medium">{{ t('chat.shippingOrderExtractionCancel.confirmTitle') }}</div>
|
||||
<div class="mt-1 opacity-80">{{ t('chat.shippingOrderExtractionCancel.confirmImpact') }}</div>
|
||||
<label class="mt-2 block opacity-90">
|
||||
{{ t('chat.shippingOrderExtractionCancel.reasonOptional') }}
|
||||
<textarea
|
||||
v-model="cancelReason"
|
||||
rows="2"
|
||||
class="input-field mt-1 w-full py-1 text-xs"
|
||||
:placeholder="t('chat.shippingOrderExtractionCancel.reasonOptional')"
|
||||
/>
|
||||
</label>
|
||||
<div class="mt-2 flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5"
|
||||
:disabled="cancelling"
|
||||
@click="confirmCancel"
|
||||
>
|
||||
{{ cancelling
|
||||
? t('chat.shippingOrderExtractionCancel.submitting')
|
||||
: t('chat.shippingOrderExtractionAction.cancel_run') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium opacity-80 hover:underline"
|
||||
:disabled="cancelling"
|
||||
@click="confirmCancelOpen = false; cancelReason = ''"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionCancel.dismiss') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="mt-2 flex flex-wrap gap-2">
|
||||
<button
|
||||
v-if="showRefresh"
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5"
|
||||
:disabled="refreshing"
|
||||
@click="emit('refresh')"
|
||||
>
|
||||
{{ refreshing
|
||||
? t('chat.shippingOrderExtractionRefreshing')
|
||||
: t('chat.shippingOrderExtractionAction.refresh_status') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="showCancel"
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5"
|
||||
:disabled="cancelling"
|
||||
@click="openCancelConfirm"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionAction.cancel_run') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="showRetry"
|
||||
type="button"
|
||||
class="inline-flex items-center rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5"
|
||||
:disabled="retrying"
|
||||
@click="emit('retry')"
|
||||
>
|
||||
{{ retrying
|
||||
? t('chat.shippingOrderExtractionRetrying')
|
||||
: t('chat.shippingOrderExtractionAction.retry_failed_attachments') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -625,6 +625,7 @@ export function useChatPage() {
|
||||
shippingBatchTasks: shipping.shippingBatchTasks,
|
||||
activeShippingTaskDetail: shipping.activeShippingTaskDetail,
|
||||
getActiveOrderExtractionRunNo: shipping.getActiveOrderExtractionRunNo,
|
||||
sessionWorkItemsRefreshTrigger: shipping.sessionWorkItemsRefreshTrigger,
|
||||
shippingInventorySelectionActive: shipping.shippingInventorySelectionActive,
|
||||
shippingInventorySelectionTaskId: shipping.shippingInventorySelectionTaskId,
|
||||
switchShippingBatch: shipping.switchShippingBatch,
|
||||
|
||||
@@ -792,6 +792,10 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
msg,
|
||||
t,
|
||||
});
|
||||
const sessionWorkItemsRefreshTrigger = ref(0);
|
||||
const bumpSessionWorkItemsRefresh = () => {
|
||||
sessionWorkItemsRefreshTrigger.value += 1;
|
||||
};
|
||||
const shippingOrderExtractionRuns = useShippingOrderExtractionRuns({
|
||||
messages,
|
||||
conversationId,
|
||||
@@ -813,6 +817,7 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
});
|
||||
},
|
||||
onRetryError: (message) => msg.error(message),
|
||||
onSessionWorkItemsRefresh: bumpSessionWorkItemsRefresh,
|
||||
t,
|
||||
});
|
||||
|
||||
@@ -1384,8 +1389,12 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
removeShippingNoticeAttachment: shippingIntakes.removeNoticeAttachment,
|
||||
retryShippingNoticeAttachment: shippingIntakes.retryNoticeAttachment,
|
||||
retryOrderExtractionRun: shippingOrderExtractionRuns.retryRun,
|
||||
refreshOrderExtractionRun: shippingOrderExtractionRuns.refreshRun,
|
||||
cancelOrderExtractionRun: shippingOrderExtractionRuns.cancelRun,
|
||||
cancelOrderExtractionUnit: shippingOrderExtractionRuns.cancelUnit,
|
||||
reparseOrderExtractionRun: shippingOrderExtractionRuns.reparseRun,
|
||||
getActiveOrderExtractionRunNo: shippingOrderExtractionRuns.getActiveRunNo,
|
||||
sessionWorkItemsRefreshTrigger,
|
||||
shippingNoticeAllReadyForConfirmation: shippingIntakes.allReadyForConfirmation,
|
||||
setShippingCandidateSelected,
|
||||
resolveShippingCandidateDuplicate,
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* features/chat/e2e/shipping-order-extraction-progress.spec.ts
|
||||
* 用途:阶段 5 用户进度卡契约冒烟——取消/刷新仅依赖后端 availableActions,不发明阶段。
|
||||
* 依赖:Vitest、orderExtractionProgressDisplay、ShippingOrderExtractionCard 映射约定。
|
||||
* 逻辑:模拟后端关闭取消开关后的投影;断言前端展示入口只读服务端动作列表。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
formatOrderExtractionElapsed,
|
||||
resolveOrderExtractionUserStageKey,
|
||||
} from '@/features/chat/shipping/orderExtractionProgressDisplay';
|
||||
|
||||
describe('shipping order extraction progress e2e contract', () => {
|
||||
it('never invents ETA and maps only backend user_visible_stage', () => {
|
||||
// 关键断言:无百分比/ETA;阶段文案 key 完全由后端阶段码驱动。
|
||||
expect(formatOrderExtractionElapsed(null)).toBe('');
|
||||
expect(resolveOrderExtractionUserStageKey('cancellation_requested', 'extracting')).toBe(
|
||||
'chat.shippingOrderExtractionUserStage.cancellation_requested',
|
||||
);
|
||||
});
|
||||
|
||||
it('hides cancel when availableActions omit cancel_run (feature flag rollback)', () => {
|
||||
const availableActions = ['view_details', 'refresh_status'] as const;
|
||||
const showCancel = availableActions.includes('cancel_run');
|
||||
const showRefresh = availableActions.includes('refresh_status');
|
||||
// 关键断言:灰度关闭取消后前端不得本地补按钮。
|
||||
expect(showCancel).toBe(false);
|
||||
expect(showRefresh).toBe(true);
|
||||
});
|
||||
|
||||
it('treats review_required as business review, not technical failure', () => {
|
||||
const stageKey = resolveOrderExtractionUserStageKey('review_required', 'failed');
|
||||
expect(stageKey).toBe('chat.shippingOrderExtractionUserStage.review_required');
|
||||
expect(stageKey.includes('failed')).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -36,6 +36,9 @@ type ShippingHandlerSource = Pick<
|
||||
| 'addShippingParseReviewLine'
|
||||
| 'removeShippingParseReviewLine'
|
||||
| 'retryOrderExtractionRun'
|
||||
| 'refreshOrderExtractionRun'
|
||||
| 'cancelOrderExtractionRun'
|
||||
| 'cancelOrderExtractionUnit'
|
||||
| 'reparseOrderExtractionRun'
|
||||
| 'resolveShippingCandidateDuplicate'
|
||||
| 'promoteShippingCandidate'
|
||||
@@ -74,6 +77,9 @@ export function createShippingMessageHandlers(shipping: ShippingHandlerSource):
|
||||
addLine: shipping.addShippingParseReviewLine,
|
||||
removeLine: shipping.removeShippingParseReviewLine,
|
||||
retryOrderExtractionRun: shipping.retryOrderExtractionRun,
|
||||
refreshOrderExtractionRun: shipping.refreshOrderExtractionRun,
|
||||
cancelOrderExtractionRun: shipping.cancelOrderExtractionRun,
|
||||
cancelOrderExtractionUnit: shipping.cancelOrderExtractionUnit,
|
||||
reparseOrderExtractionRun: shipping.reparseOrderExtractionRun,
|
||||
resolveCandidateDuplicate: shipping.resolveShippingCandidateDuplicate,
|
||||
promoteCandidate: shipping.promoteShippingCandidate,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* features/chat/shipping-review/useShippingOrderReview.spec.ts
|
||||
* 用途:阶段 3 复核页历史版本只读契约冒烟。
|
||||
* 依赖:isReviewCaseHistorical 纯函数。
|
||||
* 逻辑:断言 superseded / 非当前 case_no 时强制只读。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { isReviewCaseHistorical } from './useShippingOrderReview';
|
||||
|
||||
describe('useShippingOrderReview historical readonly', () => {
|
||||
it('forces readonly when case status is superseded', () => {
|
||||
expect(isReviewCaseHistorical(
|
||||
{ case_no: 'CASE-OLD', status: 'superseded' },
|
||||
{ current_case_no: 'CASE-NEW' },
|
||||
)).toBe(true);
|
||||
});
|
||||
|
||||
it('forces readonly when viewing non-current work item case', () => {
|
||||
expect(isReviewCaseHistorical(
|
||||
{ case_no: 'CASE-OLD', status: 'draft' },
|
||||
{ current_case_no: 'CASE-NEW', version_replaced: true },
|
||||
)).toBe(true);
|
||||
});
|
||||
|
||||
it('allows edit when viewing current case', () => {
|
||||
expect(isReviewCaseHistorical(
|
||||
{ case_no: 'CASE-1', status: 'draft' },
|
||||
{ current_case_no: 'CASE-1', version_replaced: false },
|
||||
)).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* features/chat/shipping-review/useShippingOrderReview.ts
|
||||
* 用途:加载建单前复核 Run 和当前 PDF Case 的只读数据。
|
||||
* 依赖:shipping API、Vue 响应式状态。
|
||||
* 逻辑:路由刷新后以 runNo 重建列表,再按 case_no 加载详情;阶段 2 不写入草稿。
|
||||
* 用途:加载建单前复核 Run、当前 PDF Case 与会话工作项版本上下文。
|
||||
* 依赖:shipping API session-work-items / versions、Vue 响应式状态。
|
||||
* 逻辑:路由刷新后以 runNo 重建列表;阶段 3 写入后刷新工作项;历史版本强制只读。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import {
|
||||
addWorkspaceShippingOrderReviewLine,
|
||||
createWorkspaceShippingOrderReviewManualDraft,
|
||||
@@ -18,6 +18,8 @@ import {
|
||||
getWorkspaceShippingOrderReviewPreview,
|
||||
getShippingNoticeIntake,
|
||||
getWorkspaceShippingOrderReviewRun,
|
||||
listWorkspaceShippingSessionWorkItemVersions,
|
||||
listWorkspaceShippingSessionWorkItems,
|
||||
patchWorkspaceShippingOrderReviewHeaderField,
|
||||
patchWorkspaceShippingOrderReviewLineField,
|
||||
markWorkspaceShippingOrderReviewNonOrder,
|
||||
@@ -25,38 +27,176 @@ import {
|
||||
reparseWorkspaceShippingOrderReviewDocument,
|
||||
validateWorkspaceShippingOrderReviewDraft,
|
||||
} from '../api/shipping.api';
|
||||
import type { ShippingOrderReviewCase, ShippingOrderReviewEvidence, ShippingOrderReviewRun } from '../types/shipping.api.types';
|
||||
import type {
|
||||
ShippingOrderReviewCase,
|
||||
ShippingOrderReviewEvidence,
|
||||
ShippingOrderReviewRun,
|
||||
ShippingSessionWorkItem,
|
||||
ShippingSessionWorkItemVersion,
|
||||
} from '../types/shipping.api.types';
|
||||
import { uploadFileAsset } from '@/shared/api/file-assets.api';
|
||||
|
||||
/** 复核页顶部状态横幅类型。 */
|
||||
export type ReviewStatusMessage = 'superseded' | 'reparse_in_progress' | 'restored' | null;
|
||||
|
||||
type ReviewCaseRef = { case_no: string; status: string } | null | undefined;
|
||||
type WorkItemRef = { current_case_no?: string | null; version_replaced?: boolean } | null | undefined;
|
||||
|
||||
/**
|
||||
* 判断当前 Case 是否为历史/被替代版本(强制只读)。
|
||||
*/
|
||||
export function isReviewCaseHistorical(activeCase: ReviewCaseRef, workItem: WorkItemRef): boolean {
|
||||
const caseNo = String(activeCase?.case_no || '');
|
||||
const currentCaseNo = String(workItem?.current_case_no || '');
|
||||
if (activeCase?.status === 'superseded') return true;
|
||||
if (currentCaseNo && caseNo && currentCaseNo !== caseNo) return true;
|
||||
return Boolean(workItem?.version_replaced && currentCaseNo && caseNo !== currentCaseNo);
|
||||
}
|
||||
|
||||
export function useShippingOrderReview() {
|
||||
const reviewRun = ref<ShippingOrderReviewRun | null>(null);
|
||||
const activeCase = ref<ShippingOrderReviewCase | null>(null);
|
||||
const workItem = ref<ShippingSessionWorkItem | null>(null);
|
||||
const versions = ref<ShippingSessionWorkItemVersion[]>([]);
|
||||
const statusMessage = ref<ReviewStatusMessage>(null);
|
||||
const loading = ref(false);
|
||||
const loadFailed = ref(false);
|
||||
const saving = ref(false);
|
||||
const saveFailed = ref(false);
|
||||
const versionsLoading = ref(false);
|
||||
const evidence = ref<ShippingOrderReviewEvidence[]>([]);
|
||||
const previewUrl = ref('');
|
||||
let contextConversationId = '';
|
||||
let contextItemNo = '';
|
||||
|
||||
/**
|
||||
* 是否正在查看非当前版本或已被替代的 Case。
|
||||
*/
|
||||
const isViewingHistoricalVersion = computed(() =>
|
||||
isReviewCaseHistorical(activeCase.value, workItem.value),
|
||||
);
|
||||
|
||||
/**
|
||||
* 编辑权限:历史版本或后端未开放 edit_draft 时强制只读。
|
||||
*/
|
||||
const editable = computed(() => {
|
||||
if (isViewingHistoricalVersion.value) return false;
|
||||
return activeCase.value?.available_actions.includes('edit_draft') || false;
|
||||
});
|
||||
|
||||
/**
|
||||
* 根据工作项与 Case 状态刷新顶部横幅文案键。
|
||||
*/
|
||||
const refreshStatusMessage = () => {
|
||||
if (isViewingHistoricalVersion.value || activeCase.value?.status === 'superseded') {
|
||||
statusMessage.value = 'superseded';
|
||||
return;
|
||||
}
|
||||
if (
|
||||
activeCase.value?.status === 'reparse_pending'
|
||||
|| workItem.value?.lifecycle_status === 'extracting'
|
||||
) {
|
||||
statusMessage.value = 'reparse_in_progress';
|
||||
return;
|
||||
}
|
||||
if (
|
||||
workItem.value?.lifecycle_status === 'pending_review'
|
||||
&& workItem.value?.previous_case_hint
|
||||
) {
|
||||
statusMessage.value = 'restored';
|
||||
return;
|
||||
}
|
||||
statusMessage.value = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 从会话工作台解析 item_no;优先 query item_no,再按 current_case_no 匹配。
|
||||
*/
|
||||
const resolveWorkItem = async (
|
||||
conversationId: string,
|
||||
options?: { itemNo?: string; caseNo?: string },
|
||||
): Promise<ShippingSessionWorkItem | null> => {
|
||||
const conversation = String(conversationId || '').trim();
|
||||
if (!conversation) return null;
|
||||
const summary = await listWorkspaceShippingSessionWorkItems(conversation);
|
||||
const allItems = [...summary.open_items, ...summary.closed_items];
|
||||
const explicitItemNo = String(options?.itemNo || contextItemNo || '').trim();
|
||||
if (explicitItemNo) {
|
||||
return allItems.find((item) => item.item_no === explicitItemNo) || null;
|
||||
}
|
||||
const caseNo = String(options?.caseNo || activeCase.value?.case_no || '').trim();
|
||||
if (!caseNo) return null;
|
||||
return allItems.find((item) => item.current_case_no === caseNo) || null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 拉取工作项与版本时间线;写入后或路由变化时复用。
|
||||
*/
|
||||
const refreshWorkItemContext = async (conversationId?: string, itemNo?: string) => {
|
||||
const conversation = String(conversationId || contextConversationId || '').trim();
|
||||
if (!conversation) return;
|
||||
contextConversationId = conversation;
|
||||
if (itemNo) contextItemNo = itemNo;
|
||||
try {
|
||||
const item = await resolveWorkItem(conversation, {
|
||||
itemNo: contextItemNo || undefined,
|
||||
caseNo: activeCase.value?.case_no,
|
||||
});
|
||||
workItem.value = item;
|
||||
if (!item?.item_no) {
|
||||
versions.value = [];
|
||||
refreshStatusMessage();
|
||||
return;
|
||||
}
|
||||
contextItemNo = item.item_no;
|
||||
versionsLoading.value = true;
|
||||
const response = await listWorkspaceShippingSessionWorkItemVersions(item.item_no);
|
||||
versions.value = response.versions || [];
|
||||
} catch {
|
||||
workItem.value = null;
|
||||
versions.value = [];
|
||||
} finally {
|
||||
versionsLoading.value = false;
|
||||
refreshStatusMessage();
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载 Run 汇总后优先恢复 URL 指定 Case,否则打开首个 PDF。 */
|
||||
const load = async (runNo: string, preferredCaseNo?: string) => {
|
||||
const load = async (
|
||||
runNo: string,
|
||||
preferredCaseNo?: string,
|
||||
options?: { conversationId?: string; itemNo?: string },
|
||||
) => {
|
||||
loading.value = true;
|
||||
loadFailed.value = false;
|
||||
if (options?.conversationId) contextConversationId = options.conversationId;
|
||||
if (options?.itemNo) contextItemNo = options.itemNo;
|
||||
try {
|
||||
const run = await getWorkspaceShippingOrderReviewRun(runNo);
|
||||
reviewRun.value = run;
|
||||
// 旧 Run 被新版结果替代后不再加载它的只读 Case,避免页面表现为“空订单”。
|
||||
if (run.superseded_by_run_no) {
|
||||
await load(run.superseded_by_run_no, preferredCaseNo, options);
|
||||
return;
|
||||
}
|
||||
const caseNo = preferredCaseNo || run.items[0]?.case_no;
|
||||
activeCase.value = caseNo ? await getWorkspaceShippingOrderReviewCase(caseNo) : null;
|
||||
evidence.value = caseNo ? (await getWorkspaceShippingOrderReviewEvidence(caseNo)).items : [];
|
||||
if (previewUrl.value) URL.revokeObjectURL(previewUrl.value);
|
||||
previewUrl.value = '';
|
||||
if (caseNo) {
|
||||
try { previewUrl.value = URL.createObjectURL(await getWorkspaceShippingOrderReviewPreview(caseNo)); } catch { /* PDF failure must not block the draft. */ }
|
||||
try {
|
||||
previewUrl.value = URL.createObjectURL(await getWorkspaceShippingOrderReviewPreview(caseNo));
|
||||
} catch { /* PDF failure must not block the draft. */ }
|
||||
}
|
||||
await refreshWorkItemContext(contextConversationId, contextItemNo);
|
||||
} catch {
|
||||
loadFailed.value = true;
|
||||
reviewRun.value = null;
|
||||
activeCase.value = null;
|
||||
workItem.value = null;
|
||||
versions.value = [];
|
||||
statusMessage.value = null;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
@@ -72,7 +212,10 @@ export function useShippingOrderReview() {
|
||||
evidence.value = result.items;
|
||||
if (previewUrl.value) URL.revokeObjectURL(previewUrl.value);
|
||||
previewUrl.value = '';
|
||||
try { previewUrl.value = URL.createObjectURL(await getWorkspaceShippingOrderReviewPreview(caseNo)); } catch { /* Preview remains independently recoverable. */ }
|
||||
try {
|
||||
previewUrl.value = URL.createObjectURL(await getWorkspaceShippingOrderReviewPreview(caseNo));
|
||||
} catch { /* Preview remains independently recoverable. */ }
|
||||
refreshStatusMessage();
|
||||
};
|
||||
|
||||
/** 串行保存当前 Case,成功后使用服务端 DTO 替换本地草稿,避免旧响应回写。 */
|
||||
@@ -89,6 +232,7 @@ export function useShippingOrderReview() {
|
||||
item.issue_count = activeCase.value.draft?.issues.length || 0;
|
||||
}
|
||||
}
|
||||
await refreshWorkItemContext();
|
||||
} catch (error) {
|
||||
saveFailed.value = true;
|
||||
throw error;
|
||||
@@ -125,6 +269,7 @@ export function useShippingOrderReview() {
|
||||
});
|
||||
activeCase.value = response.case;
|
||||
if (reviewRun.value) reviewRun.value = await getWorkspaceShippingOrderReviewRun(reviewRun.value.run_no);
|
||||
await refreshWorkItemContext();
|
||||
return response;
|
||||
} catch (error) {
|
||||
saveFailed.value = true;
|
||||
@@ -134,14 +279,41 @@ export function useShippingOrderReview() {
|
||||
}
|
||||
};
|
||||
const createManualDraft = () => activeCase.value && save(() => createWorkspaceShippingOrderReviewManualDraft(activeCase.value!.case_no));
|
||||
const markNonOrder = (reason: string) => activeCase.value && save(() => markWorkspaceShippingOrderReviewNonOrder(activeCase.value!.case_no, reason));
|
||||
const markQualityIssue = (reason: string) => activeCase.value && save(() => markWorkspaceShippingOrderReviewQualityIssue(activeCase.value!.case_no, reason));
|
||||
const reparseDocument = async (reason: string) => {
|
||||
/**
|
||||
* 标记非订单;附带原因码与备注供统一审计。
|
||||
* @param reason - 处置原因码
|
||||
* @param comment - 自由说明
|
||||
*/
|
||||
const markNonOrder = (reason: string, comment?: string) =>
|
||||
activeCase.value && save(() => markWorkspaceShippingOrderReviewNonOrder(activeCase.value!.case_no, reason, comment));
|
||||
/**
|
||||
* 标记质量异常;`other` 时后端要求非空备注。
|
||||
* @param reason - 质量原因码
|
||||
* @param comment - 业务说明
|
||||
*/
|
||||
const markQualityIssue = (reason: string, comment?: string) =>
|
||||
activeCase.value && save(() => markWorkspaceShippingOrderReviewQualityIssue(activeCase.value!.case_no, reason, comment));
|
||||
/**
|
||||
* 单 PDF 重识别是异步建 Run;复用保存互斥,避免重复点击创建竞争请求或把成功状态覆盖为旧 Case。
|
||||
* @param reason - 重识别原因码
|
||||
* @param comment - 自由说明
|
||||
*/
|
||||
const reparseDocument = async (reason: string, comment?: string) => {
|
||||
if (!activeCase.value) return null;
|
||||
const response = await reparseWorkspaceShippingOrderReviewDocument(activeCase.value.case_no, reason);
|
||||
activeCase.value = await getWorkspaceShippingOrderReviewCase(activeCase.value.case_no);
|
||||
if (reviewRun.value) reviewRun.value = await getWorkspaceShippingOrderReviewRun(reviewRun.value.run_no);
|
||||
return response;
|
||||
saving.value = true;
|
||||
saveFailed.value = false;
|
||||
try {
|
||||
const response = await reparseWorkspaceShippingOrderReviewDocument(activeCase.value.case_no, reason, comment);
|
||||
activeCase.value = await getWorkspaceShippingOrderReviewCase(activeCase.value.case_no);
|
||||
if (reviewRun.value) reviewRun.value = await getWorkspaceShippingOrderReviewRun(reviewRun.value.run_no);
|
||||
await refreshWorkItemContext();
|
||||
return response;
|
||||
} catch (error) {
|
||||
saveFailed.value = true;
|
||||
throw error;
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
};
|
||||
/** 上传替代 PDF 后等待既有 Intake 预解析;只有获得唯一 Document 才创建替代 Run。 */
|
||||
const uploadReplacement = async (file: File) => {
|
||||
@@ -163,8 +335,68 @@ export function useShippingOrderReview() {
|
||||
const response = await createWorkspaceShippingOrderReviewReplacementRun(activeCase.value.case_no, intakeNo);
|
||||
activeCase.value = await getWorkspaceShippingOrderReviewCase(activeCase.value.case_no);
|
||||
if (reviewRun.value) reviewRun.value = await getWorkspaceShippingOrderReviewRun(reviewRun.value.run_no);
|
||||
await refreshWorkItemContext();
|
||||
return response;
|
||||
};
|
||||
|
||||
return { reviewRun, activeCase, evidence, previewUrl, loading, loadFailed, saving, saveFailed, load, selectCase, patchHeader, patchLine, addLine, copyLine, deleteLine, validate, confirm, createManualDraft, markNonOrder, markQualityIssue, reparseDocument, uploadReplacement, startReplacementRun };
|
||||
/**
|
||||
* 跳转至工作项当前版本对应的 Run/Case。
|
||||
* @returns 目标 run_no 与 case_no;无法解析时返回 null。
|
||||
*/
|
||||
const currentVersionTarget = (): { runNo: string; caseNo: string } | null => {
|
||||
const runNo = String(workItem.value?.current_run_no || reviewRun.value?.run_no || '').trim();
|
||||
const caseNo = String(workItem.value?.current_case_no || '').trim();
|
||||
if (!runNo || !caseNo) return null;
|
||||
return { runNo, caseNo };
|
||||
};
|
||||
|
||||
/**
|
||||
* 切换到工作项当前版本,并立即加载其 Run 与 Case。
|
||||
*
|
||||
* 不能只更新路由:历史 Run 会发生替代,且路由 watcher 可能因参数时序保留旧的只读 Case。
|
||||
*/
|
||||
const openCurrentVersion = async (): Promise<{ runNo: string; caseNo: string } | null> => {
|
||||
const target = currentVersionTarget();
|
||||
if (!target) return null;
|
||||
await load(target.runNo, target.caseNo, {
|
||||
conversationId: contextConversationId,
|
||||
itemNo: contextItemNo || undefined,
|
||||
});
|
||||
return target;
|
||||
};
|
||||
|
||||
return {
|
||||
reviewRun,
|
||||
activeCase,
|
||||
workItem,
|
||||
versions,
|
||||
statusMessage,
|
||||
isViewingHistoricalVersion,
|
||||
editable,
|
||||
evidence,
|
||||
previewUrl,
|
||||
loading,
|
||||
loadFailed,
|
||||
saving,
|
||||
saveFailed,
|
||||
versionsLoading,
|
||||
load,
|
||||
selectCase,
|
||||
refreshWorkItemContext,
|
||||
currentVersionTarget,
|
||||
openCurrentVersion,
|
||||
patchHeader,
|
||||
patchLine,
|
||||
addLine,
|
||||
copyLine,
|
||||
deleteLine,
|
||||
validate,
|
||||
confirm,
|
||||
createManualDraft,
|
||||
markNonOrder,
|
||||
markQualityIssue,
|
||||
reparseDocument,
|
||||
uploadReplacement,
|
||||
startReplacementRun,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* features/chat/shipping/orderExtractionHandlingRefs.spec.ts
|
||||
* 用途:验证 handling_items.affected_refs 的展示标签与跳转目标解析。
|
||||
* 依赖:Vitest、本域纯函数工具。
|
||||
* 逻辑:覆盖 task / candidate / attachment 三类受控引用。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
formatHandlingAffectedRefLabel,
|
||||
listDisplayableHandlingAffectedRefs,
|
||||
resolveHandlingAffectedRefTarget,
|
||||
} from './orderExtractionHandlingRefs';
|
||||
|
||||
describe('orderExtractionHandlingRefs', () => {
|
||||
it('formats and routes task / candidate / attachment refs', () => {
|
||||
expect(formatHandlingAffectedRefLabel({ type: 'task', task_no: 'ST-9' })).toBe('ST-9');
|
||||
expect(formatHandlingAffectedRefLabel({
|
||||
type: 'candidate',
|
||||
candidate_no: 'C-1',
|
||||
po_number: 'PO-2',
|
||||
})).toBe('C-1 · PO-2');
|
||||
expect(formatHandlingAffectedRefLabel({
|
||||
type: 'attachment',
|
||||
file_name: 'skip.pdf',
|
||||
document_id: 8,
|
||||
})).toBe('skip.pdf');
|
||||
|
||||
expect(resolveHandlingAffectedRefTarget({ type: 'task', task_no: 'ST-9' })).toEqual({
|
||||
kind: 'task',
|
||||
taskNo: 'ST-9',
|
||||
});
|
||||
expect(resolveHandlingAffectedRefTarget({
|
||||
type: 'candidate',
|
||||
candidate_no: 'C-1',
|
||||
document_id: 3,
|
||||
})).toEqual({
|
||||
kind: 'review',
|
||||
documentId: 3,
|
||||
candidateNo: 'C-1',
|
||||
});
|
||||
|
||||
const rows = listDisplayableHandlingAffectedRefs([
|
||||
{ type: 'task', task_no: 'ST-9' },
|
||||
{ type: 'candidate', candidate_no: 'C-1' },
|
||||
{ type: 'unknown' },
|
||||
]);
|
||||
expect(rows.map((row) => row.label)).toEqual(['ST-9', 'C-1']);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* features/chat/shipping/orderExtractionHandlingRefs.ts
|
||||
* 用途:Run 级 handling_items.affected_refs 的展示文案与跳转目标解析。
|
||||
* 依赖:无业务 API;由 ShippingOrderExtractionCard / ShippingSessionSummaryPanel 调用。
|
||||
* 逻辑:只消费后端受控引用(task/candidate/document/attachment),禁止前端发明对象标识。
|
||||
*/
|
||||
|
||||
export type ShippingHandlingAffectedRef = Record<string, unknown>;
|
||||
|
||||
export type ShippingHandlingRefTarget =
|
||||
| { kind: 'task'; taskNo: string }
|
||||
| { kind: 'review'; documentId?: number; candidateNo?: string }
|
||||
| { kind: 'none' };
|
||||
|
||||
/**
|
||||
* 从受影响对象引用生成用户可见短标签。
|
||||
* @param ref - 后端 affected_refs 单项
|
||||
* @returns 可读标签;无法识别时返回空串
|
||||
*/
|
||||
export function formatHandlingAffectedRefLabel(ref: ShippingHandlingAffectedRef): string {
|
||||
const type = String(ref.type || '').trim();
|
||||
const taskNo = String(ref.task_no || '').trim();
|
||||
const candidateNo = String(ref.candidate_no || '').trim();
|
||||
const poNumber = String(ref.po_number || '').trim();
|
||||
const fileName = String(ref.file_name || '').trim();
|
||||
const documentId = Number(ref.document_id || 0);
|
||||
if (type === 'task' && taskNo) return taskNo;
|
||||
if (type === 'candidate') {
|
||||
if (candidateNo && poNumber) return `${candidateNo} · ${poNumber}`;
|
||||
if (candidateNo) return candidateNo;
|
||||
if (poNumber) return poNumber;
|
||||
}
|
||||
if (type === 'attachment' && fileName) return fileName;
|
||||
if (type === 'document') {
|
||||
if (fileName) return fileName;
|
||||
if (documentId > 0) return `#${documentId}`;
|
||||
}
|
||||
if (taskNo) return taskNo;
|
||||
if (candidateNo) return candidateNo;
|
||||
if (fileName) return fileName;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析受影响对象的跳转目标。
|
||||
* @param ref - 后端 affected_refs 单项
|
||||
*/
|
||||
export function resolveHandlingAffectedRefTarget(ref: ShippingHandlingAffectedRef): ShippingHandlingRefTarget {
|
||||
const type = String(ref.type || '').trim();
|
||||
const taskNo = String(ref.task_no || '').trim();
|
||||
const candidateNo = String(ref.candidate_no || '').trim();
|
||||
const documentId = Number(ref.document_id || 0);
|
||||
if ((type === 'task' || !type) && taskNo) {
|
||||
return { kind: 'task', taskNo };
|
||||
}
|
||||
if (type === 'candidate' || type === 'document' || type === 'attachment' || candidateNo || documentId > 0) {
|
||||
return {
|
||||
kind: 'review',
|
||||
documentId: documentId > 0 ? documentId : undefined,
|
||||
candidateNo: candidateNo || undefined,
|
||||
};
|
||||
}
|
||||
return { kind: 'none' };
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤并截断可展示的受影响对象列表。
|
||||
* @param refs - 原始 affected_refs
|
||||
* @param limit - 最大展示条数
|
||||
*/
|
||||
export function listDisplayableHandlingAffectedRefs(
|
||||
refs: ShippingHandlingAffectedRef[] | null | undefined,
|
||||
limit = 6,
|
||||
): Array<{ key: string; label: string; target: ShippingHandlingRefTarget; ref: ShippingHandlingAffectedRef }> {
|
||||
const rows: Array<{ key: string; label: string; target: ShippingHandlingRefTarget; ref: ShippingHandlingAffectedRef }> = [];
|
||||
for (const [index, ref] of (refs || []).entries()) {
|
||||
if (!ref || typeof ref !== 'object') continue;
|
||||
const label = formatHandlingAffectedRefLabel(ref);
|
||||
if (!label) continue;
|
||||
rows.push({
|
||||
key: `${String(ref.type || 'ref')}-${label}-${index}`,
|
||||
label,
|
||||
target: resolveHandlingAffectedRefTarget(ref),
|
||||
ref,
|
||||
});
|
||||
if (rows.length >= limit) break;
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* features/chat/shipping/orderExtractionProgressDisplay.spec.ts
|
||||
* 用途:校验进度展示纯函数不发明阶段码,并正确格式化耗时。
|
||||
* 依赖:Vitest、orderExtractionProgressDisplay。
|
||||
* 逻辑:覆盖空值、秒/分/小时格式,以及 stage key 回退路径。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
formatOrderExtractionElapsed,
|
||||
resolveOrderExtractionUserStageKey,
|
||||
} from './orderExtractionProgressDisplay';
|
||||
|
||||
describe('orderExtractionProgressDisplay', () => {
|
||||
it('formats elapsed seconds without inventing ETA', () => {
|
||||
expect(formatOrderExtractionElapsed(null)).toBe('');
|
||||
expect(formatOrderExtractionElapsed(12)).toBe('12s');
|
||||
expect(formatOrderExtractionElapsed(75)).toBe('1m 15s');
|
||||
expect(formatOrderExtractionElapsed(3600)).toBe('1h');
|
||||
});
|
||||
|
||||
it('prefers user_visible_stage over document status for i18n keys', () => {
|
||||
expect(resolveOrderExtractionUserStageKey('extracting', 'pending')).toBe(
|
||||
'chat.shippingOrderExtractionUserStage.extracting',
|
||||
);
|
||||
expect(resolveOrderExtractionUserStageKey(null, 'routing')).toBe(
|
||||
'chat.shippingOrderExtractionDocumentStatus.routing',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* features/chat/shipping/orderExtractionProgressDisplay.ts
|
||||
* 用途:订单抽取进度展示的纯函数(阶段文案 key、耗时格式化),禁止前端发明阶段码。
|
||||
* 依赖:无;由 ShippingOrderExtractionCard / ShippingSessionSummaryPanel 调用。
|
||||
* 逻辑:仅映射后端投影字段到 i18n key 与可读耗时;阈值与阶段判定一律以后端为准。
|
||||
*/
|
||||
|
||||
/** 将秒数格式化为「Xm Ys」风格;空值返回空串。 */
|
||||
export function formatOrderExtractionElapsed(seconds: number | null | undefined): string {
|
||||
if (seconds == null) return '';
|
||||
const value = Number(seconds);
|
||||
if (!Number.isFinite(value) || value < 0) return '';
|
||||
const total = Math.floor(value);
|
||||
if (total < 60) return `${total}s`;
|
||||
const minutes = Math.floor(total / 60);
|
||||
const remain = total % 60;
|
||||
if (minutes < 60) return remain > 0 ? `${minutes}m ${remain}s` : `${minutes}m`;
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const mins = minutes % 60;
|
||||
return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析用户可见阶段的 i18n key;无投影时回退到文档 status。
|
||||
* @param userVisibleStage - 后端 user_visible_stage
|
||||
* @param documentStatus - 后端 Unit status 兜底
|
||||
*/
|
||||
export function resolveOrderExtractionUserStageKey(
|
||||
userVisibleStage?: string | null,
|
||||
documentStatus?: string | null,
|
||||
): string {
|
||||
const stage = String(userVisibleStage || '').trim();
|
||||
if (stage) return `chat.shippingOrderExtractionUserStage.${stage}`;
|
||||
const status = String(documentStatus || '').trim();
|
||||
if (status) return `chat.shippingOrderExtractionDocumentStatus.${status}`;
|
||||
return 'chat.shippingOrderExtractionActivity.generic_processing';
|
||||
}
|
||||
@@ -68,7 +68,7 @@ describe('shipping notice order extraction state', () => {
|
||||
expect(resolveShippingOrderExtractionStatus(undefined, 'not_started')).toBe('not_started');
|
||||
});
|
||||
|
||||
it('restores only in-progress and retryable attachments into the input area', () => {
|
||||
it('restores only unsubmitted or pre-parse retryable attachments into the input area', () => {
|
||||
expect(shouldRestoreShippingNoticeIntake('queued')).toBe(true);
|
||||
expect(shouldRestoreShippingNoticeIntake('parsing')).toBe(true);
|
||||
expect(shouldRestoreShippingNoticeIntake('parse_failed')).toBe(true);
|
||||
@@ -77,7 +77,8 @@ describe('shipping notice order extraction state', () => {
|
||||
ready_for_extraction: true,
|
||||
attachment_directory_complete: true,
|
||||
})).toBe(true);
|
||||
expect(shouldRestoreShippingNoticeIntake('parsed', 'failed', 0)).toBe(true);
|
||||
// 抽取失败由 Run 状态卡重试,不能将已发送附件重新放回编辑框。
|
||||
expect(shouldRestoreShippingNoticeIntake('parsed', 'failed', 0)).toBe(false);
|
||||
expect(shouldRestoreShippingNoticeIntake('parsed', 'not_started', 0, {
|
||||
preview_status: 'directory_incomplete',
|
||||
ready_for_extraction: false,
|
||||
|
||||
@@ -41,7 +41,7 @@ const ACTIVE_ORDER_EXTRACTION = new Set(['extracting']);
|
||||
* 判断服务端 Intake 是否应恢复到输入栏。
|
||||
* AI 触发时机:无;页面刷新或重新打开会话时调用。
|
||||
* 上传快览与发送授权已拆分:未发送但已快览成功的附件,刷新后也必须恢复到输入栏;
|
||||
* 已进入订单抽取终态(包括待人工复核)的附件仅保留在消息气泡和结果卡中,
|
||||
* 已进入订单抽取终态(包括失败、待人工复核)的附件仅保留在消息气泡和结果卡中,
|
||||
* 避免把已发送的旧批次误带回当前输入框。
|
||||
* @param parseStatus - 服务端返回的预解析状态。
|
||||
* @param orderExtractionStatus - 服务端返回的订单抽取状态。
|
||||
@@ -61,8 +61,7 @@ export function shouldRestoreShippingNoticeIntake(
|
||||
status === 'parsed'
|
||||
&& (!extractionStatus || extractionStatus === 'not_started')
|
||||
&& !isShippingNoticeAttachmentParseIncomplete(parseSummary)
|
||||
)
|
||||
|| extractionStatus === 'failed';
|
||||
);
|
||||
}
|
||||
|
||||
/** 判断 Intake 是否仍需轮询上传预处理或订单抽取状态。 */
|
||||
|
||||
@@ -17,6 +17,8 @@ const api = vi.hoisted(() => ({
|
||||
markSeen: vi.fn(),
|
||||
retryRun: vi.fn(),
|
||||
reparseRun: vi.fn(),
|
||||
cancelRun: vi.fn(),
|
||||
cancelDocument: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('../api/shipping.api', () => ({
|
||||
@@ -26,6 +28,8 @@ vi.mock('../api/shipping.api', () => ({
|
||||
markWorkspaceShippingOrderExtractionRunSeen: api.markSeen,
|
||||
retryWorkspaceShippingOrderExtractionRun: api.retryRun,
|
||||
reparseWorkspaceShippingOrderExtractionRun: api.reparseRun,
|
||||
cancelWorkspaceShippingOrderExtractionRun: api.cancelRun,
|
||||
cancelWorkspaceShippingOrderExtractionDocument: api.cancelDocument,
|
||||
}));
|
||||
|
||||
const run = (patch: Partial<ShippingOrderExtractionRun>): ShippingOrderExtractionRun => ({
|
||||
@@ -69,6 +73,7 @@ const createHarness = () => {
|
||||
loadHistory: vi.fn(async () => undefined),
|
||||
onConversationResolved: vi.fn(async () => undefined),
|
||||
onRetryError: vi.fn(),
|
||||
onSessionWorkItemsRefresh: vi.fn(),
|
||||
t: (key: string) => key,
|
||||
};
|
||||
return { messages, conversationId, options, runs: useShippingOrderExtractionRuns(options) };
|
||||
@@ -165,6 +170,16 @@ describe('useShippingOrderExtractionRuns lifecycle', () => {
|
||||
expect(harness.messages.value[0]?.shipping_order_extraction_state?.status).toBe('processing');
|
||||
});
|
||||
|
||||
it('notifies session work items refresh after restoring a terminal run', async () => {
|
||||
api.listRuns.mockResolvedValue({
|
||||
items: [run({ run_no: 'SNER-DONE', status: 'completed', phase: 'completed' })],
|
||||
});
|
||||
const harness = createHarness();
|
||||
harness.conversationId.value = 'conv-1';
|
||||
await harness.runs.restoreForConversation('conv-1');
|
||||
expect(harness.options.onSessionWorkItemsRefresh).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('aborts a hanging Run query after ten seconds and keeps polling as a transport failure', async () => {
|
||||
api.createRun.mockResolvedValue({ run: run({ run_no: 'SNER-TIMEOUT', conversation_id: 'conv-timeout' }), reused: false });
|
||||
api.getRun.mockImplementation((_runNo: string, signal: AbortSignal) => new Promise((_resolve, reject) => {
|
||||
@@ -320,6 +335,52 @@ describe('mapOrderExtractionRunToMessageState', () => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it('persists again when only handling_items or primary_notice change', async () => {
|
||||
vi.useFakeTimers();
|
||||
const first = run({
|
||||
run_no: 'SNER-HANDLING',
|
||||
status: 'processing',
|
||||
primary_notice: 'candidate_conflict',
|
||||
handling_items: [{
|
||||
category: 'candidate_conflict',
|
||||
count: 1,
|
||||
reason_codes: ['email_supplement_conflict'],
|
||||
affected_refs: [{ type: 'candidate', candidate_no: 'C-1' }],
|
||||
primary_action: 'review_candidate',
|
||||
}],
|
||||
});
|
||||
const second = run({
|
||||
run_no: 'SNER-HANDLING',
|
||||
status: 'processing',
|
||||
primary_notice: 'auto_freeze_blocked',
|
||||
handling_items: [{
|
||||
category: 'auto_freeze_blocked',
|
||||
count: 1,
|
||||
reason_codes: ['profile_not_auto_freeze_approved'],
|
||||
affected_refs: [{ type: 'task', task_no: 'ST-9', candidate_no: 'C-2' }],
|
||||
primary_action: 'view_details',
|
||||
}],
|
||||
});
|
||||
api.listRuns.mockResolvedValue({ items: [first] });
|
||||
api.getRun.mockResolvedValueOnce(second);
|
||||
const harness = createHarness();
|
||||
harness.conversationId.value = 'conv-1';
|
||||
|
||||
await harness.runs.restoreForConversation('conv-1');
|
||||
expect(harness.options.saveLocalMessageToBackend).toHaveBeenCalledTimes(1);
|
||||
await vi.advanceTimersByTimeAsync(1000);
|
||||
|
||||
// 关键断言:处理说明独立变化也必须重新持久化,历史会话才能恢复最新原因与影响对象。
|
||||
expect(harness.options.saveLocalMessageToBackend).toHaveBeenCalledTimes(2);
|
||||
expect(harness.messages.value[0]?.shipping_order_extraction_state?.primaryNotice).toBe('auto_freeze_blocked');
|
||||
expect(harness.messages.value[0]?.shipping_order_extraction_state?.handlingItems?.[0]?.affectedRefs?.[0]).toMatchObject({
|
||||
type: 'task',
|
||||
task_no: 'ST-9',
|
||||
});
|
||||
harness.runs.stopPolling();
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it('merges duplicate local cards for one Run when a terminal update arrives', async () => {
|
||||
vi.useFakeTimers();
|
||||
const active = run({ run_no: 'SNER-DUPLICATE', status: 'processing' });
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
* features/chat/shipping/useShippingOrderExtractionRuns.ts
|
||||
* 用途:把货代订单抽取作为独立 Run 启动、轮询并投影到聊天状态消息。
|
||||
* 依赖:shipping.api Run 接口、chat.types、Vue refs。
|
||||
* 逻辑:发送处理器调用 startRun;本模块持久化本地消息并轮询 Run;终态后仍保留 run_no 供右侧「本次处理」面板。
|
||||
* 逻辑:发送处理器调用 startRun;本模块持久化本地消息并轮询 Run;终态后仍保留 run_no 供状态卡展示。
|
||||
* 右侧「本次处理」列表由 session-work-items API 驱动,本模块仅在终态/重识别后触发其刷新。
|
||||
* 轮询前台 2s / 后台 5–10s;取消走请求语义 API,刷新为只读 GET。
|
||||
* 持久化去重签名必须包含 handling_items / primary_notice,避免处理说明变化后历史会话仍读到旧卡。
|
||||
*/
|
||||
import { getCurrentInstance, onBeforeUnmount, type ComputedRef, type Ref } from 'vue';
|
||||
import {
|
||||
cancelWorkspaceShippingOrderExtractionDocument,
|
||||
cancelWorkspaceShippingOrderExtractionRun,
|
||||
createWorkspaceShippingOrderExtractionRun,
|
||||
getWorkspaceShippingOrderExtractionRun,
|
||||
listWorkspaceShippingOrderExtractionRuns,
|
||||
@@ -31,10 +36,25 @@ interface UseShippingOrderExtractionRunsOptions {
|
||||
loadHistory: () => Promise<void>;
|
||||
onConversationResolved: (conversationId: string) => Promise<void> | void;
|
||||
onRetryError: (message: string) => void;
|
||||
/** 终态/重识别/恢复后通知右侧面板立即刷新会话工作项。 */
|
||||
onSessionWorkItemsRefresh?: () => void;
|
||||
t: (key: string, params?: Record<string, unknown>) => string;
|
||||
}
|
||||
|
||||
const ACTIVE_RUN_STATUSES = new Set(['queued', 'processing']);
|
||||
const FOREGROUND_POLL_MS = 2000;
|
||||
const BACKGROUND_POLL_MS = 8000;
|
||||
|
||||
/** 按页面可见性选择轮询间隔;后台放慢,失败退避另算。 */
|
||||
function resolvePollIntervalMs(failureCount = 0): number {
|
||||
if (failureCount > 0) {
|
||||
return Math.min(15000, 2000 * (2 ** Math.min(failureCount, 3)));
|
||||
}
|
||||
if (typeof document !== 'undefined' && document.visibilityState === 'hidden') {
|
||||
return BACKGROUND_POLL_MS;
|
||||
}
|
||||
return FOREGROUND_POLL_MS;
|
||||
}
|
||||
|
||||
/** 把领域 Run 转为聊天组件既有的订单抽取状态卡契约。 */
|
||||
export function mapOrderExtractionRunToMessageState(run: ShippingOrderExtractionRun): ShippingOrderExtractionState {
|
||||
@@ -47,6 +67,7 @@ export function mapOrderExtractionRunToMessageState(run: ShippingOrderExtraction
|
||||
completedDocuments: Number(run.summary?.completed_documents || 0),
|
||||
reviewRequiredDocuments: Number(run.summary?.review_required_documents || 0),
|
||||
failedDocuments: Number(run.summary?.failed_documents || 0),
|
||||
cancelledDocuments: Number(run.summary?.cancelled_documents || 0),
|
||||
candidateCount: Number(run.summary?.candidate_count || 0),
|
||||
openedExistingCount: Number(
|
||||
run.summary?.opened_existing_documents
|
||||
@@ -59,12 +80,17 @@ export function mapOrderExtractionRunToMessageState(run: ShippingOrderExtraction
|
||||
unitId: Number(run.current_activity.unit_id || 0),
|
||||
fileName: run.current_activity.file_name || null,
|
||||
eventCode: String(run.current_activity.event_code || ''),
|
||||
userVisibleStage: run.current_activity.user_visible_stage || null,
|
||||
selectionBatch: run.current_activity.selection_batch != null
|
||||
? Number(run.current_activity.selection_batch || 0) || null
|
||||
: null,
|
||||
reasonCodes: Array.isArray(run.current_activity.reason_codes)
|
||||
? run.current_activity.reason_codes.map((item) => String(item || '').trim()).filter(Boolean)
|
||||
: [],
|
||||
elapsedSeconds: run.current_activity.elapsed_seconds != null
|
||||
? Number(run.current_activity.elapsed_seconds)
|
||||
: null,
|
||||
lastActivityAt: run.current_activity.last_activity_at || null,
|
||||
}
|
||||
: null,
|
||||
selectionPlan: run.selection_plan
|
||||
@@ -108,6 +134,41 @@ export function mapOrderExtractionRunToMessageState(run: ShippingOrderExtraction
|
||||
}
|
||||
: null,
|
||||
availableActions: Array.isArray(run.available_actions) ? [...run.available_actions] : [],
|
||||
handlingItems: Array.isArray(run.handling_items)
|
||||
? run.handling_items.map((item) => ({
|
||||
category: String(item.category || '').trim(),
|
||||
count: Number(item.count || 0),
|
||||
reasonCodes: Array.isArray(item.reason_codes)
|
||||
? item.reason_codes.map((code) => String(code || '').trim()).filter(Boolean)
|
||||
: [],
|
||||
affectedRefs: Array.isArray(item.affected_refs)
|
||||
? item.affected_refs.filter((ref): ref is Record<string, unknown> => Boolean(ref) && typeof ref === 'object')
|
||||
: [],
|
||||
primaryAction: item.primary_action || null,
|
||||
})).filter((item) => item.category)
|
||||
: [],
|
||||
primaryNotice: run.primary_notice || null,
|
||||
userVisibleStage: run.user_visible_stage || null,
|
||||
healthTips: Array.isArray(run.health_tips)
|
||||
? run.health_tips.map((tip) => ({
|
||||
code: tip.code,
|
||||
thresholdSeconds: Number(tip.threshold_seconds || 0),
|
||||
idleOrElapsedSeconds: Number(tip.idle_or_elapsed_seconds || 0),
|
||||
}))
|
||||
: [],
|
||||
cancellation: run.cancellation
|
||||
? {
|
||||
requested: Boolean(run.cancellation.requested),
|
||||
requestedAt: run.cancellation.requested_at || null,
|
||||
completedAt: run.cancellation.completed_at || null,
|
||||
actorType: run.cancellation.actor_type || null,
|
||||
actorId: run.cancellation.actor_id || null,
|
||||
reason: run.cancellation.reason || null,
|
||||
reasonCode: run.cancellation.reason_code || null,
|
||||
}
|
||||
: null,
|
||||
progressVersion: run.progress_version != null ? Number(run.progress_version) : null,
|
||||
lastActivityAt: run.last_activity_at || null,
|
||||
terminal: !ACTIVE_RUN_STATUSES.has(run.status),
|
||||
refreshFailed: false,
|
||||
errorCode: run.error?.code || null,
|
||||
@@ -202,6 +263,11 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
summary: run.summary,
|
||||
current_activity: run.current_activity,
|
||||
available_actions: run.available_actions,
|
||||
handling_items: run.handling_items,
|
||||
primary_notice: run.primary_notice,
|
||||
health_tips: run.health_tips,
|
||||
cancellation: run.cancellation,
|
||||
progress_version: run.progress_version,
|
||||
result: run.result,
|
||||
error: run.error,
|
||||
reparse: run.reparse,
|
||||
@@ -259,6 +325,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
// Run 状态卡已持久化;工作台可由页面下一次刷新继续恢复。
|
||||
}
|
||||
await Promise.allSettled([options.loadHistory()]);
|
||||
options.onSessionWorkItemsRefresh?.();
|
||||
return reviewAttachments;
|
||||
};
|
||||
|
||||
@@ -299,13 +366,12 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
await upsertRunMessage(run);
|
||||
await acknowledgeTerminalRunWhenVisible(run);
|
||||
if (generation !== pollGeneration || activeRunNo !== runNo) return;
|
||||
pollTimer = setTimeout(() => void pollRun(run.run_no, generation), 2000);
|
||||
pollTimer = setTimeout(() => void pollRun(run.run_no, generation), resolvePollIntervalMs(0));
|
||||
} catch {
|
||||
if (generation !== pollGeneration || activeRunNo !== runNo) return;
|
||||
pollFailureCount += 1;
|
||||
setRunRefreshFailed(runNo, true);
|
||||
const delayMs = Math.min(15000, 2000 * (2 ** Math.min(pollFailureCount, 3)));
|
||||
pollTimer = setTimeout(() => void pollRun(runNo, generation), delayMs);
|
||||
pollTimer = setTimeout(() => void pollRun(runNo, generation), resolvePollIntervalMs(pollFailureCount));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -317,6 +383,18 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
pollTimer = setTimeout(() => void pollRun(runNo, generation), delayMs);
|
||||
};
|
||||
|
||||
/**
|
||||
* 前台恢复时立刻拉一次,避免后台节流后状态滞后。
|
||||
*/
|
||||
const onVisibilityChange = () => {
|
||||
if (typeof document === 'undefined' || document.visibilityState !== 'visible') return;
|
||||
if (!activeRunNo || !pollTimer) return;
|
||||
const runNo = activeRunNo;
|
||||
const generation = pollGeneration;
|
||||
if (pollTimer) clearTimeout(pollTimer);
|
||||
pollTimer = setTimeout(() => void pollRun(runNo, generation), 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* 启动订单抽取后台 Run,并把用户操作和状态卡持久化到本地会话。
|
||||
* @param query - 用户本次备注;允许为空,不发送给 Dify Chatflow。
|
||||
@@ -376,6 +454,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
await upsertRunMessage(response.run);
|
||||
await acknowledgeTerminalRunWhenVisible(response.run);
|
||||
await Promise.allSettled([options.refreshNoticeIntakeStatuses()]);
|
||||
options.onSessionWorkItemsRefresh?.();
|
||||
if (ACTIVE_RUN_STATUSES.has(response.run.status)) {
|
||||
beginPolling(response.run.run_no, 1000);
|
||||
}
|
||||
@@ -386,6 +465,94 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 只读刷新当前 Run 投影;不改变业务状态,失败仅标记 refreshFailed。
|
||||
* @param runNo - 目标 Run 编号。
|
||||
*/
|
||||
const refreshRun = async (runNo: string): Promise<boolean> => {
|
||||
const normalizedRunNo = String(runNo || '').trim();
|
||||
if (!normalizedRunNo) return false;
|
||||
try {
|
||||
const run = await getWorkspaceShippingOrderExtractionRun(normalizedRunNo);
|
||||
setRunRefreshFailed(run.run_no, false);
|
||||
if (!ACTIVE_RUN_STATUSES.has(run.status)) {
|
||||
const reviewAttachments = await refreshTerminalFacts(run);
|
||||
await upsertRunMessage(run, reviewAttachments);
|
||||
await acknowledgeTerminalRunWhenVisible(run);
|
||||
return true;
|
||||
}
|
||||
await upsertRunMessage(run);
|
||||
if (activeRunNo !== run.run_no || !pollTimer) beginPolling(run.run_no, FOREGROUND_POLL_MS);
|
||||
return true;
|
||||
} catch (error) {
|
||||
setRunRefreshFailed(normalizedRunNo, true);
|
||||
options.onRetryError(error instanceof Error ? error.message : options.t('chat.shippingOrderExtractionRefreshFailed'));
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 请求取消整批;排队 Unit 立即取消,执行中进入 cancellation_requested。
|
||||
* @param runNo - 目标 Run。
|
||||
* @param reason - 可选原因;管理员取消他人时由调用方保证非空。
|
||||
*/
|
||||
const cancelRun = async (runNo: string, reason?: string | null): Promise<boolean> => {
|
||||
const normalizedRunNo = String(runNo || '').trim();
|
||||
if (!normalizedRunNo) return false;
|
||||
try {
|
||||
const response = await cancelWorkspaceShippingOrderExtractionRun(normalizedRunNo, {
|
||||
reason: reason || null,
|
||||
});
|
||||
const run = response.run;
|
||||
await upsertRunMessage(run);
|
||||
await acknowledgeTerminalRunWhenVisible(run);
|
||||
if (ACTIVE_RUN_STATUSES.has(run.status)) {
|
||||
beginPolling(run.run_no, 1000);
|
||||
} else {
|
||||
stopPolling();
|
||||
activeRunNo = run.run_no;
|
||||
const reviewAttachments = await refreshTerminalFacts(run);
|
||||
await upsertRunMessage(run, reviewAttachments);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
options.onRetryError(error instanceof Error ? error.message : options.t('chat.shippingOrderExtractionCancel.failed'));
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 请求取消单个 PDF Unit。
|
||||
* @param runNo - 所属 Run。
|
||||
* @param documentId - 目标文档 ID。
|
||||
* @param reason - 可选原因。
|
||||
*/
|
||||
const cancelUnit = async (
|
||||
runNo: string,
|
||||
documentId: number,
|
||||
reason?: string | null,
|
||||
): Promise<boolean> => {
|
||||
const normalizedRunNo = String(runNo || '').trim();
|
||||
const normalizedDocId = Number(documentId || 0);
|
||||
if (!normalizedRunNo || !normalizedDocId) return false;
|
||||
try {
|
||||
const response = await cancelWorkspaceShippingOrderExtractionDocument(normalizedRunNo, normalizedDocId, {
|
||||
reason: reason || null,
|
||||
});
|
||||
if (response.run) {
|
||||
await upsertRunMessage(response.run);
|
||||
await acknowledgeTerminalRunWhenVisible(response.run);
|
||||
if (ACTIVE_RUN_STATUSES.has(response.run.status)) {
|
||||
beginPolling(response.run.run_no, 1000);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
options.onRetryError(error instanceof Error ? error.message : options.t('chat.shippingOrderExtractionCancel.failed'));
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 创建新版识别 Run;旧版本保持审计只读,轮询自动转向新的 Run 编号。 */
|
||||
const reparseRun = async (
|
||||
runNo: string,
|
||||
@@ -402,6 +569,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
await upsertRunMessage(response.run);
|
||||
await acknowledgeTerminalRunWhenVisible(response.run);
|
||||
await Promise.allSettled([options.refreshNoticeIntakeStatuses(), options.refreshShippingActions()]);
|
||||
options.onSessionWorkItemsRefresh?.();
|
||||
if (ACTIVE_RUN_STATUSES.has(response.run.status)) beginPolling(response.run.run_no, 1000);
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -432,7 +600,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
}));
|
||||
};
|
||||
|
||||
/** 刷新或进入既有会话时恢复最新 Run;活动 Run 继续轮询,终态只恢复状态卡并保留 run_no 供右侧面板。 */
|
||||
/** 刷新或进入既有会话时恢复最新 Run 状态卡;活动 Run 继续轮询。右侧面板列表由 session-work-items 独立恢复。 */
|
||||
const restoreForConversation = async (conversationId: string): Promise<void> => {
|
||||
clearActiveRun();
|
||||
try {
|
||||
@@ -449,6 +617,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
if (options.conversationId.value !== conversationId) return;
|
||||
await upsertRunMessage(latest, reviewAttachments);
|
||||
await acknowledgeTerminalRunWhenVisible(latest);
|
||||
options.onSessionWorkItemsRefresh?.();
|
||||
if (options.conversationId.value !== conversationId) return;
|
||||
if (ACTIVE_RUN_STATUSES.has(latest.status)) {
|
||||
beginPolling(latest.run_no, 1000);
|
||||
@@ -458,10 +627,23 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
}
|
||||
};
|
||||
|
||||
if (getCurrentInstance()) onBeforeUnmount(clearActiveRun);
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||
}
|
||||
if (getCurrentInstance()) {
|
||||
onBeforeUnmount(() => {
|
||||
if (typeof document !== 'undefined') {
|
||||
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||
}
|
||||
clearActiveRun();
|
||||
});
|
||||
}
|
||||
return {
|
||||
startRun,
|
||||
retryRun,
|
||||
refreshRun,
|
||||
cancelRun,
|
||||
cancelUnit,
|
||||
reparseRun,
|
||||
restoreForConversation,
|
||||
stopPolling,
|
||||
|
||||
@@ -37,17 +37,41 @@ export interface ShippingOrderExtractionStateSummary {
|
||||
completedDocuments: number;
|
||||
reviewRequiredDocuments: number;
|
||||
failedDocuments: number;
|
||||
/** 已取消 PDF 份数;由后端投影,前端不得自行推算 */
|
||||
cancelledDocuments?: number;
|
||||
candidateCount: number;
|
||||
/** 解析阶段已关联已有任务的份数(open_existing) */
|
||||
openedExistingCount?: number;
|
||||
}
|
||||
|
||||
/** 健康提示;阈值与判定一律以后端投影为准。 */
|
||||
export interface ShippingOrderExtractionHealthTipState {
|
||||
code: 'processing_slow' | 'queue_backlog' | 'processing_attention';
|
||||
thresholdSeconds: number;
|
||||
idleOrElapsedSeconds: number;
|
||||
}
|
||||
|
||||
/** 取消请求元数据投影(请求语义,非即时终态)。 */
|
||||
export interface ShippingOrderExtractionCancellationState {
|
||||
requested: boolean;
|
||||
requestedAt?: string | null;
|
||||
completedAt?: string | null;
|
||||
actorType?: 'user' | 'admin' | 'system' | null;
|
||||
actorId?: string | null;
|
||||
reason?: string | null;
|
||||
reasonCode?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionCurrentActivityState {
|
||||
unitId: number;
|
||||
fileName?: string | null;
|
||||
eventCode: string;
|
||||
/** 用户可见业务阶段码;文案走 shippingOrderExtractionUserStage.* */
|
||||
userVisibleStage?: string | null;
|
||||
selectionBatch?: number | null;
|
||||
reasonCodes?: string[];
|
||||
elapsedSeconds?: number | null;
|
||||
lastActivityAt?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionSelectionPlanState {
|
||||
@@ -82,6 +106,15 @@ export interface ShippingOrderExtractionUnitSummaryState {
|
||||
technicalFailureReasonCodes?: string[];
|
||||
}
|
||||
|
||||
/** Run 级待处理事项;由后端投影,前端按 category 展示原因与跳转。 */
|
||||
export interface ShippingOrderExtractionHandlingItemState {
|
||||
category: string;
|
||||
count: number;
|
||||
reasonCodes: string[];
|
||||
affectedRefs: Array<Record<string, unknown>>;
|
||||
primaryAction?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionState {
|
||||
status: ShippingOrderExtractionStateStatus;
|
||||
summary: ShippingOrderExtractionStateSummary;
|
||||
@@ -89,6 +122,16 @@ export interface ShippingOrderExtractionState {
|
||||
selectionPlan?: ShippingOrderExtractionSelectionPlanState | null;
|
||||
unitSummary?: ShippingOrderExtractionUnitSummaryState | null;
|
||||
availableActions: string[];
|
||||
/** Run 级拆分后的处理事项(待补/冲突/冻结/复核/失败等)。 */
|
||||
handlingItems?: ShippingOrderExtractionHandlingItemState[];
|
||||
/** 优先级最高的处理事项类别,供一句过程通知。 */
|
||||
primaryNotice?: string | null;
|
||||
/** Run 级用户可见阶段;无 currentActivity 时供进度卡兜底。 */
|
||||
userVisibleStage?: string | null;
|
||||
healthTips?: ShippingOrderExtractionHealthTipState[];
|
||||
cancellation?: ShippingOrderExtractionCancellationState | null;
|
||||
progressVersion?: number | null;
|
||||
lastActivityAt?: string | null;
|
||||
terminal: boolean;
|
||||
refreshFailed?: boolean;
|
||||
errorCode?: string | null;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* 用途:货代发货 Agent / 工作台 API 请求与响应契约类型。
|
||||
* 依赖:无(纯类型模块)。
|
||||
* 逻辑:shipping.api.ts 与 Chat/工作台组件统一引用本文件 DTO 类型。
|
||||
* 阶段 0 冻结用户可见阶段、健康提示、取消元数据与审计 DTO;写路径与 UI 在后续阶段启用。
|
||||
*/
|
||||
export type InventorySourceStatus =
|
||||
| 'unresolved'
|
||||
@@ -669,6 +670,48 @@ export type ShippingOrderExtractionDocumentStatus =
|
||||
| 'failed'
|
||||
| 'cancelled';
|
||||
|
||||
/** 后端投影的用户可见阶段;前端禁止用本地时钟或猜测重算。 */
|
||||
export type ShippingOrderExtractionUserVisibleStage =
|
||||
| 'pending'
|
||||
| 'document_queued'
|
||||
| 'waiting_layout'
|
||||
| 'layout_parsing_started'
|
||||
| 'routing'
|
||||
| 'matching_profile'
|
||||
| 'extracting'
|
||||
| 'merging_supplement'
|
||||
| 'candidate_ready'
|
||||
| 'review_required'
|
||||
| 'technical_retrying'
|
||||
| 'failed'
|
||||
| 'cancellation_requested'
|
||||
| 'cancelled'
|
||||
| 'completed';
|
||||
|
||||
/** 健康提示码;阈值由后端统一计算。 */
|
||||
export type ShippingOrderExtractionHealthTipCode =
|
||||
| 'processing_slow'
|
||||
| 'queue_backlog'
|
||||
| 'processing_attention';
|
||||
|
||||
export type ShippingOrderExtractionCancelActorType = 'user' | 'admin' | 'system';
|
||||
|
||||
export interface ShippingOrderExtractionHealthTip {
|
||||
code: ShippingOrderExtractionHealthTipCode;
|
||||
threshold_seconds: number;
|
||||
idle_or_elapsed_seconds: number;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionCancellation {
|
||||
requested: boolean;
|
||||
requested_at?: string | null;
|
||||
completed_at?: string | null;
|
||||
actor_type?: ShippingOrderExtractionCancelActorType | null;
|
||||
actor_id?: string | null;
|
||||
reason?: string | null;
|
||||
reason_code?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionRunSummary {
|
||||
total_documents: number;
|
||||
pending_documents: number;
|
||||
@@ -676,6 +719,7 @@ export interface ShippingOrderExtractionRunSummary {
|
||||
completed_documents: number;
|
||||
review_required_documents: number;
|
||||
failed_documents: number;
|
||||
cancelled_documents?: number;
|
||||
candidate_count: number;
|
||||
opened_existing_documents?: number;
|
||||
}
|
||||
@@ -684,8 +728,11 @@ export interface ShippingOrderExtractionCurrentActivity {
|
||||
unit_id: number;
|
||||
file_name?: string | null;
|
||||
event_code: string;
|
||||
user_visible_stage?: ShippingOrderExtractionUserVisibleStage | null;
|
||||
selection_batch?: number | null;
|
||||
reason_codes?: string[];
|
||||
elapsed_seconds?: number | null;
|
||||
last_activity_at?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionProfileSummary {
|
||||
@@ -707,6 +754,12 @@ export interface ShippingOrderExtractionDocumentResult {
|
||||
document_id: number;
|
||||
file_name?: string | null;
|
||||
status: ShippingOrderExtractionDocumentStatus;
|
||||
user_visible_stage?: ShippingOrderExtractionUserVisibleStage | null;
|
||||
queue_position?: number | null;
|
||||
elapsed_seconds?: number | null;
|
||||
health_tips?: ShippingOrderExtractionHealthTip[];
|
||||
cancellation?: ShippingOrderExtractionCancellation | null;
|
||||
activity_version?: number | null;
|
||||
selection_batch?: number | null;
|
||||
group_key?: string | null;
|
||||
retry_status?: string | null;
|
||||
@@ -787,6 +840,20 @@ export interface ShippingOrderExtractionRun {
|
||||
} | null;
|
||||
current_activity?: ShippingOrderExtractionCurrentActivity | null;
|
||||
available_actions: string[];
|
||||
/** Run 级处理事项;聊天卡与右侧「本次处理」按类别展示。 */
|
||||
handling_items?: Array<{
|
||||
category: string;
|
||||
count: number;
|
||||
reason_codes?: string[];
|
||||
affected_refs?: Array<Record<string, unknown>>;
|
||||
primary_action?: string | null;
|
||||
}>;
|
||||
primary_notice?: string | null;
|
||||
user_visible_stage?: ShippingOrderExtractionUserVisibleStage | null;
|
||||
health_tips?: ShippingOrderExtractionHealthTip[];
|
||||
cancellation?: ShippingOrderExtractionCancellation | null;
|
||||
progress_version?: number | null;
|
||||
last_activity_at?: string | null;
|
||||
result?: {
|
||||
batch_no?: string | null;
|
||||
created_count?: number;
|
||||
@@ -794,6 +861,9 @@ export interface ShippingOrderExtractionRun {
|
||||
pending_count?: number;
|
||||
non_shipping_count?: number;
|
||||
created_with_missing_fields_count?: number;
|
||||
pending_orders?: Array<Record<string, unknown>>;
|
||||
auto_freeze?: Record<string, unknown>;
|
||||
budget_stopped?: boolean;
|
||||
} | null;
|
||||
// 用户态 Run 契约只暴露稳定错误码;错误正文留在服务端管理员诊断边界。
|
||||
error?: { code?: string | null } | null;
|
||||
@@ -813,6 +883,82 @@ export interface ShippingOrderExtractionProgressEvent {
|
||||
occurred_at: string;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionCancelRequest {
|
||||
reason?: string | null;
|
||||
reason_code?: string | null;
|
||||
expected_progress_version?: number | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionUnitCancelRequest {
|
||||
reason?: string | null;
|
||||
reason_code?: string | null;
|
||||
expected_activity_version?: number | null;
|
||||
}
|
||||
|
||||
/** 管理员审计查询与详情 DTO;禁止包含正文、密钥或对象存储 URL。 */
|
||||
export type ShippingAuditActorType = 'user' | 'system' | 'rpa' | 'chatflow' | 'admin';
|
||||
export type ShippingAuditResult = 'success' | 'failure' | 'rejected' | 'ignored';
|
||||
|
||||
export interface ShippingAuditEvidenceRef {
|
||||
file_asset_id?: number | null;
|
||||
content_sha256?: string | null;
|
||||
version?: number | null;
|
||||
page_no?: number | null;
|
||||
table_id?: string | null;
|
||||
cell_id?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingAuditEvent {
|
||||
event_id: number;
|
||||
event_type: string;
|
||||
occurred_at: string;
|
||||
actor_type: ShippingAuditActorType;
|
||||
actor_id?: string | null;
|
||||
actor_role?: string | null;
|
||||
request_id?: string | null;
|
||||
operation_id?: string | null;
|
||||
source?: string | null;
|
||||
result?: ShippingAuditResult | null;
|
||||
error_code?: string | null;
|
||||
aggregate_type: string;
|
||||
aggregate_id: string;
|
||||
conversation_id?: string | null;
|
||||
run_no?: string | null;
|
||||
unit_id?: string | null;
|
||||
document_id?: string | null;
|
||||
review_case_no?: string | null;
|
||||
task_no?: string | null;
|
||||
attempt_no?: number | null;
|
||||
action?: string | null;
|
||||
reason?: string | null;
|
||||
reason_code?: string | null;
|
||||
before_snapshot?: Record<string, unknown> | null;
|
||||
after_snapshot?: Record<string, unknown> | null;
|
||||
evidence_refs?: ShippingAuditEvidenceRef[];
|
||||
artifact_refs?: ShippingAuditEvidenceRef[];
|
||||
context_refs?: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export interface ShippingAuditEventQuery {
|
||||
from?: string | null;
|
||||
to?: string | null;
|
||||
actor_id?: string | null;
|
||||
run_no?: string | null;
|
||||
task_no?: string | null;
|
||||
document_id?: string | null;
|
||||
event_type?: string | null;
|
||||
result?: ShippingAuditResult | null;
|
||||
request_id?: string | null;
|
||||
operation_id?: string | null;
|
||||
before_id?: number | null;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface ShippingAuditEventListResponse {
|
||||
items: ShippingAuditEvent[];
|
||||
next_before_id?: number | null;
|
||||
}
|
||||
|
||||
export interface ShippingOrderExtractionRunCreateResponse {
|
||||
run: ShippingOrderExtractionRun;
|
||||
reused: boolean;
|
||||
@@ -845,6 +991,7 @@ export interface ShippingOrderReviewCaseSummary {
|
||||
|
||||
export interface ShippingOrderReviewRun {
|
||||
run_no: string;
|
||||
superseded_by_run_no?: string | null;
|
||||
summary: Record<string, number>;
|
||||
items: ShippingOrderReviewCaseSummary[];
|
||||
}
|
||||
@@ -981,6 +1128,71 @@ export interface ShippingDuplicateResult {
|
||||
|
||||
export interface ShippingCreateBatchFromIntakesResponse extends ShippingNoticeUploadResponse {}
|
||||
|
||||
/** 会话 PDF 工作项生命周期;禁止前端按最新 Run 推断。 */
|
||||
export type ShippingSessionWorkItemLifecycleStatus =
|
||||
| 'pending_review'
|
||||
| 'extracting'
|
||||
| 'reparse_failed'
|
||||
| 'closed';
|
||||
|
||||
export type ShippingSessionWorkItemClosedReason =
|
||||
| 'confirmed'
|
||||
| 'non_order'
|
||||
| 'user_cancelled'
|
||||
| 'admin_terminated';
|
||||
|
||||
/** 单条会话 PDF 工作项摘要;右侧「本次处理」行模型。 */
|
||||
export interface ShippingSessionWorkItem {
|
||||
item_no: string;
|
||||
conversation_id: string;
|
||||
owner_user_id: number;
|
||||
root_document_id: number;
|
||||
current_document_id: number;
|
||||
current_document_filename?: string | null;
|
||||
current_run_id?: number | null;
|
||||
current_run_no?: string | null;
|
||||
current_case_id?: number | null;
|
||||
current_case_no?: string | null;
|
||||
current_version_no: number;
|
||||
lifecycle_status: ShippingSessionWorkItemLifecycleStatus | string;
|
||||
closed_reason?: ShippingSessionWorkItemClosedReason | string | null;
|
||||
closed_at?: string | null;
|
||||
lock_version: number;
|
||||
version_replaced?: boolean;
|
||||
previous_case_hint?: string | null;
|
||||
available_actions: string[];
|
||||
created_at?: string | null;
|
||||
updated_at?: string | null;
|
||||
}
|
||||
|
||||
/** 工作项版本历史行;只读时间线投影。 */
|
||||
export interface ShippingSessionWorkItemVersion {
|
||||
case_no: string;
|
||||
case_status?: string | null;
|
||||
run_id?: number | null;
|
||||
document_id?: number | null;
|
||||
document_filename?: string | null;
|
||||
is_current?: boolean;
|
||||
is_readonly?: boolean;
|
||||
version_label?: string | null;
|
||||
created_at?: string | null;
|
||||
confirmed_at?: string | null;
|
||||
}
|
||||
|
||||
/** 会话工作台聚合读模型;open_items / closed_items 为唯一列表事实源。 */
|
||||
export interface ShippingSessionWorkItemSummary {
|
||||
conversation_id: string;
|
||||
open_count: number;
|
||||
closed_count: number;
|
||||
pending_review_count: number;
|
||||
extracting_count: number;
|
||||
open_items: ShippingSessionWorkItem[];
|
||||
closed_items: ShippingSessionWorkItem[];
|
||||
closed_collapsed: boolean;
|
||||
max_open_items: number;
|
||||
truncated?: boolean;
|
||||
}
|
||||
|
||||
export interface ShippingDecisionResponse {
|
||||
status: string;
|
||||
message?: string;
|
||||
|
||||
@@ -1,31 +1,99 @@
|
||||
<!--
|
||||
用途:提供按 PDF 独立处理的建单前订单人工复核工作台。
|
||||
依赖:路由参数、复核 composable、冻结 Schema DTO、受控 PDF 预览组件。
|
||||
逻辑:复用聊天壳的历史侧栏;中心维护订单单头和表格化单身,右侧固定 PDF/证据检查器;处置、重识别及确认建单均只消费当前 Case Draft。
|
||||
用途:提供按 PDF 独立处理的建单前订单人工复核工作台(阶段 3:工作项版本中心)。
|
||||
依赖:路由参数、复核 composable、ReviewDocumentPreview、ReviewVersionHistoryPanel、ReviewActionConfirmDialog。
|
||||
逻辑:左侧 PDF 原件预览 + 字段证据定位;中部编辑;右侧版本历史;破坏性操作(含质量异常)二次确认;历史版本强制只读。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ArrowLeft, Copy, FileText, MapPin, Plus, RefreshCw, Save, Trash2, TriangleAlert, Undo2 } from 'lucide-vue-next';
|
||||
import { ArrowLeft, Crosshair, ExternalLink, Plus, RefreshCw, Save, TriangleAlert, Undo2, Copy, Trash2 } from 'lucide-vue-next';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useIsMobile } from '@/shared/composables/useIsMobile';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useChatPageContext } from '@/features/chat/composables/chat.context';
|
||||
import { useShippingOrderReview } from '../shipping-review/useShippingOrderReview';
|
||||
import ReviewActionConfirmDialog, {
|
||||
type ReviewConfirmAction,
|
||||
type ReviewConfirmPayload,
|
||||
} from '../components/shipping-review/ReviewActionConfirmDialog.vue';
|
||||
import ReviewDocumentPreview from '../components/shipping-review/ReviewDocumentPreview.vue';
|
||||
import ReviewVersionHistoryPanel from '../components/shipping-review/ReviewVersionHistoryPanel.vue';
|
||||
import { useShippingOrderReview } from '../shipping-review/useShippingOrderReview';
|
||||
import type { ShippingOrderReviewEvidence } from '../types/shipping.api.types';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const page = useChatPageContext();
|
||||
const { t } = useI18n();
|
||||
const { reviewRun, activeCase, evidence, previewUrl, loading, loadFailed, saving, saveFailed, load, selectCase, patchHeader, patchLine, addLine, copyLine, deleteLine, validate, confirm, createManualDraft, markNonOrder, markQualityIssue, reparseDocument, uploadReplacement } = useShippingOrderReview();
|
||||
const { t, te } = useI18n();
|
||||
const {
|
||||
reviewRun,
|
||||
activeCase,
|
||||
workItem,
|
||||
versions,
|
||||
statusMessage,
|
||||
isViewingHistoricalVersion,
|
||||
loading,
|
||||
loadFailed,
|
||||
saving,
|
||||
saveFailed,
|
||||
versionsLoading,
|
||||
evidence,
|
||||
previewUrl,
|
||||
load,
|
||||
selectCase,
|
||||
refreshWorkItemContext,
|
||||
openCurrentVersion,
|
||||
patchHeader,
|
||||
patchLine,
|
||||
addLine,
|
||||
copyLine,
|
||||
deleteLine,
|
||||
validate,
|
||||
confirm,
|
||||
createManualDraft,
|
||||
markNonOrder,
|
||||
markQualityIssue,
|
||||
reparseDocument,
|
||||
uploadReplacement,
|
||||
editable,
|
||||
} = useShippingOrderReview();
|
||||
const msg = useMessage();
|
||||
const { isMobile } = useIsMobile();
|
||||
/** 新模式从 query 读取 run_no;保留旧路径参数以兼容已收藏的复核链接。 */
|
||||
|
||||
const runNo = computed(() => String(route.query.run_no || route.params.runNo || ''));
|
||||
const agentId = computed(() => String(route.params.agentId || ''));
|
||||
const conversationId = computed(() => String(page.conversationId || route.query.conversation_id || ''));
|
||||
const itemNoFromQuery = computed(() => String(route.query.item_no || ''));
|
||||
|
||||
const focusedEvidenceRef = ref<{ fieldId: string; lineIndex?: number } | null>(null);
|
||||
/**
|
||||
* 当前用于 PDF 证据高亮的条目:明细同时按字段与行号匹配,避免多行同字段定位错位。
|
||||
*/
|
||||
const selectedEvidence = computed((): ShippingOrderReviewEvidence | null => {
|
||||
const items = evidence.value || [];
|
||||
if (!items.length) return null;
|
||||
const fieldId = String(focusedEvidenceRef.value?.fieldId || '').trim();
|
||||
if (fieldId) {
|
||||
const lineIndex = focusedEvidenceRef.value?.lineIndex;
|
||||
const matched = items.find((item) => String(item.field_id || '') === fieldId
|
||||
&& (lineIndex === undefined || Number(item.line_index) === lineIndex));
|
||||
if (matched) return matched;
|
||||
}
|
||||
return items.find((item) => item.bbox) || items[0] || null;
|
||||
});
|
||||
|
||||
/**
|
||||
* 聚焦订单字段以便 PDF 侧定位对应证据。
|
||||
*/
|
||||
const findFieldEvidence = (fieldId: string, lineIndex?: number) => (evidence.value || []).find((item) =>
|
||||
String(item.field_id || '') === String(fieldId || '').trim()
|
||||
&& (lineIndex === undefined || Number(item.line_index) === lineIndex),
|
||||
);
|
||||
const hasFieldEvidence = (fieldId: string, lineIndex?: number) => Boolean(findFieldEvidence(fieldId, lineIndex));
|
||||
/** 聚焦字段证据:有 bbox 时高亮,否则仅切至证据所在页。 */
|
||||
const focusFieldEvidence = (fieldId: string, lineIndex?: number) => {
|
||||
focusedEvidenceRef.value = findFieldEvidence(fieldId, lineIndex)
|
||||
? { fieldId: String(fieldId || '').trim(), lineIndex }
|
||||
: null;
|
||||
};
|
||||
|
||||
const headerSchemaFields = computed(() => (activeCase.value?.schema.fields || []).filter((field) => field.scope === 'header'));
|
||||
const lineSchemaFields = computed(() => (activeCase.value?.schema.fields || []).filter((field) => field.scope === 'line'));
|
||||
@@ -53,18 +121,46 @@ const machineValueByIdFor = (fields: Array<Record<string, unknown>>, fieldId: st
|
||||
const field = fields.find((item) => String(item.field_id || '') === fieldId);
|
||||
return field ? machineValue(field) : '';
|
||||
};
|
||||
const editable = computed(() => activeCase.value?.available_actions.includes('edit_draft') || false);
|
||||
const selectedEvidenceId = ref('');
|
||||
const contextOpen = ref(false);
|
||||
const confirmDialogOpen = ref(false);
|
||||
const confirmSuccess = ref<{ taskNo: string; autoProgress: boolean } | null>(null);
|
||||
const selectedEvidence = computed(() => evidence.value.find((item) => item.evidence_id === selectedEvidenceId.value) || null);
|
||||
// PDF.js uses evidence.page_no to select the page; retain the original Blob URL while switching evidence.
|
||||
const previewSrc = computed(() => previewUrl.value);
|
||||
const selectEvidence = (fieldId: string, lineIndex?: number) => {
|
||||
const item = evidence.value.find((entry) => entry.field_id === fieldId && entry.line_index === lineIndex);
|
||||
selectedEvidenceId.value = item?.evidence_id || '';
|
||||
const caseStatusLabel = (status: string) => {
|
||||
const key = `chat.shippingOrderReview.caseStatuses.${status}`;
|
||||
return te(key) ? t(key) : t('chat.shippingOrderReview.caseStatuses.unknown');
|
||||
};
|
||||
const statusBannerText = computed(() => {
|
||||
if (!statusMessage.value) return '';
|
||||
return t(`chat.shippingOrderReview.statusBanner.${statusMessage.value}`);
|
||||
});
|
||||
const workItemVersionLabel = computed(() => {
|
||||
const versionNo = workItem.value?.current_version_no;
|
||||
if (!versionNo) return '';
|
||||
return t('chat.shippingSessionWorkItem.versionLabel', { version: versionNo });
|
||||
});
|
||||
|
||||
const contextOpen = ref(false);
|
||||
const confirmSuccess = ref<{
|
||||
taskNo: string;
|
||||
autoProgress: boolean;
|
||||
progressStatus: string;
|
||||
progressMessage: string;
|
||||
checkpoint: string;
|
||||
} | null>(null);
|
||||
const pendingAction = ref<ReviewConfirmAction | null>(null);
|
||||
const pendingReplaceFile = ref<File | null>(null);
|
||||
const actionDialogOpen = ref(false);
|
||||
|
||||
/** 将自动推进结果映射为本地化状态;服务端 message 继续作为具体停留原因。 */
|
||||
const autoProgressStatusLabel = (status: string) => {
|
||||
const normalized = String(status || '').trim();
|
||||
const key = `chat.shippingOrderReview.autoProgress.status.${normalized}`;
|
||||
return normalized && te(key) ? t(key) : t('chat.shippingOrderReview.autoProgress.status.unknown');
|
||||
};
|
||||
|
||||
/** 打开已创建订单的任务工作台,由该页持续展示真实流程、待办与事件时间线。 */
|
||||
const openTaskProgress = (taskNo: string) => {
|
||||
const normalized = String(taskNo || '').trim();
|
||||
if (!normalized) return;
|
||||
void router.push({ name: 'workspace-shipping-tasks', params: { taskNo: normalized } });
|
||||
};
|
||||
|
||||
const reportSave = async (action: () => Promise<unknown> | null) => {
|
||||
try { await action(); }
|
||||
catch (error) {
|
||||
@@ -79,98 +175,450 @@ const reportDisposition = async (action: () => Promise<unknown> | null) => {
|
||||
msg.error(message);
|
||||
}
|
||||
};
|
||||
const confirmCase = () => {
|
||||
confirmDialogOpen.value = true;
|
||||
|
||||
/** 打开指定类型的二次确认弹窗。 */
|
||||
const openActionDialog = (action: ReviewConfirmAction) => {
|
||||
pendingAction.value = action;
|
||||
actionDialogOpen.value = true;
|
||||
};
|
||||
const confirmCaseSubmit = async () => {
|
||||
|
||||
/**
|
||||
* 确认弹窗提交:按 action 分发至对应写操作。
|
||||
* 核心逻辑:质量异常/非订单/重识别携带 reasonCode + comment,供后端统一审计复盘。
|
||||
* @param payload - 弹窗确认载荷
|
||||
*/
|
||||
const submitPendingAction = async (payload: ReviewConfirmPayload) => {
|
||||
const action = pendingAction.value;
|
||||
if (!action) return;
|
||||
try {
|
||||
const response = await confirm();
|
||||
if (response?.task_no) {
|
||||
confirmSuccess.value = {
|
||||
taskNo: String(response.task_no),
|
||||
autoProgress: Boolean(response.auto_progress_started || response.auto_progress),
|
||||
};
|
||||
if (action === 'confirm') {
|
||||
const response = await confirm();
|
||||
if (response?.task_no) {
|
||||
confirmSuccess.value = {
|
||||
taskNo: String(response.task_no),
|
||||
autoProgress: Boolean(response.auto_progress_started || response.auto_progress),
|
||||
progressStatus: String(response.auto_progress?.status || ''),
|
||||
progressMessage: String(response.auto_progress?.message || ''),
|
||||
checkpoint: String(response.auto_progress?.checkpoint || ''),
|
||||
};
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action === 'reparse') {
|
||||
const response = await reparseDocument(payload.reasonCode || 'document_quality', payload.comment);
|
||||
if (response?.run.run_no) {
|
||||
await router.replace({
|
||||
query: {
|
||||
...route.query,
|
||||
run_no: response.run.run_no,
|
||||
case: undefined,
|
||||
case_no: undefined,
|
||||
item_no: workItem.value?.item_no || itemNoFromQuery.value || undefined,
|
||||
},
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action === 'non_order') {
|
||||
await markNonOrder(payload.reasonCode || 'non_order', payload.comment);
|
||||
return;
|
||||
}
|
||||
if (action === 'quality_issue') {
|
||||
await markQualityIssue(payload.reasonCode || 'other', payload.comment);
|
||||
return;
|
||||
}
|
||||
if (action === 'replace' && pendingReplaceFile.value) {
|
||||
await uploadReplacement(pendingReplaceFile.value);
|
||||
pendingReplaceFile.value = null;
|
||||
}
|
||||
} catch (error) {
|
||||
const message = error instanceof BusinessError ? error.message : t('errors.generic');
|
||||
msg.error(message);
|
||||
} finally {
|
||||
pendingAction.value = null;
|
||||
}
|
||||
};
|
||||
|
||||
const selectReplacement = (event: Event) => {
|
||||
const file = (event.target as HTMLInputElement).files?.[0];
|
||||
if (file) void reportDisposition(() => uploadReplacement(file));
|
||||
if (!file) return;
|
||||
pendingReplaceFile.value = file;
|
||||
pendingAction.value = 'replace';
|
||||
actionDialogOpen.value = true;
|
||||
(event.target as HTMLInputElement).value = '';
|
||||
};
|
||||
|
||||
const select = async (caseNo: string) => {
|
||||
focusedEvidenceRef.value = null;
|
||||
await selectCase(caseNo);
|
||||
// Preserve review mode and the originating conversation while switching PDFs.
|
||||
await router.replace({ query: { ...route.query, case: caseNo } });
|
||||
};
|
||||
/** 在同一 ChatView 内退出复核模式,保留原会话实例及其滚动位置。 */
|
||||
|
||||
/**
|
||||
* 版本历史面板选择:历史版本只读打开,当前版本正常编辑。
|
||||
*/
|
||||
const selectVersionFromHistory = async (caseNo: string) => {
|
||||
await select(caseNo);
|
||||
await refreshWorkItemContext(conversationId.value, workItem.value?.item_no || itemNoFromQuery.value);
|
||||
};
|
||||
|
||||
/**
|
||||
* 跳转至工作项当前版本 Case。
|
||||
*/
|
||||
const jumpToCurrentVersion = async () => {
|
||||
const target = await openCurrentVersion();
|
||||
if (!target) return;
|
||||
await router.replace({
|
||||
query: {
|
||||
...route.query,
|
||||
run_no: target.runNo,
|
||||
case: target.caseNo,
|
||||
case_no: undefined,
|
||||
item_no: workItem.value?.item_no || itemNoFromQuery.value || undefined,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/** 退出复核模式回到「本次处理」侧栏视图。 */
|
||||
const back = () => router.replace({
|
||||
name: 'Chat',
|
||||
params: { agentId: agentId.value },
|
||||
query: Object.fromEntries(Object.entries(route.query).filter(([key]) => key !== 'mode' && key !== 'run_no')),
|
||||
query: Object.fromEntries(
|
||||
Object.entries(route.query).filter(([key]) => !['mode', 'run_no', 'case', 'case_no', 'item_no'].includes(key)),
|
||||
),
|
||||
});
|
||||
|
||||
watch(
|
||||
[runNo, () => String(route.query.case || '')],
|
||||
([nextRun, nextCase]) => { if (nextRun) void load(nextRun, nextCase || undefined); },
|
||||
[runNo, () => String(route.query.case || route.query.case_no || ''), conversationId, itemNoFromQuery],
|
||||
([nextRun, nextCase, nextConversationId, nextItemNo]) => {
|
||||
if (nextRun) {
|
||||
void load(nextRun, nextCase || undefined, {
|
||||
conversationId: nextConversationId || undefined,
|
||||
itemNo: nextItemNo || undefined,
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
watch(
|
||||
() => reviewRun.value?.run_no,
|
||||
(resolvedRunNo) => {
|
||||
if (resolvedRunNo && resolvedRunNo !== runNo.value) {
|
||||
void router.replace({
|
||||
query: {
|
||||
...route.query,
|
||||
run_no: resolvedRunNo,
|
||||
case: undefined,
|
||||
case_no: undefined,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="flex min-h-0 flex-1 flex-col bg-slate-50 text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
||||
<header class="flex shrink-0 items-center gap-3 border-b border-slate-200 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900">
|
||||
<button type="button" class="rounded-md p-1 hover:bg-slate-100 dark:hover:bg-slate-800" :aria-label="t('chat.shippingOrderReview.back')" @click="back"><ArrowLeft class="h-5 w-5" /></button>
|
||||
<div class="min-w-0"><h1 class="text-base font-semibold">{{ t('chat.shippingOrderReview.title') }}</h1><p class="truncate text-xs text-slate-500 dark:text-slate-400">{{ t('chat.shippingOrderReview.run', { runNo }) }}</p></div>
|
||||
<button type="button" class="ml-auto rounded border border-slate-200 px-2.5 py-1.5 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" @click="contextOpen = !contextOpen">{{ contextOpen ? '收起对话上下文' : '对话上下文' }}</button>
|
||||
<span class="shrink-0 rounded-full bg-sky-100 px-2.5 py-1 text-xs text-sky-800 dark:bg-sky-950 dark:text-sky-100">{{ saving ? t('chat.shippingOrderReview.saving') : saveFailed ? t('chat.shippingOrderReview.saveFailed') : t('chat.shippingOrderReview.saved') }}</span>
|
||||
</header>
|
||||
<div
|
||||
v-if="confirmSuccess"
|
||||
class="mx-4 mt-3 rounded-xl border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm text-emerald-800 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-100"
|
||||
>
|
||||
{{ confirmSuccess.autoProgress
|
||||
? t('chat.shippingOrderReview.confirmAutoProgress', { taskNo: confirmSuccess.taskNo })
|
||||
: t('chat.shippingOrderReview.confirmSuccess', { taskNo: confirmSuccess.taskNo }) }}
|
||||
<main
|
||||
class="flex min-h-0 flex-1 flex-col bg-slate-50 text-slate-900 dark:bg-slate-950 dark:text-slate-100"
|
||||
data-testid="shipping-order-review-view"
|
||||
:data-readonly="isViewingHistoricalVersion ? 'true' : 'false'"
|
||||
>
|
||||
<header class="flex shrink-0 items-center gap-3 border-b border-slate-200 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900">
|
||||
<button type="button" class="rounded-md p-1 hover:bg-slate-100 dark:hover:bg-slate-800" :aria-label="t('chat.shippingOrderReview.backToSession')" @click="back">
|
||||
<ArrowLeft class="h-5 w-5" />
|
||||
</button>
|
||||
<div class="min-w-0 flex-1">
|
||||
<h1 class="text-base font-semibold">{{ t('chat.shippingOrderReview.title') }}</h1>
|
||||
<p class="truncate text-xs text-slate-500 dark:text-slate-400">
|
||||
<template v-if="workItem?.item_no">
|
||||
{{ t('chat.shippingOrderReview.workItemHeader', { itemNo: workItem.item_no, version: workItemVersionLabel }) }}
|
||||
</template>
|
||||
<template v-else>{{ t('chat.shippingOrderReview.run', { runNo }) }}</template>
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" class="rounded border border-slate-200 px-2.5 py-1.5 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" @click="contextOpen = !contextOpen">
|
||||
{{ contextOpen ? t('chat.shippingOrderReview.hideContext') : t('chat.shippingOrderReview.showContext') }}
|
||||
</button>
|
||||
<span class="shrink-0 rounded-full bg-sky-100 px-2.5 py-1 text-xs text-sky-800 dark:bg-sky-950 dark:text-sky-100">
|
||||
{{ saving ? t('chat.shippingOrderReview.saving') : saveFailed ? t('chat.shippingOrderReview.saveFailed') : t('chat.shippingOrderReview.saved') }}
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="p-8 text-sm text-slate-600 dark:text-slate-300">{{ t('chat.shippingOrderReview.loading') }}</div>
|
||||
<div v-else-if="loadFailed" class="m-4 rounded-lg border border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 dark:border-rose-800 dark:bg-rose-950/30 dark:text-rose-100">{{ t('chat.shippingOrderReview.unavailable') }}</div>
|
||||
<div v-else class="grid min-h-0 flex-1 grid-cols-1 xl:grid-cols-[minmax(0,1fr)_minmax(340px,420px)]">
|
||||
<section class="min-h-0 overflow-y-auto p-4 lg:p-5">
|
||||
<div v-if="activeCase?.draft?.issues?.length" class="mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-xs text-amber-950 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100"><div class="font-semibold">{{ t('chat.shippingOrderReview.issues') }}</div><div v-for="issue in activeCase.draft.issues" :key="`${issue.code}-${issue.severity}`" class="mt-1">{{ issue.code }}</div></div>
|
||||
<section class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<div class="flex items-center justify-between gap-3"><div><h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.orderFields') }}</h2><p class="mt-1 text-xs text-slate-500">{{ t('chat.shippingOrderReview.schemaVersion', { version: activeCase?.schema.schema_version_id || '-' }) }}</p></div></div>
|
||||
<div v-if="primaryHeaderFields.length" class="mt-4 grid gap-3 md:grid-cols-2 2xl:grid-cols-3">
|
||||
<div v-for="field in primaryHeaderFields" :key="field.field_id" class="min-w-0">
|
||||
<label class="flex items-center justify-between gap-2 text-xs font-medium text-slate-600 dark:text-slate-300"><span class="truncate">{{ field.display_name }}<span v-if="field.required"> *</span></span><button type="button" class="shrink-0 text-slate-500 hover:text-sky-600" :aria-label="t('chat.shippingOrderReview.viewEvidence')" @click="selectEvidence(field.field_id)"><MapPin class="h-3.5 w-3.5" /></button></label>
|
||||
<input :value="draftValue(activeCase?.draft?.header_values || {}, field.field_id)" :disabled="!editable || saving" class="mt-1 w-full rounded-md border border-slate-300 bg-white px-2.5 py-2 text-sm dark:border-slate-600 dark:bg-slate-950" @change="reportSave(() => patchHeader(field.field_id, ($event.target as HTMLInputElement).value))">
|
||||
<div class="mt-1 flex items-center justify-between gap-2 text-[11px] text-slate-500"><span>{{ (activeCase?.draft?.header_values as Record<string, unknown>)?.values && Object.prototype.hasOwnProperty.call((activeCase?.draft?.header_values as Record<string, unknown>).values as object, field.field_id) ? t('chat.shippingOrderReview.manualSource') : t('chat.shippingOrderReview.machineSource') }}</span><button v-if="editable" type="button" class="hover:text-sky-600" @click="reportSave(() => patchHeader(field.field_id, null, true))"><Undo2 class="mr-1 inline h-3 w-3" />{{ t('chat.shippingOrderReview.restoreMachine') }}</button></div>
|
||||
<div
|
||||
v-if="statusBannerText"
|
||||
class="mx-4 mt-3 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-100"
|
||||
data-testid="review-status-banner"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<span>{{ statusBannerText }}</span>
|
||||
<button
|
||||
v-if="isViewingHistoricalVersion"
|
||||
type="button"
|
||||
class="rounded border border-amber-400 px-2 py-1 text-xs font-medium hover:bg-amber-100 dark:hover:bg-amber-900"
|
||||
data-testid="jump-to-current-version"
|
||||
@click="jumpToCurrentVersion"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.jumpToCurrentVersion') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="confirmSuccess"
|
||||
class="mx-4 mt-3 rounded-xl border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm text-emerald-800 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-100"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<p>{{ confirmSuccess.autoProgress
|
||||
? t('chat.shippingOrderReview.confirmAutoProgress', { taskNo: confirmSuccess.taskNo })
|
||||
: t('chat.shippingOrderReview.confirmSuccess', { taskNo: confirmSuccess.taskNo }) }}</p>
|
||||
<p v-if="confirmSuccess.autoProgress" class="mt-1 text-xs">
|
||||
{{ t('chat.shippingOrderReview.autoProgress.result', { status: autoProgressStatusLabel(confirmSuccess.progressStatus) }) }}
|
||||
</p>
|
||||
<p v-if="confirmSuccess.progressMessage" class="mt-1 text-xs">{{ confirmSuccess.progressMessage }}</p>
|
||||
<p v-if="confirmSuccess.checkpoint" class="mt-1 text-xs text-amber-800 dark:text-amber-200">
|
||||
{{ t('chat.shippingOrderReview.autoProgress.checkpoint', { checkpoint: confirmSuccess.checkpoint }) }}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex shrink-0 items-center gap-1 rounded border border-emerald-400 px-2.5 py-1.5 text-xs font-medium hover:bg-emerald-100 dark:hover:bg-emerald-900"
|
||||
data-testid="open-confirmed-task-progress"
|
||||
@click="openTaskProgress(confirmSuccess.taskNo)"
|
||||
>
|
||||
<ExternalLink class="h-3.5 w-3.5" />{{ t('chat.shippingOrderReview.autoProgress.viewTask') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="loading" class="p-8 text-sm text-slate-600 dark:text-slate-300">{{ t('chat.shippingOrderReview.loading') }}</div>
|
||||
<div v-else-if="loadFailed" class="m-4 rounded-lg border border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 dark:border-rose-800 dark:bg-rose-950/30 dark:text-rose-100">
|
||||
{{ t('chat.shippingOrderReview.unavailable') }}
|
||||
</div>
|
||||
<div v-else class="min-h-0 flex-1 overflow-y-auto">
|
||||
<section class="p-4 lg:p-5">
|
||||
<div class="grid gap-4 xl:grid-cols-[minmax(480px,1.25fr)_minmax(420px,1fr)]">
|
||||
<aside
|
||||
class="order-2 min-h-[180px] overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm xl:order-1 xl:h-[calc(100vh-11rem)] xl:min-h-[560px] dark:border-slate-800 dark:bg-slate-900"
|
||||
data-testid="review-document-preview"
|
||||
>
|
||||
<div class="border-b border-slate-200 px-3 py-2 text-xs font-semibold text-slate-600 dark:border-slate-800 dark:text-slate-300">
|
||||
{{ t('chat.shippingOrderReview.previewTitle') }}
|
||||
</div>
|
||||
<ReviewDocumentPreview
|
||||
v-if="previewUrl"
|
||||
:src="previewUrl"
|
||||
:evidence="selectedEvidence"
|
||||
:title="t('chat.shippingOrderReview.previewTitle')"
|
||||
:loading-text="t('chat.shippingOrderReview.previewLoading')"
|
||||
:unavailable-text="t('chat.shippingOrderReview.previewUnavailable')"
|
||||
/>
|
||||
<div v-else class="flex min-h-[140px] items-center justify-center p-4 text-sm text-slate-500 xl:min-h-[360px]">
|
||||
{{ t('chat.shippingOrderReview.previewUnavailable') }}
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="order-1 min-w-0 space-y-4 xl:order-2">
|
||||
<nav class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900" :aria-label="t('chat.shippingOrderReview.documentNavigation')">
|
||||
<div class="mb-2 text-xs font-semibold text-slate-500">{{ t('chat.shippingOrderReview.documents') }}</div>
|
||||
<div class="flex gap-2 overflow-x-auto">
|
||||
<button
|
||||
v-for="item in reviewRun?.items || []"
|
||||
:key="item.case_no"
|
||||
type="button"
|
||||
class="min-w-52 rounded-lg border p-2.5 text-left text-sm"
|
||||
:class="activeCase?.case_no === item.case_no ? 'border-sky-500 bg-sky-50 dark:bg-sky-950/30' : 'border-slate-200 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800'"
|
||||
@click="select(item.case_no)"
|
||||
>
|
||||
<div class="truncate font-medium">{{ item.file_name || t('chat.shippingOrderReview.unnamedDocument') }}</div>
|
||||
<div class="mt-1 flex items-center gap-1 text-xs text-slate-500">
|
||||
<TriangleAlert v-if="item.issue_count" class="h-3.5 w-3.5 text-amber-500" />
|
||||
{{ t('chat.shippingOrderReview.caseStatus', { status: caseStatusLabel(item.status), count: item.issue_count }) }}
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<details class="rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<summary class="cursor-pointer px-4 py-3 text-sm font-semibold">{{ t('chat.shippingOrderReview.versionHistory.title') }}</summary>
|
||||
<div class="border-t border-slate-200 p-4 dark:border-slate-800">
|
||||
<ReviewVersionHistoryPanel
|
||||
:item-no="workItem?.item_no || itemNoFromQuery"
|
||||
:versions="versions"
|
||||
:loading="versionsLoading"
|
||||
:active-case-no="activeCase?.case_no"
|
||||
@select="selectVersionFromHistory"
|
||||
/>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div v-if="contextOpen" class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.contextTitle') }}</h2>
|
||||
<p class="mt-1 text-xs text-slate-500">{{ t('chat.shippingOrderReview.contextDesc') }}</p>
|
||||
<div class="mt-4 space-y-3">
|
||||
<article v-for="(message, index) in page.messages.slice(-6)" :key="`${message.local_id || index}`" class="rounded-lg border border-slate-200 p-3 text-sm dark:border-slate-700">
|
||||
<div class="mb-1 text-xs font-medium text-slate-500">{{ message.role === 'user' ? t('chat.shippingOrderReview.contextUser') : t('chat.shippingOrderReview.contextAi') }}</div>
|
||||
<p class="whitespace-pre-wrap break-words">{{ message.content }}</p>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="mt-4 rounded-lg border border-dashed border-slate-300 p-3 text-sm text-slate-500 dark:border-slate-700"><p>{{ t('chat.shippingOrderReview.noMachineOrder') }}</p><div v-if="activeCase?.available_actions.includes('create_draft')" class="mt-3 flex flex-wrap gap-2"><button type="button" class="rounded border px-2 py-1 text-xs" :disabled="saving" @click="reportDisposition(() => createManualDraft())">{{ t('chat.shippingOrderReview.createManualDraft') }}</button><button type="button" class="rounded border px-2 py-1 text-xs" :disabled="saving" @click="reportDisposition(() => markNonOrder('non_order'))">{{ t('chat.shippingOrderReview.markNonOrder') }}</button></div></div>
|
||||
<details v-if="optionalEmptyHeaderFields.length" class="mt-4 rounded-lg border border-slate-200 p-3 text-sm dark:border-slate-700"><summary class="cursor-pointer font-medium">{{ t('chat.shippingOrderReview.moreFields', { count: optionalEmptyHeaderFields.length }) }}</summary><div class="mt-3 grid gap-2 sm:grid-cols-2"><div v-for="field in optionalEmptyHeaderFields" :key="field.field_id" class="text-xs"><div class="text-slate-500">{{ field.display_name }}</div><div>{{ t('chat.shippingOrderReview.emptyValue') }}</div></div></div></details>
|
||||
</section>
|
||||
|
||||
<section class="mt-4 rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<div class="flex items-center justify-between gap-3 border-b border-slate-200 px-4 py-3 dark:border-slate-800"><div><h3 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.lines') }}</h3><p class="mt-1 text-xs text-slate-500">{{ (activeCase?.draft?.lines || []).length }} {{ t('chat.shippingOrderReview.lines') }}</p></div><button v-if="!isMobile" type="button" :disabled="!editable || saving" class="inline-flex items-center gap-1 rounded border px-2 py-1 text-xs disabled:opacity-50" @click="reportSave(() => addLine())"><Plus class="h-3.5 w-3.5" />{{ t('chat.shippingOrderReview.addLine') }}</button></div>
|
||||
<div v-if="activeCase?.draft?.lines?.length" class="overflow-x-auto"><table class="min-w-full border-collapse text-left text-xs"><thead class="bg-slate-50 text-slate-500 dark:bg-slate-950/40 dark:text-slate-400"><tr><th class="sticky left-0 z-10 min-w-14 border-b border-slate-200 bg-slate-50 px-3 py-2 font-medium dark:border-slate-800 dark:bg-slate-950">#</th><th v-for="field in primaryLineFields" :key="field.field_id" class="min-w-40 border-b border-slate-200 px-3 py-2 font-medium dark:border-slate-800">{{ field.display_name }}<span v-if="field.required"> *</span></th><th v-if="!isMobile" class="sticky right-0 z-10 border-b border-slate-200 bg-slate-50 px-3 py-2 dark:border-slate-800 dark:bg-slate-950"><span class="sr-only">{{ t('chat.shippingOrderReview.line', { index: '' }) }}</span></th></tr></thead><tbody><tr v-for="(line, index) in activeCase?.draft?.lines || []" :key="String(line.line_key || index)" class="border-b border-slate-100 last:border-0 dark:border-slate-800"><td class="sticky left-0 z-10 bg-white px-3 py-2 font-medium dark:bg-slate-900">{{ index + 1 }}</td><td v-for="field in primaryLineFields" :key="field.field_id" class="min-w-40 px-3 py-2 align-top"><div class="flex min-w-0 items-center gap-1"><input :value="draftValue(line, field.field_id)" :disabled="!editable || saving" class="min-w-0 flex-1 rounded border border-slate-300 bg-white px-2 py-1.5 dark:border-slate-600 dark:bg-slate-950" @change="reportSave(() => patchLine(String(line.line_key), field.field_id, ($event.target as HTMLInputElement).value))"><button type="button" class="shrink-0 text-slate-500 hover:text-sky-600" :aria-label="t('chat.shippingOrderReview.viewEvidence')" @click="selectEvidence(field.field_id, index)"><MapPin class="h-3.5 w-3.5" /></button></div></td><td v-if="!isMobile" class="sticky right-0 z-10 whitespace-nowrap bg-white px-2 py-2 dark:bg-slate-900"><button type="button" :disabled="!editable || saving" class="rounded p-1 hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-slate-800" :aria-label="t('chat.shippingOrderReview.copyLine')" @click="reportSave(() => copyLine(String(line.line_key)))"><Copy class="h-3.5 w-3.5" /></button><button type="button" :disabled="!editable || saving" class="rounded p-1 hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-slate-800" :aria-label="t('chat.shippingOrderReview.deleteLine')" @click="reportSave(() => deleteLine(String(line.line_key)))"><Trash2 class="h-3.5 w-3.5" /></button></td></tr></tbody></table></div>
|
||||
<div v-else class="p-4 text-sm text-slate-500">{{ t('chat.shippingOrderReview.noLines') }}</div>
|
||||
<details v-if="optionalEmptyLineFields.length" class="border-t border-slate-200 px-4 py-3 text-xs dark:border-slate-800"><summary class="cursor-pointer text-slate-500">{{ t('chat.shippingOrderReview.moreFields', { count: optionalEmptyLineFields.length }) }}</summary><p class="mt-2 text-slate-500">{{ optionalEmptyLineFields.map((field) => field.display_name).join(' · ') }}</p></details>
|
||||
</section>
|
||||
</section>
|
||||
<div v-if="activeCase?.draft?.issues?.length" class="rounded-lg border border-amber-300 bg-amber-50 p-3 text-xs text-amber-950 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100">
|
||||
<div class="font-semibold">{{ t('chat.shippingOrderReview.issues') }}</div>
|
||||
<div v-for="issue in activeCase.draft.issues" :key="`${issue.code}-${issue.severity}`" class="mt-1">{{ issue.code }}</div>
|
||||
</div>
|
||||
|
||||
<aside class="flex min-h-0 flex-col border-t border-slate-200 bg-white xl:border-l xl:border-t-0 dark:border-slate-800 dark:bg-slate-900">
|
||||
<nav class="shrink-0 border-b border-slate-200 p-3 dark:border-slate-800" :aria-label="t('chat.shippingOrderReview.documentNavigation')"><div class="mb-2 text-xs font-semibold text-slate-500">{{ t('chat.shippingOrderReview.documents') }}</div><div class="flex gap-2 overflow-x-auto xl:flex-col xl:overflow-y-auto"><button v-for="item in reviewRun?.items || []" :key="item.case_no" type="button" class="min-w-52 rounded-lg border p-2.5 text-left text-sm xl:min-w-0" :class="activeCase?.case_no === item.case_no ? 'border-sky-500 bg-sky-50 dark:bg-sky-950/30' : 'border-slate-200 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800'" @click="select(item.case_no)"><div class="truncate font-medium">{{ item.file_name || t('chat.shippingOrderReview.unnamedDocument') }}</div><div class="mt-1 flex items-center gap-1 text-xs text-slate-500"><TriangleAlert v-if="item.issue_count" class="h-3.5 w-3.5 text-amber-500" />{{ t('chat.shippingOrderReview.caseStatus', { status: item.status, count: item.issue_count }) }}</div></button></div></nav>
|
||||
<div v-if="contextOpen" class="min-h-0 flex-1 overflow-y-auto p-4"><h2 class="text-sm font-semibold">对话上下文</h2><p class="mt-1 text-xs text-slate-500">当前会话中最近的订单抽取消息与附件。</p><div class="mt-4 space-y-3"><article v-for="(message, index) in page.messages.slice(-6)" :key="`${message.local_id || index}`" class="rounded-lg border border-slate-200 p-3 text-sm dark:border-slate-700"><div class="mb-1 text-xs font-medium text-slate-500">{{ message.role === 'user' ? '用户' : 'AI' }}</div><p class="whitespace-pre-wrap break-words">{{ message.content }}</p><div v-if="message.attachments?.length" class="mt-2 text-xs text-slate-500">{{ message.attachments.map((item) => item.name || '附件').join(' · ') }}</div></article><p v-if="page.messages.length === 0" class="text-sm text-slate-500">暂无可显示的对话上下文。</p></div></div>
|
||||
<div v-else class="flex min-h-0 flex-1 flex-col p-3"><div class="mb-2 flex items-center gap-2 text-sm font-semibold"><FileText class="h-4 w-4" />{{ activeCase?.document.file_name || t('chat.shippingOrderReview.unnamedDocument') }}</div><div class="min-h-[320px] flex-1 overflow-hidden rounded-xl border border-slate-300 bg-slate-50 dark:border-slate-700 dark:bg-slate-950"><ReviewDocumentPreview v-if="previewSrc" :src="previewSrc" :evidence="selectedEvidence" :title="t('chat.shippingOrderReview.previewTitle')" :loading-text="t('chat.shippingOrderReview.previewLoading')" :unavailable-text="t('chat.shippingOrderReview.previewUnavailable')" /></div><div v-if="selectedEvidence" class="mt-3 rounded-lg border border-sky-200 bg-sky-50 p-3 text-xs text-sky-950 dark:border-sky-900 dark:bg-sky-950/30 dark:text-sky-100"><div class="flex items-center gap-1 font-semibold"><MapPin class="h-3.5 w-3.5" />{{ t('chat.shippingOrderReview.evidenceAt', { page: selectedEvidence.page_no || '-' }) }}</div><p v-if="selectedEvidence.quote" class="mt-1 break-words">{{ selectedEvidence.quote }}</p><p v-if="!selectedEvidence.bbox" class="mt-1">{{ t('chat.shippingOrderReview.evidenceNoHighlight') }}</p></div><p v-else class="mt-3 text-xs text-slate-500">{{ t('chat.shippingOrderReview.evidenceSummary') }}</p></div>
|
||||
</aside>
|
||||
</div>
|
||||
<section class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.orderFields') }}</h2>
|
||||
<p class="mt-1 text-xs text-slate-500">{{ t('chat.shippingOrderReview.schemaVersion', { version: activeCase?.schema.schema_version_id || '-' }) }}</p>
|
||||
</div>
|
||||
<span v-if="isViewingHistoricalVersion" class="rounded-full bg-slate-100 px-2 py-0.5 text-xs text-slate-600 dark:bg-slate-800 dark:text-slate-300">
|
||||
{{ t('chat.shippingOrderReview.readOnly') }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="primaryHeaderFields.length" class="mt-4 grid gap-3 md:grid-cols-2 2xl:grid-cols-3">
|
||||
<div v-for="field in primaryHeaderFields" :key="field.field_id" class="min-w-0">
|
||||
<div class="flex items-center justify-between gap-2 text-xs font-medium text-slate-600 dark:text-slate-300">
|
||||
<span class="truncate">{{ field.display_name }}<span v-if="field.required"> *</span></span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded p-1 text-slate-500 hover:bg-sky-50 hover:text-sky-600 disabled:cursor-not-allowed disabled:opacity-35 dark:hover:bg-sky-950"
|
||||
:disabled="!hasFieldEvidence(field.field_id)"
|
||||
:aria-label="t('chat.shippingOrderReview.locateSource', { field: field.display_name })"
|
||||
:title="t('chat.shippingOrderReview.locateSource', { field: field.display_name })"
|
||||
@click="focusFieldEvidence(field.field_id)"
|
||||
><Crosshair class="h-3 w-3" /></button>
|
||||
</div>
|
||||
<input
|
||||
:value="draftValue(activeCase?.draft?.header_values || {}, field.field_id)"
|
||||
:disabled="!editable || saving"
|
||||
class="mt-1 w-full rounded-md border border-slate-300 bg-white px-2.5 py-2 text-sm dark:border-slate-600 dark:bg-slate-950"
|
||||
@focus="focusFieldEvidence(field.field_id)"
|
||||
@change="reportSave(() => patchHeader(field.field_id, ($event.target as HTMLInputElement).value))"
|
||||
>
|
||||
<div class="mt-1 flex items-center justify-between gap-2 text-[11px] text-slate-500">
|
||||
<span>{{ (activeCase?.draft?.header_values as Record<string, unknown>)?.values && Object.prototype.hasOwnProperty.call((activeCase?.draft?.header_values as Record<string, unknown>).values as object, field.field_id) ? t('chat.shippingOrderReview.manualSource') : t('chat.shippingOrderReview.machineSource') }}</span>
|
||||
<button v-if="editable" type="button" class="hover:text-sky-600" @click="reportSave(() => patchHeader(field.field_id, null, true))">
|
||||
<Undo2 class="mr-1 inline h-3 w-3" />{{ t('chat.shippingOrderReview.restoreMachine') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="mt-4 rounded-lg border border-dashed border-slate-300 p-3 text-sm text-slate-500 dark:border-slate-700">
|
||||
<p>{{ t('chat.shippingOrderReview.noMachineOrder') }}</p>
|
||||
<div v-if="editable && activeCase?.available_actions.includes('create_draft')" class="mt-3 flex flex-wrap gap-2">
|
||||
<button type="button" class="rounded border px-2 py-1 text-xs" :disabled="saving" @click="reportDisposition(() => createManualDraft())">{{ t('chat.shippingOrderReview.createManualDraft') }}</button>
|
||||
<button type="button" class="rounded border px-2 py-1 text-xs" :disabled="saving" @click="openActionDialog('non_order')">{{ t('chat.shippingOrderReview.markNonOrder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<details v-if="optionalEmptyHeaderFields.length" class="mt-4 rounded-lg border border-slate-200 p-3 text-sm dark:border-slate-700">
|
||||
<summary class="cursor-pointer font-medium">{{ t('chat.shippingOrderReview.moreFields', { count: optionalEmptyHeaderFields.length }) }}</summary>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
<footer v-if="activeCase?.draft" class="flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-slate-200 bg-white p-3 dark:border-slate-800 dark:bg-slate-900"><button v-if="activeCase?.available_actions.includes('mark_non_order')" type="button" :disabled="saving" class="rounded border px-3 py-2 text-sm disabled:opacity-50" @click="reportDisposition(() => markNonOrder('non_order'))">{{ t('chat.shippingOrderReview.markNonOrder') }}</button><button v-if="activeCase?.available_actions.includes('mark_quality_issue')" type="button" :disabled="saving" class="rounded border px-3 py-2 text-sm disabled:opacity-50" @click="reportDisposition(() => markQualityIssue('other'))">{{ t('chat.shippingOrderReview.markQualityIssue') }}</button><button v-if="activeCase?.available_actions.includes('reparse')" type="button" :disabled="saving" class="inline-flex items-center gap-1 rounded border px-3 py-2 text-sm disabled:opacity-50" @click="reportDisposition(() => reparseDocument('document_quality'))"><RefreshCw class="h-4 w-4" />{{ t('chat.shippingOrderReview.reparse') }}</button><label v-if="activeCase?.available_actions.includes('mark_quality_issue')" class="cursor-pointer rounded border px-3 py-2 text-sm"><input class="sr-only" type="file" accept="application/pdf,.pdf" :disabled="saving" @change="selectReplacement">{{ t('chat.shippingOrderReview.uploadReplacement') }}</label><button v-if="activeCase?.available_actions.includes('validate')" type="button" :disabled="saving" class="inline-flex items-center gap-1 rounded bg-sky-600 px-3 py-2 text-sm text-white disabled:opacity-50" @click="reportSave(() => validate())"><Save class="h-4 w-4" />{{ t('chat.shippingOrderReview.saveNow') }}</button><button v-if="activeCase?.available_actions.includes('confirm')" type="button" :disabled="saving" class="rounded bg-emerald-600 px-3 py-2 text-sm text-white disabled:opacity-50" @click="confirmCase">{{ t('chat.shippingOrderReview.confirmCreate') }}</button></footer>
|
||||
<DeleteConfirmDialog v-model="confirmDialogOpen" :title="t('chat.shippingOrderReview.confirmCreate')" :message="t('chat.shippingOrderReview.confirmPrompt')" :confirm-text="t('chat.shippingOrderReview.confirmCreate')" confirm-tone="primary" :confirm-loading="saving" @confirm="confirmCaseSubmit" />
|
||||
</main>
|
||||
<section class="rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<div class="flex items-center justify-between gap-3 border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.lines') }}</h3>
|
||||
<p class="mt-1 text-xs text-slate-500">{{ (activeCase?.draft?.lines || []).length }} {{ t('chat.shippingOrderReview.lines') }}</p>
|
||||
</div>
|
||||
<button v-if="editable" type="button" :disabled="saving" class="inline-flex items-center gap-1 rounded border px-2 py-1 text-xs disabled:opacity-50" data-testid="review-add-line" @click="reportSave(() => addLine())">
|
||||
<Plus class="h-3.5 w-3.5" />{{ t('chat.shippingOrderReview.addLine') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="activeCase?.draft?.lines?.length" class="overflow-x-auto">
|
||||
<table class="min-w-full border-collapse text-left text-[11px]">
|
||||
<thead class="bg-slate-50 text-slate-500 dark:bg-slate-950/40 dark:text-slate-400">
|
||||
<tr>
|
||||
<th class="sticky left-0 z-10 min-w-12 border-b border-slate-200 bg-slate-50 px-2 py-1.5 font-medium dark:border-slate-800 dark:bg-slate-950">#</th>
|
||||
<th v-for="field in primaryLineFields" :key="field.field_id" class="min-w-28 border-b border-slate-200 px-2 py-1.5 font-medium dark:border-slate-800">
|
||||
{{ field.display_name }}<span v-if="field.required"> *</span>
|
||||
</th>
|
||||
<th class="sticky right-0 z-10 border-b border-slate-200 bg-slate-50 px-2 py-1.5 dark:border-slate-800 dark:bg-slate-950">
|
||||
<span class="sr-only">{{ t('chat.shippingOrderReview.line', { index: '' }) }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(line, index) in activeCase?.draft?.lines || []" :key="String(line.line_key || index)" class="border-b border-slate-100 last:border-0 dark:border-slate-800">
|
||||
<td class="sticky left-0 z-10 bg-white px-2 py-1.5 font-medium dark:bg-slate-900">{{ index + 1 }}</td>
|
||||
<td v-for="field in primaryLineFields" :key="field.field_id" class="min-w-28 px-2 py-1.5 align-middle">
|
||||
<div class="flex min-w-0 items-center gap-1">
|
||||
<input
|
||||
:value="draftValue(line, field.field_id)"
|
||||
:disabled="!editable || saving"
|
||||
class="min-w-0 flex-1 rounded border border-slate-300 bg-white px-1.5 py-1 text-xs dark:border-slate-600 dark:bg-slate-950"
|
||||
@focus="focusFieldEvidence(field.field_id, index)"
|
||||
@change="reportSave(() => patchLine(String(line.line_key), field.field_id, ($event.target as HTMLInputElement).value))"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="shrink-0 rounded p-0.5 text-slate-500 hover:bg-sky-50 hover:text-sky-600 disabled:cursor-not-allowed disabled:opacity-35 dark:hover:bg-sky-950"
|
||||
:disabled="!hasFieldEvidence(field.field_id, index)"
|
||||
:aria-label="t('chat.shippingOrderReview.locateSource', { field: field.display_name })"
|
||||
:title="t('chat.shippingOrderReview.locateSource', { field: field.display_name })"
|
||||
@click="focusFieldEvidence(field.field_id, index)"
|
||||
><Crosshair class="h-3 w-3" /></button>
|
||||
</div>
|
||||
</td>
|
||||
<td class="sticky right-0 z-10 whitespace-nowrap bg-white px-1.5 py-1.5 dark:bg-slate-900">
|
||||
<button type="button" :disabled="!editable || saving" class="rounded p-1 hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-slate-800" data-testid="review-copy-line" :aria-label="t('chat.shippingOrderReview.copyLine')" @click="reportSave(() => copyLine(String(line.line_key)))">
|
||||
<Copy class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
<button type="button" :disabled="!editable || saving" class="rounded p-1 hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-slate-800" data-testid="review-delete-line" :aria-label="t('chat.shippingOrderReview.deleteLine')" @click="reportSave(() => deleteLine(String(line.line_key)))">
|
||||
<Trash2 class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="p-4 text-sm text-slate-500">{{ t('chat.shippingOrderReview.noLines') }}</div>
|
||||
<details v-if="optionalEmptyLineFields.length" class="border-t border-slate-200 px-4 py-3 text-xs dark:border-slate-800">
|
||||
<summary class="cursor-pointer text-slate-500">{{ t('chat.shippingOrderReview.moreFields', { count: optionalEmptyLineFields.length }) }}</summary>
|
||||
<p class="mt-2 text-slate-500">{{ optionalEmptyLineFields.map((field) => field.display_name).join(' · ') }}</p>
|
||||
</details>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer
|
||||
v-if="activeCase?.draft && !isViewingHistoricalVersion"
|
||||
class="flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-slate-200 bg-white p-3 dark:border-slate-800 dark:bg-slate-900"
|
||||
>
|
||||
<button v-if="activeCase?.available_actions.includes('mark_non_order')" type="button" :disabled="saving" class="rounded border px-3 py-2 text-sm disabled:opacity-50" @click="openActionDialog('non_order')">
|
||||
{{ t('chat.shippingOrderReview.markNonOrder') }}
|
||||
</button>
|
||||
<button v-if="activeCase?.available_actions.includes('mark_quality_issue')" type="button" :disabled="saving" class="rounded border px-3 py-2 text-sm disabled:opacity-50" @click="openActionDialog('quality_issue')">
|
||||
{{ t('chat.shippingOrderReview.markQualityIssue') }}
|
||||
</button>
|
||||
<button v-if="activeCase?.available_actions.includes('reparse')" type="button" :disabled="saving" class="inline-flex items-center gap-1 rounded border px-3 py-2 text-sm disabled:opacity-50" @click="openActionDialog('reparse')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('chat.shippingOrderReview.reparse') }}
|
||||
</button>
|
||||
<label v-if="activeCase?.available_actions.includes('mark_quality_issue')" class="cursor-pointer rounded border px-3 py-2 text-sm">
|
||||
<input class="sr-only" type="file" accept="application/pdf,.pdf" :disabled="saving" @change="selectReplacement">
|
||||
{{ t('chat.shippingOrderReview.uploadReplacement') }}
|
||||
</label>
|
||||
<button v-if="activeCase?.available_actions.includes('validate')" type="button" :disabled="saving" class="inline-flex items-center gap-1 rounded bg-sky-600 px-3 py-2 text-sm text-white disabled:opacity-50" @click="reportSave(() => validate())">
|
||||
<Save class="h-4 w-4" />{{ t('chat.shippingOrderReview.saveNow') }}
|
||||
</button>
|
||||
<button v-if="activeCase?.available_actions.includes('confirm')" type="button" :disabled="saving" class="rounded bg-emerald-600 px-3 py-2 text-sm text-white disabled:opacity-50" @click="openActionDialog('confirm')">
|
||||
{{ t('chat.shippingOrderReview.confirmCreate') }}
|
||||
</button>
|
||||
</footer>
|
||||
|
||||
<ReviewActionConfirmDialog
|
||||
v-if="actionDialogOpen && pendingAction"
|
||||
v-model="actionDialogOpen"
|
||||
:action="pendingAction"
|
||||
:confirm-loading="saving"
|
||||
@confirm="submitPendingAction"
|
||||
@cancel="pendingReplaceFile = null"
|
||||
/>
|
||||
</main>
|
||||
</template>
|
||||
@@ -0,0 +1,325 @@
|
||||
/**
|
||||
* features/workspace/shipping-task-center/ShippingRunProgressTable.vue
|
||||
* 用途:任务中心「我的识别」续办表——展示用户自有抽取 Run 的阶段、耗时、取消态与续办动作。
|
||||
* 依赖:shipping.api 分页列表/取消/重试、vue-i18n、vue-router、orderExtractionProgressDisplay。
|
||||
* 逻辑:事实来自后端投影;打开会话/复核深链到 Chat;取消/重试复用工作台 API。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import {
|
||||
cancelWorkspaceShippingOrderExtractionRun,
|
||||
listShippingChatAgents,
|
||||
listWorkspaceShippingOrderExtractionRunsPage,
|
||||
retryWorkspaceShippingOrderExtractionRun,
|
||||
SHIPPING_NOTICE_AGENT_CODE,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
import type { ShippingOrderExtractionRun } from '@/features/chat/types/shipping.api.types';
|
||||
import { formatOrderExtractionElapsed } from '@/features/chat/shipping/orderExtractionProgressDisplay';
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
const loading = ref(false);
|
||||
const actingRunNo = ref('');
|
||||
const pendingCancelRunNo = ref('');
|
||||
const cancelReason = ref('');
|
||||
const status = ref('');
|
||||
const page = ref(1);
|
||||
const pageSize = 20;
|
||||
const total = ref(0);
|
||||
const rows = ref<ShippingOrderExtractionRun[]>([]);
|
||||
const chatAgentId = ref<number | null>(null);
|
||||
const error = ref('');
|
||||
|
||||
/**
|
||||
* 解析货代 Chat Agent,供会话深链。
|
||||
*/
|
||||
async function resolveChatAgent() {
|
||||
try {
|
||||
const agents = await listShippingChatAgents();
|
||||
const found = agents.find((a) => String(a.agent_code || '').trim() === SHIPPING_NOTICE_AGENT_CODE);
|
||||
if (found) chatAgentId.value = found.id;
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页加载当前用户识别 Run。
|
||||
*/
|
||||
async function load() {
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
try {
|
||||
const response = await listWorkspaceShippingOrderExtractionRunsPage({
|
||||
status: status.value || undefined,
|
||||
page: page.value,
|
||||
page_size: pageSize,
|
||||
});
|
||||
rows.value = response.items || [];
|
||||
total.value = Number(response.total || 0);
|
||||
} catch {
|
||||
error.value = t('workspace.shippingNotice.myRuns.loadFailed');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户可见阶段文案;无投影时回退状态文案。
|
||||
*/
|
||||
function stageLabel(run: ShippingOrderExtractionRun): string {
|
||||
const stage = String(run.current_activity?.user_visible_stage || '').trim();
|
||||
if (stage) {
|
||||
const key = `chat.shippingOrderExtractionUserStage.${stage}`;
|
||||
if (te(key)) return t(key);
|
||||
}
|
||||
const statusKey = `chat.shippingOrderExtractionCardTitle.${run.status}`;
|
||||
return te(statusKey) ? t(statusKey) : run.status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开所属会话;活动 Run 进入聊天进度面。
|
||||
*/
|
||||
async function openInChat(run: ShippingOrderExtractionRun) {
|
||||
const agentId = Number(run.agent_id || chatAgentId.value || 0);
|
||||
if (!agentId) return;
|
||||
const query: Record<string, string> = {};
|
||||
const cid = String(run.conversation_id || '').trim();
|
||||
if (cid) query.conversation_id = cid;
|
||||
if (['review_required', 'partially_completed'].includes(run.status)) {
|
||||
query.mode = 'order-review';
|
||||
query.run_no = run.run_no;
|
||||
}
|
||||
await router.push({ path: `/chat/${agentId}`, query });
|
||||
}
|
||||
|
||||
/** 请求取消整批;排队立即取消,执行中进入正在取消。 */
|
||||
async function submitCancelRun(run: ShippingOrderExtractionRun, reason?: string | null) {
|
||||
if (actingRunNo.value) return;
|
||||
actingRunNo.value = run.run_no;
|
||||
try {
|
||||
await cancelWorkspaceShippingOrderExtractionRun(run.run_no, {
|
||||
reason: String(reason || '').trim() || null,
|
||||
});
|
||||
pendingCancelRunNo.value = '';
|
||||
cancelReason.value = '';
|
||||
await load();
|
||||
} catch {
|
||||
error.value = t('chat.shippingOrderExtractionCancel.failed');
|
||||
} finally {
|
||||
actingRunNo.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展开/收起单行取消表单。
|
||||
*/
|
||||
function beginCancelRun(run: ShippingOrderExtractionRun) {
|
||||
if (pendingCancelRunNo.value === run.run_no) {
|
||||
pendingCancelRunNo.value = '';
|
||||
cancelReason.value = '';
|
||||
return;
|
||||
}
|
||||
pendingCancelRunNo.value = run.run_no;
|
||||
cancelReason.value = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 重试失败附件。
|
||||
*/
|
||||
async function retryRun(run: ShippingOrderExtractionRun) {
|
||||
if (actingRunNo.value) return;
|
||||
actingRunNo.value = run.run_no;
|
||||
try {
|
||||
await retryWorkspaceShippingOrderExtractionRun(run.run_no);
|
||||
await load();
|
||||
} catch {
|
||||
error.value = t('chat.shippingOrderExtractionRetryFailed');
|
||||
} finally {
|
||||
actingRunNo.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
watch(status, () => {
|
||||
page.value = 1;
|
||||
void load();
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await resolveChatAgent();
|
||||
await load();
|
||||
});
|
||||
|
||||
defineExpose({ reload: load });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="space-y-3" data-testid="shipping-run-progress-table">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h3 class="text-base font-semibold text-primary">{{ t('workspace.shippingNotice.myRuns.title') }}</h3>
|
||||
<p class="text-xs text-muted">{{ t('workspace.shippingNotice.myRuns.subtitle') }}</p>
|
||||
</div>
|
||||
<label class="flex items-center gap-2 text-sm text-secondary">
|
||||
{{ t('workspace.shippingNotice.myRuns.status') }}
|
||||
<select v-model="status" class="input-field py-1.5 text-sm">
|
||||
<option value="">{{ t('workspace.shippingNotice.myRuns.allStatuses') }}</option>
|
||||
<option
|
||||
v-for="value in ['queued', 'processing', 'completed', 'partially_completed', 'review_required', 'failed', 'cancelled']"
|
||||
:key="value"
|
||||
:value="value"
|
||||
>
|
||||
{{ t(`chat.shippingOrderExtractionCardTitle.${value}`) }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p v-if="error" class="rounded-lg border border-rose-200 bg-rose-50 p-3 text-sm text-rose-700">{{ error }}</p>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl border border-default bg-surface">
|
||||
<table class="min-w-[860px] w-full text-left text-sm">
|
||||
<thead class="border-b border-default bg-surface-soft text-xs text-muted">
|
||||
<tr>
|
||||
<th class="px-3 py-2">{{ t('workspace.shippingNotice.myRuns.runNo') }}</th>
|
||||
<th class="px-3 py-2">{{ t('workspace.shippingNotice.myRuns.status') }}</th>
|
||||
<th class="px-3 py-2">{{ t('workspace.shippingNotice.myRuns.stage') }}</th>
|
||||
<th class="px-3 py-2">{{ t('workspace.shippingNotice.myRuns.summary') }}</th>
|
||||
<th class="px-3 py-2">{{ t('workspace.shippingNotice.myRuns.elapsed') }}</th>
|
||||
<th class="px-3 py-2">{{ t('workspace.shippingNotice.myRuns.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="loading">
|
||||
<td colspan="6" class="px-3 py-8 text-center text-muted">{{ t('workspace.shippingNotice.myRuns.loading') }}</td>
|
||||
</tr>
|
||||
<tr v-else-if="!rows.length">
|
||||
<td colspan="6" class="px-3 py-8 text-center text-muted">{{ t('workspace.shippingNotice.myRuns.empty') }}</td>
|
||||
</tr>
|
||||
<tr
|
||||
v-for="run in rows"
|
||||
:key="run.run_no"
|
||||
class="border-b border-default last:border-0"
|
||||
>
|
||||
<td class="px-3 py-2 font-mono text-xs">{{ run.run_no }}</td>
|
||||
<td class="px-3 py-2">
|
||||
{{ t(`chat.shippingOrderExtractionCardTitle.${run.status}`) }}
|
||||
<span
|
||||
v-if="run.cancellation?.requested && !run.cancellation?.completed_at"
|
||||
class="ml-1 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] text-amber-800"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionUserStage.cancellation_requested') }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-3 py-2">
|
||||
<div>{{ stageLabel(run) }}</div>
|
||||
<div v-if="run.current_activity?.file_name" class="text-[11px] text-muted">
|
||||
{{ run.current_activity.file_name }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-xs text-secondary">
|
||||
{{ t('workspace.shippingNotice.myRuns.summaryCounts', {
|
||||
total: run.summary?.total_documents || 0,
|
||||
done: run.summary?.completed_documents || 0,
|
||||
review: run.summary?.review_required_documents || 0,
|
||||
failed: run.summary?.failed_documents || 0,
|
||||
cancelled: run.summary?.cancelled_documents || 0,
|
||||
}) }}
|
||||
</td>
|
||||
<td class="px-3 py-2 text-xs">
|
||||
{{ formatOrderExtractionElapsed(run.current_activity?.elapsed_seconds) || '—' }}
|
||||
</td>
|
||||
<td class="px-3 py-2">
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs font-medium text-brand-700 hover:underline"
|
||||
@click="openInChat(run)"
|
||||
>
|
||||
{{ t('workspace.shippingNotice.myRuns.openChat') }}
|
||||
</button>
|
||||
<template v-if="(run.available_actions || []).includes('cancel_run')">
|
||||
<div
|
||||
v-if="pendingCancelRunNo === run.run_no"
|
||||
class="w-full min-w-[220px] space-y-1.5 rounded-md border border-rose-200 bg-rose-50/60 p-2 dark:border-rose-900/40 dark:bg-rose-950/20"
|
||||
>
|
||||
<label class="block text-[11px] text-secondary">
|
||||
{{ t('chat.shippingOrderExtractionCancel.reasonOptional') }}
|
||||
</label>
|
||||
<textarea
|
||||
v-model="cancelReason"
|
||||
rows="2"
|
||||
class="input-field w-full py-1 text-xs"
|
||||
/>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs font-medium text-rose-700 hover:underline"
|
||||
:disabled="actingRunNo === run.run_no"
|
||||
@click="submitCancelRun(run, cancelReason)"
|
||||
>
|
||||
{{ actingRunNo === run.run_no
|
||||
? t('chat.shippingOrderExtractionCancel.submitting')
|
||||
: t('chat.shippingOrderExtractionAction.cancel_run') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-muted hover:underline"
|
||||
:disabled="actingRunNo === run.run_no"
|
||||
@click="pendingCancelRunNo = ''; cancelReason = ''"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionCancel.dismiss') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
class="text-xs font-medium text-rose-700 hover:underline"
|
||||
:disabled="actingRunNo === run.run_no"
|
||||
@click="beginCancelRun(run)"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionAction.cancel_run') }}
|
||||
</button>
|
||||
</template>
|
||||
<button
|
||||
v-if="(run.available_actions || []).includes('retry_failed_attachments') || (run.summary?.failed_documents || 0) > 0"
|
||||
type="button"
|
||||
class="text-xs font-medium text-secondary hover:underline"
|
||||
:disabled="actingRunNo === run.run_no"
|
||||
@click="retryRun(run)"
|
||||
>
|
||||
{{ t('chat.shippingOrderExtractionAction.retry_failed_attachments') }}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end gap-3 text-sm">
|
||||
<span class="text-xs text-muted">{{ t('workspace.shippingNotice.myRuns.total', { count: total }) }}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-default px-3 py-1.5 disabled:opacity-50"
|
||||
:disabled="page <= 1 || loading"
|
||||
@click="page -= 1; load()"
|
||||
>
|
||||
{{ t('workspace.shippingNotice.myRuns.previous') }}
|
||||
</button>
|
||||
<span>{{ page }}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-default px-3 py-1.5 disabled:opacity-50"
|
||||
:disabled="page * pageSize >= total || loading"
|
||||
@click="page += 1; load()"
|
||||
>
|
||||
{{ t('workspace.shippingNotice.myRuns.next') }}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* features/workspace/shipping-task-center/ShippingTaskCenterPage.vue
|
||||
* 用途:发货「我的待办」壳——Pending|Processing|Done + 右侧任务工作台或复核深链。
|
||||
* 依赖:shipping-tasks.api(my-todos)、shipping.api 详情、ShippingTaskWorkbench、useShippingTodoBadge。
|
||||
* 逻辑:review_case 项用 review_run_no 打开人工复核;task 项打开任务处理工作台。
|
||||
* 用途:发货「我的待办」壳——Pending|Processing|Done + 识别 Run 续办表 + 右侧任务工作台或复核深链。
|
||||
* 依赖:shipping-tasks.api(my-todos)、shipping.api 详情、ShippingTaskWorkbench、ShippingRunProgressTable、useShippingTodoBadge。
|
||||
* 逻辑:review_case 项用 review_run_no 打开人工复核;task 项打开任务处理工作台;识别页承接取消/重试/回会话。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
@@ -22,11 +22,14 @@ import {
|
||||
} from '@/features/workspace/api/shipping-tasks.api';
|
||||
import { useShippingTodoBadge } from '../composables/useShippingTodoBadge';
|
||||
import ShippingTaskWorkbench from './ShippingTaskWorkbench.vue';
|
||||
import ShippingRunProgressTable from './ShippingRunProgressTable.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { refreshShippingTodoBadge } = useShippingTodoBadge();
|
||||
|
||||
/** todos=建单后待办;runs=建单前识别续办 */
|
||||
const surface = ref<'todos' | 'runs'>('todos');
|
||||
const bucket = ref<'pending' | 'processing' | 'done'>('pending');
|
||||
const filterTodoCategory = ref<'all' | 'review' | 'exception' | 'manual_upload'>('all');
|
||||
const filterCustomer = ref('');
|
||||
@@ -58,6 +61,7 @@ const preferredTaskNo = computed(() =>
|
||||
String(route.params.taskNo || route.query.task_no || '').trim().toUpperCase(),
|
||||
);
|
||||
const preferredReviewRun = computed(() => String(route.query.run_no || '').trim());
|
||||
const isDirectTaskRoute = computed(() => Boolean(String(route.params.taskNo || '').trim()));
|
||||
|
||||
const selectedItem = computed(() =>
|
||||
tasks.value.find((item) => todoItemKey(item) === selectedRef.value) || null,
|
||||
@@ -193,6 +197,10 @@ async function loadDetail(taskNo: string) {
|
||||
*/
|
||||
async function refreshAll() {
|
||||
await Promise.all([loadTodos(), loadCounts()]);
|
||||
if (isDirectTaskRoute.value && preferredTaskNo.value) {
|
||||
await loadDetail(preferredTaskNo.value);
|
||||
return;
|
||||
}
|
||||
const item = selectedItem.value;
|
||||
if (item?.task_no && item.item_kind !== 'review_case') {
|
||||
await loadDetail(item.task_no);
|
||||
@@ -281,6 +289,11 @@ watch(selectedItem, (item) => {
|
||||
onMounted(async () => {
|
||||
await Promise.all([resolveChatAgent(), loadCounts(), loadTodos()]);
|
||||
if (preferredTaskNo.value) {
|
||||
if (isDirectTaskRoute.value) {
|
||||
selectedRef.value = preferredTaskNo.value;
|
||||
await loadDetail(preferredTaskNo.value);
|
||||
return;
|
||||
}
|
||||
const hit = tasks.value.find((item) => String(item.task_no || '').toUpperCase() === preferredTaskNo.value);
|
||||
if (!hit) {
|
||||
selectedRef.value = preferredTaskNo.value;
|
||||
@@ -307,6 +320,52 @@ onMounted(async () => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-xl px-3 py-1.5 text-sm font-medium"
|
||||
:class="surface === 'todos' ? 'bg-brand-600 text-white' : 'border border-default text-secondary hover:bg-surface-soft'"
|
||||
@click="surface = 'todos'"
|
||||
>
|
||||
{{ $t('workspace.shippingNotice.myTodos.title') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-xl px-3 py-1.5 text-sm font-medium"
|
||||
:class="surface === 'runs' ? 'bg-brand-600 text-white' : 'border border-default text-secondary hover:bg-surface-soft'"
|
||||
@click="surface = 'runs'"
|
||||
>
|
||||
{{ $t('workspace.shippingNotice.myRuns.title') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="isDirectTaskRoute" class="rounded-2xl border border-default bg-surface p-4">
|
||||
<div v-if="detailLoading" class="py-16 text-center text-sm text-muted">
|
||||
{{ $t('workspace.shippingNotice.loading') }}
|
||||
</div>
|
||||
<div v-else-if="!detail" class="py-16 text-center text-sm text-muted">
|
||||
{{ $t('workspace.shippingNotice.selectCase') }}
|
||||
</div>
|
||||
<div v-else class="space-y-3">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<div class="font-mono text-lg font-bold text-primary">{{ detail.task_no }}</div>
|
||||
<button
|
||||
v-if="chatAgentId"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-xl border border-default px-3 py-1.5 text-xs font-medium text-secondary hover:bg-surface-soft"
|
||||
@click="openInChat"
|
||||
>
|
||||
<ExternalLink class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.shippingNotice.openChat') }}
|
||||
</button>
|
||||
</div>
|
||||
<ShippingTaskWorkbench :detail="detail" :can-handle="canHandle" @refreshed="refreshAll" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ShippingRunProgressTable v-else-if="surface === 'runs'" />
|
||||
|
||||
<template v-else>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
v-for="key in (['pending', 'processing', 'done'] as const)"
|
||||
@@ -480,5 +539,6 @@ onMounted(async () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -39,7 +39,9 @@
|
||||
"platformApps": "Platform Apps",
|
||||
"shippingOrderDocumentProfiles": "Doc Templates",
|
||||
"shippingFieldAssets": "Field Assets",
|
||||
"shippingOrderSchema": "Order Schema"
|
||||
"shippingOrderSchema": "Order Schema",
|
||||
"shippingAudit": "Audit center",
|
||||
"shippingReviewSupervision": "Review supervision"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "READ-ONLY RUN DIAGNOSTICS",
|
||||
@@ -55,6 +57,9 @@
|
||||
"createdAt": "Created",
|
||||
"totalDuration": "Total duration",
|
||||
"viewDetail": "View details",
|
||||
"actions": "Actions",
|
||||
"cancelRun": "Cancel run",
|
||||
"cancelFailed": "Failed to cancel run",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"loading": "Loading...",
|
||||
@@ -168,6 +173,24 @@
|
||||
"review_required": "Manual review required",
|
||||
"failed": "Failed",
|
||||
"cancelled": "Cancelled"
|
||||
},
|
||||
"healthStatus": "Health",
|
||||
"healthStatuses": {
|
||||
"healthy": "Healthy",
|
||||
"degraded": "Degraded"
|
||||
},
|
||||
"activeCount": "Active runs",
|
||||
"staleCount": "Stale / backlog",
|
||||
"failureRate": "Failure rate",
|
||||
"latencySummary": "Total latency P50 {p50} / P95 {p95} / Max {max}",
|
||||
"staleRuns": "Stale runs: {runs}",
|
||||
"healthUnavailable": "Health summary unavailable",
|
||||
"staleOnly": "Stale only",
|
||||
"cancellationInFlight": "Cancelling only",
|
||||
"cancellation": "Cancellation",
|
||||
"cancellationStates": {
|
||||
"in_flight": "Cancelling",
|
||||
"completed": "Cancelled"
|
||||
}
|
||||
},
|
||||
"shippingOrderSchema": {
|
||||
@@ -344,8 +367,8 @@
|
||||
"placementHeader": "Order information",
|
||||
"placementLine": "Item details",
|
||||
"placement": {
|
||||
"header": "Order information",
|
||||
"line": "Item details"
|
||||
"header": "Header",
|
||||
"line": "Line"
|
||||
},
|
||||
"fieldType": {
|
||||
"string": "Text",
|
||||
@@ -552,10 +575,6 @@
|
||||
"suggestPreviewEmpty": "All suggested fields are already adopted.",
|
||||
"suggestConfirm": "Confirm adoption",
|
||||
"suggestCancel": "Cancel",
|
||||
"placement": {
|
||||
"header": "Header",
|
||||
"line": "Line"
|
||||
},
|
||||
"operationFailed": "Order template operation failed",
|
||||
"fieldCategory": "Field category",
|
||||
"fieldCategoryOption": {
|
||||
@@ -2702,8 +2721,47 @@
|
||||
"empty": "No validation runs yet.",
|
||||
"completed": "Validation run completed.",
|
||||
"failed": "Validation run failed.",
|
||||
"currentDraft": "Current draft validation", "currentDraftHint": "The system checks the configuration and reads the current sample once.", "validateCurrent": "Validate current draft", "validating": "Validating...", "goPublishCheck": "Continue to publish check", "structureCheck": "Configuration check", "structureCheckHint": "Checks bindings, page coordinates, scopes, and line structure.", "sampleCheck": "Current sample read", "sampleCheckHint": "Checks whether the annotated sample returns fields and line items.",
|
||||
"state": { "ready": "Current draft can enter publish check", "stale": "Configuration changed; validate again", "failed": "Validation failed; return to the editor", "pending": "Current draft has not been validated" }, "stateHint": { "ready": "Both configuration and sample checks passed.", "stale": "Historical validation belongs to an earlier draft and cannot publish.", "failed": "Fix the annotations and validate again.", "pending": "Save the annotations, then validate once." }, "runStatus": { "passed": "Passed", "failed": "Failed", "stale": "Stale", "pending": "Not run", "running": "Running" }, "resultsTitle": "Current sample results", "resultsHint": "Only reads from the current draft and current annotations. Deleted lines are shown for review only and are excluded from the order result.", "refreshResults": "Read again", "resultsLoading": "Reading current sample...", "resultsFailed": "No value was read or the read failed. Check the annotations in the editor.", "headerResults": "Order header", "lineResults": "Order lines", "noHeaderResults": "No order header fields were read from the current sample.", "noLineResults": "No order lines were read from the current sample.", "noValue": "No value read", "rowStatus": "Status", "deleted": "Deleted; excluded", "read": "Read"
|
||||
"currentDraft": "Current draft validation",
|
||||
"currentDraftHint": "The system checks the configuration and reads the current sample once.",
|
||||
"validateCurrent": "Validate current draft",
|
||||
"validating": "Validating...",
|
||||
"goPublishCheck": "Continue to publish check",
|
||||
"structureCheck": "Configuration check",
|
||||
"structureCheckHint": "Checks bindings, page coordinates, scopes, and line structure.",
|
||||
"sampleCheck": "Current sample read",
|
||||
"sampleCheckHint": "Checks whether the annotated sample returns fields and line items.",
|
||||
"state": {
|
||||
"ready": "Current draft can enter publish check",
|
||||
"stale": "Configuration changed; validate again",
|
||||
"failed": "Validation failed; return to the editor",
|
||||
"pending": "Current draft has not been validated"
|
||||
},
|
||||
"stateHint": {
|
||||
"ready": "Both configuration and sample checks passed.",
|
||||
"stale": "Historical validation belongs to an earlier draft and cannot publish.",
|
||||
"failed": "Fix the annotations and validate again.",
|
||||
"pending": "Save the annotations, then validate once."
|
||||
},
|
||||
"runStatus": {
|
||||
"passed": "Passed",
|
||||
"failed": "Failed",
|
||||
"stale": "Stale",
|
||||
"pending": "Not run",
|
||||
"running": "Running"
|
||||
},
|
||||
"resultsTitle": "Current sample results",
|
||||
"resultsHint": "Only reads from the current draft and current annotations. Deleted lines are shown for review only and are excluded from the order result.",
|
||||
"refreshResults": "Read again",
|
||||
"resultsLoading": "Reading current sample...",
|
||||
"resultsFailed": "No value was read or the read failed. Check the annotations in the editor.",
|
||||
"headerResults": "Order header",
|
||||
"lineResults": "Order lines",
|
||||
"noHeaderResults": "No order header fields were read from the current sample.",
|
||||
"noLineResults": "No order lines were read from the current sample.",
|
||||
"noValue": "No value read",
|
||||
"rowStatus": "Status",
|
||||
"deleted": "Deleted; excluded",
|
||||
"read": "Read"
|
||||
},
|
||||
"orderProfilePublishCheck": {
|
||||
"eyebrow": "PUBLISH GATE",
|
||||
@@ -2719,7 +2777,16 @@
|
||||
"noBlocking": "No blocking items.",
|
||||
"warnings": "Warnings (confirm each item)",
|
||||
"confirm": "Confirm publication",
|
||||
"failed": "Publish check failed.", "readyTitle": "Validated draft", "readyHint": "The current-sample validation passed. Generate a check to review prerequisites and changes.", "reportTitle": "Publish check result", "blockedHint": "These issues must be fixed and cannot be acknowledged away.", "reviewHint": "Confirm all listed changes to publish this template version.", "confirmHint": "Confirm that you reviewed the changes above.", "currentValidationRequired": "The current draft must pass current-sample validation first.", "semanticDiffReview": "This version has semantic changes. Confirm that you reviewed them.", "unknownIssue": "The publish check found an issue that needs attention."
|
||||
"failed": "Publish check failed.",
|
||||
"readyTitle": "Validated draft",
|
||||
"readyHint": "The current-sample validation passed. Generate a check to review prerequisites and changes.",
|
||||
"reportTitle": "Publish check result",
|
||||
"blockedHint": "These issues must be fixed and cannot be acknowledged away.",
|
||||
"reviewHint": "Confirm all listed changes to publish this template version.",
|
||||
"confirmHint": "Confirm that you reviewed the changes above.",
|
||||
"currentValidationRequired": "The current draft must pass current-sample validation first.",
|
||||
"semanticDiffReview": "This version has semantic changes. Confirm that you reviewed them.",
|
||||
"unknownIssue": "The publish check found an issue that needs attention."
|
||||
},
|
||||
"shippingOrderProfiles": {
|
||||
"title": "Order Document Profiles",
|
||||
@@ -3112,15 +3179,22 @@
|
||||
"gateTitle": "Pre-publish blind test",
|
||||
"gateRequiredHint": "Complete and approve an independent blind test before entering the publish check.",
|
||||
"gateApprovedHint": "The blind test for this draft is approved; you can enter the publish check.",
|
||||
"status": { "missing": "Not created", "draft": "Action required", "approved": "Approved", "superseded": "Superseded" },
|
||||
"status": {
|
||||
"missing": "Not created",
|
||||
"draft": "Action required",
|
||||
"approved": "Approved",
|
||||
"superseded": "Superseded"
|
||||
},
|
||||
"samples": "Samples: {count} · {status}",
|
||||
"notRun": "not run",
|
||||
"approvedHint": "This blind test is approved; no further run or approval is needed.",
|
||||
"selectIndependentSample": "Select independent sample",
|
||||
"loadIndependentSamples": "Load available samples",
|
||||
"loadingIndependentSamples": "Loading available samples…",
|
||||
"loadIndependentSamplesTimedOut": "Loading available samples timed out. Confirm the backend is running, then try again.",
|
||||
"loadIndependentSamplesHint": "Load candidates only when adding a blind-test sample, so opening this page does not wait for historical-sample scanning.",
|
||||
"selectSamplePlaceholder": "Select an order not used to annotate this template",
|
||||
"sampleOption": "{filename} · P{page} · Table {table} · {rows} rows x {columns} columns · {header}",
|
||||
"noIndependentSamples": "No independent sample is available. Upload and parse another matching order first.",
|
||||
"reviewHint": "Mark every item correct or incorrect. Provide a correction for incorrect items; unreviewed items cannot be added.",
|
||||
"row": "Line {index}",
|
||||
@@ -3153,13 +3227,23 @@
|
||||
"execution": "Run and approve",
|
||||
"runHint": "Run reparses every blind-test sample with the current draft; all samples must pass before approval.",
|
||||
"unknownSample": "Unknown sample",
|
||||
"failure": { "title": "Execution failure details", "hint": "Use the reason to adjust annotations or reconfirm blind-test truth, then run again.", "fieldMismatch": "{sample}: the reread value for order field {field} differs from the human truth.", "fieldNeedsReview": "{sample}: order field {field} is not confirmed; check its anchor and coordinate range.", "fieldUnavailable": "{sample}: no usable value was read for order field {field}; check its anchor, page, and coordinate evidence.", "coordinateEvidenceMissing": "{sample}: table or page coordinate evidence is missing, so the blind test cannot run.", "rowsMismatch": "{sample}: reread order lines differ from the human truth.", "unknown": "{sample}: the blind test did not pass; check the raw diagnostic code below." },
|
||||
"failure": {
|
||||
"title": "Execution failure details",
|
||||
"hint": "Use the reason to adjust annotations or reconfirm blind-test truth, then run again.",
|
||||
"fieldMismatch": "{sample}: the reread value for order field {field} differs from the human truth.",
|
||||
"fieldNeedsReview": "{sample}: order field {field} is not confirmed; check its anchor and coordinate range.",
|
||||
"fieldUnavailable": "{sample}: no usable value was read for order field {field}; check its anchor, page, and coordinate evidence.",
|
||||
"coordinateEvidenceMissing": "{sample}: table or page coordinate evidence is missing, so the blind test cannot run.",
|
||||
"rowsMismatch": "{sample}: reread order lines differ from the human truth.",
|
||||
"unknown": "{sample}: the blind test did not pass; check the raw diagnostic code below."
|
||||
},
|
||||
"run": "Run",
|
||||
"approve": "Approve"
|
||||
},
|
||||
"workbench": {
|
||||
"boundHistoricalSchema": "bound historical version",
|
||||
"intro": "Drag evidence regions on a controlled document page; saved definitions contain no HTML or storage URL.", "returnToLibrary": "Back to document templates",
|
||||
"intro": "Drag evidence regions on a controlled document page; saved definitions contain no HTML or storage URL.",
|
||||
"returnToLibrary": "Back to document templates",
|
||||
"structure": "Structure",
|
||||
"saveStatus": {
|
||||
"saved": "Saved",
|
||||
@@ -3175,7 +3259,31 @@
|
||||
"acceptSuggestion": "Accept",
|
||||
"acceptAdjustedSuggestion": "Accept with adjustments",
|
||||
"rejectSuggestion": "Reject",
|
||||
"suggestionAdjustmentField": "Choose replacement field", "sampleValueUnavailable": "No value read", "orderFieldValueReading": "Reading", "orderFieldValueFailed": "Read failed", "currentSampleValue": "Current sample value", "selectedRegion": "Selected annotation", "recognitionResults": "Recognition results", "orderHeaderResults": "Order header fields", "orderLineResults": "Order line fields", "noRecognitionResults": "No structured result available", "lineResultField": "Line {row} · {field}", "previewState": { "idle": "Waiting", "updating": "Reading", "ready": "Updated", "failed": "Read failed" }, "evidenceStatus": { "read": "Read", "review": "Needs review", "loading": "Reading", "failed": "Read failed", "deleted": "Deleted; excluded from results", "unavailable": "No value read" },
|
||||
"suggestionAdjustmentField": "Choose replacement field",
|
||||
"sampleValueUnavailable": "No value read",
|
||||
"orderFieldValueReading": "Reading",
|
||||
"orderFieldValueFailed": "Read failed",
|
||||
"currentSampleValue": "Current sample value",
|
||||
"selectedRegion": "Selected annotation",
|
||||
"recognitionResults": "Recognition results",
|
||||
"orderHeaderResults": "Order header fields",
|
||||
"orderLineResults": "Order line fields",
|
||||
"noRecognitionResults": "No structured result available",
|
||||
"lineResultField": "Line {row} · {field}",
|
||||
"previewState": {
|
||||
"idle": "Waiting",
|
||||
"updating": "Reading",
|
||||
"ready": "Updated",
|
||||
"failed": "Read failed"
|
||||
},
|
||||
"evidenceStatus": {
|
||||
"read": "Read",
|
||||
"review": "Needs review",
|
||||
"loading": "Reading",
|
||||
"failed": "Read failed",
|
||||
"deleted": "Deleted; excluded from results",
|
||||
"unavailable": "No value read"
|
||||
},
|
||||
"openCanvas": "Create draft and open canvas",
|
||||
"loadingPage": "Loading page...",
|
||||
"canvasZoom": "Page zoom",
|
||||
@@ -3201,6 +3309,15 @@
|
||||
"drawHeader": "Draw header",
|
||||
"drawOrderField": "Draw order field",
|
||||
"drawOrderAnchor": "Draw order field label",
|
||||
"drawDocumentMatchAnchor": "Draw document match anchor (label, then fixed value)",
|
||||
"drawDocumentMatchAnchorShortcut": "Document match anchor (M): label, then fixed value",
|
||||
"drawOrderAnchorShortcut": "Order field label (A)",
|
||||
"drawOrderFieldShortcut": "Order field (O)",
|
||||
"drawHeaderShortcut": "Detail header (H)",
|
||||
"drawLineShortcut": "Detail row (L)",
|
||||
"drawFieldShortcut": "Detail field (F)",
|
||||
"drawExclusionShortcut": "Exclusion area (X)",
|
||||
"autoSuggestShortcut": "Auto-mark (G)",
|
||||
"drawLine": "Draw physical line",
|
||||
"drawField": "Draw field",
|
||||
"drawExclusion": "Draw exclusion",
|
||||
@@ -3235,6 +3352,13 @@
|
||||
"suggestedValue": "Detected value",
|
||||
"orderAnchor": "Order field label",
|
||||
"orderAnchorTool": "Field label",
|
||||
"documentMatchAnchorTool": "Match anchor",
|
||||
"documentMatchAnchorLabel": "Match anchor label",
|
||||
"documentMatchAnchorValue": "Match anchor value",
|
||||
"documentMatchAnchorHint": "Use the left toolbar to select the label and fixed value. Only text inside these boxes is matched, so notes cannot produce a false match.",
|
||||
"documentMatchAnchorEmpty": "Use the Match anchor tool: select the label first, then the fixed value.",
|
||||
"documentMatchAnchorTextMissing": "No text was detected in the selected area. Adjust the selection and try again.",
|
||||
"orderFieldAnchorNext": "Field label read. Select the field value.",
|
||||
"headerTool": "Table header",
|
||||
"lineTool": "Detail row",
|
||||
"fieldTool": "Detail field",
|
||||
@@ -3422,5 +3546,100 @@
|
||||
"identity_rule_set": "Customer identity rule sets",
|
||||
"identity_rule": "Customer identity rules"
|
||||
}
|
||||
},
|
||||
"shippingAudit": {
|
||||
"title": "Run & audit",
|
||||
"subtitle": "Query shipping audit events by time, actor, Run/Task and event type. Details show whitelist diffs only; exports are controlled and audited.",
|
||||
"refresh": "Refresh",
|
||||
"export": "Export CSV",
|
||||
"exporting": "Exporting...",
|
||||
"apply": "Apply",
|
||||
"loading": "Loading...",
|
||||
"empty": "No audit events",
|
||||
"loadFailed": "Failed to load audit events",
|
||||
"detailFailed": "Failed to load audit detail",
|
||||
"exportFailed": "Export failed",
|
||||
"detailTitle": "Audit detail",
|
||||
"diff": "Diff",
|
||||
"before": "Before",
|
||||
"after": "After",
|
||||
"noDiff": "No whitelist diff to show",
|
||||
"total": "{count} total",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"filters": {
|
||||
"eventType": "Event type",
|
||||
"actorType": "Actor type",
|
||||
"runNo": "Run no.",
|
||||
"taskNo": "Task no.",
|
||||
"operationId": "operation_id",
|
||||
"q": "ID search",
|
||||
"all": "All",
|
||||
"actorId": "Actor ID",
|
||||
"documentId": "Document ID",
|
||||
"conversationId": "Conversation ID",
|
||||
"sessionItemId": "Session work item",
|
||||
"reviewCaseNo": "Review case no.",
|
||||
"ownerUserId": "Owner user ID",
|
||||
"requestId": "request_id",
|
||||
"result": "Result",
|
||||
"createdFrom": "From",
|
||||
"createdTo": "To"
|
||||
},
|
||||
"columns": {
|
||||
"time": "Time",
|
||||
"event": "Event",
|
||||
"actor": "Actor",
|
||||
"run": "Run",
|
||||
"task": "Task",
|
||||
"result": "Result",
|
||||
"conversation": "Conversation",
|
||||
"sessionItem": "Work item",
|
||||
"reviewCase": "Case"
|
||||
}
|
||||
},
|
||||
"shippingReviewSupervision": {
|
||||
"title": "Review supervision",
|
||||
"subtitle": "Cross-user session PDF work items. Terminate or revoke confirmation requires a reason and explicit confirmation.",
|
||||
"refresh": "Refresh",
|
||||
"apply": "Apply",
|
||||
"loading": "Loading...",
|
||||
"empty": "No work items",
|
||||
"loadFailed": "Failed to load supervision list",
|
||||
"actionFailed": "Action failed. Please try again.",
|
||||
"terminate": "Terminate",
|
||||
"revoke": "Revoke confirmation",
|
||||
"terminateTitle": "Terminate work item",
|
||||
"revokeTitle": "Revoke confirmation",
|
||||
"terminateImpact": "This forcibly closes work item {itemNo}. The owner can no longer review it.",
|
||||
"revokeImpact": "This revokes the confirmation for work item {itemNo} (within 24h and before inventory match).",
|
||||
"reasonLabel": "Reason (required)",
|
||||
"reasonRequired": "A reason is required",
|
||||
"confirmTerminate": "I confirm terminating this work item (CONFIRM_TERMINATE)",
|
||||
"confirmRevoke": "I confirm revoking this confirmation (CONFIRM_REVOKE)",
|
||||
"confirmRequired": "Check the confirmation box before submitting",
|
||||
"submit": "Submit",
|
||||
"submitting": "Submitting...",
|
||||
"terminateSuccess": "Work item terminated",
|
||||
"revokeSuccess": "Confirmation revoked",
|
||||
"total": "{count} total",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"filters": {
|
||||
"lifecycleStatus": "Lifecycle",
|
||||
"ownerUserId": "Owner user ID",
|
||||
"conversationId": "Conversation ID",
|
||||
"q": "Search by ID",
|
||||
"all": "All"
|
||||
},
|
||||
"columns": {
|
||||
"itemNo": "Work item",
|
||||
"owner": "Owner",
|
||||
"conversation": "Conversation",
|
||||
"document": "Current PDF",
|
||||
"status": "Status",
|
||||
"updated": "Updated",
|
||||
"actions": "Actions"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,8 +109,16 @@
|
||||
"shortCode": "Short code",
|
||||
"site": "Delivery site",
|
||||
"statusLabel": "Status",
|
||||
"roles": { "bill_to": "Bill-to", "ship_to": "Ship-to" },
|
||||
"status": { "unmatched": "Unmatched", "unique_candidate": "Unique candidate", "ambiguous": "Multiple candidates", "confirmed": "Confirmed" }
|
||||
"roles": {
|
||||
"bill_to": "Bill-to",
|
||||
"ship_to": "Ship-to"
|
||||
},
|
||||
"status": {
|
||||
"unmatched": "Unmatched",
|
||||
"unique_candidate": "Unique candidate",
|
||||
"ambiguous": "Multiple candidates",
|
||||
"confirmed": "Confirmed"
|
||||
}
|
||||
},
|
||||
"shippingCandidateCount": "{count} orders",
|
||||
"shippingCandidateReady": "Ready",
|
||||
@@ -138,12 +146,14 @@
|
||||
"completed": "Completed {count}",
|
||||
"running": "In progress {count}",
|
||||
"needsHuman": "Needs human {count}",
|
||||
"pendingConfirmation": "Awaiting confirmation {count}",
|
||||
"failed": "Failed {count}",
|
||||
"pending": "Queued {count}",
|
||||
"empty": "Task progress for this upload will appear here.",
|
||||
"unnamedPdf": "Untitled PDF",
|
||||
"progressIndex": "{current}/{total}",
|
||||
"exception": "Exception",
|
||||
"pendingConfirmationBadge": "Awaiting confirmation",
|
||||
"duplicateBadge": "Duplicate",
|
||||
"openReview": "Open manual review",
|
||||
"openTask": "Open task workbench",
|
||||
@@ -152,6 +162,7 @@
|
||||
"compactProgress": "{total} PDFs: {auto} auto-progressing, {review} need review, {failed} failed",
|
||||
"processNoticeProcessing": "Processing attachments — see the right panel for progress",
|
||||
"processNoticeNeedsAction": "Some attachments need human action — see the right panel",
|
||||
"processNoticeCandidateConfirmation": "Order candidates are ready — confirm each one in the right panel",
|
||||
"processNoticeDuplicateLinked": "Duplicates found and linked to existing tasks — see the right panel",
|
||||
"processNoticeCompleted": "Processing complete — details are in the right panel",
|
||||
"processNoticeFailed": "Processing failed — retry or view details on the right",
|
||||
@@ -160,7 +171,77 @@
|
||||
"waitingUpload": "Awaiting manual upload",
|
||||
"needsReview": "Needs manual review",
|
||||
"duplicateProcessing": "Duplicate in progress",
|
||||
"existingTaskNo": "Existing task {taskNo}"
|
||||
"existingTaskNo": "Existing task {taskNo}",
|
||||
"cancelled": "Cancelled {count}"
|
||||
},
|
||||
"shippingSessionWorkItem": {
|
||||
"status": {
|
||||
"pending_review": "Pending review",
|
||||
"extracting": "Extracting",
|
||||
"reparse_failed": "Reparse failed",
|
||||
"closed": "Closed"
|
||||
},
|
||||
"versionLabel": "V{version}",
|
||||
"versionReplaced": "New version created; previous is read-only",
|
||||
"versionRestored": "Previous version restored",
|
||||
"completedCollapsed": "Completed {count}",
|
||||
"openOnlyFilter": "Pending only",
|
||||
"enterManualReview": "Manual review",
|
||||
"viewVersionHistory": "Version history",
|
||||
"requestReparse": "Re-identify",
|
||||
"markNonOrder": "Mark non-order",
|
||||
"replaceFile": "Replace file",
|
||||
"cancelProcessing": "Cancel this processing",
|
||||
"cancelReasonPrompt": "Enter a cancellation reason",
|
||||
"nonOrderReasonPrompt": "Enter a reason for marking non-order",
|
||||
"reparseReasonPrompt": "Enter a reason for re-identification",
|
||||
"reasonRequired": "A reason is required to continue",
|
||||
"caseRequired": "This work item has no review case; open manual review first",
|
||||
"versionHistoryTitle": "Version history",
|
||||
"currentVersion": "Current",
|
||||
"readonlyVersion": "Read-only",
|
||||
"noVersions": "No version history",
|
||||
"loading": "Loading…",
|
||||
"loadFailed": "Failed to load work items",
|
||||
"closedReason": {
|
||||
"confirmed": "Confirmed and task created",
|
||||
"non_order": "Marked as non-order",
|
||||
"user_cancelled": "Cancelled by user",
|
||||
"admin_terminated": "Terminated by admin"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionHandling": {
|
||||
"title": "Action required",
|
||||
"count": "{count} item(s)",
|
||||
"reasonPrefix": "Reasons: ",
|
||||
"affectedPrefix": "Affected: ",
|
||||
"category": {
|
||||
"document_review": "PDF needs manual review",
|
||||
"candidate_missing_info": "Order needs missing info",
|
||||
"candidate_conflict": "Order has conflicts",
|
||||
"candidate_confirmation": "Candidates await confirmation",
|
||||
"technical_failure": "Attachment processing failed",
|
||||
"auto_freeze_blocked": "Auto-freeze was blocked",
|
||||
"budget_stopped": "Initial budget exhausted"
|
||||
},
|
||||
"primaryNotice": {
|
||||
"document_review": "Some PDFs need manual review — follow the items below",
|
||||
"candidate_missing_info": "Orders are missing required fields — complete them then confirm",
|
||||
"candidate_conflict": "Orders have conflicts — resolve them before continuing",
|
||||
"candidate_confirmation": "Order candidates are ready — confirm each one",
|
||||
"technical_failure": "Some attachments failed — retry or view details",
|
||||
"auto_freeze_blocked": "Auto-freeze did not pass the gate — review the reasons",
|
||||
"budget_stopped": "Initial parsing budget is exhausted — check remaining attachments"
|
||||
},
|
||||
"reason": {
|
||||
"profile_not_auto_freeze_approved": "Profile is not approved for auto-freeze",
|
||||
"multiple_profiles_detected": "Multiple profiles detected; auto-freeze is blocked",
|
||||
"profile_auto_freeze_qualification_missing": "Auto-freeze qualification is missing",
|
||||
"profile_manual_confirmation_required": "Profile requires manual confirmation before freeze",
|
||||
"auto_freeze_not_enabled": "Auto-freeze was not enabled for this run",
|
||||
"auto_freeze_policy_missing": "Auto-freeze policy is missing",
|
||||
"budget_initial_limit": "Initial attachment budget limit reached"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionCardTitle": {
|
||||
"queued": "Order parsing is queued",
|
||||
@@ -177,11 +258,14 @@
|
||||
"shippingOrderExtractionFailed": "Order parsing failed",
|
||||
"shippingOrderExtractionSummary": {
|
||||
"total": "{count} PDF(s)",
|
||||
"processing": "{count} processing",
|
||||
"completed": "{count} completed",
|
||||
"completedProgress": "Progress {value}",
|
||||
"candidates": "{count} candidate(s)",
|
||||
"reviewRequired": "{count} need review",
|
||||
"failed": "{count} failed"
|
||||
"failed": "{count} failed",
|
||||
"cancelled": "{count} cancelled",
|
||||
"pending": "{count} queued"
|
||||
},
|
||||
"shippingOrderExtractionCurrentFile": "Current: {fileName}",
|
||||
"shippingOrderExtractionRefreshFailed": "Status could not be refreshed right now. Processing is still continuing in the background.",
|
||||
@@ -229,7 +313,10 @@
|
||||
"technical_failed": "The system could not finish this attachment.",
|
||||
"budget_stopped": "The current attachment budget has been reached. Remaining attachments require manual review.",
|
||||
"run_completed": "This order parsing run is complete.",
|
||||
"generic_processing": "The system is processing the order attachment."
|
||||
"generic_processing": "The system is processing the order attachment.",
|
||||
"cancellation_requested": "Cancellation requested; stopping at a safe point.",
|
||||
"cancellation_completed": "Cancellation completed.",
|
||||
"unit_cancelled": "This attachment was cancelled."
|
||||
},
|
||||
"shippingOrderExtractionAction": {
|
||||
"view_details": "View details",
|
||||
@@ -237,7 +324,10 @@
|
||||
"retry_failed_attachments": "Retry failed attachments",
|
||||
"view_evidence": "View evidence",
|
||||
"review_candidate": "Confirm manually",
|
||||
"manual_review": "Manual review"
|
||||
"manual_review": "Manual review",
|
||||
"refresh_status": "Refresh status",
|
||||
"cancel_run": "Cancel this run",
|
||||
"cancel_unit": "Cancel this PDF"
|
||||
},
|
||||
"shippingOrderExtractionDocumentStatus": {
|
||||
"pending": "Pending",
|
||||
@@ -276,12 +366,23 @@
|
||||
"same_business_content": "Business content matches an existing task.",
|
||||
"duplicate_decision_required": "A duplicate was detected and needs a manual decision.",
|
||||
"open_existing_reconciliation_required": "Fields still need reconciliation before opening the existing task.",
|
||||
"field_conflict": "Field values conflict and need manual confirmation."
|
||||
"field_conflict": "Field values conflict and need manual confirmation.",
|
||||
"SHIPPING_NOTICE": {
|
||||
"ORDER_EXTRACTION_JOB_FAILED": "The order extraction job failed. Layout parsing is often not ready—enable the layout service and retry.",
|
||||
"ORDER_EXTRACTION_LAYOUT_SCHEDULING_FAILED": "The order attachment layout job could not be created. Enable the layout service and retry.",
|
||||
"ORDER_EXTRACTION_LAYOUT_PREREQUISITE_FAILED": "Order attachment layout prerequisites are incomplete. Retry or re-upload the files.",
|
||||
"ORDER_EXTRACTION_LAYOUT_FAILED": "Order attachment layout parsing failed. Please retry.",
|
||||
"ORDER_EXTRACTION_FAILED": "Order extraction failed. Please retry.",
|
||||
"ORDER_EXTRACTION_TIMEOUT": "Order extraction timed out. Please retry later."
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionPoNumber": "PO: {value}",
|
||||
"shippingOrderExtractionLineCount": "Lines: {count}",
|
||||
"shippingOrderExtractionReviewDetail": "Line {line}: {field} needs to be completed or corrected",
|
||||
"shippingOrderExtractionReviewField": { "qty": "Quantity", "unknown": "Line-item field" },
|
||||
"shippingOrderExtractionReviewField": {
|
||||
"qty": "Quantity",
|
||||
"unknown": "Line-item field"
|
||||
},
|
||||
"shippingOrderExtractionProfileSummary": "Template: {name} V{version}",
|
||||
"shippingOrderExtractionPlanSummary": "This run planned {groups} order group(s) from {total} attachment(s). The first wave may process up to {attachments} attachment(s) with concurrency {concurrency}.",
|
||||
"shippingOrderExtractionPlanSelected": "{count} attachment(s) selected",
|
||||
@@ -860,7 +961,17 @@
|
||||
"empty": "No matching data"
|
||||
}
|
||||
},
|
||||
"shippingCustomer": { "title": "Confirm Standard Customer", "subtitle": "Select a customer maintained by an administrator. Parsed names are evidence only and are never bound automatically.", "searchPlaceholder": "Search customer name or short code", "search": "Search", "empty": "No active customer found. Ask an administrator to maintain customer master data.", "confirm": "Confirm customer", "loadFailed": "Failed to load customers", "confirmed": "Standard customer confirmed", "confirmFailed": "Failed to confirm customer" },
|
||||
"shippingCustomer": {
|
||||
"title": "Confirm Standard Customer",
|
||||
"subtitle": "Select a customer maintained by an administrator. Parsed names are evidence only and are never bound automatically.",
|
||||
"searchPlaceholder": "Search customer name or short code",
|
||||
"search": "Search",
|
||||
"empty": "No active customer found. Ask an administrator to maintain customer master data.",
|
||||
"confirm": "Confirm customer",
|
||||
"loadFailed": "Failed to load customers",
|
||||
"confirmed": "Standard customer confirmed",
|
||||
"confirmFailed": "Failed to confirm customer"
|
||||
},
|
||||
"training": {
|
||||
"badge": "Employee Training Workspace",
|
||||
"title": "",
|
||||
@@ -1024,8 +1135,14 @@
|
||||
"The admin view must be able to export join date, completion date, department, name, employee ID, and score."
|
||||
],
|
||||
"booleanOptions": [
|
||||
{ "id": "true", "label": "True" },
|
||||
{ "id": "false", "label": "False" }
|
||||
{
|
||||
"id": "true",
|
||||
"label": "True"
|
||||
},
|
||||
{
|
||||
"id": "false",
|
||||
"label": "False"
|
||||
}
|
||||
],
|
||||
"questionBank": [
|
||||
{
|
||||
@@ -1035,10 +1152,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "According to the onboarding exam, salary is paid on the 15th of each month.",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 8th" },
|
||||
{ "id": "b", "label": "B. 9th" },
|
||||
{ "id": "c", "label": "C. 15th" },
|
||||
{ "id": "d", "label": "D. 27th" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 8th"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 9th"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 15th"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. 27th"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1048,9 +1177,18 @@
|
||||
"answer": "b",
|
||||
"explanation": "The company cafeteria uses the Zhongmi meal-ordering system, not OA or ERP.",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. OA" },
|
||||
{ "id": "b", "label": "B. Zhongmi ordering system" },
|
||||
{ "id": "c", "label": "C. ERP" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. OA"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. Zhongmi ordering system"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. ERP"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1060,10 +1198,22 @@
|
||||
"answer": "abcd",
|
||||
"explanation": "All four options listed in the exam belong to the company product scope.",
|
||||
"options": [
|
||||
{ "id": "abcd", "label": "A/B/C/D All of the above" },
|
||||
{ "id": "ab", "label": "A/B" },
|
||||
{ "id": "cd", "label": "C/D" },
|
||||
{ "id": "a", "label": "A only" }
|
||||
{
|
||||
"id": "abcd",
|
||||
"label": "A/B/C/D All of the above"
|
||||
},
|
||||
{
|
||||
"id": "ab",
|
||||
"label": "A/B"
|
||||
},
|
||||
{
|
||||
"id": "cd",
|
||||
"label": "C/D"
|
||||
},
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A only"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1073,10 +1223,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "Leave must use the OA leave application form.",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. Overtime request" },
|
||||
{ "id": "b", "label": "B. Contact form" },
|
||||
{ "id": "c", "label": "C. Leave application" },
|
||||
{ "id": "d", "label": "D. Employee request form" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. Overtime request"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. Contact form"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. Leave application"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. Employee request form"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1086,9 +1248,18 @@
|
||||
"answer": "a",
|
||||
"explanation": "QC080000 is the hazardous substance process management certification standard.",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. Hazardous substance process management standard" },
|
||||
{ "id": "b", "label": "B. Occupational health and safety management system" },
|
||||
{ "id": "c", "label": "C. Environmental management system" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. Hazardous substance process management standard"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. Occupational health and safety management system"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. Environmental management system"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1098,8 +1269,14 @@
|
||||
"answer": "a",
|
||||
"explanation": "The standard 5S terms are sort, set in order, shine, standardize, and sustain.",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. Sort, set in order, shine, standardize, sustain" },
|
||||
{ "id": "b", "label": "B. Sort, set in order, clean up, standardize, sustain" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. Sort, set in order, shine, standardize, sustain"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. Sort, set in order, clean up, standardize, sustain"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1109,26 +1286,280 @@
|
||||
"answer": "a",
|
||||
"explanation": "You should stand on the upwind side when using a fire extinguisher.",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. Upwind side" },
|
||||
{ "id": "b", "label": "B. Downwind side" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. Upwind side"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. Downwind side"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "id": "q8", "type": "boolean", "prompt": "Normal attendance requires clock-in, and overtime must be applied for in advance.", "answer": "true", "explanation": "Both attendance and overtime follow the company attendance policy." },
|
||||
{ "id": "q9", "type": "boolean", "prompt": "If you forget to clock in, you need an OA correction request.", "answer": "true", "explanation": "Missed punches must be corrected through the OA process." },
|
||||
{ "id": "q10", "type": "boolean", "prompt": "Monthly salary is calculated from the 21st of the previous month to the 20th of the current month.", "answer": "true", "explanation": "The exam explicitly defines this payroll calculation cycle." },
|
||||
{ "id": "q11", "type": "boolean", "prompt": "Cafeteria meals require advance booking, and face recognition can be used for dining.", "answer": "true", "explanation": "Advance booking and face-recognition dining are both supported." },
|
||||
{ "id": "q12", "type": "boolean", "prompt": "In the event of fire or explosion, you should immediately call 119.", "answer": "true", "explanation": "Calling the fire emergency number is the first step in this scenario." },
|
||||
{ "id": "q13", "type": "boolean", "prompt": "Dormitory residents must maintain fire awareness and must not install wires privately or use high-power appliances.", "answer": "true", "explanation": "This is a mandatory dormitory fire-safety rule." },
|
||||
{ "id": "q14", "type": "boolean", "prompt": "Following safety production regulations is a safety obligation of employees.", "answer": "true", "explanation": "Safety compliance is both a rule and an employee obligation." },
|
||||
{ "id": "q15", "type": "boolean", "prompt": "Employee badges may be lent to others freely.", "answer": "false", "explanation": "A badge is a personal identity credential and may not be lent out." },
|
||||
{ "id": "q16", "type": "boolean", "prompt": "RoHS mainly regulates materials and processes in electrical and electronic products to better protect human health and the environment.", "answer": "true", "explanation": "RoHS focuses on restricting hazardous substances and improving environmental protection." },
|
||||
{ "id": "q17", "type": "boolean", "prompt": "Our company's HSF policy is: green design, eco-friendly purchasing; resource conservation, green output.", "answer": "true", "explanation": "This is the HSF policy statement provided in the exam." },
|
||||
{ "id": "q18", "type": "boolean", "prompt": "EHS stands for Environment, Health, and Safety.", "answer": "true", "explanation": "EHS is the standard abbreviation for environment, health, and safety." },
|
||||
{ "id": "q19", "type": "boolean", "prompt": "External documents do not need to be controlled or managed by the organization.", "answer": "false", "explanation": "External documents also need controlled management." },
|
||||
{ "id": "q20", "type": "boolean", "prompt": "Product-related requirements should include legal and regulatory requirements as well as customer requirements.", "answer": "true", "explanation": "Product requirements must cover both regulations and customer requirements." }
|
||||
{
|
||||
"id": "q8",
|
||||
"type": "boolean",
|
||||
"prompt": "Normal attendance requires clock-in, and overtime must be applied for in advance.",
|
||||
"answer": "true",
|
||||
"explanation": "Both attendance and overtime follow the company attendance policy."
|
||||
},
|
||||
{
|
||||
"id": "q9",
|
||||
"type": "boolean",
|
||||
"prompt": "If you forget to clock in, you need an OA correction request.",
|
||||
"answer": "true",
|
||||
"explanation": "Missed punches must be corrected through the OA process."
|
||||
},
|
||||
{
|
||||
"id": "q10",
|
||||
"type": "boolean",
|
||||
"prompt": "Monthly salary is calculated from the 21st of the previous month to the 20th of the current month.",
|
||||
"answer": "true",
|
||||
"explanation": "The exam explicitly defines this payroll calculation cycle."
|
||||
},
|
||||
{
|
||||
"id": "q11",
|
||||
"type": "boolean",
|
||||
"prompt": "Cafeteria meals require advance booking, and face recognition can be used for dining.",
|
||||
"answer": "true",
|
||||
"explanation": "Advance booking and face-recognition dining are both supported."
|
||||
},
|
||||
{
|
||||
"id": "q12",
|
||||
"type": "boolean",
|
||||
"prompt": "In the event of fire or explosion, you should immediately call 119.",
|
||||
"answer": "true",
|
||||
"explanation": "Calling the fire emergency number is the first step in this scenario."
|
||||
},
|
||||
{
|
||||
"id": "q13",
|
||||
"type": "boolean",
|
||||
"prompt": "Dormitory residents must maintain fire awareness and must not install wires privately or use high-power appliances.",
|
||||
"answer": "true",
|
||||
"explanation": "This is a mandatory dormitory fire-safety rule."
|
||||
},
|
||||
{
|
||||
"id": "q14",
|
||||
"type": "boolean",
|
||||
"prompt": "Following safety production regulations is a safety obligation of employees.",
|
||||
"answer": "true",
|
||||
"explanation": "Safety compliance is both a rule and an employee obligation."
|
||||
},
|
||||
{
|
||||
"id": "q15",
|
||||
"type": "boolean",
|
||||
"prompt": "Employee badges may be lent to others freely.",
|
||||
"answer": "false",
|
||||
"explanation": "A badge is a personal identity credential and may not be lent out."
|
||||
},
|
||||
{
|
||||
"id": "q16",
|
||||
"type": "boolean",
|
||||
"prompt": "RoHS mainly regulates materials and processes in electrical and electronic products to better protect human health and the environment.",
|
||||
"answer": "true",
|
||||
"explanation": "RoHS focuses on restricting hazardous substances and improving environmental protection."
|
||||
},
|
||||
{
|
||||
"id": "q17",
|
||||
"type": "boolean",
|
||||
"prompt": "Our company's HSF policy is: green design, eco-friendly purchasing; resource conservation, green output.",
|
||||
"answer": "true",
|
||||
"explanation": "This is the HSF policy statement provided in the exam."
|
||||
},
|
||||
{
|
||||
"id": "q18",
|
||||
"type": "boolean",
|
||||
"prompt": "EHS stands for Environment, Health, and Safety.",
|
||||
"answer": "true",
|
||||
"explanation": "EHS is the standard abbreviation for environment, health, and safety."
|
||||
},
|
||||
{
|
||||
"id": "q19",
|
||||
"type": "boolean",
|
||||
"prompt": "External documents do not need to be controlled or managed by the organization.",
|
||||
"answer": "false",
|
||||
"explanation": "External documents also need controlled management."
|
||||
},
|
||||
{
|
||||
"id": "q20",
|
||||
"type": "boolean",
|
||||
"prompt": "Product-related requirements should include legal and regulatory requirements as well as customer requirements.",
|
||||
"answer": "true",
|
||||
"explanation": "Product requirements must cover both regulations and customer requirements."
|
||||
}
|
||||
]
|
||||
},
|
||||
"shippingOrderReview": {
|
||||
"title": "Order review", "run": "Run {runNo}", "back": "Back to chat", "readOnly": "Read-only preview", "loading": "Loading review results...", "unavailable": "Review results are unavailable. Please try again later.", "documentNavigation": "PDF navigation", "documents": "PDF documents", "unnamedDocument": "Unnamed PDF", "caseStatus": "{status} · {count} issue(s)", "previewTitle": "PDF preview", "previewLoading": "Loading PDF preview...", "previewUnavailable": "PDF preview is unavailable. Draft editing is unaffected.", "evidenceSummary": "Select a field's location icon to inspect its evidence.", "evidenceAt": "PDF page {page}", "evidenceNoHighlight": "This evidence has no reliable coordinates. Only its page and quote are shown; no highlight is fabricated.", "viewEvidence": "View evidence", "orderFields": "Order fields", "schemaVersion": "Frozen schema #{version}", "issues": "Open issues", "machineSource": "Source: machine extraction", "manualSource": "Source: manual edit", "restoreMachine": "Restore machine value", "saved": "Saved", "saving": "Saving", "saveFailed": "Save failed", "saveNow": "Save and validate", "addLine": "Add line", "copyLine": "Copy line", "deleteLine": "Delete line", "noMachineOrder": "No reliable order was identified.", "lines": "Order lines", "line": "Line {index}", "noLines": "No order lines were identified.", "moreFields": "More order information ({count})", "emptyValue": "Not provided", "unknownField": "Order field", "createManualDraft": "Create manual order draft", "markNonOrder": "Mark as non-order", "markQualityIssue": "File quality issue", "reparse": "Reparse this PDF", "uploadReplacement": "Upload replacement PDF", "confirmCreate": "Confirm and create task", "confirmPrompt": "This freezes the current draft and creates one independent task. Editing will no longer be available. Continue?", "confirmSuccess": "Task {taskNo} created", "confirmAutoProgress": "Task {taskNo} created and auto-progress started"
|
||||
"title": "Order review",
|
||||
"run": "Run {runNo}",
|
||||
"back": "Back to chat",
|
||||
"readOnly": "Read-only preview",
|
||||
"loading": "Loading review results...",
|
||||
"unavailable": "Review results are unavailable. Please try again later.",
|
||||
"documentNavigation": "PDF navigation",
|
||||
"documents": "PDF documents",
|
||||
"unnamedDocument": "Unnamed PDF",
|
||||
"caseStatus": "{status} · {count} issue(s)",
|
||||
"caseStatuses": {
|
||||
"unreviewed": "Pending review",
|
||||
"draft": "Draft",
|
||||
"ready": "Ready to confirm",
|
||||
"confirmed": "Task created",
|
||||
"non_order": "Marked as non-order",
|
||||
"quality_issue": "File quality issue",
|
||||
"reparse_pending": "Re-recognizing",
|
||||
"superseded": "Replaced by newer result",
|
||||
"unknown": "Unknown status"
|
||||
},
|
||||
"previewTitle": "PDF preview",
|
||||
"previewLoading": "Loading PDF preview...",
|
||||
"previewUnavailable": "PDF preview is unavailable. Draft editing is unaffected.",
|
||||
"previewCollapsed": "This evidence has only a page and quote, with no reliable coordinates; the PDF preview is collapsed.",
|
||||
"expandPreview": "Expand PDF preview",
|
||||
"evidenceSummary": "Select a field's location icon to inspect its evidence.",
|
||||
"evidenceAt": "PDF page {page}",
|
||||
"evidenceNoHighlight": "This evidence has no reliable coordinates. Only its page and quote are shown; no highlight is fabricated.",
|
||||
"viewEvidence": "View evidence",
|
||||
"locateSource": "Locate source: {field}",
|
||||
"orderFields": "Order fields",
|
||||
"schemaVersion": "Frozen schema #{version}",
|
||||
"issues": "Open issues",
|
||||
"machineSource": "Source: machine extraction",
|
||||
"manualSource": "Source: manual edit",
|
||||
"restoreMachine": "Restore machine value",
|
||||
"saved": "Saved",
|
||||
"saving": "Saving",
|
||||
"saveFailed": "Save failed",
|
||||
"saveNow": "Save and validate",
|
||||
"addLine": "Add line",
|
||||
"copyLine": "Copy line",
|
||||
"deleteLine": "Delete line",
|
||||
"noMachineOrder": "Machine results are awaiting review. Create a draft to make corrections.",
|
||||
"lines": "Order lines",
|
||||
"line": "Line {index}",
|
||||
"noLines": "No order lines were identified.",
|
||||
"moreFields": "More order information ({count})",
|
||||
"emptyValue": "Not provided",
|
||||
"unknownField": "Order field",
|
||||
"createManualDraft": "Create manual order draft",
|
||||
"markNonOrder": "Mark as non-order",
|
||||
"markQualityIssue": "File quality issue",
|
||||
"reparse": "Reparse this PDF",
|
||||
"uploadReplacement": "Upload replacement PDF",
|
||||
"confirmCreate": "Confirm and create task",
|
||||
"confirmPrompt": "This freezes the current draft and creates one independent task. Editing will no longer be available. Continue?",
|
||||
"confirmSuccess": "Task {taskNo} created",
|
||||
"confirmAutoProgress": "Task {taskNo} created and auto-progress started",
|
||||
"autoProgress": {
|
||||
"result": "Auto-progress result: {status}",
|
||||
"checkpoint": "Current checkpoint: {checkpoint}",
|
||||
"viewTask": "View order progress",
|
||||
"status": {
|
||||
"ok": "Current automatic steps completed",
|
||||
"running": "Processing",
|
||||
"needs_human": "Manual action required",
|
||||
"failed": "Auto-progress failed",
|
||||
"unknown": "Status pending confirmation"
|
||||
}
|
||||
},
|
||||
"backToSession": "Back to this session",
|
||||
"workItemHeader": "Work item {itemNo} · {version}",
|
||||
"jumpToCurrentVersion": "Go to current version",
|
||||
"showContext": "Conversation context",
|
||||
"hideContext": "Hide context",
|
||||
"contextTitle": "Conversation context",
|
||||
"contextDesc": "Recent order extraction messages in this conversation.",
|
||||
"contextUser": "User",
|
||||
"contextAi": "AI",
|
||||
"statusBanner": {
|
||||
"superseded": "You are viewing a historical version. The current version has changed; editing and confirmation are disabled.",
|
||||
"reparse_in_progress": "This PDF is being re-recognized. Please wait before continuing review.",
|
||||
"restored": "Re-recognition failed and the previous version was restored. You may continue editing."
|
||||
},
|
||||
"versionHistory": {
|
||||
"title": "Version history",
|
||||
"itemNo": "Work item {itemNo}",
|
||||
"result": "Result",
|
||||
"createdAt": "Created",
|
||||
"confirmedAt": "Confirmed",
|
||||
"viewReadonly": "View read-only",
|
||||
"open": "Open"
|
||||
},
|
||||
"confirmDialog": {
|
||||
"reasonLabel": "Reason (required)",
|
||||
"reasonPlaceholder": "Describe why you are taking this action...",
|
||||
"reasonRequired": "A reason is required",
|
||||
"confirm": {
|
||||
"title": "Confirm and create task",
|
||||
"impact": "This freezes the current draft and creates one independent task. Editing will no longer be available.",
|
||||
"confirm": "Confirm task"
|
||||
},
|
||||
"reparse": {
|
||||
"title": "Reparse this PDF",
|
||||
"impact": "A new extraction run will be created. The current version becomes read-only history.",
|
||||
"confirm": "Start reparse"
|
||||
},
|
||||
"non_order": {
|
||||
"title": "Mark as non-order",
|
||||
"impact": "This closes the PDF work item as non-order and it cannot return to a confirmable state.",
|
||||
"confirm": "Confirm mark"
|
||||
},
|
||||
"replace": {
|
||||
"title": "Upload replacement PDF",
|
||||
"impact": "The new PDF replaces the current document and triggers re-recognition. The current version becomes read-only.",
|
||||
"confirm": "Confirm upload"
|
||||
},
|
||||
"reasonCodeLabel": "Reason type",
|
||||
"reasonCodeRequired": "Please select a reason type",
|
||||
"quality_issue": {
|
||||
"title": "Mark file quality issue",
|
||||
"impact": "Keeps the PDF, draft, and machine values for replacement or reparse. Select a reason; a comment is required when choosing Other.",
|
||||
"confirm": "Confirm"
|
||||
},
|
||||
"qualityReasons": {
|
||||
"blurred": "Blurred image",
|
||||
"incomplete_pages": "Incomplete pages",
|
||||
"password_protected": "Password protected",
|
||||
"corrupted": "Corrupted file",
|
||||
"wrong_orientation": "Wrong orientation",
|
||||
"unsupported_layout": "Unsupported layout",
|
||||
"missing_order_table": "Missing order table",
|
||||
"other": "Other (comment required)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionElapsed": "Elapsed {elapsed}",
|
||||
"shippingOrderExtractionQueuePosition": "Queue position {position}",
|
||||
"shippingOrderExtractionRefreshing": "Refreshing...",
|
||||
"shippingOrderExtractionUserStage": {
|
||||
"pending": "Pending",
|
||||
"document_queued": "Queued, waiting to start",
|
||||
"waiting_layout": "Waiting for layout parsing",
|
||||
"layout_parsing_started": "Parsing layout",
|
||||
"routing": "Analysing document structure",
|
||||
"matching_profile": "Matching order template",
|
||||
"extracting": "Extracting order fields",
|
||||
"merging_supplement": "Merging email supplements",
|
||||
"candidate_ready": "Candidate ready",
|
||||
"review_required": "Manual review required",
|
||||
"technical_retrying": "Retrying",
|
||||
"failed": "Failed",
|
||||
"cancellation_requested": "Cancelling…",
|
||||
"cancelled": "Cancelled",
|
||||
"completed": "Completed"
|
||||
},
|
||||
"shippingOrderExtractionHealthTip": {
|
||||
"processing_slow": "This is taking longer than usual. Processing continues — try refreshing later.",
|
||||
"queue_backlog": "There is a queue ahead. Please wait.",
|
||||
"processing_attention": "Processing has been slow. Contact an admin if there is no progress."
|
||||
},
|
||||
"shippingOrderExtractionCancel": {
|
||||
"confirmTitle": "Cancel this identification run?",
|
||||
"confirmImpact": "Queued attachments cancel immediately. In-flight ones stop at a safe checkpoint. Completed results are kept.",
|
||||
"reasonRequired": "A cancellation reason is required",
|
||||
"reasonOptional": "Optional: cancellation reason",
|
||||
"submitting": "Submitting cancellation…",
|
||||
"dismiss": "Keep running",
|
||||
"failed": "Cancellation request failed. Please try again."
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,15 @@
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_NOT_RETRYABLE": "Only failed order identification runs can be retried.",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_SNAPSHOT_OBSOLETE": "This run uses an obsolete input contract and cannot be retried. Send the email and attachments again to start a new run.",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_CONVERSATION_ACTIVE": "An order identification run is already processing in this conversation. Please wait for it to finish.",
|
||||
"SHIPPING_NOTICE.CANCEL_FORBIDDEN": "You are not allowed to cancel this order identification run.",
|
||||
"SHIPPING_NOTICE.CANCEL_REASON_REQUIRED": "A reason is required when cancelling another user’s run.",
|
||||
"SHIPPING_NOTICE.CANCEL_NOT_ACTIVE": "This run is finished or cannot be cancelled.",
|
||||
"SHIPPING_NOTICE.CANCEL_CONFLICT": "The cancellation request conflicts with the current progress. Refresh and try again.",
|
||||
"SHIPPING_NOTICE.CANCEL_FEATURE_DISABLED": "Order extraction cancel is disabled. Contact an administrator.",
|
||||
"SHIPPING_NOTICE.AUDIT_EXPORT_FEATURE_DISABLED": "Audit export is disabled. Contact an administrator.",
|
||||
"SHIPPING_NOTICE.AUDIT_PERSIST_FAILED": "Failed to persist the audit record. The operation was not completed. Please retry.",
|
||||
"SHIPPING_NOTICE.AUDIT_METADATA_FORBIDDEN": "Audit write contains forbidden sensitive fields.",
|
||||
"SHIPPING_NOTICE.AUDIT_SNAPSHOT_FORBIDDEN": "Audit snapshot contains forbidden sensitive fields.",
|
||||
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "The order template has not been initialized.",
|
||||
"SHIPPING_ORDER_SCHEMA_EXISTS": "The order template already exists.",
|
||||
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "An order template draft already exists. Complete or publish it first.",
|
||||
@@ -378,6 +387,7 @@
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_REQUIRED": "The confirmation request is missing an idempotency key. Please try again.",
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_CONFLICT": "The confirmation request conflicts with an existing request. Refresh and try again.",
|
||||
"SHIPPING_REVIEW_CONFIRM_VALIDATION_FAILED": "The draft has not passed complete validation and cannot be confirmed.",
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "The review PDF is unavailable and cannot be confirmed."
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "The review PDF is unavailable and cannot be confirmed.",
|
||||
"SHIPPING_REVIEW_QUALITY_COMMENT_REQUIRED": "A comment is required when the quality issue reason is Other."
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,12 @@
|
||||
"archived": "Archived"
|
||||
},
|
||||
"disposition": {
|
||||
"actions": { "delete": "Delete", "archive": "Archive", "restore": "Restore", "purge": "Delete permanently" },
|
||||
"actions": {
|
||||
"delete": "Delete",
|
||||
"archive": "Archive",
|
||||
"restore": "Restore",
|
||||
"purge": "Delete permanently"
|
||||
},
|
||||
"reasonPrompt": "Enter the deletion or void reason:",
|
||||
"purgeReasonPrompt": "Enter the permanent deletion reason (administrators, pure draft tasks only):",
|
||||
"confirm": "{action} the selected {count} task(s)?",
|
||||
@@ -376,6 +381,25 @@
|
||||
"uploaded": "Uploaded to freight",
|
||||
"upload_failed": "Freight upload failed",
|
||||
"backend_orchestrator_task_finished": "Background task completed"
|
||||
},
|
||||
"myRuns": {
|
||||
"title": "My identification runs",
|
||||
"subtitle": "Continue in-progress, failed, or cancelled order identification runs from here.",
|
||||
"status": "Status",
|
||||
"allStatuses": "All statuses",
|
||||
"runNo": "Run no.",
|
||||
"stage": "Current stage",
|
||||
"summary": "Attachment progress",
|
||||
"summaryCounts": "{total} total: done {done} / review {review} / failed {failed} / cancelled {cancelled}",
|
||||
"elapsed": "Elapsed",
|
||||
"actions": "Actions",
|
||||
"openChat": "Open chat",
|
||||
"loading": "Loading identification runs...",
|
||||
"empty": "No identification runs yet",
|
||||
"loadFailed": "Failed to load identification runs",
|
||||
"total": "{count} total",
|
||||
"previous": "Previous",
|
||||
"next": "Next"
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
"shippingOrderExtractionRuns": "งานระบุคำสั่งซื้อ",
|
||||
"shippingOrderDocumentProfiles": "แม่แบบเอกสาร",
|
||||
"shippingFieldAssets": "คลังฟิลด์",
|
||||
"shippingOrderSchema": "Order Schema"
|
||||
"shippingOrderSchema": "Order Schema",
|
||||
"shippingAudit": "ศูนย์ตรวจสอบ",
|
||||
"shippingReviewSupervision": "การกำกับการตรวจทาน"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "การวินิจฉัยการทำงานแบบอ่านอย่างเดียว",
|
||||
@@ -54,6 +56,9 @@
|
||||
"createdAt": "เวลาสร้าง",
|
||||
"totalDuration": "เวลารวม",
|
||||
"viewDetail": "ดูรายละเอียด",
|
||||
"actions": "การดำเนินการ",
|
||||
"cancelRun": "ยกเลิกการทำงาน",
|
||||
"cancelFailed": "ยกเลิกการทำงานไม่สำเร็จ",
|
||||
"previous": "ก่อนหน้า",
|
||||
"next": "ถัดไป",
|
||||
"loading": "กำลังโหลด...",
|
||||
@@ -167,6 +172,24 @@
|
||||
"review_required": "ต้องตรวจด้วยตนเองทั้งหมด",
|
||||
"failed": "ล้มเหลว",
|
||||
"cancelled": "ยกเลิก"
|
||||
},
|
||||
"healthStatus": "สุขภาพระบบ",
|
||||
"healthStatuses": {
|
||||
"healthy": "ปกติ",
|
||||
"degraded": "เสื่อม"
|
||||
},
|
||||
"activeCount": "รอบที่กำลังทำงาน",
|
||||
"staleCount": "ค้าง / คิวค้าง",
|
||||
"failureRate": "อัตราล้มเหลว",
|
||||
"latencySummary": "เวลารวม P50 {p50} / P95 {p95} / Max {max}",
|
||||
"staleRuns": "รอบที่ค้าง: {runs}",
|
||||
"healthUnavailable": "ไม่สามารถโหลดสรุปสุขภาพได้",
|
||||
"staleOnly": "เฉพาะที่ค้าง",
|
||||
"cancellationInFlight": "เฉพาะที่กำลังยกเลิก",
|
||||
"cancellation": "สถานะยกเลิก",
|
||||
"cancellationStates": {
|
||||
"in_flight": "กำลังยกเลิก",
|
||||
"completed": "ยกเลิกแล้ว"
|
||||
}
|
||||
},
|
||||
"shippingOrderSchema": {
|
||||
@@ -343,8 +366,8 @@
|
||||
"placementHeader": "ข้อมูลคำสั่งซื้อ",
|
||||
"placementLine": "รายละเอียดสินค้า",
|
||||
"placement": {
|
||||
"header": "ข้อมูลคำสั่งซื้อ",
|
||||
"line": "รายละเอียดสินค้า"
|
||||
"header": "หัวตาราง",
|
||||
"line": "รายการ"
|
||||
},
|
||||
"fieldType": {
|
||||
"string": "ข้อความ",
|
||||
@@ -551,10 +574,6 @@
|
||||
"suggestPreviewEmpty": "ฟิลด์แนะนำถูกนำมาใช้ครบแล้ว ไม่ต้องเปลี่ยน",
|
||||
"suggestConfirm": "ยืนยันการนำมาใช้",
|
||||
"suggestCancel": "ยกเลิก",
|
||||
"placement": {
|
||||
"header": "หัวตาราง",
|
||||
"line": "รายการ"
|
||||
},
|
||||
"operationFailed": "ดำเนินการเทมเพลตคำสั่งซื้อไม่สำเร็จ",
|
||||
"fieldCategory": "หมวดหมู่ฟิลด์",
|
||||
"fieldCategoryOption": {
|
||||
@@ -2569,7 +2588,48 @@
|
||||
"time": "เวลาสร้าง",
|
||||
"empty": "ยังไม่มีผลการตรวจสอบ",
|
||||
"completed": "ตรวจสอบเสร็จแล้ว",
|
||||
"failed": "ตรวจสอบล้มเหลว", "currentDraft": "ตรวจสอบฉบับร่างปัจจุบัน", "currentDraftHint": "ระบบจะตรวจการตั้งค่าและอ่านตัวอย่างปัจจุบันหนึ่งครั้ง", "validateCurrent": "ตรวจสอบฉบับร่างปัจจุบัน", "validating": "กำลังตรวจสอบ…", "goPublishCheck": "ไปยังการตรวจสอบก่อนเผยแพร่", "structureCheck": "ตรวจสอบการตั้งค่า", "structureCheckHint": "ตรวจการผูกฟิลด์ พิกัดหน้า ขอบเขต และโครงสร้างรายการ", "sampleCheck": "อ่านตัวอย่างปัจจุบัน", "sampleCheckHint": "ตรวจว่าตัวอย่างที่ทำเครื่องหมายอ่านฟิลด์และรายการได้หรือไม่", "state": { "ready": "ฉบับร่างปัจจุบันพร้อมตรวจสอบก่อนเผยแพร่", "stale": "การตั้งค่าเปลี่ยนแล้ว โปรดตรวจสอบอีกครั้ง", "failed": "ตรวจสอบไม่ผ่าน โปรดกลับไปแก้ไข", "pending": "ยังไม่ได้ตรวจสอบฉบับร่างปัจจุบัน" }, "stateHint": { "ready": "การตรวจการตั้งค่าและตัวอย่างผ่านแล้ว", "stale": "ผลเก่าเป็นของฉบับร่างก่อนหน้าและใช้เผยแพร่ไม่ได้", "failed": "แก้ไขเครื่องหมายแล้วตรวจสอบอีกครั้ง", "pending": "บันทึกเครื่องหมายแล้วจึงตรวจสอบ" }, "runStatus": { "passed": "ผ่าน", "failed": "ไม่ผ่าน", "stale": "ล้าสมัย", "pending": "ยังไม่ทำ", "running": "กำลังตรวจสอบ" }, "resultsTitle": "ผลการอ่านตัวอย่างปัจจุบัน", "resultsHint": "แสดงเฉพาะผลที่อ่านแบบเรียลไทม์จากฉบับร่างและการทำเครื่องหมายปัจจุบัน แถวที่ลบมีไว้ตรวจสอบและจะไม่เข้าผลลัพธ์คำสั่งซื้อ", "refreshResults": "อ่านอีกครั้ง", "resultsLoading": "กำลังอ่านตัวอย่างปัจจุบัน...", "resultsFailed": "ไม่พบค่าหรืออ่านล้มเหลว โปรดตรวจสอบการทำเครื่องหมายในตัวแก้ไข", "headerResults": "ส่วนหัวคำสั่งซื้อ", "lineResults": "รายการคำสั่งซื้อ", "noHeaderResults": "ไม่พบฟิลด์ส่วนหัวจากตัวอย่างปัจจุบัน", "noLineResults": "ไม่พบรายการจากตัวอย่างปัจจุบัน", "noValue": "ไม่พบค่า", "rowStatus": "สถานะ", "deleted": "ลบแล้ว ไม่นับผล", "read": "อ่านแล้ว"
|
||||
"failed": "ตรวจสอบล้มเหลว",
|
||||
"currentDraft": "ตรวจสอบฉบับร่างปัจจุบัน",
|
||||
"currentDraftHint": "ระบบจะตรวจการตั้งค่าและอ่านตัวอย่างปัจจุบันหนึ่งครั้ง",
|
||||
"validateCurrent": "ตรวจสอบฉบับร่างปัจจุบัน",
|
||||
"validating": "กำลังตรวจสอบ…",
|
||||
"goPublishCheck": "ไปยังการตรวจสอบก่อนเผยแพร่",
|
||||
"structureCheck": "ตรวจสอบการตั้งค่า",
|
||||
"structureCheckHint": "ตรวจการผูกฟิลด์ พิกัดหน้า ขอบเขต และโครงสร้างรายการ",
|
||||
"sampleCheck": "อ่านตัวอย่างปัจจุบัน",
|
||||
"sampleCheckHint": "ตรวจว่าตัวอย่างที่ทำเครื่องหมายอ่านฟิลด์และรายการได้หรือไม่",
|
||||
"state": {
|
||||
"ready": "ฉบับร่างปัจจุบันพร้อมตรวจสอบก่อนเผยแพร่",
|
||||
"stale": "การตั้งค่าเปลี่ยนแล้ว โปรดตรวจสอบอีกครั้ง",
|
||||
"failed": "ตรวจสอบไม่ผ่าน โปรดกลับไปแก้ไข",
|
||||
"pending": "ยังไม่ได้ตรวจสอบฉบับร่างปัจจุบัน"
|
||||
},
|
||||
"stateHint": {
|
||||
"ready": "การตรวจการตั้งค่าและตัวอย่างผ่านแล้ว",
|
||||
"stale": "ผลเก่าเป็นของฉบับร่างก่อนหน้าและใช้เผยแพร่ไม่ได้",
|
||||
"failed": "แก้ไขเครื่องหมายแล้วตรวจสอบอีกครั้ง",
|
||||
"pending": "บันทึกเครื่องหมายแล้วจึงตรวจสอบ"
|
||||
},
|
||||
"runStatus": {
|
||||
"passed": "ผ่าน",
|
||||
"failed": "ไม่ผ่าน",
|
||||
"stale": "ล้าสมัย",
|
||||
"pending": "ยังไม่ทำ",
|
||||
"running": "กำลังตรวจสอบ"
|
||||
},
|
||||
"resultsTitle": "ผลการอ่านตัวอย่างปัจจุบัน",
|
||||
"resultsHint": "แสดงเฉพาะผลที่อ่านแบบเรียลไทม์จากฉบับร่างและการทำเครื่องหมายปัจจุบัน แถวที่ลบมีไว้ตรวจสอบและจะไม่เข้าผลลัพธ์คำสั่งซื้อ",
|
||||
"refreshResults": "อ่านอีกครั้ง",
|
||||
"resultsLoading": "กำลังอ่านตัวอย่างปัจจุบัน...",
|
||||
"resultsFailed": "ไม่พบค่าหรืออ่านล้มเหลว โปรดตรวจสอบการทำเครื่องหมายในตัวแก้ไข",
|
||||
"headerResults": "ส่วนหัวคำสั่งซื้อ",
|
||||
"lineResults": "รายการคำสั่งซื้อ",
|
||||
"noHeaderResults": "ไม่พบฟิลด์ส่วนหัวจากตัวอย่างปัจจุบัน",
|
||||
"noLineResults": "ไม่พบรายการจากตัวอย่างปัจจุบัน",
|
||||
"noValue": "ไม่พบค่า",
|
||||
"rowStatus": "สถานะ",
|
||||
"deleted": "ลบแล้ว ไม่นับผล",
|
||||
"read": "อ่านแล้ว"
|
||||
},
|
||||
"orderProfilePublishCheck": {
|
||||
"eyebrow": "ด่านเผยแพร่",
|
||||
@@ -2585,7 +2645,16 @@
|
||||
"noBlocking": "ไม่มีรายการที่ขัดขวาง",
|
||||
"warnings": "คำเตือน (ยืนยันแต่ละรายการ)",
|
||||
"confirm": "ยืนยันการเผยแพร่",
|
||||
"failed": "ตรวจสอบการเผยแพร่ล้มเหลว", "readyTitle": "ฉบับร่างที่ตรวจสอบแล้ว", "readyHint": "การตรวจตัวอย่างปัจจุบันผ่านแล้ว สร้างรายงานเพื่อตรวจเงื่อนไขและการเปลี่ยนแปลง", "reportTitle": "ผลการตรวจสอบก่อนเผยแพร่", "blockedHint": "ต้องแก้ปัญหาเหล่านี้ ไม่สามารถยืนยันเพื่อข้ามได้", "reviewHint": "ยืนยันการเปลี่ยนแปลงที่แสดงทั้งหมดเพื่อเผยแพร่รุ่นนี้", "confirmHint": "โปรดยืนยันว่าได้ตรวจสอบการเปลี่ยนแปลงข้างต้นแล้ว", "currentValidationRequired": "ฉบับร่างปัจจุบันต้องผ่านการตรวจตัวอย่างก่อน", "semanticDiffReview": "รุ่นนี้มีความแตกต่างเชิงความหมาย โปรดยืนยันว่าได้ตรวจสอบแล้ว", "unknownIssue": "การตรวจสอบก่อนเผยแพร่พบปัญหาที่ต้องจัดการ"
|
||||
"failed": "ตรวจสอบการเผยแพร่ล้มเหลว",
|
||||
"readyTitle": "ฉบับร่างที่ตรวจสอบแล้ว",
|
||||
"readyHint": "การตรวจตัวอย่างปัจจุบันผ่านแล้ว สร้างรายงานเพื่อตรวจเงื่อนไขและการเปลี่ยนแปลง",
|
||||
"reportTitle": "ผลการตรวจสอบก่อนเผยแพร่",
|
||||
"blockedHint": "ต้องแก้ปัญหาเหล่านี้ ไม่สามารถยืนยันเพื่อข้ามได้",
|
||||
"reviewHint": "ยืนยันการเปลี่ยนแปลงที่แสดงทั้งหมดเพื่อเผยแพร่รุ่นนี้",
|
||||
"confirmHint": "โปรดยืนยันว่าได้ตรวจสอบการเปลี่ยนแปลงข้างต้นแล้ว",
|
||||
"currentValidationRequired": "ฉบับร่างปัจจุบันต้องผ่านการตรวจตัวอย่างก่อน",
|
||||
"semanticDiffReview": "รุ่นนี้มีความแตกต่างเชิงความหมาย โปรดยืนยันว่าได้ตรวจสอบแล้ว",
|
||||
"unknownIssue": "การตรวจสอบก่อนเผยแพร่พบปัญหาที่ต้องจัดการ"
|
||||
},
|
||||
"shippingOrderProfiles": {
|
||||
"title": "โปรไฟล์เอกสารคำสั่งซื้อ",
|
||||
@@ -2978,15 +3047,22 @@
|
||||
"gateTitle": "การทดสอบแบบปิดบังก่อนเผยแพร่",
|
||||
"gateRequiredHint": "ต้องทำและอนุมัติการทดสอบแบบปิดบังด้วยตัวอย่างอิสระก่อนเข้าสู่การตรวจสอบก่อนเผยแพร่",
|
||||
"gateApprovedHint": "การทดสอบแบบปิดบังของฉบับร่างนี้ได้รับอนุมัติแล้ว สามารถเข้าสู่การตรวจสอบก่อนเผยแพร่ได้",
|
||||
"status": { "missing": "ยังไม่ได้สร้าง", "draft": "ต้องดำเนินการ", "approved": "อนุมัติแล้ว", "superseded": "หมดอายุแล้ว" },
|
||||
"status": {
|
||||
"missing": "ยังไม่ได้สร้าง",
|
||||
"draft": "ต้องดำเนินการ",
|
||||
"approved": "อนุมัติแล้ว",
|
||||
"superseded": "หมดอายุแล้ว"
|
||||
},
|
||||
"samples": "ตัวอย่าง: {count} · {status}",
|
||||
"notRun": "ยังไม่ดำเนินการ",
|
||||
"approvedHint": "การทดสอบแบบปิดบังนี้ได้รับอนุมัติแล้ว ไม่ต้องดำเนินการหรืออนุมัติซ้ำ",
|
||||
"selectIndependentSample": "เลือกตัวอย่างอิสระ",
|
||||
"loadIndependentSamples": "โหลดตัวอย่างที่ใช้ได้",
|
||||
"loadingIndependentSamples": "กำลังโหลดตัวอย่างที่ใช้ได้…",
|
||||
"loadIndependentSamplesTimedOut": "การโหลดตัวอย่างที่ใช้ได้หมดเวลา โปรดยืนยันว่าแบ็กเอนด์ทำงานปกติแล้วลองใหม่",
|
||||
"loadIndependentSamplesHint": "โหลดตัวเลือกเมื่อต้องเพิ่มตัวอย่างทดสอบเท่านั้น เพื่อไม่ให้การเปิดหน้านี้ต้องรอการสแกนตัวอย่างเดิมทั้งหมด",
|
||||
"selectSamplePlaceholder": "เลือกคำสั่งซื้อที่ไม่ได้ใช้ทำเครื่องหมายเทมเพลตนี้",
|
||||
"sampleOption": "{filename} · P{page} · ตาราง {table} · {rows} แถว x {columns} คอลัมน์ · {header}",
|
||||
"noIndependentSamples": "ไม่มีตัวอย่างอิสระ โปรดอัปโหลดและแยกข้อมูลคำสั่งซื้อประเภทเดียวกันอีกฉบับก่อน",
|
||||
"reviewHint": "ทำเครื่องหมายแต่ละรายการว่าถูกต้องหรือผิดพลาด หากผิดพลาดต้องระบุค่าที่แก้ไข รายการที่ยังไม่ตรวจทานจะเพิ่มไม่ได้",
|
||||
"row": "รายการ {index}",
|
||||
@@ -3019,13 +3095,23 @@
|
||||
"execution": "ดำเนินการและอนุมัติ",
|
||||
"runHint": "การดำเนินการจะวิเคราะห์ตัวอย่างทดสอบทั้งหมดด้วยฉบับร่างปัจจุบันใหม่ และต้องผ่านทั้งหมดจึงอนุมัติได้",
|
||||
"unknownSample": "ตัวอย่างที่ไม่ทราบ",
|
||||
"failure": { "title": "รายละเอียดการดำเนินการที่ล้มเหลว", "hint": "ใช้เหตุผลเพื่อปรับคำอธิบายประกอบหรือยืนยันข้อมูลจริงของการทดสอบใหม่ แล้วดำเนินการอีกครั้ง", "fieldMismatch": "{sample}: ค่าที่อ่านใหม่ของฟิลด์คำสั่งซื้อ {field} ไม่ตรงกับข้อมูลจริงที่ยืนยันโดยคน", "fieldNeedsReview": "{sample}: ฟิลด์คำสั่งซื้อ {field} ยังไม่อยู่ในสถานะยืนยัน โปรดตรวจจุดยึดและช่วงพิกัด", "fieldUnavailable": "{sample}: ไม่พบค่าที่ใช้ได้ของฟิลด์คำสั่งซื้อ {field} โปรดตรวจจุดยึด หน้าเอกสาร และหลักฐานพิกัด", "coordinateEvidenceMissing": "{sample}: ไม่มีหลักฐานพิกัดของตารางหรือหน้า จึงดำเนินการทดสอบไม่ได้", "rowsMismatch": "{sample}: รายการคำสั่งซื้อที่อ่านใหม่ไม่ตรงกับข้อมูลจริงที่ยืนยันโดยคน", "unknown": "{sample}: การทดสอบแบบปิดบังไม่ผ่าน โปรดตรวจรหัสวินิจฉัยด้านล่าง" },
|
||||
"failure": {
|
||||
"title": "รายละเอียดการดำเนินการที่ล้มเหลว",
|
||||
"hint": "ใช้เหตุผลเพื่อปรับคำอธิบายประกอบหรือยืนยันข้อมูลจริงของการทดสอบใหม่ แล้วดำเนินการอีกครั้ง",
|
||||
"fieldMismatch": "{sample}: ค่าที่อ่านใหม่ของฟิลด์คำสั่งซื้อ {field} ไม่ตรงกับข้อมูลจริงที่ยืนยันโดยคน",
|
||||
"fieldNeedsReview": "{sample}: ฟิลด์คำสั่งซื้อ {field} ยังไม่อยู่ในสถานะยืนยัน โปรดตรวจจุดยึดและช่วงพิกัด",
|
||||
"fieldUnavailable": "{sample}: ไม่พบค่าที่ใช้ได้ของฟิลด์คำสั่งซื้อ {field} โปรดตรวจจุดยึด หน้าเอกสาร และหลักฐานพิกัด",
|
||||
"coordinateEvidenceMissing": "{sample}: ไม่มีหลักฐานพิกัดของตารางหรือหน้า จึงดำเนินการทดสอบไม่ได้",
|
||||
"rowsMismatch": "{sample}: รายการคำสั่งซื้อที่อ่านใหม่ไม่ตรงกับข้อมูลจริงที่ยืนยันโดยคน",
|
||||
"unknown": "{sample}: การทดสอบแบบปิดบังไม่ผ่าน โปรดตรวจรหัสวินิจฉัยด้านล่าง"
|
||||
},
|
||||
"run": "ดำเนินการ",
|
||||
"approve": "อนุมัติ"
|
||||
},
|
||||
"workbench": {
|
||||
"boundHistoricalSchema": "เวอร์ชันประวัติที่ผูกไว้",
|
||||
"intro": "ลากพื้นที่หลักฐานบนหน้าเอกสารที่ควบคุมไว้ คำนิยามที่บันทึกไม่มี HTML หรือ URL ที่เก็บข้อมูล", "returnToLibrary": "กลับไปยังเทมเพลตเอกสาร",
|
||||
"intro": "ลากพื้นที่หลักฐานบนหน้าเอกสารที่ควบคุมไว้ คำนิยามที่บันทึกไม่มี HTML หรือ URL ที่เก็บข้อมูล",
|
||||
"returnToLibrary": "กลับไปยังเทมเพลตเอกสาร",
|
||||
"structure": "โครงสร้าง",
|
||||
"saveStatus": {
|
||||
"saved": "บันทึกแล้ว",
|
||||
@@ -3041,7 +3127,31 @@
|
||||
"acceptSuggestion": "ยอมรับ",
|
||||
"acceptAdjustedSuggestion": "ยอมรับหลังปรับ",
|
||||
"rejectSuggestion": "ปฏิเสธ",
|
||||
"suggestionAdjustmentField": "เลือกฟิลด์ทดแทน", "sampleValueUnavailable": "ไม่พบค่าที่อ่านได้", "orderFieldValueReading": "กำลังอ่าน", "orderFieldValueFailed": "อ่านไม่สำเร็จ", "currentSampleValue": "ค่าจากตัวอย่างปัจจุบัน", "selectedRegion": "คำอธิบายประกอบที่เลือก", "recognitionResults": "ผลลัพธ์การรู้จำ", "orderHeaderResults": "ฟิลด์ส่วนหัวคำสั่งซื้อ", "orderLineResults": "ฟิลด์รายการคำสั่งซื้อ", "noRecognitionResults": "ยังไม่มีผลลัพธ์แบบมีโครงสร้าง", "lineResultField": "แถว {row} · {field}", "previewState": { "idle": "กำลังรอ", "updating": "กำลังอ่าน", "ready": "อัปเดตแล้ว", "failed": "อ่านไม่สำเร็จ" }, "evidenceStatus": { "read": "อ่านแล้ว", "review": "ต้องตรวจทาน", "loading": "กำลังอ่าน", "failed": "อ่านไม่สำเร็จ", "deleted": "ลบแล้ว ไม่นับในผลลัพธ์", "unavailable": "ไม่พบค่าที่อ่านได้" },
|
||||
"suggestionAdjustmentField": "เลือกฟิลด์ทดแทน",
|
||||
"sampleValueUnavailable": "ไม่พบค่าที่อ่านได้",
|
||||
"orderFieldValueReading": "กำลังอ่าน",
|
||||
"orderFieldValueFailed": "อ่านไม่สำเร็จ",
|
||||
"currentSampleValue": "ค่าจากตัวอย่างปัจจุบัน",
|
||||
"selectedRegion": "คำอธิบายประกอบที่เลือก",
|
||||
"recognitionResults": "ผลลัพธ์การรู้จำ",
|
||||
"orderHeaderResults": "ฟิลด์ส่วนหัวคำสั่งซื้อ",
|
||||
"orderLineResults": "ฟิลด์รายการคำสั่งซื้อ",
|
||||
"noRecognitionResults": "ยังไม่มีผลลัพธ์แบบมีโครงสร้าง",
|
||||
"lineResultField": "แถว {row} · {field}",
|
||||
"previewState": {
|
||||
"idle": "กำลังรอ",
|
||||
"updating": "กำลังอ่าน",
|
||||
"ready": "อัปเดตแล้ว",
|
||||
"failed": "อ่านไม่สำเร็จ"
|
||||
},
|
||||
"evidenceStatus": {
|
||||
"read": "อ่านแล้ว",
|
||||
"review": "ต้องตรวจทาน",
|
||||
"loading": "กำลังอ่าน",
|
||||
"failed": "อ่านไม่สำเร็จ",
|
||||
"deleted": "ลบแล้ว ไม่นับในผลลัพธ์",
|
||||
"unavailable": "ไม่พบค่าที่อ่านได้"
|
||||
},
|
||||
"openCanvas": "สร้างฉบับร่างและเปิดผืนงาน",
|
||||
"loadingPage": "กำลังโหลดหน้า...",
|
||||
"canvasZoom": "การซูมหน้า",
|
||||
@@ -3067,6 +3177,15 @@
|
||||
"drawHeader": "วาดหัวตาราง",
|
||||
"drawOrderField": "วาดฟิลด์คำสั่งซื้อ",
|
||||
"drawOrderAnchor": "วาดป้ายกำกับฟิลด์คำสั่งซื้อ",
|
||||
"drawDocumentMatchAnchor": "วาดจุดยึดการจับคู่เอกสาร (ป้ายกำกับ แล้วค่าคงที่)",
|
||||
"drawDocumentMatchAnchorShortcut": "จุดยึดการจับคู่เอกสาร (M): ป้ายกำกับ แล้วค่าคงที่",
|
||||
"drawOrderAnchorShortcut": "ป้ายกำกับฟิลด์คำสั่งซื้อ (A)",
|
||||
"drawOrderFieldShortcut": "ฟิลด์คำสั่งซื้อ (O)",
|
||||
"drawHeaderShortcut": "หัวตารางรายละเอียด (H)",
|
||||
"drawLineShortcut": "แถวรายละเอียด (L)",
|
||||
"drawFieldShortcut": "ฟิลด์รายละเอียด (F)",
|
||||
"drawExclusionShortcut": "พื้นที่ยกเว้น (X)",
|
||||
"autoSuggestShortcut": "ทำเครื่องหมายอัตโนมัติ (G)",
|
||||
"drawLine": "วาดแถวจริง",
|
||||
"drawField": "วาดฟิลด์",
|
||||
"drawExclusion": "วาดพื้นที่ยกเว้น",
|
||||
@@ -3101,6 +3220,13 @@
|
||||
"suggestedValue": "ค่าที่ตรวจพบ",
|
||||
"orderAnchor": "ป้ายกำกับฟิลด์คำสั่งซื้อ",
|
||||
"orderAnchorTool": "ป้ายฟิลด์",
|
||||
"documentMatchAnchorTool": "จุดยึดการจับคู่",
|
||||
"documentMatchAnchorLabel": "ป้ายกำกับจุดยึดการจับคู่",
|
||||
"documentMatchAnchorValue": "ค่าจุดยึดการจับคู่",
|
||||
"documentMatchAnchorHint": "ใช้แถบเครื่องมือด้านซ้ายเพื่อเลือกป้ายกำกับและค่าคงที่ ระบบจะจับคู่เฉพาะข้อความในกรอบ จึงไม่ตรงกับข้อความเดียวกันในหมายเหตุ",
|
||||
"documentMatchAnchorEmpty": "ใช้เครื่องมือจุดยึดการจับคู่: เลือกป้ายกำกับก่อน แล้วเลือกค่าคงที่",
|
||||
"documentMatchAnchorTextMissing": "ไม่พบข้อความในพื้นที่ที่เลือก โปรดปรับกรอบแล้วลองอีกครั้ง",
|
||||
"orderFieldAnchorNext": "อ่านป้ายกำกับฟิลด์แล้ว โปรดเลือกค่าฟิลด์",
|
||||
"headerTool": "หัวตาราง",
|
||||
"lineTool": "แถวรายการ",
|
||||
"fieldTool": "ฟิลด์รายการ",
|
||||
@@ -3288,5 +3414,100 @@
|
||||
"identity_rule_set": "ชุดกฎตัวตนลูกค้า",
|
||||
"identity_rule": "กฎการระบุตัวตนลูกค้า"
|
||||
}
|
||||
},
|
||||
"shippingAudit": {
|
||||
"title": "การทำงานและการตรวจสอบ",
|
||||
"subtitle": "ค้นหาเหตุการณ์ตรวจสอบตามเวลา ผู้ดำเนินการ Run/Task และประเภทเหตุการณ์ รายละเอียดแสดงเฉพาะ diff ตาม whitelist และการส่งออกถูกควบคุมและบันทึก",
|
||||
"refresh": "รีเฟรช",
|
||||
"export": "ส่งออก CSV",
|
||||
"exporting": "กำลังส่งออก...",
|
||||
"apply": "ใช้ตัวกรอง",
|
||||
"loading": "กำลังโหลด...",
|
||||
"empty": "ไม่มีเหตุการณ์ตรวจสอบ",
|
||||
"loadFailed": "โหลดรายการตรวจสอบล้มเหลว",
|
||||
"detailFailed": "โหลดรายละเอียดล้มเหลว",
|
||||
"exportFailed": "ส่งออกล้มเหลว",
|
||||
"detailTitle": "รายละเอียดการตรวจสอบ",
|
||||
"diff": "ความแตกต่าง",
|
||||
"before": "ก่อน",
|
||||
"after": "หลัง",
|
||||
"noDiff": "ไม่มี diff ตาม whitelist",
|
||||
"total": "ทั้งหมด {count}",
|
||||
"previous": "ก่อนหน้า",
|
||||
"next": "ถัดไป",
|
||||
"filters": {
|
||||
"eventType": "ประเภทเหตุการณ์",
|
||||
"actorType": "ประเภทผู้ดำเนินการ",
|
||||
"runNo": "หมายเลข Run",
|
||||
"taskNo": "หมายเลข Task",
|
||||
"operationId": "operation_id",
|
||||
"q": "ค้นหาหมายเลข",
|
||||
"all": "ทั้งหมด",
|
||||
"actorId": "Actor ID",
|
||||
"documentId": "Document ID",
|
||||
"conversationId": "Conversation ID",
|
||||
"sessionItemId": "Session work item",
|
||||
"reviewCaseNo": "Review case no.",
|
||||
"ownerUserId": "Owner user ID",
|
||||
"requestId": "request_id",
|
||||
"result": "ผลลัพธ์",
|
||||
"createdFrom": "ตั้งแต่",
|
||||
"createdTo": "ถึง"
|
||||
},
|
||||
"columns": {
|
||||
"time": "เวลา",
|
||||
"event": "เหตุการณ์",
|
||||
"actor": "ผู้ดำเนินการ",
|
||||
"run": "Run",
|
||||
"task": "Task",
|
||||
"result": "ผลลัพธ์",
|
||||
"conversation": "เซสชัน",
|
||||
"sessionItem": "รายการงาน",
|
||||
"reviewCase": "Case"
|
||||
}
|
||||
},
|
||||
"shippingReviewSupervision": {
|
||||
"title": "การกำกับการตรวจทาน",
|
||||
"subtitle": "ดูรายการงาน PDF ข้ามผู้ใช้ การยกเลิกหรือเพิกถอนการยืนยันต้องมีเหตุผลและยืนยันซ้ำ",
|
||||
"refresh": "รีเฟรช",
|
||||
"apply": "ใช้ตัวกรอง",
|
||||
"loading": "กำลังโหลด...",
|
||||
"empty": "ไม่มีรายการงาน",
|
||||
"loadFailed": "โหลดรายการกำกับไม่สำเร็จ",
|
||||
"actionFailed": "ดำเนินการไม่สำเร็จ โปรดลองอีกครั้ง",
|
||||
"terminate": "ยกเลิก",
|
||||
"revoke": "เพิกถอนการยืนยัน",
|
||||
"terminateTitle": "ยกเลิกรายการงาน",
|
||||
"revokeTitle": "เพิกถอนการยืนยัน",
|
||||
"terminateImpact": "จะปิดรายการงาน {itemNo} โดยบังคับ เจ้าของจะไม่สามารถตรวจทานต่อได้",
|
||||
"revokeImpact": "จะเพิกถอนการยืนยันของรายการงาน {itemNo} (ภายใน 24 ชม. และก่อนจับคู่สต็อก)",
|
||||
"reasonLabel": "เหตุผล (จำเป็น)",
|
||||
"reasonRequired": "กรุณาระบุเหตุผล",
|
||||
"confirmTerminate": "ฉันยืนยันการยกเลิกรายการงานนี้ (CONFIRM_TERMINATE)",
|
||||
"confirmRevoke": "ฉันยืนยันการเพิกถอนการยืนยันนี้ (CONFIRM_REVOKE)",
|
||||
"confirmRequired": "โปรดติ๊กยืนยันก่อนส่ง",
|
||||
"submit": "ส่ง",
|
||||
"submitting": "กำลังส่ง...",
|
||||
"terminateSuccess": "ยกเลิกรายการงานแล้ว",
|
||||
"revokeSuccess": "เพิกถอนการยืนยันแล้ว",
|
||||
"total": "ทั้งหมด {count} รายการ",
|
||||
"previous": "ก่อนหน้า",
|
||||
"next": "ถัดไป",
|
||||
"filters": {
|
||||
"lifecycleStatus": "วงจรชีวิต",
|
||||
"ownerUserId": "ID ผู้ใช้เจ้าของ",
|
||||
"conversationId": "ID การสนทนา",
|
||||
"q": "ค้นหาตามรหัส",
|
||||
"all": "ทั้งหมด"
|
||||
},
|
||||
"columns": {
|
||||
"itemNo": "รายการงาน",
|
||||
"owner": "เจ้าของ",
|
||||
"conversation": "การสนทนา",
|
||||
"document": "PDF ปัจจุบัน",
|
||||
"status": "สถานะ",
|
||||
"updated": "อัปเดต",
|
||||
"actions": "การดำเนินการ"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,8 +109,16 @@
|
||||
"shortCode": "รหัสย่อ",
|
||||
"site": "สถานที่จัดส่ง",
|
||||
"statusLabel": "สถานะ",
|
||||
"roles": { "bill_to": "ลูกค้าวางบิล", "ship_to": "ลูกค้าจัดส่ง" },
|
||||
"status": { "unmatched": "ไม่พบข้อมูล", "unique_candidate": "พบหนึ่งรายการ", "ambiguous": "พบหลายรายการ", "confirmed": "ยืนยันแล้ว" }
|
||||
"roles": {
|
||||
"bill_to": "ลูกค้าวางบิล",
|
||||
"ship_to": "ลูกค้าจัดส่ง"
|
||||
},
|
||||
"status": {
|
||||
"unmatched": "ไม่พบข้อมูล",
|
||||
"unique_candidate": "พบหนึ่งรายการ",
|
||||
"ambiguous": "พบหลายรายการ",
|
||||
"confirmed": "ยืนยันแล้ว"
|
||||
}
|
||||
},
|
||||
"shippingCandidateCount": "คำสั่งซื้อ {count} รายการ",
|
||||
"shippingCandidateReady": "พร้อมสร้างงาน",
|
||||
@@ -138,12 +146,14 @@
|
||||
"completed": "เสร็จแล้ว {count}",
|
||||
"running": "กำลังทำ {count}",
|
||||
"needsHuman": "ต้องมีคนดูแล {count}",
|
||||
"pendingConfirmation": "รอยืนยัน {count}",
|
||||
"failed": "ล้มเหลว {count}",
|
||||
"pending": "รอคิว {count}",
|
||||
"empty": "ความคืบหน้าของงานหลังอัปโหลดจะแสดงที่นี่",
|
||||
"unnamedPdf": "PDF ไม่มีชื่อ",
|
||||
"progressIndex": "{current}/{total}",
|
||||
"exception": "ข้อยกเว้น",
|
||||
"pendingConfirmationBadge": "รอยืนยัน",
|
||||
"duplicateBadge": "ซ้ำ",
|
||||
"openReview": "เข้าสู่การตรวจสอบด้วยตนเอง",
|
||||
"openTask": "เปิดงานประมวลผล",
|
||||
@@ -152,6 +162,7 @@
|
||||
"compactProgress": "{total} PDF: อัตโนมัติ {auto}, ต้องตรวจ {review}, ล้มเหลว {failed}",
|
||||
"processNoticeProcessing": "กำลังประมวลผลไฟล์แนบ — ดูความคืบหน้าที่แผงด้านขวา",
|
||||
"processNoticeNeedsAction": "บางไฟล์ต้องมีคนจัดการ — ดูที่แผงด้านขวา",
|
||||
"processNoticeCandidateConfirmation": "สร้างรายการคำสั่งซื้อแล้ว โปรดยืนยันทีละรายการในแผงด้านขวา",
|
||||
"processNoticeDuplicateLinked": "พบไฟล์ซ้ำและเชื่อมกับงานที่มีอยู่แล้ว — ดูที่แผงด้านขวา",
|
||||
"processNoticeCompleted": "ประมวลผลเสร็จแล้ว — รายละเอียดอยู่ที่แผงด้านขวา",
|
||||
"processNoticeFailed": "ประมวลผลล้มเหลว — ลองใหม่หรือดูรายละเอียดทางขวา",
|
||||
@@ -160,7 +171,77 @@
|
||||
"waitingUpload": "รออัปโหลดด้วยตนเอง",
|
||||
"needsReview": "ต้องตรวจสอบด้วยตนเอง",
|
||||
"duplicateProcessing": "กำลังจัดการรายการซ้ำ",
|
||||
"existingTaskNo": "งานที่มีอยู่ {taskNo}"
|
||||
"existingTaskNo": "งานที่มีอยู่ {taskNo}",
|
||||
"cancelled": "ยกเลิกแล้ว {count}"
|
||||
},
|
||||
"shippingSessionWorkItem": {
|
||||
"status": {
|
||||
"pending_review": "รอตรวจสอบ",
|
||||
"extracting": "กำลังดึงข้อมูล",
|
||||
"reparse_failed": "แยกวิเคราะห์ใหม่ล้มเหลว",
|
||||
"closed": "ปิดแล้ว"
|
||||
},
|
||||
"versionLabel": "V{version}",
|
||||
"versionReplaced": "สร้างเวอร์ชันใหม่แล้ว เวอร์ชันเดิมอ่านอย่างเดียว",
|
||||
"versionRestored": "กู้คืนเวอร์ชันก่อนหน้าแล้ว",
|
||||
"completedCollapsed": "เสร็จแล้ว {count} รายการ",
|
||||
"openOnlyFilter": "เฉพาะรอดำเนินการ",
|
||||
"enterManualReview": "ตรวจสอบด้วยตนเอง",
|
||||
"viewVersionHistory": "ประวัติเวอร์ชัน",
|
||||
"requestReparse": "ระบุใหม่",
|
||||
"markNonOrder": "ทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ",
|
||||
"replaceFile": "แทนที่ไฟล์",
|
||||
"cancelProcessing": "ยกเลิกการประมวลผลนี้",
|
||||
"cancelReasonPrompt": "กรอกเหตุผลการยกเลิก",
|
||||
"nonOrderReasonPrompt": "กรอกเหตุผลที่ทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ",
|
||||
"reparseReasonPrompt": "กรอกเหตุผลการระบุใหม่",
|
||||
"reasonRequired": "ต้องระบุเหตุผลก่อนดำเนินการต่อ",
|
||||
"caseRequired": "รายการงานนี้ยังไม่มีเคสตรวจสอบ กรุณาเปิดการตรวจสอบด้วยตนเองก่อน",
|
||||
"versionHistoryTitle": "ประวัติเวอร์ชัน",
|
||||
"currentVersion": "ปัจจุบัน",
|
||||
"readonlyVersion": "อ่านอย่างเดียว",
|
||||
"noVersions": "ไม่มีประวัติเวอร์ชัน",
|
||||
"loading": "กำลังโหลด…",
|
||||
"loadFailed": "โหลดรายการงานไม่สำเร็จ",
|
||||
"closedReason": {
|
||||
"confirmed": "ยืนยันและสร้างงานแล้ว",
|
||||
"non_order": "ทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ",
|
||||
"user_cancelled": "ผู้ใช้ยกเลิก",
|
||||
"admin_terminated": "ผู้ดูแลระบบยุติ"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionHandling": {
|
||||
"title": "รายการที่ต้องจัดการ",
|
||||
"count": "{count} รายการ",
|
||||
"reasonPrefix": "สาเหตุ: ",
|
||||
"affectedPrefix": "วัตถุที่ได้รับผล: ",
|
||||
"category": {
|
||||
"document_review": "PDF ต้องตรวจสอบด้วยตนเอง",
|
||||
"candidate_missing_info": "คำสั่งซื้อขาดข้อมูล",
|
||||
"candidate_conflict": "คำสั่งซื้อมีข้อขัดแย้ง",
|
||||
"candidate_confirmation": "รายการรอยืนยัน",
|
||||
"technical_failure": "ประมวลผลไฟล์แนบล้มเหลว",
|
||||
"auto_freeze_blocked": "การแช่แข็งอัตโนมัติถูกบล็อก",
|
||||
"budget_stopped": "งบรอบแรกหมดแล้ว"
|
||||
},
|
||||
"primaryNotice": {
|
||||
"document_review": "บาง PDF ต้องตรวจสอบด้วยตนเอง — ทำตามรายการด้านล่าง",
|
||||
"candidate_missing_info": "คำสั่งซื้อขาดฟิลด์ที่จำเป็น — กรอกแล้วจึงยืนยัน",
|
||||
"candidate_conflict": "คำสั่งซื้อมีข้อขัดแย้ง — ตัดสินด้วยตนเองก่อนดำเนินการต่อ",
|
||||
"candidate_confirmation": "สร้างรายการคำสั่งซื้อแล้ว — ยืนยันทีละรายการ",
|
||||
"technical_failure": "บางไฟล์แนบล้มเหลว — ลองใหม่หรือดูรายละเอียด",
|
||||
"auto_freeze_blocked": "การแช่แข็งอัตโนมัติไม่ผ่านเงื่อนไข — ดูสาเหตุ",
|
||||
"budget_stopped": "งบแยกวิเคราะห์รอบแรกหมดแล้ว — ตรวจไฟล์ที่ยังไม่ประมวลผล"
|
||||
},
|
||||
"reason": {
|
||||
"profile_not_auto_freeze_approved": "เทมเพลตยังไม่ผ่านคุณสมบัติแช่แข็งอัตโนมัติ",
|
||||
"multiple_profiles_detected": "พบหลายเทมเพลต จึงไม่สามารถแช่แข็งอัตโนมัติ",
|
||||
"profile_auto_freeze_qualification_missing": "ไม่มีคุณสมบัติแช่แข็งอัตโนมัติ",
|
||||
"profile_manual_confirmation_required": "เทมเพลตต้องยืนยันด้วยตนเองก่อนแช่แข็ง",
|
||||
"auto_freeze_not_enabled": "รอบนี้ไม่ได้เปิดแช่แข็งอัตโนมัติ",
|
||||
"auto_freeze_policy_missing": "ไม่มีนโยบายแช่แข็งอัตโนมัติ",
|
||||
"budget_initial_limit": "ถึงขีดจำกัดงบไฟล์แนบรอบแรกแล้ว"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionCardTitle": {
|
||||
"queued": "คำสั่งแยกวิเคราะห์คำสั่งซื้ออยู่ในคิว",
|
||||
@@ -176,12 +257,15 @@
|
||||
"shippingOrderExtractionCompleted": "แยกวิเคราะห์คำสั่งซื้อเสร็จแล้ว",
|
||||
"shippingOrderExtractionFailed": "แยกวิเคราะห์คำสั่งซื้อไม่สำเร็จ",
|
||||
"shippingOrderExtractionSummary": {
|
||||
"total": "{count} PDF",
|
||||
"completed": "สำเร็จ {count} รายการ",
|
||||
"total": "PDF {count} ไฟล์",
|
||||
"processing": "กำลังประมวลผล {count}",
|
||||
"completed": "สำเร็จ {count}",
|
||||
"completedProgress": "ความคืบหน้า {value}",
|
||||
"candidates": "ตัวเลือก {count} รายการ",
|
||||
"reviewRequired": "ต้องตรวจสอบ {count} รายการ",
|
||||
"failed": "ล้มเหลว {count} รายการ"
|
||||
"candidates": "ผู้สมัคร {count}",
|
||||
"reviewRequired": "ต้องตรวจสอบ {count}",
|
||||
"failed": "ล้มเหลว {count}",
|
||||
"cancelled": "ยกเลิกแล้ว {count}",
|
||||
"pending": "รอคิว {count}"
|
||||
},
|
||||
"shippingOrderExtractionCurrentFile": "ไฟล์ปัจจุบัน: {fileName}",
|
||||
"shippingOrderExtractionRefreshFailed": "ยังรีเฟรชสถานะไม่ได้ในขณะนี้ แต่ระบบยังประมวลผลต่อในเบื้องหลัง",
|
||||
@@ -229,7 +313,10 @@
|
||||
"technical_failed": "ระบบไม่สามารถประมวลผลไฟล์แนบนี้ได้",
|
||||
"budget_stopped": "ถึงงบประมาณไฟล์แนบของรอบนี้แล้ว ไฟล์ที่เหลือต้องตรวจสอบด้วยตนเอง",
|
||||
"run_completed": "การแยกวิเคราะห์คำสั่งซื้อรอบนี้เสร็จแล้ว",
|
||||
"generic_processing": "ระบบกำลังประมวลผลไฟล์แนบคำสั่งซื้อ"
|
||||
"generic_processing": "ระบบกำลังประมวลผลไฟล์แนบคำสั่งซื้อ",
|
||||
"cancellation_requested": "ได้รับคำขอยกเลิกแล้ว กำลังหยุดอย่างปลอดภัย",
|
||||
"cancellation_completed": "การยกเลิกเสร็จสิ้น",
|
||||
"unit_cancelled": "ไฟล์นี้ถูกยกเลิกแล้ว"
|
||||
},
|
||||
"shippingOrderExtractionAction": {
|
||||
"view_details": "ดูรายละเอียด",
|
||||
@@ -237,7 +324,10 @@
|
||||
"retry_failed_attachments": "ลองไฟล์แนบที่ล้มเหลวอีกครั้ง",
|
||||
"view_evidence": "ดูหลักฐาน",
|
||||
"review_candidate": "ยืนยันด้วยตนเอง",
|
||||
"manual_review": "ตรวจสอบด้วยตนเอง"
|
||||
"manual_review": "ตรวจสอบด้วยตนเอง",
|
||||
"refresh_status": "รีเฟรชสถานะ",
|
||||
"cancel_run": "ยกเลิกการระบุครั้งนี้",
|
||||
"cancel_unit": "ยกเลิก PDF นี้"
|
||||
},
|
||||
"shippingOrderExtractionDocumentStatus": {
|
||||
"pending": "รอดำเนินการ",
|
||||
@@ -276,12 +366,23 @@
|
||||
"same_business_content": "เนื้อหาธุรกิจตรงกับงานที่มีอยู่",
|
||||
"duplicate_decision_required": "ตรวจพบรายการซ้ำและต้องให้คนตัดสินใจ",
|
||||
"open_existing_reconciliation_required": "ยังต้องกระทบยอดฟิลด์ก่อนเปิดงานเดิม",
|
||||
"field_conflict": "ค่าฟิลด์ขัดแย้งกันและต้องยืนยันด้วยตนเอง"
|
||||
"field_conflict": "ค่าฟิลด์ขัดแย้งกันและต้องยืนยันด้วยตนเอง",
|
||||
"SHIPPING_NOTICE": {
|
||||
"ORDER_EXTRACTION_JOB_FAILED": "งานดึงคำสั่งซื้อล้มเหลว มักเกิดจากเลย์เอาต์ไฟล์แนบยังไม่พร้อม เปิดบริการเลย์เอาต์แล้วลองใหม่",
|
||||
"ORDER_EXTRACTION_LAYOUT_SCHEDULING_FAILED": "สร้างงานแยกเลย์เอาต์ไฟล์แนบคำสั่งซื้อไม่ได้ เปิดบริการเลย์เอาต์แล้วลองใหม่",
|
||||
"ORDER_EXTRACTION_LAYOUT_PREREQUISITE_FAILED": "เงื่อนไขเลย์เอาต์ไฟล์แนบคำสั่งซื้อไม่ครบ ลองใหม่หรืออัปโหลดใหม่",
|
||||
"ORDER_EXTRACTION_LAYOUT_FAILED": "แยกเลย์เอาต์ไฟล์แนบคำสั่งซื้อล้มเหลว โปรดลองใหม่",
|
||||
"ORDER_EXTRACTION_FAILED": "ดึงคำสั่งซื้อล้มเหลว โปรดลองใหม่",
|
||||
"ORDER_EXTRACTION_TIMEOUT": "ดึงคำสั่งซื้อหมดเวลา โปรดลองใหม่ภายหลัง"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionPoNumber": "PO: {value}",
|
||||
"shippingOrderExtractionLineCount": "จำนวนบรรทัด: {count}",
|
||||
"shippingOrderExtractionReviewDetail": "บรรทัดที่ {line}: ต้องกรอกหรือแก้ไข{field}",
|
||||
"shippingOrderExtractionReviewField": { "qty": "จำนวน", "unknown": "ฟิลด์รายการ" },
|
||||
"shippingOrderExtractionReviewField": {
|
||||
"qty": "จำนวน",
|
||||
"unknown": "ฟิลด์รายการ"
|
||||
},
|
||||
"shippingOrderExtractionProfileSummary": "เทมเพลต: {name} V{version}",
|
||||
"shippingOrderExtractionPlanSummary": "รอบนี้วางแผน {groups} กลุ่มคำสั่งซื้อจากไฟล์แนบ {total} ไฟล์ โดยรอบแรกจะประมวลผลได้สูงสุด {attachments} ไฟล์ พร้อมกัน {concurrency} ไฟล์",
|
||||
"shippingOrderExtractionPlanSelected": "เลือกแล้ว {count} ไฟล์",
|
||||
@@ -860,7 +961,17 @@
|
||||
"empty": "ไม่พบข้อมูลที่ตรงเงื่อนไข"
|
||||
}
|
||||
},
|
||||
"shippingCustomer": { "title": "ยืนยันลูกค้ามาตรฐาน", "subtitle": "เลือกลูกค้าที่ผู้ดูแลระบบจัดการ ชื่อจากการแยกข้อมูลเป็นเพียงหลักฐานและจะไม่ผูกอัตโนมัติ", "searchPlaceholder": "ค้นหาชื่อลูกค้าหรือรหัสย่อ", "search": "ค้นหา", "empty": "ไม่พบลูกค้าที่ใช้งาน โปรดติดต่อผู้ดูแลระบบ", "confirm": "ยืนยันลูกค้า", "loadFailed": "โหลดรายชื่อลูกค้าล้มเหลว", "confirmed": "ยืนยันลูกค้ามาตรฐานแล้ว", "confirmFailed": "ยืนยันลูกค้าล้มเหลว" },
|
||||
"shippingCustomer": {
|
||||
"title": "ยืนยันลูกค้ามาตรฐาน",
|
||||
"subtitle": "เลือกลูกค้าที่ผู้ดูแลระบบจัดการ ชื่อจากการแยกข้อมูลเป็นเพียงหลักฐานและจะไม่ผูกอัตโนมัติ",
|
||||
"searchPlaceholder": "ค้นหาชื่อลูกค้าหรือรหัสย่อ",
|
||||
"search": "ค้นหา",
|
||||
"empty": "ไม่พบลูกค้าที่ใช้งาน โปรดติดต่อผู้ดูแลระบบ",
|
||||
"confirm": "ยืนยันลูกค้า",
|
||||
"loadFailed": "โหลดรายชื่อลูกค้าล้มเหลว",
|
||||
"confirmed": "ยืนยันลูกค้ามาตรฐานแล้ว",
|
||||
"confirmFailed": "ยืนยันลูกค้าล้มเหลว"
|
||||
},
|
||||
"training": {
|
||||
"badge": "พื้นที่อบรมพนักงาน",
|
||||
"title": "",
|
||||
@@ -1024,8 +1135,14 @@
|
||||
"ฝั่งจัดการต้องส่งออกวันที่เริ่มงาน วันที่เสร็จสิ้น แผนก ชื่อ รหัสพนักงาน และคะแนนได้"
|
||||
],
|
||||
"booleanOptions": [
|
||||
{ "id": "true", "label": "ถูก" },
|
||||
{ "id": "false", "label": "ผิด" }
|
||||
{
|
||||
"id": "true",
|
||||
"label": "ถูก"
|
||||
},
|
||||
{
|
||||
"id": "false",
|
||||
"label": "ผิด"
|
||||
}
|
||||
],
|
||||
"questionBank": [
|
||||
{
|
||||
@@ -1035,10 +1152,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "ตามข้อสอบอบรมพนักงานใหม่ เงินเดือนจ่ายในวันที่ 15 ของทุกเดือน",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. วันที่ 8" },
|
||||
{ "id": "b", "label": "B. วันที่ 9" },
|
||||
{ "id": "c", "label": "C. วันที่ 15" },
|
||||
{ "id": "d", "label": "D. วันที่ 27" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. วันที่ 8"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. วันที่ 9"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. วันที่ 15"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. วันที่ 27"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1048,9 +1177,18 @@
|
||||
"answer": "b",
|
||||
"explanation": "โรงอาหารของบริษัทใช้ระบบสั่งอาหาร Zhongmi",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. OA" },
|
||||
{ "id": "b", "label": "B. ระบบสั่งอาหาร Zhongmi" },
|
||||
{ "id": "c", "label": "C. ERP" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. OA"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. ระบบสั่งอาหาร Zhongmi"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. ERP"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1060,10 +1198,22 @@
|
||||
"answer": "abcd",
|
||||
"explanation": "ตัวเลือกทั้งสี่ข้อเป็นกลุ่มผลิตภัณฑ์ของบริษัทตามข้อสอบ",
|
||||
"options": [
|
||||
{ "id": "abcd", "label": "A/B/C/D ทั้งหมด" },
|
||||
{ "id": "ab", "label": "A/B" },
|
||||
{ "id": "cd", "label": "C/D" },
|
||||
{ "id": "a", "label": "เฉพาะ A" }
|
||||
{
|
||||
"id": "abcd",
|
||||
"label": "A/B/C/D ทั้งหมด"
|
||||
},
|
||||
{
|
||||
"id": "ab",
|
||||
"label": "A/B"
|
||||
},
|
||||
{
|
||||
"id": "cd",
|
||||
"label": "C/D"
|
||||
},
|
||||
{
|
||||
"id": "a",
|
||||
"label": "เฉพาะ A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1073,10 +1223,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "การลาต้องใช้แบบฟอร์มใบลาของ OA",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. ใบขอโอที" },
|
||||
{ "id": "b", "label": "B. ใบติดต่อ" },
|
||||
{ "id": "c", "label": "C. ใบลางาน" },
|
||||
{ "id": "d", "label": "D. ใบคำขอพนักงาน" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. ใบขอโอที"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. ใบติดต่อ"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. ใบลางาน"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. ใบคำขอพนักงาน"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1086,9 +1248,18 @@
|
||||
"answer": "a",
|
||||
"explanation": "QC080000 คือมาตรฐานการจัดการกระบวนการสารอันตราย",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. มาตรฐานการจัดการสารอันตราย" },
|
||||
{ "id": "b", "label": "B. ระบบอาชีวอนามัยและความปลอดภัย" },
|
||||
{ "id": "c", "label": "C. ระบบการจัดการสิ่งแวดล้อม" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. มาตรฐานการจัดการสารอันตราย"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. ระบบอาชีวอนามัยและความปลอดภัย"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. ระบบการจัดการสิ่งแวดล้อม"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1098,8 +1269,14 @@
|
||||
"answer": "a",
|
||||
"explanation": "5S หมายถึงสะสาง สะดวก สะอาด สุขลักษณะ และสร้างนิสัย",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. สะสาง สะดวก สะอาด สุขลักษณะ สร้างนิสัย" },
|
||||
{ "id": "b", "label": "B. สะสาง สะดวก ทำความสะอาด สุขลักษณะ สร้างนิสัย" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. สะสาง สะดวก สะอาด สุขลักษณะ สร้างนิสัย"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. สะสาง สะดวก ทำความสะอาด สุขลักษณะ สร้างนิสัย"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1109,26 +1286,280 @@
|
||||
"answer": "a",
|
||||
"explanation": "ต้องยืนด้านเหนือลมเมื่อใช้ถังดับเพลิง",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. ด้านเหนือลม" },
|
||||
{ "id": "b", "label": "B. ด้านใต้ลม" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. ด้านเหนือลม"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. ด้านใต้ลม"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "id": "q8", "type": "boolean", "prompt": "การเข้างานปกติต้องลงเวลา และการทำโอทีต้องยื่นคำขอล่วงหน้า", "answer": "true", "explanation": "การเข้างานและโอทีต้องปฏิบัติตามกฎการลงเวลาของบริษัท" },
|
||||
{ "id": "q9", "type": "boolean", "prompt": "หากลืมลงเวลา ต้องยื่นคำขอแก้ไขผ่าน OA", "answer": "true", "explanation": "การลืมลงเวลาต้องแก้ไขผ่านกระบวนการ OA" },
|
||||
{ "id": "q10", "type": "boolean", "prompt": "เงินเดือนคำนวณตั้งแต่วันที่ 21 ของเดือนก่อนถึงวันที่ 20 ของเดือนปัจจุบัน", "answer": "true", "explanation": "ข้อสอบระบุรอบการคำนวณเงินเดือนนี้ไว้อย่างชัดเจน" },
|
||||
{ "id": "q11", "type": "boolean", "prompt": "การรับประทานอาหารในโรงอาหารต้องจองล่วงหน้า และสามารถใช้การสแกนใบหน้าได้", "answer": "true", "explanation": "โรงอาหารรองรับทั้งการจองล่วงหน้าและการสแกนใบหน้า" },
|
||||
{ "id": "q12", "type": "boolean", "prompt": "เมื่อเกิดไฟไหม้หรือระเบิด ควรโทร 119 ทันที", "answer": "true", "explanation": "การแจ้งหน่วยดับเพลิงเป็นขั้นตอนแรกที่ถูกต้อง" },
|
||||
{ "id": "q13", "type": "boolean", "prompt": "ผู้พักอาศัยในหอพักต้องระวังเรื่องไฟ และห้ามต่อสายไฟเองหรือใช้เครื่องใช้ไฟฟ้ากำลังสูง", "answer": "true", "explanation": "นี่คือข้อบังคับด้านความปลอดภัยจากอัคคีภัยในหอพัก" },
|
||||
{ "id": "q14", "type": "boolean", "prompt": "การปฏิบัติตามกฎความปลอดภัยในการผลิตเป็นหน้าที่ของพนักงาน", "answer": "true", "explanation": "การปฏิบัติตามกฎความปลอดภัยเป็นทั้งข้อกำหนดและหน้าที่ของพนักงาน" },
|
||||
{ "id": "q15", "type": "boolean", "prompt": "บัตรพนักงานสามารถให้ผู้อื่นยืมใช้ได้อย่างอิสระ", "answer": "false", "explanation": "บัตรพนักงานเป็นเอกสารยืนยันตัวตนส่วนบุคคล ห้ามให้ยืม" },
|
||||
{ "id": "q16", "type": "boolean", "prompt": "RoHS ใช้กำหนดมาตรฐานวัสดุและกระบวนการของผลิตภัณฑ์ไฟฟ้าและอิเล็กทรอนิกส์เพื่อปกป้องสุขภาพและสิ่งแวดล้อม", "answer": "true", "explanation": "เป้าหมายหลักของ RoHS คือการจำกัดสารอันตรายและลดความเสี่ยงต่อสิ่งแวดล้อม" },
|
||||
{ "id": "q17", "type": "boolean", "prompt": "นโยบาย HSF ของบริษัทคือ ออกแบบสีเขียว จัดซื้อเป็นมิตรต่อสิ่งแวดล้อม ประหยัดทรัพยากร และผลิตอย่างเป็นมิตรต่อสิ่งแวดล้อม", "answer": "true", "explanation": "นี่คือข้อความนโยบาย HSF ตามที่ระบุในข้อสอบ" },
|
||||
{ "id": "q18", "type": "boolean", "prompt": "EHS หมายถึง Environment, Health, Safety", "answer": "true", "explanation": "EHS เป็นตัวย่อมาตรฐานของสิ่งแวดล้อม สุขภาพ และความปลอดภัย" },
|
||||
{ "id": "q19", "type": "boolean", "prompt": "เอกสารจากภายนอกไม่จำเป็นต้องถูกควบคุมหรือจัดการโดยองค์กร", "answer": "false", "explanation": "เอกสารจากภายนอกก็ต้องมีการควบคุมเช่นกัน" },
|
||||
{ "id": "q20", "type": "boolean", "prompt": "ข้อกำหนดที่เกี่ยวข้องกับผลิตภัณฑ์ควรรวมถึงข้อกำหนดตามกฎหมายและข้อกำหนดของลูกค้า", "answer": "true", "explanation": "ข้อกำหนดของผลิตภัณฑ์ต้องครอบคลุมทั้งกฎหมายและความต้องการของลูกค้า" }
|
||||
{
|
||||
"id": "q8",
|
||||
"type": "boolean",
|
||||
"prompt": "การเข้างานปกติต้องลงเวลา และการทำโอทีต้องยื่นคำขอล่วงหน้า",
|
||||
"answer": "true",
|
||||
"explanation": "การเข้างานและโอทีต้องปฏิบัติตามกฎการลงเวลาของบริษัท"
|
||||
},
|
||||
{
|
||||
"id": "q9",
|
||||
"type": "boolean",
|
||||
"prompt": "หากลืมลงเวลา ต้องยื่นคำขอแก้ไขผ่าน OA",
|
||||
"answer": "true",
|
||||
"explanation": "การลืมลงเวลาต้องแก้ไขผ่านกระบวนการ OA"
|
||||
},
|
||||
{
|
||||
"id": "q10",
|
||||
"type": "boolean",
|
||||
"prompt": "เงินเดือนคำนวณตั้งแต่วันที่ 21 ของเดือนก่อนถึงวันที่ 20 ของเดือนปัจจุบัน",
|
||||
"answer": "true",
|
||||
"explanation": "ข้อสอบระบุรอบการคำนวณเงินเดือนนี้ไว้อย่างชัดเจน"
|
||||
},
|
||||
{
|
||||
"id": "q11",
|
||||
"type": "boolean",
|
||||
"prompt": "การรับประทานอาหารในโรงอาหารต้องจองล่วงหน้า และสามารถใช้การสแกนใบหน้าได้",
|
||||
"answer": "true",
|
||||
"explanation": "โรงอาหารรองรับทั้งการจองล่วงหน้าและการสแกนใบหน้า"
|
||||
},
|
||||
{
|
||||
"id": "q12",
|
||||
"type": "boolean",
|
||||
"prompt": "เมื่อเกิดไฟไหม้หรือระเบิด ควรโทร 119 ทันที",
|
||||
"answer": "true",
|
||||
"explanation": "การแจ้งหน่วยดับเพลิงเป็นขั้นตอนแรกที่ถูกต้อง"
|
||||
},
|
||||
{
|
||||
"id": "q13",
|
||||
"type": "boolean",
|
||||
"prompt": "ผู้พักอาศัยในหอพักต้องระวังเรื่องไฟ และห้ามต่อสายไฟเองหรือใช้เครื่องใช้ไฟฟ้ากำลังสูง",
|
||||
"answer": "true",
|
||||
"explanation": "นี่คือข้อบังคับด้านความปลอดภัยจากอัคคีภัยในหอพัก"
|
||||
},
|
||||
{
|
||||
"id": "q14",
|
||||
"type": "boolean",
|
||||
"prompt": "การปฏิบัติตามกฎความปลอดภัยในการผลิตเป็นหน้าที่ของพนักงาน",
|
||||
"answer": "true",
|
||||
"explanation": "การปฏิบัติตามกฎความปลอดภัยเป็นทั้งข้อกำหนดและหน้าที่ของพนักงาน"
|
||||
},
|
||||
{
|
||||
"id": "q15",
|
||||
"type": "boolean",
|
||||
"prompt": "บัตรพนักงานสามารถให้ผู้อื่นยืมใช้ได้อย่างอิสระ",
|
||||
"answer": "false",
|
||||
"explanation": "บัตรพนักงานเป็นเอกสารยืนยันตัวตนส่วนบุคคล ห้ามให้ยืม"
|
||||
},
|
||||
{
|
||||
"id": "q16",
|
||||
"type": "boolean",
|
||||
"prompt": "RoHS ใช้กำหนดมาตรฐานวัสดุและกระบวนการของผลิตภัณฑ์ไฟฟ้าและอิเล็กทรอนิกส์เพื่อปกป้องสุขภาพและสิ่งแวดล้อม",
|
||||
"answer": "true",
|
||||
"explanation": "เป้าหมายหลักของ RoHS คือการจำกัดสารอันตรายและลดความเสี่ยงต่อสิ่งแวดล้อม"
|
||||
},
|
||||
{
|
||||
"id": "q17",
|
||||
"type": "boolean",
|
||||
"prompt": "นโยบาย HSF ของบริษัทคือ ออกแบบสีเขียว จัดซื้อเป็นมิตรต่อสิ่งแวดล้อม ประหยัดทรัพยากร และผลิตอย่างเป็นมิตรต่อสิ่งแวดล้อม",
|
||||
"answer": "true",
|
||||
"explanation": "นี่คือข้อความนโยบาย HSF ตามที่ระบุในข้อสอบ"
|
||||
},
|
||||
{
|
||||
"id": "q18",
|
||||
"type": "boolean",
|
||||
"prompt": "EHS หมายถึง Environment, Health, Safety",
|
||||
"answer": "true",
|
||||
"explanation": "EHS เป็นตัวย่อมาตรฐานของสิ่งแวดล้อม สุขภาพ และความปลอดภัย"
|
||||
},
|
||||
{
|
||||
"id": "q19",
|
||||
"type": "boolean",
|
||||
"prompt": "เอกสารจากภายนอกไม่จำเป็นต้องถูกควบคุมหรือจัดการโดยองค์กร",
|
||||
"answer": "false",
|
||||
"explanation": "เอกสารจากภายนอกก็ต้องมีการควบคุมเช่นกัน"
|
||||
},
|
||||
{
|
||||
"id": "q20",
|
||||
"type": "boolean",
|
||||
"prompt": "ข้อกำหนดที่เกี่ยวข้องกับผลิตภัณฑ์ควรรวมถึงข้อกำหนดตามกฎหมายและข้อกำหนดของลูกค้า",
|
||||
"answer": "true",
|
||||
"explanation": "ข้อกำหนดของผลิตภัณฑ์ต้องครอบคลุมทั้งกฎหมายและความต้องการของลูกค้า"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shippingOrderReview": {
|
||||
"title": "ตรวจทานคำสั่งซื้อ", "run": "รอบการระบุ {runNo}", "back": "กลับไปยังแชต", "readOnly": "ดูอย่างเดียว", "loading": "กำลังโหลดผลการตรวจทาน...", "unavailable": "ยังโหลดผลการตรวจทานไม่ได้ โปรดลองอีกครั้งภายหลัง", "documentNavigation": "รายการ PDF", "documents": "ไฟล์ PDF", "unnamedDocument": "PDF ไม่มีชื่อ", "caseStatus": "{status} · ปัญหา {count} รายการ", "previewTitle": "ตัวอย่าง PDF", "previewLoading": "กำลังโหลดตัวอย่าง PDF...", "previewUnavailable": "ตัวอย่าง PDF ใช้งานไม่ได้ แต่การแก้ไขร่างไม่ได้รับผลกระทบ", "evidenceSummary": "เลือกไอคอนตำแหน่งข้างฟิลด์เพื่อดูหลักฐาน", "evidenceAt": "PDF หน้า {page}", "evidenceNoHighlight": "หลักฐานนี้ไม่มีพิกัดที่เชื่อถือได้ จะแสดงเฉพาะหน้าและข้อความอ้างอิงโดยไม่สร้างการไฮไลต์เทียม", "viewEvidence": "ดูหลักฐาน", "orderFields": "ฟิลด์คำสั่งซื้อ", "schemaVersion": "Schema ที่ตรึงไว้ #{version}", "issues": "ปัญหาที่ยังเปิดอยู่", "machineSource": "แหล่งที่มา: การระบุของระบบ", "manualSource": "แหล่งที่มา: แก้ไขโดยผู้ใช้", "restoreMachine": "คืนค่าเครื่อง", "saved": "บันทึกแล้ว", "saving": "กำลังบันทึก", "saveFailed": "บันทึกไม่สำเร็จ", "saveNow": "บันทึกและตรวจสอบ", "addLine": "เพิ่มรายการ", "copyLine": "คัดลอกรายการ", "deleteLine": "ลบรายการ", "noMachineOrder": "ไม่พบคำสั่งซื้อที่เชื่อถือได้", "lines": "รายการคำสั่งซื้อ", "line": "บรรทัด {index}", "noLines": "ไม่พบรายการคำสั่งซื้อ", "moreFields": "ข้อมูลคำสั่งซื้อเพิ่มเติม ({count})", "emptyValue": "ไม่มีข้อมูล", "unknownField": "ฟิลด์คำสั่งซื้อ", "createManualDraft": "สร้างร่างคำสั่งซื้อด้วยตนเอง", "markNonOrder": "ทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ", "markQualityIssue": "ปัญหาคุณภาพไฟล์", "reparse": "ระบุ PDF นี้ใหม่", "uploadReplacement": "อัปโหลด PDF ทดแทน", "confirmCreate": "ยืนยันและสร้างงาน", "confirmPrompt": "การยืนยันจะตรึงฉบับร่างปัจจุบันและสร้างงานแยกหนึ่งงาน และจะไม่สามารถแก้ไขต่อได้ ต้องการดำเนินการต่อหรือไม่?", "confirmSuccess": "สร้างงาน {taskNo} แล้ว", "confirmAutoProgress": "สร้างงาน {taskNo} แล้ว และเริ่มการดำเนินการอัตโนมัติ"
|
||||
"title": "ตรวจทานคำสั่งซื้อ",
|
||||
"run": "รอบการระบุ {runNo}",
|
||||
"back": "กลับไปยังแชต",
|
||||
"readOnly": "ดูอย่างเดียว",
|
||||
"loading": "กำลังโหลดผลการตรวจทาน...",
|
||||
"unavailable": "ยังโหลดผลการตรวจทานไม่ได้ โปรดลองอีกครั้งภายหลัง",
|
||||
"documentNavigation": "รายการ PDF",
|
||||
"documents": "ไฟล์ PDF",
|
||||
"unnamedDocument": "PDF ไม่มีชื่อ",
|
||||
"caseStatus": "{status} · ปัญหา {count} รายการ",
|
||||
"caseStatuses": {
|
||||
"unreviewed": "รอตรวจสอบ",
|
||||
"draft": "ฉบับร่าง",
|
||||
"ready": "พร้อมยืนยัน",
|
||||
"confirmed": "สร้างงานแล้ว",
|
||||
"non_order": "ระบุว่าไม่ใช่ใบสั่งซื้อ",
|
||||
"quality_issue": "ปัญหาคุณภาพไฟล์",
|
||||
"reparse_pending": "กำลังรู้จำใหม่",
|
||||
"superseded": "ถูกแทนที่ด้วยผลลัพธ์ใหม่",
|
||||
"unknown": "ไม่ทราบสถานะ"
|
||||
},
|
||||
"previewTitle": "ตัวอย่าง PDF",
|
||||
"previewLoading": "กำลังโหลดตัวอย่าง PDF...",
|
||||
"previewUnavailable": "ตัวอย่าง PDF ใช้งานไม่ได้ แต่การแก้ไขร่างไม่ได้รับผลกระทบ",
|
||||
"previewCollapsed": "หลักฐานนี้มีเพียงหน้าและข้อความอ้างอิง โดยไม่มีพิกัดที่เชื่อถือได้ จึงย่อการแสดงตัวอย่าง PDF แล้ว",
|
||||
"expandPreview": "ขยายตัวอย่าง PDF",
|
||||
"evidenceSummary": "เลือกไอคอนตำแหน่งข้างฟิลด์เพื่อดูหลักฐาน",
|
||||
"evidenceAt": "PDF หน้า {page}",
|
||||
"evidenceNoHighlight": "หลักฐานนี้ไม่มีพิกัดที่เชื่อถือได้ จะแสดงเฉพาะหน้าและข้อความอ้างอิงโดยไม่สร้างการไฮไลต์เทียม",
|
||||
"viewEvidence": "ดูหลักฐาน",
|
||||
"locateSource": "ค้นหาต้นฉบับ: {field}",
|
||||
"orderFields": "ฟิลด์คำสั่งซื้อ",
|
||||
"schemaVersion": "Schema ที่ตรึงไว้ #{version}",
|
||||
"issues": "ปัญหาที่ยังเปิดอยู่",
|
||||
"machineSource": "แหล่งที่มา: การระบุของระบบ",
|
||||
"manualSource": "แหล่งที่มา: แก้ไขโดยผู้ใช้",
|
||||
"restoreMachine": "คืนค่าเครื่อง",
|
||||
"saved": "บันทึกแล้ว",
|
||||
"saving": "กำลังบันทึก",
|
||||
"saveFailed": "บันทึกไม่สำเร็จ",
|
||||
"saveNow": "บันทึกและตรวจสอบ",
|
||||
"addLine": "เพิ่มรายการ",
|
||||
"copyLine": "คัดลอกรายการ",
|
||||
"deleteLine": "ลบรายการ",
|
||||
"noMachineOrder": "ผลการระบุโดยระบบรอการตรวจสอบ สามารถสร้างฉบับร่างเพื่อแก้ไขได้",
|
||||
"lines": "รายการคำสั่งซื้อ",
|
||||
"line": "บรรทัด {index}",
|
||||
"noLines": "ไม่พบรายการคำสั่งซื้อ",
|
||||
"moreFields": "ข้อมูลคำสั่งซื้อเพิ่มเติม ({count})",
|
||||
"emptyValue": "ไม่มีข้อมูล",
|
||||
"unknownField": "ฟิลด์คำสั่งซื้อ",
|
||||
"createManualDraft": "สร้างร่างคำสั่งซื้อด้วยตนเอง",
|
||||
"markNonOrder": "ทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ",
|
||||
"markQualityIssue": "ปัญหาคุณภาพไฟล์",
|
||||
"reparse": "ระบุ PDF นี้ใหม่",
|
||||
"uploadReplacement": "อัปโหลด PDF ทดแทน",
|
||||
"confirmCreate": "ยืนยันและสร้างงาน",
|
||||
"confirmPrompt": "การยืนยันจะตรึงฉบับร่างปัจจุบันและสร้างงานแยกหนึ่งงาน และจะไม่สามารถแก้ไขต่อได้ ต้องการดำเนินการต่อหรือไม่?",
|
||||
"confirmSuccess": "สร้างงาน {taskNo} แล้ว",
|
||||
"confirmAutoProgress": "สร้างงาน {taskNo} แล้ว และเริ่มการดำเนินการอัตโนมัติ",
|
||||
"autoProgress": {
|
||||
"result": "ผลการดำเนินการอัตโนมัติ: {status}",
|
||||
"checkpoint": "จุดตรวจปัจจุบัน: {checkpoint}",
|
||||
"viewTask": "ดูความคืบหน้าคำสั่งซื้อ",
|
||||
"status": {
|
||||
"ok": "ดำเนินขั้นตอนอัตโนมัติที่ทำได้เสร็จแล้ว",
|
||||
"running": "กำลังประมวลผล",
|
||||
"needs_human": "ต้องดำเนินการโดยเจ้าหน้าที่",
|
||||
"failed": "การดำเนินการอัตโนมัติล้มเหลว",
|
||||
"unknown": "รอยืนยันสถานะ"
|
||||
}
|
||||
},
|
||||
"backToSession": "กลับไปการประมวลผลครั้งนี้",
|
||||
"workItemHeader": "รายการงาน {itemNo} · {version}",
|
||||
"jumpToCurrentVersion": "ไปยังเวอร์ชันปัจจุบัน",
|
||||
"showContext": "บริบทการสนทนา",
|
||||
"hideContext": "ซ่อนบริบท",
|
||||
"contextTitle": "บริบทการสนทนา",
|
||||
"contextDesc": "ข้อความการดึงคำสั่งซื้อล่าสุดในเซสชันนี้",
|
||||
"contextUser": "ผู้ใช้",
|
||||
"contextAi": "AI",
|
||||
"statusBanner": {
|
||||
"superseded": "คุณกำลังดูเวอร์ชันประวัติ เวอร์ชันปัจจุบันมีการอัปเดตแล้ว การแก้ไขและการยืนยันถูกปิดใช้งาน",
|
||||
"reparse_in_progress": "PDF นี้กำลังถูกระบุใหม่ โปรดรอให้เสร็จก่อนดำเนินการตรวจทานต่อ",
|
||||
"restored": "การระบุใหม่ล้มเหลวและกู้คืนเวอร์ชันก่อนหน้าแล้ว คุณสามารถแก้ไขต่อได้"
|
||||
},
|
||||
"versionHistory": {
|
||||
"title": "ประวัติเวอร์ชัน",
|
||||
"itemNo": "รายการงาน {itemNo}",
|
||||
"result": "ผลลัพธ์",
|
||||
"createdAt": "สร้างเมื่อ",
|
||||
"confirmedAt": "ยืนยันเมื่อ",
|
||||
"viewReadonly": "ดูแบบอ่านอย่างเดียว",
|
||||
"open": "เปิด"
|
||||
},
|
||||
"confirmDialog": {
|
||||
"reasonLabel": "เหตุผล (จำเป็น)",
|
||||
"reasonPlaceholder": "อธิบายเหตุผลของการดำเนินการ...",
|
||||
"reasonRequired": "กรุณาระบุเหตุผล",
|
||||
"confirm": {
|
||||
"title": "ยืนยันและสร้างงาน",
|
||||
"impact": "การยืนยันจะตรึงฉบับร่างปัจจุบันและสร้างงานแยกหนึ่งงาน และจะไม่สามารถแก้ไขต่อได้",
|
||||
"confirm": "ยืนยันสร้างงาน"
|
||||
},
|
||||
"reparse": {
|
||||
"title": "ระบุ PDF นี้ใหม่",
|
||||
"impact": "จะสร้างรอบการระบุใหม่ เวอร์ชันปัจจุบันจะกลายเป็นประวัติแบบอ่านอย่างเดียว",
|
||||
"confirm": "เริ่มระบุใหม่"
|
||||
},
|
||||
"non_order": {
|
||||
"title": "ทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ",
|
||||
"impact": "จะปิดรายการงาน PDF นี้และทำเครื่องหมายว่าไม่ใช่คำสั่งซื้อ และไม่สามารถกลับไปยืนยันได้",
|
||||
"confirm": "ยืนยันการทำเครื่องหมาย"
|
||||
},
|
||||
"replace": {
|
||||
"title": "อัปโหลด PDF ทดแทน",
|
||||
"impact": "PDF ใหม่จะแทนที่เอกสารปัจจุบันและเรียกการระบุใหม่ เวอร์ชันปัจจุบันจะกลายเป็นแบบอ่านอย่างเดียว",
|
||||
"confirm": "ยืนยันการอัปโหลด"
|
||||
},
|
||||
"reasonCodeLabel": "ประเภทเหตุผล",
|
||||
"reasonCodeRequired": "กรุณาเลือกประเภทเหตุผล",
|
||||
"quality_issue": {
|
||||
"title": "ทำเครื่องหมายปัญหาคุณภาพไฟล์",
|
||||
"impact": "คง PDF ร่าง และค่าจากเครื่องไว้สำหรับอัปโหลดทดแทนหรือรู้จำใหม่ ต้องเลือกเหตุผล และกรอกรายละเอียดเมื่อเลือก อื่นๆ",
|
||||
"confirm": "ยืนยัน"
|
||||
},
|
||||
"qualityReasons": {
|
||||
"blurred": "ภาพเบลอ",
|
||||
"incomplete_pages": "หน้าไม่ครบ",
|
||||
"password_protected": "มีการป้องกันด้วยรหัสผ่าน",
|
||||
"corrupted": "ไฟล์เสียหาย",
|
||||
"wrong_orientation": "ทิศทางผิด",
|
||||
"unsupported_layout": "รูปแบบไม่รองรับ",
|
||||
"missing_order_table": "ไม่มีตารางคำสั่งซื้อ",
|
||||
"other": "อื่นๆ (ต้องระบุรายละเอียด)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionElapsed": "ใช้เวลา {elapsed}",
|
||||
"shippingOrderExtractionQueuePosition": "คิวลำดับที่ {position}",
|
||||
"shippingOrderExtractionRefreshing": "กำลังรีเฟรช...",
|
||||
"shippingOrderExtractionUserStage": {
|
||||
"pending": "รอดำเนินการ",
|
||||
"document_queued": "เข้าคิวแล้ว รอประมวลผล",
|
||||
"waiting_layout": "รอการวิเคราะห์เลย์เอาต์",
|
||||
"layout_parsing_started": "กำลังวิเคราะห์เลย์เอาต์",
|
||||
"routing": "กำลังวิเคราะห์โครงสร้างเอกสาร",
|
||||
"matching_profile": "กำลังจับคู่เทมเพลตคำสั่งซื้อ",
|
||||
"extracting": "กำลังดึงฟิลด์คำสั่งซื้อ",
|
||||
"merging_supplement": "กำลังรวมข้อมูลเสริมจากอีเมล",
|
||||
"candidate_ready": "สร้างตัวเลือกแล้ว",
|
||||
"review_required": "ต้องตรวจสอบด้วยตนเอง",
|
||||
"technical_retrying": "ระบบกำลังลองใหม่",
|
||||
"failed": "ล้มเหลว",
|
||||
"cancellation_requested": "กำลังยกเลิก…",
|
||||
"cancelled": "ยกเลิกแล้ว",
|
||||
"completed": "เสร็จสิ้น"
|
||||
},
|
||||
"shippingOrderExtractionHealthTip": {
|
||||
"processing_slow": "ใช้เวลานานกว่าปกติ ระบบยังทำงานอยู่ คุณสามารถรีเฟรชภายหลัง",
|
||||
"queue_backlog": "คิวค่อนข้างยาว กรุณารอสักครู่",
|
||||
"processing_attention": "ใช้เวลานาน หากยังไม่คืบหน้า โปรดติดต่อผู้ดูแล"
|
||||
},
|
||||
"shippingOrderExtractionCancel": {
|
||||
"confirmTitle": "ยืนยันยกเลิกการระบุครั้งนี้?",
|
||||
"confirmImpact": "ไฟล์ในคิวจะถูกยกเลิกทันที ส่วนที่กำลังประมวลผลจะหยุดที่จุดปลอดภัย ผลลัพธ์ที่เสร็จแล้วจะถูกเก็บไว้",
|
||||
"reasonRequired": "กรุณาระบุเหตุผลในการยกเลิก",
|
||||
"reasonOptional": "ไม่บังคับ: เหตุผลในการยกเลิก",
|
||||
"submitting": "กำลังส่งคำขอยกเลิก…",
|
||||
"dismiss": "ยังไม่ยกเลิก",
|
||||
"failed": "คำขอยกเลิกล้มเหลว โปรดลองใหม่ภายหลัง"
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,15 @@
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_NOT_RETRYABLE": "ลองระบุใหม่ได้เฉพาะงานระบุคำสั่งซื้อที่ล้มเหลวเท่านั้น",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_SNAPSHOT_OBSOLETE": "งานนี้ใช้สัญญาข้อมูลนำเข้าเวอร์ชันเก่าและไม่สามารถลองใหม่ได้ โปรดส่งอีเมลและไฟล์แนบอีกครั้งเพื่อเริ่มงานใหม่",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_CONVERSATION_ACTIVE": "มีงานระบุคำสั่งซื้อกำลังดำเนินการอยู่ในบทสนทนานี้ โปรดรอให้เสร็จสิ้นก่อน",
|
||||
"SHIPPING_NOTICE.CANCEL_FORBIDDEN": "คุณไม่มีสิทธิ์ยกเลิกงานระบุคำสั่งซื้อนี้",
|
||||
"SHIPPING_NOTICE.CANCEL_REASON_REQUIRED": "เมื่อยกเลิกงานของผู้อื่นต้องระบุเหตุผล",
|
||||
"SHIPPING_NOTICE.CANCEL_NOT_ACTIVE": "งานนี้สิ้นสุดแล้วหรือไม่สามารถยกเลิกได้",
|
||||
"SHIPPING_NOTICE.CANCEL_CONFLICT": "คำขอยกเลิกขัดแย้งกับความคืบหน้าปัจจุบัน กรุณารีเฟรชแล้วลองใหม่",
|
||||
"SHIPPING_NOTICE.CANCEL_FEATURE_DISABLED": "ฟังก์ชันยกเลิกการระบุคำสั่งซื้อถูกปิด กรุณาติดต่อผู้ดูแลระบบ",
|
||||
"SHIPPING_NOTICE.AUDIT_EXPORT_FEATURE_DISABLED": "ฟังก์ชันส่งออกการตรวจสอบถูกปิด กรุณาติดต่อผู้ดูแลระบบ",
|
||||
"SHIPPING_NOTICE.AUDIT_PERSIST_FAILED": "บันทึกการตรวจสอบล้มเหลว การดำเนินการยังไม่เสร็จสิ้น กรุณาลองใหม่",
|
||||
"SHIPPING_NOTICE.AUDIT_METADATA_FORBIDDEN": "การบันทึกตรวจสอบมีฟิลด์ที่ละเอียดอ่อนซึ่งห้ามใช้",
|
||||
"SHIPPING_NOTICE.AUDIT_SNAPSHOT_FORBIDDEN": "สแนปชอตการตรวจสอบมีฟิลด์ที่ละเอียดอ่อนซึ่งห้ามใช้",
|
||||
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "ยังไม่ได้เริ่มต้นเทมเพลตคำสั่งซื้อ",
|
||||
"SHIPPING_ORDER_SCHEMA_EXISTS": "มีเทมเพลตคำสั่งซื้ออยู่แล้ว",
|
||||
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "มีฉบับร่างเทมเพลตคำสั่งซื้ออยู่แล้ว โปรดดำเนินการหรือเผยแพร่ฉบับปัจจุบันก่อน",
|
||||
@@ -378,6 +387,7 @@
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_REQUIRED": "คำขอยืนยันไม่มีคีย์ idempotency โปรดลองอีกครั้ง",
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_CONFLICT": "คำขอยืนยันขัดแย้งกับคำขอเดิม โปรดรีเฟรชแล้วลองอีกครั้ง",
|
||||
"SHIPPING_REVIEW_CONFIRM_VALIDATION_FAILED": "ฉบับร่างยังไม่ผ่านการตรวจสอบครบถ้วน จึงยืนยันไม่ได้",
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "PDF สำหรับตรวจทานไม่พร้อมใช้งาน จึงยืนยันไม่ได้"
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "PDF สำหรับตรวจทานไม่พร้อมใช้งาน จึงยืนยันไม่ได้",
|
||||
"SHIPPING_REVIEW_QUALITY_COMMENT_REQUIRED": "ต้องระบุรายละเอียดเมื่อเลือกเหตุผลเป็น อื่นๆ"
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,12 @@
|
||||
"archived": "เก็บถาวรแล้ว"
|
||||
},
|
||||
"disposition": {
|
||||
"actions": { "delete": "ลบ", "archive": "เก็บถาวร", "restore": "กู้คืน", "purge": "ลบถาวร" },
|
||||
"actions": {
|
||||
"delete": "ลบ",
|
||||
"archive": "เก็บถาวร",
|
||||
"restore": "กู้คืน",
|
||||
"purge": "ลบถาวร"
|
||||
},
|
||||
"reasonPrompt": "ระบุเหตุผลในการลบหรือยกเลิกงาน:",
|
||||
"purgeReasonPrompt": "ระบุเหตุผลในการลบถาวร (เฉพาะผู้ดูแลและงานที่สร้างผิดเท่านั้น):",
|
||||
"confirm": "ยืนยัน{action}งานที่เลือก {count} งานหรือไม่?",
|
||||
@@ -317,6 +322,25 @@
|
||||
"uploaded": "อัปโหลดไปยังระบบขนส่งแล้ว",
|
||||
"upload_failed": "อัปโหลดไปยังระบบขนส่งไม่สำเร็จ",
|
||||
"backend_orchestrator_task_finished": "งานเบื้องหลังเสร็จแล้ว"
|
||||
},
|
||||
"myRuns": {
|
||||
"title": "งานระบุของฉัน",
|
||||
"subtitle": "ดูและดำเนินการต่องานระบุคำสั่งซื้อที่กำลังทำ ล้มเหลว หรือยกเลิกแล้ว",
|
||||
"status": "สถานะ",
|
||||
"allStatuses": "ทุกสถานะ",
|
||||
"runNo": "หมายเลขรอบ",
|
||||
"stage": "ขั้นตอนปัจจุบัน",
|
||||
"summary": "ความคืบหน้าไฟล์",
|
||||
"summaryCounts": "ทั้งหมด {total}: สำเร็จ {done} / ตรวจทาน {review} / ล้มเหลว {failed} / ยกเลิก {cancelled}",
|
||||
"elapsed": "ใช้เวลา",
|
||||
"actions": "การดำเนินการ",
|
||||
"openChat": "เปิดแชท",
|
||||
"loading": "กำลังโหลดงานระบุ...",
|
||||
"empty": "ยังไม่มีงานระบุ",
|
||||
"loadFailed": "โหลดงานระบุล้มเหลว",
|
||||
"total": "ทั้งหมด {count}",
|
||||
"previous": "ก่อนหน้า",
|
||||
"next": "ถัดไป"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,9 @@
|
||||
"shippingInventory": "库存管理",
|
||||
"shippingIdentityRules": "客户识别",
|
||||
"shippingOrderExtractionRuns": "识别任务",
|
||||
"shippingOrderDocumentProfiles": "文档模板"
|
||||
"shippingOrderDocumentProfiles": "文档模板",
|
||||
"shippingAudit": "运行与审计中心",
|
||||
"shippingReviewSupervision": "复核监管台"
|
||||
},
|
||||
"shippingFieldAssets": {
|
||||
"title": "字段资产库",
|
||||
@@ -183,6 +185,9 @@
|
||||
"createdAt": "创建时间",
|
||||
"totalDuration": "总耗时",
|
||||
"viewDetail": "查看详情",
|
||||
"actions": "操作",
|
||||
"cancelRun": "取消运行",
|
||||
"cancelFailed": "取消运行失败",
|
||||
"previous": "上一页",
|
||||
"next": "下一页",
|
||||
"loading": "正在加载...",
|
||||
@@ -204,29 +209,90 @@
|
||||
"autoFreezeBlockingReasons": "阻断原因",
|
||||
"autoFreezeNoBlockingReasons": "当前没有阻断原因",
|
||||
"jobAttempts": "Job 执行尝试",
|
||||
"units": "文档单元诊断",
|
||||
"routeDecision": "模板路由判断",
|
||||
"executionMode": "执行路径",
|
||||
"matchStatus": "模板匹配",
|
||||
"selectedProfile": "选中模板",
|
||||
"autoCreateApproved": "盲测批准",
|
||||
"fallbackReasons": "回退原因",
|
||||
"candidates": "候选模板",
|
||||
"hardMatch": "硬条件通过",
|
||||
"hardMismatch": "硬条件未通过",
|
||||
"missingAnchors": "缺失锚点:{ids}",
|
||||
"yes": "是",
|
||||
"no": "否",
|
||||
"autoFreezeModes": { "manual_confirmation": "人工确认", "auto_freeze": "自动冻结" },
|
||||
"autoFreezeQualificationStatuses": { "manual_confirmation": "人工确认", "auto_freeze_approved": "已批准自动冻结", "auto_freeze_suspended": "已暂停自动冻结" },
|
||||
"autoFreezeCustomerScopeStatuses": { "unconfigured": "未配置", "matched": "已命中授权", "out_of_scope": "超出授权范围", "customer_unconfirmed": "客户未确认", "ambiguous": "多个客户" },
|
||||
"autoFreezeBusinessScenarioStatuses": { "unconfigured": "未配置", "matched": "已命中授权", "out_of_scope": "超出授权范围" },
|
||||
"executionModes": { "deterministic": "后端确定性解析", "review_required": "人工处理", "skipped": "跳过执行" },
|
||||
"matchStatuses": { "unique_match": "唯一命中", "no_match": "未命中", "ambiguous": "多个模板命中", "layout_drift": "版式漂移", "evidence_insufficient": "证据不足" },
|
||||
"visibilities": { "workspace": "工作台事件", "admin": "管理诊断事件" },
|
||||
"reasonCodes": { "profile_evidence_insufficient": "模板证据不足", "profile_no_match": "无合格模板", "profile_ambiguous": "候选模板分差不足", "profile_layout_drift": "表格或锚点与模板不符", "profile_not_auto_create_approved": "模板尚未获得自动建单批准", "multiple_tables_detected": "检测到多个表格", "no_parsed_lines": "未解析到有效明细", "row_needs_review": "存在需复核的明细行", "header_value_conflict": "订单字段值冲突", "required_header_missing": "缺少必填订单字段", "required_line_field_missing": "缺少必填明细字段", "profile_schema_field_mismatch": "模板字段与冻结 Schema 不一致" },
|
||||
"autoFreezeReasonCodes": { "profile_not_auto_freeze_approved": "未命中可自动冻结模板", "multiple_profiles_detected": "命中多个模板版本", "profile_auto_freeze_qualification_missing": "缺少自动冻结资格记录", "profile_manual_confirmation_required": "模板仍需人工确认", "profile_auto_freeze_suspended": "模板自动冻结资格已暂停", "technical_failure_present": "存在技术失败", "budget_stopped": "触发预算停止", "review_required": "存在人工复核", "run_failed": "Run 执行失败", "run_cancelled": "Run 已取消", "pending_orders_present": "仍有待处理订单", "customer_scope_not_configured": "客户授权未配置", "customer_scope_out_of_scope": "当前客户不在授权范围内", "multiple_customers_detected": "检测到多个已确认客户", "business_scenario_not_configured": "业务场景授权未配置", "business_scenario_out_of_scope": "当前业务场景不在授权范围内", "customer_confirmation_required": "仍需客户确认" },
|
||||
"lifecycle": "脱敏事件时间线",
|
||||
"units": "文档单元诊断",
|
||||
"routeDecision": "模板路由判断",
|
||||
"executionMode": "执行路径",
|
||||
"matchStatus": "模板匹配",
|
||||
"selectedProfile": "选中模板",
|
||||
"autoCreateApproved": "盲测批准",
|
||||
"fallbackReasons": "回退原因",
|
||||
"candidates": "候选模板",
|
||||
"hardMatch": "硬条件通过",
|
||||
"hardMismatch": "硬条件未通过",
|
||||
"missingAnchors": "缺失锚点:{ids}",
|
||||
"yes": "是",
|
||||
"no": "否",
|
||||
"autoFreezeModes": {
|
||||
"manual_confirmation": "人工确认",
|
||||
"auto_freeze": "自动冻结"
|
||||
},
|
||||
"autoFreezeQualificationStatuses": {
|
||||
"manual_confirmation": "人工确认",
|
||||
"auto_freeze_approved": "已批准自动冻结",
|
||||
"auto_freeze_suspended": "已暂停自动冻结"
|
||||
},
|
||||
"autoFreezeCustomerScopeStatuses": {
|
||||
"unconfigured": "未配置",
|
||||
"matched": "已命中授权",
|
||||
"out_of_scope": "超出授权范围",
|
||||
"customer_unconfirmed": "客户未确认",
|
||||
"ambiguous": "多个客户"
|
||||
},
|
||||
"autoFreezeBusinessScenarioStatuses": {
|
||||
"unconfigured": "未配置",
|
||||
"matched": "已命中授权",
|
||||
"out_of_scope": "超出授权范围"
|
||||
},
|
||||
"executionModes": {
|
||||
"deterministic": "后端确定性解析",
|
||||
"review_required": "人工处理",
|
||||
"skipped": "跳过执行"
|
||||
},
|
||||
"matchStatuses": {
|
||||
"unique_match": "唯一命中",
|
||||
"no_match": "未命中",
|
||||
"ambiguous": "多个模板命中",
|
||||
"layout_drift": "版式漂移",
|
||||
"evidence_insufficient": "证据不足"
|
||||
},
|
||||
"visibilities": {
|
||||
"workspace": "工作台事件",
|
||||
"admin": "管理诊断事件"
|
||||
},
|
||||
"reasonCodes": {
|
||||
"profile_evidence_insufficient": "模板证据不足",
|
||||
"profile_no_match": "无合格模板",
|
||||
"profile_ambiguous": "候选模板分差不足",
|
||||
"profile_layout_drift": "表格或锚点与模板不符",
|
||||
"profile_not_auto_create_approved": "模板尚未获得自动建单批准",
|
||||
"multiple_tables_detected": "检测到多个表格",
|
||||
"no_parsed_lines": "未解析到有效明细",
|
||||
"row_needs_review": "存在需复核的明细行",
|
||||
"header_value_conflict": "订单字段值冲突",
|
||||
"required_header_missing": "缺少必填订单字段",
|
||||
"required_line_field_missing": "缺少必填明细字段",
|
||||
"profile_schema_field_mismatch": "模板字段与冻结 Schema 不一致"
|
||||
},
|
||||
"autoFreezeReasonCodes": {
|
||||
"profile_not_auto_freeze_approved": "未命中可自动冻结模板",
|
||||
"multiple_profiles_detected": "命中多个模板版本",
|
||||
"profile_auto_freeze_qualification_missing": "缺少自动冻结资格记录",
|
||||
"profile_manual_confirmation_required": "模板仍需人工确认",
|
||||
"profile_auto_freeze_suspended": "模板自动冻结资格已暂停",
|
||||
"technical_failure_present": "存在技术失败",
|
||||
"budget_stopped": "触发预算停止",
|
||||
"review_required": "存在人工复核",
|
||||
"run_failed": "Run 执行失败",
|
||||
"run_cancelled": "Run 已取消",
|
||||
"pending_orders_present": "仍有待处理订单",
|
||||
"customer_scope_not_configured": "客户授权未配置",
|
||||
"customer_scope_out_of_scope": "当前客户不在授权范围内",
|
||||
"multiple_customers_detected": "检测到多个已确认客户",
|
||||
"business_scenario_not_configured": "业务场景授权未配置",
|
||||
"business_scenario_out_of_scope": "当前业务场景不在授权范围内",
|
||||
"customer_confirmation_required": "仍需客户确认"
|
||||
},
|
||||
"lifecycle": "脱敏事件时间线",
|
||||
"statuses": {
|
||||
"queued": "等待执行",
|
||||
"processing": "处理中",
|
||||
@@ -235,6 +301,24 @@
|
||||
"review_required": "全部待人工处理",
|
||||
"failed": "失败",
|
||||
"cancelled": "已取消"
|
||||
},
|
||||
"healthStatus": "健康状态",
|
||||
"healthStatuses": {
|
||||
"healthy": "正常",
|
||||
"degraded": "降级"
|
||||
},
|
||||
"activeCount": "活动 Run",
|
||||
"staleCount": "卡住/积压",
|
||||
"failureRate": "失败率",
|
||||
"latencySummary": "总耗时 P50 {p50} / P95 {p95} / Max {max}",
|
||||
"staleRuns": "异常编号:{runs}",
|
||||
"healthUnavailable": "暂时无法加载健康汇总",
|
||||
"staleOnly": "仅卡住/积压",
|
||||
"cancellationInFlight": "仅取消中",
|
||||
"cancellation": "取消状态",
|
||||
"cancellationStates": {
|
||||
"in_flight": "正在取消",
|
||||
"completed": "已取消完成"
|
||||
}
|
||||
},
|
||||
"shippingOrderSchema": {
|
||||
@@ -440,8 +524,8 @@
|
||||
"placementHeader": "订单信息",
|
||||
"placementLine": "货品明细",
|
||||
"placement": {
|
||||
"header": "订单信息",
|
||||
"line": "货品明细"
|
||||
"header": "表头",
|
||||
"line": "表身"
|
||||
},
|
||||
"fieldType": {
|
||||
"string": "文本",
|
||||
@@ -648,10 +732,6 @@
|
||||
"suggestPreviewEmpty": "建议字段均已采用,无需变更。",
|
||||
"suggestConfirm": "确认采用",
|
||||
"suggestCancel": "取消",
|
||||
"placement": {
|
||||
"header": "表头",
|
||||
"line": "表身"
|
||||
},
|
||||
"operationFailed": "订单模板操作失败"
|
||||
},
|
||||
"shippingInventory": {
|
||||
@@ -2749,21 +2829,124 @@
|
||||
"failed": "验证运行失败。",
|
||||
"currentDraft": "当前草稿验证",
|
||||
"currentDraftHint": "系统将检查配置,并用当前样本读取一次结果。",
|
||||
"validateCurrent": "验证当前草稿", "validating": "正在验证…", "goPublishCheck": "进入发布检查",
|
||||
"structureCheck": "配置检查", "structureCheckHint": "检查字段绑定、坐标范围、页码和明细结构。",
|
||||
"sampleCheck": "当前样本试读", "sampleCheckHint": "检查当前标注能否从样本中读取字段和明细。",
|
||||
"state": { "ready": "当前草稿可进入发布检查", "stale": "配置已改变,请重新验证", "failed": "验证未通过,请返回编辑器修复", "pending": "尚未验证当前草稿" },
|
||||
"stateHint": { "ready": "配置检查和当前样本试读均已通过。", "stale": "历史验证属于较早草稿,不能用于发布。", "failed": "请根据失败项调整标注后再次验证。", "pending": "完成标注并保存后,运行一次验证。" },
|
||||
"runStatus": { "passed": "已通过", "failed": "未通过", "stale": "已过期", "pending": "未执行", "running": "验证中" },
|
||||
"resultsTitle": "本次样本识别结果", "resultsHint": "仅显示当前草稿按当前标注实时读取的结果;已删除明细仅供核对,不会进入订单结果。", "refreshResults": "重新读取", "resultsLoading": "正在读取当前样本...", "resultsFailed": "未读取到值或读取失败,请返回编辑器检查标注。", "headerResults": "订单表头", "lineResults": "订单明细", "noHeaderResults": "当前样本未读取到订单表头字段。", "noLineResults": "当前样本未读取到订单明细。", "noValue": "未读取到值", "rowStatus": "状态", "deleted": "已删除,不纳入结果", "read": "已读取"
|
||||
"validateCurrent": "验证当前草稿",
|
||||
"validating": "正在验证…",
|
||||
"goPublishCheck": "进入发布检查",
|
||||
"structureCheck": "配置检查",
|
||||
"structureCheckHint": "检查字段绑定、坐标范围、页码和明细结构。",
|
||||
"sampleCheck": "当前样本试读",
|
||||
"sampleCheckHint": "检查当前标注能否从样本中读取字段和明细。",
|
||||
"state": {
|
||||
"ready": "当前草稿可进入发布检查",
|
||||
"stale": "配置已改变,请重新验证",
|
||||
"failed": "验证未通过,请返回编辑器修复",
|
||||
"pending": "尚未验证当前草稿"
|
||||
},
|
||||
"stateHint": {
|
||||
"ready": "配置检查和当前样本试读均已通过。",
|
||||
"stale": "历史验证属于较早草稿,不能用于发布。",
|
||||
"failed": "请根据失败项调整标注后再次验证。",
|
||||
"pending": "完成标注并保存后,运行一次验证。"
|
||||
},
|
||||
"runStatus": {
|
||||
"passed": "已通过",
|
||||
"failed": "未通过",
|
||||
"stale": "已过期",
|
||||
"pending": "未执行",
|
||||
"running": "验证中"
|
||||
},
|
||||
"resultsTitle": "本次样本识别结果",
|
||||
"resultsHint": "仅显示当前草稿按当前标注实时读取的结果;已删除明细仅供核对,不会进入订单结果。",
|
||||
"refreshResults": "重新读取",
|
||||
"resultsLoading": "正在读取当前样本...",
|
||||
"resultsFailed": "未读取到值或读取失败,请返回编辑器检查标注。",
|
||||
"headerResults": "订单表头",
|
||||
"lineResults": "订单明细",
|
||||
"noHeaderResults": "当前样本未读取到订单表头字段。",
|
||||
"noLineResults": "当前样本未读取到订单明细。",
|
||||
"noValue": "未读取到值",
|
||||
"rowStatus": "状态",
|
||||
"deleted": "已删除,不纳入结果",
|
||||
"read": "已读取"
|
||||
},
|
||||
"orderProfilePublishCheck": {
|
||||
"eyebrow": "发布门禁", "title": "确认发布订单文档模板", "description": "报告冻结草稿版本;草稿改变后报告自动失效。", "back": "返回验证", "selectRun": "选择通过的验证运行", "noRun": "当前草稿没有可用于发布的当前样本验证;请先返回验证页面。", "create": "生成发布检查报告", "report": "报告 {reportNo}", "status": "状态:{status} · Revision {revision}", "blocking": "阻断项", "noBlocking": "无阻断项。", "warnings": "需要确认的变更", "confirm": "确认发布", "failed": "发布检查失败。", "readyTitle": "已验证草稿", "readyHint": "当前样本验证已通过。生成检查后可查看盲测、差异和发布前置条件。", "reportTitle": "发布检查结果", "blockedHint": "以下问题必须修复,不能通过确认绕过。", "reviewHint": "确认所有变更后即可发布当前模板版本。", "confirmHint": "请确认已审核上述变更。", "currentValidationRequired": "当前草稿必须先完成并通过当前样本验证。", "semanticDiffReview": "此版本包含语义差异,请确认已审核。", "unknownIssue": "发布检查发现需要处理的问题。"
|
||||
"eyebrow": "发布门禁",
|
||||
"title": "确认发布订单文档模板",
|
||||
"description": "报告冻结草稿版本;草稿改变后报告自动失效。",
|
||||
"back": "返回验证",
|
||||
"selectRun": "选择通过的验证运行",
|
||||
"noRun": "当前草稿没有可用于发布的当前样本验证;请先返回验证页面。",
|
||||
"create": "生成发布检查报告",
|
||||
"report": "报告 {reportNo}",
|
||||
"status": "状态:{status} · Revision {revision}",
|
||||
"blocking": "阻断项",
|
||||
"noBlocking": "无阻断项。",
|
||||
"warnings": "需要确认的变更",
|
||||
"confirm": "确认发布",
|
||||
"failed": "发布检查失败。",
|
||||
"readyTitle": "已验证草稿",
|
||||
"readyHint": "当前样本验证已通过。生成检查后可查看盲测、差异和发布前置条件。",
|
||||
"reportTitle": "发布检查结果",
|
||||
"blockedHint": "以下问题必须修复,不能通过确认绕过。",
|
||||
"reviewHint": "确认所有变更后即可发布当前模板版本。",
|
||||
"confirmHint": "请确认已审核上述变更。",
|
||||
"currentValidationRequired": "当前草稿必须先完成并通过当前样本验证。",
|
||||
"semanticDiffReview": "此版本包含语义差异,请确认已审核。",
|
||||
"unknownIssue": "发布检查发现需要处理的问题。"
|
||||
},
|
||||
"shippingOrderProfiles": {
|
||||
"title": "订单文档模板",
|
||||
"library": { "title": "订单文档模板", "subtitle": "管理模板族、草稿、已发布版本和历史查看。", "create": "创建模板", "search": "搜索模板", "status": "当前状态", "actions": "操作", "draft": "草稿", "published": "已发布 v{version}", "retired": "已退役", "loading": "正在加载模板...", "empty": "暂无模板。", "loadFailed": "加载模板失败。", "createFailed": "创建新版本草稿失败。" },
|
||||
"wizard": { "title": "创建订单文档模板", "description": "先明确模板用途,再选择首份建模与训练样本开始标注。", "steps": "第 {step} 步,共 3 步", "stepLabel": "步骤 {step}", "identityStep": "基本信息", "sampleStep": "选择建模样本", "tableStep": "选择订单明细表", "namePlaceholder": "例如:ACME 采购订单", "systemCodeHint": "系统会在创建后自动生成不可变编码,用于版本、路由和审计。", "schemaRequired": "请先在订单 Schema 页面发布一个可用版本,再创建模板。", "selectSchema": "选择已发布 Schema", "uploadNewSample": "上传新样本", "uploadNewSampleHint": "上传后系统会自动解析;完成后自动选中该文件。", "uploading": "正在上传", "sampleParsing": "正在解析,完成后会自动选中。", "sampleParseFailed": "解析失败,请重新上传或选择已有样本。", "sampleReady": "样本已解析并自动选中,可继续下一步。", "sampleSelected": "当前样本", "reuseSample": "复用已有样本", "reuseSampleHint": "仅展示已解析完成的模板专用样本。", "previous": "上一步", "next": "下一步", "createDraft": "创建草稿", "createAndEdit": "创建并进入标注", "incomplete": "请先完成必填信息。", "loadFailed": "加载向导选项失败。", "uploadFailed": "上传模板样本失败。", "sampleHint": "上传或选择样本不会创建模板;创建后该样本会同时作为标注和训练证据。", "tableLoadFailed": "加载样本表格失败。", "tableOption": "第 {page} 页 · {rows} 行 · {columns} 列", "orderLineTable": "订单明细表", "orderLineTableHint": "后续标注和订单明细行识别都以此表为基准。", "noTable": "该样本没有可用表格,请选择其他已解析样本。", "createFailed": "模板草稿创建失败,未保留半成品。" },
|
||||
"library": {
|
||||
"title": "订单文档模板",
|
||||
"subtitle": "管理模板族、草稿、已发布版本和历史查看。",
|
||||
"create": "创建模板",
|
||||
"search": "搜索模板",
|
||||
"status": "当前状态",
|
||||
"actions": "操作",
|
||||
"draft": "草稿",
|
||||
"published": "已发布 v{version}",
|
||||
"retired": "已退役",
|
||||
"loading": "正在加载模板...",
|
||||
"empty": "暂无模板。",
|
||||
"loadFailed": "加载模板失败。",
|
||||
"createFailed": "创建新版本草稿失败。"
|
||||
},
|
||||
"wizard": {
|
||||
"title": "创建订单文档模板",
|
||||
"description": "先明确模板用途,再选择首份建模与训练样本开始标注。",
|
||||
"steps": "第 {step} 步,共 3 步",
|
||||
"stepLabel": "步骤 {step}",
|
||||
"identityStep": "基本信息",
|
||||
"sampleStep": "选择建模样本",
|
||||
"tableStep": "选择订单明细表",
|
||||
"namePlaceholder": "例如:ACME 采购订单",
|
||||
"systemCodeHint": "系统会在创建后自动生成不可变编码,用于版本、路由和审计。",
|
||||
"schemaRequired": "请先在订单 Schema 页面发布一个可用版本,再创建模板。",
|
||||
"selectSchema": "选择已发布 Schema",
|
||||
"uploadNewSample": "上传新样本",
|
||||
"uploadNewSampleHint": "上传后系统会自动解析;完成后自动选中该文件。",
|
||||
"uploading": "正在上传",
|
||||
"sampleParsing": "正在解析,完成后会自动选中。",
|
||||
"sampleParseFailed": "解析失败,请重新上传或选择已有样本。",
|
||||
"sampleReady": "样本已解析并自动选中,可继续下一步。",
|
||||
"sampleSelected": "当前样本",
|
||||
"reuseSample": "复用已有样本",
|
||||
"reuseSampleHint": "仅展示已解析完成的模板专用样本。",
|
||||
"previous": "上一步",
|
||||
"next": "下一步",
|
||||
"createDraft": "创建草稿",
|
||||
"createAndEdit": "创建并进入标注",
|
||||
"incomplete": "请先完成必填信息。",
|
||||
"loadFailed": "加载向导选项失败。",
|
||||
"uploadFailed": "上传模板样本失败。",
|
||||
"sampleHint": "上传或选择样本不会创建模板;创建后该样本会同时作为标注和训练证据。",
|
||||
"tableLoadFailed": "加载样本表格失败。",
|
||||
"tableOption": "第 {page} 页 · {rows} 行 · {columns} 列",
|
||||
"orderLineTable": "订单明细表",
|
||||
"orderLineTableHint": "后续标注和订单明细行识别都以此表为基准。",
|
||||
"noTable": "该样本没有可用表格,请选择其他已解析样本。",
|
||||
"createFailed": "模板草稿创建失败,未保留半成品。"
|
||||
},
|
||||
"subtitle": "从 MinerU 表格样本可视化配置精确列映射;无需编辑 JSON 或结构指纹。",
|
||||
"structureBlocked": "该表格结构异常,不能创建模板。请等待坐标证据重建后再复核,勿通过字段映射修复原始网格。",
|
||||
"reconstructionRequired": "此表头混入明细,需先确认列边界并重建表格;重建结果必须人工审核。",
|
||||
@@ -3095,7 +3278,6 @@
|
||||
"loadFailed": "订单文档模板加载失败",
|
||||
"candidateCount": "{count} 条候选 · {status}",
|
||||
"candidateItem": "候选 {count}",
|
||||
"sourceRows": "来源物理行:{rows}",
|
||||
"emptyCandidateValue": "未识别到值",
|
||||
"noCandidateRows": "当前标注没有识别到有效明细,请检查物理行、line_no 和字段范围。",
|
||||
"blindTest": {
|
||||
@@ -3103,15 +3285,22 @@
|
||||
"gateTitle": "发布前盲测",
|
||||
"gateRequiredHint": "需完成独立样本盲测并批准后,才能进入发布检查。",
|
||||
"gateApprovedHint": "当前草稿的盲测已批准,可进入发布检查。",
|
||||
"status": { "missing": "未建立", "draft": "待完成", "approved": "已批准", "superseded": "已失效" },
|
||||
"status": {
|
||||
"missing": "未建立",
|
||||
"draft": "待完成",
|
||||
"approved": "已批准",
|
||||
"superseded": "已失效"
|
||||
},
|
||||
"samples": "样本:{count} · {status}",
|
||||
"notRun": "未执行",
|
||||
"approvedHint": "盲测已批准,无需重复执行或批准。",
|
||||
"selectIndependentSample": "选择独立样本",
|
||||
"loadIndependentSamples": "加载可选样本",
|
||||
"loadingIndependentSamples": "正在加载可选样本…",
|
||||
"loadIndependentSamplesTimedOut": "加载可选样本超时,请确认后端服务正常后重试。",
|
||||
"loadIndependentSamplesHint": "需要新增盲测样本时再加载候选,避免打开页面等待历史样本扫描。",
|
||||
"selectSamplePlaceholder": "请选择未参与当前模板标注的订单",
|
||||
"sampleOption": "{filename} · P{page} · 表 {table} · {rows} 行 × {columns} 列 · {header}",
|
||||
"noIndependentSamples": "没有可用的独立样本;请先上传并完成解析另一份同类订单。",
|
||||
"reviewHint": "请逐项勾选正确或错误;标为错误时填写更正值,未勾选不能加入盲测。",
|
||||
"row": "明细 {index}",
|
||||
@@ -3131,10 +3320,10 @@
|
||||
"addTrainingSample": "添加训练样本",
|
||||
"trainingRequired": "批准前请先在编辑器将当前标注样本加入训练样本。",
|
||||
"goToEditor": "返回编辑器绑定训练样本",
|
||||
"addedSamples": "已加入的盲测样本",
|
||||
"addedSamplesHint": "草稿可移除;批准后保留审计记录。",
|
||||
"removeSample": "移除样本",
|
||||
"sampleRemoved": "盲测样本已移除",
|
||||
"addedSamples": "已加入的盲测样本",
|
||||
"addedSamplesHint": "草稿可移除;批准后保留审计记录。",
|
||||
"removeSample": "移除样本",
|
||||
"sampleRemoved": "盲测样本已移除",
|
||||
"addCurrentSample": "添加当前盲测样本",
|
||||
"backToValidation": "返回验证",
|
||||
"goPublishCheck": "进入发布检查",
|
||||
@@ -3144,13 +3333,63 @@
|
||||
"execution": "执行与批准",
|
||||
"runHint": "执行会按当前草稿重新解析全部盲测样本;只有全量通过才能批准。",
|
||||
"unknownSample": "未知样本",
|
||||
"failure": { "title": "本次执行失败明细", "hint": "请按原因返回编辑器调整标注或重新确认盲测真值,再次执行。", "fieldMismatch": "{sample}:订单字段 {field} 的重新读取值与人工真值不一致。", "fieldNeedsReview": "{sample}:订单字段 {field} 未达到可确认状态,请检查锚点和坐标范围。", "fieldUnavailable": "{sample}:订单字段 {field} 未读取到可用值,请检查锚点、页面和坐标证据。", "coordinateEvidenceMissing": "{sample}:缺少表格或页面坐标证据,无法完成盲测。", "rowsMismatch": "{sample}:重新解析的订单明细与人工真值不一致。", "unknown": "{sample}:盲测执行未通过,请检查下方原始诊断码。" },
|
||||
"failure": {
|
||||
"title": "本次执行失败明细",
|
||||
"hint": "请按原因返回编辑器调整标注或重新确认盲测真值,再次执行。",
|
||||
"fieldMismatch": "{sample}:订单字段 {field} 的重新读取值与人工真值不一致。",
|
||||
"fieldNeedsReview": "{sample}:订单字段 {field} 未达到可确认状态,请检查锚点和坐标范围。",
|
||||
"fieldUnavailable": "{sample}:订单字段 {field} 未读取到可用值,请检查锚点、页面和坐标证据。",
|
||||
"coordinateEvidenceMissing": "{sample}:缺少表格或页面坐标证据,无法完成盲测。",
|
||||
"rowsMismatch": "{sample}:重新解析的订单明细与人工真值不一致。",
|
||||
"unknown": "{sample}:盲测执行未通过,请检查下方原始诊断码。"
|
||||
},
|
||||
"run": "执行",
|
||||
"approve": "批准"
|
||||
},
|
||||
"workbench": {
|
||||
"boundHistoricalSchema": "已绑定历史版本",
|
||||
"intro": "在受控文档页面拖拽证据区域;保存定义不含 HTML 或存储地址。", "structure": "结构", "returnToLibrary": "返回文档模板", "saveStatus": { "saved": "已保存", "saving": "正在保存", "failed": "保存失败,将保留本地修改", "readonly": "只读:编辑租约不可用" }, "exportLocalDraft": "导出本地草稿", "recoverLease": "重新获取租约", "takeOverLease": "确认接管租约", "invalidDefinitionPath": "模板配置无效:{path}", "suggestionReadyForDecision": "建议已生成,请确认决定", "acceptSuggestion": "接受", "acceptAdjustedSuggestion": "调整后接受", "rejectSuggestion": "拒绝", "suggestionAdjustmentField": "选择替代字段", "sampleValueUnavailable": "未读取到值", "orderFieldValueReading": "读取中", "orderFieldValueFailed": "读取失败", "currentSampleValue": "当前样本值", "selectedRegion": "当前标注", "recognitionResults": "识别结果", "orderHeaderResults": "订单表头字段", "orderLineResults": "订单明细行字段", "noRecognitionResults": "暂未读取到结构化结果", "lineResultField": "第 {row} 行 · {field}", "previewState": { "idle": "等待识别", "updating": "正在识别", "ready": "已更新", "failed": "识别失败" }, "evidenceStatus": { "read": "已读取", "review": "需复核", "loading": "读取中", "failed": "读取失败", "deleted": "已删除,不纳入结果", "unavailable": "未读取到值" },
|
||||
"workbench": {
|
||||
"boundHistoricalSchema": "已绑定历史版本",
|
||||
"intro": "在受控文档页面拖拽证据区域;保存定义不含 HTML 或存储地址。",
|
||||
"structure": "结构",
|
||||
"returnToLibrary": "返回文档模板",
|
||||
"saveStatus": {
|
||||
"saved": "已保存",
|
||||
"saving": "正在保存",
|
||||
"failed": "保存失败,将保留本地修改",
|
||||
"readonly": "只读:编辑租约不可用"
|
||||
},
|
||||
"exportLocalDraft": "导出本地草稿",
|
||||
"recoverLease": "重新获取租约",
|
||||
"takeOverLease": "确认接管租约",
|
||||
"invalidDefinitionPath": "模板配置无效:{path}",
|
||||
"suggestionReadyForDecision": "建议已生成,请确认决定",
|
||||
"acceptSuggestion": "接受",
|
||||
"acceptAdjustedSuggestion": "调整后接受",
|
||||
"rejectSuggestion": "拒绝",
|
||||
"suggestionAdjustmentField": "选择替代字段",
|
||||
"sampleValueUnavailable": "未读取到值",
|
||||
"orderFieldValueReading": "读取中",
|
||||
"orderFieldValueFailed": "读取失败",
|
||||
"currentSampleValue": "当前样本值",
|
||||
"selectedRegion": "当前标注",
|
||||
"recognitionResults": "识别结果",
|
||||
"orderHeaderResults": "订单表头字段",
|
||||
"orderLineResults": "订单明细行字段",
|
||||
"noRecognitionResults": "暂未读取到结构化结果",
|
||||
"lineResultField": "第 {row} 行 · {field}",
|
||||
"previewState": {
|
||||
"idle": "等待识别",
|
||||
"updating": "正在识别",
|
||||
"ready": "已更新",
|
||||
"failed": "识别失败"
|
||||
},
|
||||
"evidenceStatus": {
|
||||
"read": "已读取",
|
||||
"review": "需复核",
|
||||
"loading": "读取中",
|
||||
"failed": "读取失败",
|
||||
"deleted": "已删除,不纳入结果",
|
||||
"unavailable": "未读取到值"
|
||||
},
|
||||
"openCanvas": "创建草稿并打开画布",
|
||||
"loadingPage": "正在加载页面…",
|
||||
"canvasZoom": "页面缩放",
|
||||
@@ -3176,6 +3415,15 @@
|
||||
"drawHeader": "绘制表头",
|
||||
"drawOrderField": "绘制订单字段",
|
||||
"drawOrderAnchor": "绘制订单字段标签",
|
||||
"drawDocumentMatchAnchor": "绘制文档匹配锚点(先标签,后固定值)",
|
||||
"drawDocumentMatchAnchorShortcut": "文档匹配锚点(M):先框标签,再框固定值",
|
||||
"drawOrderAnchorShortcut": "订单字段标签(A)",
|
||||
"drawOrderFieldShortcut": "订单字段(O)",
|
||||
"drawHeaderShortcut": "明细表头(H)",
|
||||
"drawLineShortcut": "明细行项(L)",
|
||||
"drawFieldShortcut": "明细字段(F)",
|
||||
"drawExclusionShortcut": "排除区域(X)",
|
||||
"autoSuggestShortcut": "自动标记(G)",
|
||||
"drawLine": "绘制物理行",
|
||||
"drawField": "绘制字段",
|
||||
"drawExclusion": "绘制排除区",
|
||||
@@ -3210,6 +3458,13 @@
|
||||
"suggestedValue": "识别值",
|
||||
"orderAnchor": "订单字段标签",
|
||||
"orderAnchorTool": "字段标签",
|
||||
"documentMatchAnchorTool": "匹配锚点",
|
||||
"documentMatchAnchorLabel": "匹配锚点标签",
|
||||
"documentMatchAnchorValue": "匹配锚点值",
|
||||
"documentMatchAnchorHint": "从左侧工具框选标签和固定值;系统只使用框内文字匹配,不会命中备注中的相同文字。",
|
||||
"documentMatchAnchorEmpty": "请使用左侧“匹配锚点”工具,先框选标签,再框选固定值。",
|
||||
"documentMatchAnchorTextMissing": "框选区域未识别到文字;请调整框选范围后重试。",
|
||||
"orderFieldAnchorNext": "已读取字段标签,请框选字段值。",
|
||||
"headerTool": "明细表头",
|
||||
"lineTool": "明细行项",
|
||||
"fieldTool": "明细字段",
|
||||
@@ -3217,7 +3472,12 @@
|
||||
"orderFieldValueMode": "读取方式",
|
||||
"orderFieldStopAnchor": "结束标签",
|
||||
"orderFieldStopAnchorPlaceholder": "例如 SHIP TO",
|
||||
"orderFieldModes": { "singleLine": "单行", "rightOfAnchor": "标签右侧", "belowAnchor": "标签下方", "multiLine": "多行" },
|
||||
"orderFieldModes": {
|
||||
"singleLine": "单行",
|
||||
"rightOfAnchor": "标签右侧",
|
||||
"belowAnchor": "标签下方",
|
||||
"multiLine": "多行"
|
||||
},
|
||||
"matchCurrentHeader": "匹配当前表头",
|
||||
"matchAllHeaders": "匹配全部表头",
|
||||
"confirmHeaderBinding": "确认“{text}”绑定为 {field}",
|
||||
@@ -3264,5 +3524,100 @@
|
||||
"orderFieldStopAnchor": "多行订单字段必须填写结束标签。"
|
||||
}
|
||||
}
|
||||
},
|
||||
"shippingAudit": {
|
||||
"title": "运行与审计",
|
||||
"subtitle": "按时间、操作者、Run/Task、事件类型查询货代统一审计;详情仅展示白名单前后差异,导出受控且留痕。",
|
||||
"refresh": "刷新",
|
||||
"export": "导出 CSV",
|
||||
"exporting": "正在导出...",
|
||||
"apply": "应用",
|
||||
"loading": "正在加载...",
|
||||
"empty": "暂无审计事件",
|
||||
"loadFailed": "加载审计列表失败",
|
||||
"detailFailed": "加载审计详情失败",
|
||||
"exportFailed": "导出失败",
|
||||
"detailTitle": "审计详情",
|
||||
"diff": "前后差异",
|
||||
"before": "变更前",
|
||||
"after": "变更后",
|
||||
"noDiff": "无可展示的白名单差异",
|
||||
"total": "共 {count} 条",
|
||||
"previous": "上一页",
|
||||
"next": "下一页",
|
||||
"filters": {
|
||||
"eventType": "事件类型",
|
||||
"actorType": "操作者类型",
|
||||
"runNo": "Run 编号",
|
||||
"taskNo": "Task 编号",
|
||||
"operationId": "operation_id",
|
||||
"q": "编号检索",
|
||||
"all": "全部",
|
||||
"actorId": "操作者 ID",
|
||||
"documentId": "文档 ID",
|
||||
"conversationId": "会话 ID",
|
||||
"sessionItemId": "工作项编号",
|
||||
"reviewCaseNo": "复核 Case",
|
||||
"ownerUserId": "属主用户 ID",
|
||||
"requestId": "request_id",
|
||||
"result": "结果",
|
||||
"createdFrom": "开始时间",
|
||||
"createdTo": "结束时间"
|
||||
},
|
||||
"columns": {
|
||||
"time": "时间",
|
||||
"event": "事件",
|
||||
"actor": "操作者",
|
||||
"run": "Run",
|
||||
"task": "Task",
|
||||
"result": "结果",
|
||||
"conversation": "会话",
|
||||
"sessionItem": "工作项",
|
||||
"reviewCase": "Case"
|
||||
}
|
||||
},
|
||||
"shippingReviewSupervision": {
|
||||
"title": "复核监管台",
|
||||
"subtitle": "跨用户查看会话 PDF 工作项;终止或撤销确认须填写理由并二次确认。",
|
||||
"refresh": "刷新",
|
||||
"apply": "应用筛选",
|
||||
"loading": "正在加载...",
|
||||
"empty": "暂无工作项",
|
||||
"loadFailed": "加载监管列表失败",
|
||||
"actionFailed": "操作失败,请稍后重试",
|
||||
"terminate": "终止",
|
||||
"revoke": "撤销确认",
|
||||
"terminateTitle": "终止工作项",
|
||||
"revokeTitle": "撤销确认",
|
||||
"terminateImpact": "将强制关闭工作项 {itemNo},属主将无法继续复核。",
|
||||
"revokeImpact": "将撤销工作项 {itemNo} 的确认结果(24 小时内且未匹配库存)。",
|
||||
"reasonLabel": "操作理由(必填)",
|
||||
"reasonRequired": "请填写操作理由",
|
||||
"confirmTerminate": "我确认终止此工作项(CONFIRM_TERMINATE)",
|
||||
"confirmRevoke": "我确认撤销此确认结果(CONFIRM_REVOKE)",
|
||||
"confirmRequired": "请勾选确认后再提交",
|
||||
"submit": "确认提交",
|
||||
"submitting": "提交中...",
|
||||
"terminateSuccess": "工作项已终止",
|
||||
"revokeSuccess": "确认已撤销",
|
||||
"total": "共 {count} 条",
|
||||
"previous": "上一页",
|
||||
"next": "下一页",
|
||||
"filters": {
|
||||
"lifecycleStatus": "生命周期",
|
||||
"ownerUserId": "属主用户 ID",
|
||||
"conversationId": "会话 ID",
|
||||
"q": "编号检索",
|
||||
"all": "全部"
|
||||
},
|
||||
"columns": {
|
||||
"itemNo": "工作项",
|
||||
"owner": "属主",
|
||||
"conversation": "会话",
|
||||
"document": "当前 PDF",
|
||||
"status": "状态",
|
||||
"updated": "更新时间",
|
||||
"actions": "操作"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,8 +109,16 @@
|
||||
"shortCode": "客户简称",
|
||||
"site": "送货站点",
|
||||
"statusLabel": "匹配状态",
|
||||
"roles": { "bill_to": "账款客户", "ship_to": "送货客户" },
|
||||
"status": { "unmatched": "未匹配", "unique_candidate": "唯一候选", "ambiguous": "多个候选", "confirmed": "已确认" }
|
||||
"roles": {
|
||||
"bill_to": "账款客户",
|
||||
"ship_to": "送货客户"
|
||||
},
|
||||
"status": {
|
||||
"unmatched": "未匹配",
|
||||
"unique_candidate": "唯一候选",
|
||||
"ambiguous": "多个候选",
|
||||
"confirmed": "已确认"
|
||||
}
|
||||
},
|
||||
"shippingCandidateCount": "共 {count} 个订单",
|
||||
"shippingCandidateReady": "可建单",
|
||||
@@ -138,20 +146,24 @@
|
||||
"completed": "已完成 {count}",
|
||||
"running": "处理中 {count}",
|
||||
"needsHuman": "需人工 {count}",
|
||||
"pendingConfirmation": "待确认 {count}",
|
||||
"failed": "失败 {count}",
|
||||
"pending": "排队 {count}",
|
||||
"empty": "上传后将在此显示本次任务进度。",
|
||||
"unnamedPdf": "未命名 PDF",
|
||||
"progressIndex": "{current}/{total}",
|
||||
"exception": "异常",
|
||||
"pendingConfirmationBadge": "待确认",
|
||||
"duplicateBadge": "重复",
|
||||
"openReview": "进入人工复核",
|
||||
"openTask": "打开任务处理",
|
||||
"openExistingTask": "查看已有任务",
|
||||
"openExistingCount": "重复处理中 {count}",
|
||||
"cancelled": "已取消 {count}",
|
||||
"compactProgress": "{total} 个 PDF:{auto} 自动推进,{review} 需复核,{failed} 失败",
|
||||
"processNoticeProcessing": "正在处理附件,进度见右侧「本次处理」",
|
||||
"processNoticeNeedsAction": "部分附件需人工处理,请查看右侧「本次处理」",
|
||||
"processNoticeCandidateConfirmation": "订单候选已生成,请在右侧逐份人工确认",
|
||||
"processNoticeDuplicateLinked": "发现重复文件,已关联已有任务,请在右侧查看",
|
||||
"processNoticeCompleted": "处理完成,详情见右侧「本次处理」",
|
||||
"processNoticeFailed": "处理失败,可在右侧重试或查看详情",
|
||||
@@ -162,6 +174,75 @@
|
||||
"duplicateProcessing": "重复处理中",
|
||||
"existingTaskNo": "已有任务 {taskNo}"
|
||||
},
|
||||
"shippingSessionWorkItem": {
|
||||
"status": {
|
||||
"pending_review": "待复核",
|
||||
"extracting": "识别中",
|
||||
"reparse_failed": "重识别失败",
|
||||
"closed": "已完成"
|
||||
},
|
||||
"versionLabel": "V{version}",
|
||||
"versionReplaced": "已生成新版本,旧版只读",
|
||||
"versionRestored": "已恢复上一版本",
|
||||
"completedCollapsed": "已完成 {count} 项",
|
||||
"openOnlyFilter": "仅看待处理",
|
||||
"enterManualReview": "人工复核",
|
||||
"viewVersionHistory": "版本历史",
|
||||
"requestReparse": "重新识别",
|
||||
"markNonOrder": "标记非订单",
|
||||
"replaceFile": "替换文件",
|
||||
"cancelProcessing": "取消本次处理",
|
||||
"cancelReasonPrompt": "请填写取消原因",
|
||||
"nonOrderReasonPrompt": "请填写标记非订单的原因",
|
||||
"reparseReasonPrompt": "请填写重新识别的原因",
|
||||
"reasonRequired": "必须填写原因后才能继续",
|
||||
"caseRequired": "当前工作项缺少复核 Case,请先进入人工复核",
|
||||
"versionHistoryTitle": "版本历史",
|
||||
"currentVersion": "当前",
|
||||
"readonlyVersion": "只读",
|
||||
"noVersions": "暂无版本记录",
|
||||
"loading": "加载中…",
|
||||
"loadFailed": "加载工作项失败",
|
||||
"closedReason": {
|
||||
"confirmed": "已确认建单",
|
||||
"non_order": "已标记非订单",
|
||||
"user_cancelled": "用户取消",
|
||||
"admin_terminated": "管理员终止"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionHandling": {
|
||||
"title": "待处理事项",
|
||||
"count": "{count} 项",
|
||||
"reasonPrefix": "原因:",
|
||||
"affectedPrefix": "影响对象:",
|
||||
"category": {
|
||||
"document_review": "PDF 需人工复核",
|
||||
"candidate_missing_info": "订单待补信息",
|
||||
"candidate_conflict": "订单存在冲突",
|
||||
"candidate_confirmation": "候选待人工确认",
|
||||
"technical_failure": "附件处理失败",
|
||||
"auto_freeze_blocked": "自动冻结受阻",
|
||||
"budget_stopped": "首轮预算已用尽"
|
||||
},
|
||||
"primaryNotice": {
|
||||
"document_review": "部分 PDF 需人工复核,请按下方事项处理",
|
||||
"candidate_missing_info": "订单缺少必填信息,请补全后确认",
|
||||
"candidate_conflict": "订单存在冲突,请人工判定后继续",
|
||||
"candidate_confirmation": "订单候选已生成,请逐份人工确认",
|
||||
"technical_failure": "部分附件处理失败,可重试或查看详情",
|
||||
"auto_freeze_blocked": "自动冻结未通过门禁,请查看原因并处理",
|
||||
"budget_stopped": "首轮识别预算已用尽,请查看未处理附件"
|
||||
},
|
||||
"reason": {
|
||||
"profile_not_auto_freeze_approved": "模板未通过自动冻结资格审批",
|
||||
"multiple_profiles_detected": "检测到多个模板,无法自动冻结",
|
||||
"profile_auto_freeze_qualification_missing": "缺少自动冻结资格配置",
|
||||
"profile_manual_confirmation_required": "模板要求人工确认后冻结",
|
||||
"auto_freeze_not_enabled": "本轮未启用自动冻结",
|
||||
"auto_freeze_policy_missing": "缺少自动冻结策略",
|
||||
"budget_initial_limit": "已达首轮附件预算上限"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionCardTitle": {
|
||||
"queued": "订单解析排队中",
|
||||
"processing": "订单解析处理中",
|
||||
@@ -177,14 +258,51 @@
|
||||
"shippingOrderExtractionFailed": "订单解析失败",
|
||||
"shippingOrderExtractionSummary": {
|
||||
"total": "共 {count} 个 PDF",
|
||||
"processing": "处理中 {count} 个",
|
||||
"completed": "成功 {count} 个",
|
||||
"completedProgress": "附件进度 {value}",
|
||||
"candidates": "候选 {count} 个",
|
||||
"reviewRequired": "需复核 {count} 个",
|
||||
"failed": "失败 {count} 个"
|
||||
"failed": "失败 {count} 个",
|
||||
"cancelled": "已取消 {count} 个",
|
||||
"pending": "排队 {count} 个"
|
||||
},
|
||||
"shippingOrderExtractionCurrentFile": "当前:{fileName}",
|
||||
"shippingOrderExtractionElapsed": "已用时 {elapsed}",
|
||||
"shippingOrderExtractionQueuePosition": "队列第 {position} 位",
|
||||
"shippingOrderExtractionRefreshing": "正在刷新...",
|
||||
"shippingOrderExtractionRefreshFailed": "暂时无法刷新状态,系统仍会继续处理。",
|
||||
"shippingOrderExtractionUserStage": {
|
||||
"pending": "等待处理",
|
||||
"document_queued": "已入队,等待处理",
|
||||
"waiting_layout": "等待版面解析",
|
||||
"layout_parsing_started": "正在解析版面",
|
||||
"routing": "分析文档结构中",
|
||||
"matching_profile": "匹配订单模板中",
|
||||
"extracting": "提取订单字段中",
|
||||
"merging_supplement": "合并正文补充信息中",
|
||||
"candidate_ready": "候选已生成",
|
||||
"review_required": "需要人工复核",
|
||||
"technical_retrying": "系统正在重试",
|
||||
"failed": "处理失败",
|
||||
"cancellation_requested": "正在取消…",
|
||||
"cancelled": "已取消",
|
||||
"completed": "已完成"
|
||||
},
|
||||
"shippingOrderExtractionHealthTip": {
|
||||
"processing_slow": "处理时间偏长,系统仍在继续,可稍后刷新。",
|
||||
"queue_backlog": "前方排队较多,请稍候。",
|
||||
"processing_attention": "处理时间较长,如持续无进展可联系管理员。"
|
||||
},
|
||||
"shippingOrderExtractionCancel": {
|
||||
"confirmTitle": "确认取消本次识别?",
|
||||
"confirmImpact": "排队中的附件将立即取消;正在处理的附件会在安全点停止。已完成结果会保留。",
|
||||
"reasonRequired": "请填写取消原因",
|
||||
"reasonOptional": "可选:填写取消原因",
|
||||
"submitting": "正在提交取消…",
|
||||
"dismiss": "暂不取消",
|
||||
"failed": "取消请求失败,请稍后重试。"
|
||||
},
|
||||
"shippingOrderExtractionDetailsTitle": "处理详情",
|
||||
"shippingOrderExtractionCloseDetails": "关闭处理详情",
|
||||
"shippingOrderExtractionTimelineTitle": "运行时间线",
|
||||
@@ -229,6 +347,9 @@
|
||||
"technical_failed": "系统未能完成该附件处理。",
|
||||
"budget_stopped": "已达到当前附件预算,剩余附件等待人工复核。",
|
||||
"run_completed": "本次订单解析已完成。",
|
||||
"cancellation_requested": "已收到取消请求,正在安全停止。",
|
||||
"cancellation_completed": "取消已完成。",
|
||||
"unit_cancelled": "该附件已取消。",
|
||||
"generic_processing": "系统正在处理订单附件。"
|
||||
},
|
||||
"shippingOrderExtractionAction": {
|
||||
@@ -237,7 +358,10 @@
|
||||
"retry_failed_attachments": "重试失败附件",
|
||||
"view_evidence": "查看证据",
|
||||
"review_candidate": "人工确认",
|
||||
"manual_review": "人工复核"
|
||||
"manual_review": "人工复核",
|
||||
"refresh_status": "刷新状态",
|
||||
"cancel_run": "取消本次识别",
|
||||
"cancel_unit": "取消此 PDF"
|
||||
},
|
||||
"shippingOrderExtractionDocumentStatus": {
|
||||
"pending": "等待处理",
|
||||
@@ -276,12 +400,23 @@
|
||||
"same_business_content": "业务内容与已有任务相同。",
|
||||
"duplicate_decision_required": "检测到重复,需要人工决定如何处理。",
|
||||
"open_existing_reconciliation_required": "打开已有任务前仍需核对字段。",
|
||||
"field_conflict": "字段存在冲突,需要人工确认。"
|
||||
"field_conflict": "字段存在冲突,需要人工确认。",
|
||||
"SHIPPING_NOTICE": {
|
||||
"ORDER_EXTRACTION_JOB_FAILED": "订单识别后台任务失败。常见原因是附件版面解析未就绪,请确认版面服务已开启后重试。",
|
||||
"ORDER_EXTRACTION_LAYOUT_SCHEDULING_FAILED": "订单附件版面解析任务未能创建。请确认版面服务已开启后重试。",
|
||||
"ORDER_EXTRACTION_LAYOUT_PREREQUISITE_FAILED": "订单附件版面条件不完整,请重试或重新上传附件。",
|
||||
"ORDER_EXTRACTION_LAYOUT_FAILED": "订单附件版面解析失败,请重试。",
|
||||
"ORDER_EXTRACTION_FAILED": "订单识别失败,请重试。",
|
||||
"ORDER_EXTRACTION_TIMEOUT": "订单识别超时,请稍后重试。"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionPoNumber": "PO:{value}",
|
||||
"shippingOrderExtractionLineCount": "订单行:{count}",
|
||||
"shippingOrderExtractionReviewDetail": "第 {line} 行:{field}需要补充或修正",
|
||||
"shippingOrderExtractionReviewField": { "qty": "数量", "unknown": "明细字段" },
|
||||
"shippingOrderExtractionReviewField": {
|
||||
"qty": "数量",
|
||||
"unknown": "明细字段"
|
||||
},
|
||||
"shippingOrderExtractionProfileSummary": "模板:{name} V{version}",
|
||||
"shippingOrderExtractionPlanSummary": "本轮从 {total} 个附件中规划 {groups} 个订单组,首轮最多识别 {attachments} 个附件,并发 {concurrency} 个。",
|
||||
"shippingOrderExtractionPlanSelected": "已选 {count} 个附件",
|
||||
@@ -860,7 +995,17 @@
|
||||
"empty": "暂无符合条件的数据"
|
||||
}
|
||||
},
|
||||
"shippingCustomer": { "title": "确认标准客户", "subtitle": "请选择管理员维护的正式客户。解析名称仅作为线索,不会自动绑定。", "searchPlaceholder": "搜索客户名称或简码", "search": "搜索", "empty": "未找到启用客户,请联系管理员维护客户资料", "confirm": "确认客户", "loadFailed": "加载客户列表失败", "confirmed": "标准客户已确认", "confirmFailed": "确认客户失败" },
|
||||
"shippingCustomer": {
|
||||
"title": "确认标准客户",
|
||||
"subtitle": "请选择管理员维护的正式客户。解析名称仅作为线索,不会自动绑定。",
|
||||
"searchPlaceholder": "搜索客户名称或简码",
|
||||
"search": "搜索",
|
||||
"empty": "未找到启用客户,请联系管理员维护客户资料",
|
||||
"confirm": "确认客户",
|
||||
"loadFailed": "加载客户列表失败",
|
||||
"confirmed": "标准客户已确认",
|
||||
"confirmFailed": "确认客户失败"
|
||||
},
|
||||
"training": {
|
||||
"badge": "员工培训工作区",
|
||||
"title": "",
|
||||
@@ -1024,8 +1169,14 @@
|
||||
"管理端需要能导出入职日期、完成日期、部门、姓名、工号和分数。"
|
||||
],
|
||||
"booleanOptions": [
|
||||
{ "id": "true", "label": "正确" },
|
||||
{ "id": "false", "label": "错误" }
|
||||
{
|
||||
"id": "true",
|
||||
"label": "正确"
|
||||
},
|
||||
{
|
||||
"id": "false",
|
||||
"label": "错误"
|
||||
}
|
||||
],
|
||||
"questionBank": [
|
||||
{
|
||||
@@ -1035,10 +1186,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "根据新人培训试卷答案,工资固定在每月 15 号发放。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 8号" },
|
||||
{ "id": "b", "label": "B. 9号" },
|
||||
{ "id": "c", "label": "C. 15号" },
|
||||
{ "id": "d", "label": "D. 27号" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 8号"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 9号"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 15号"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. 27号"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1048,9 +1211,18 @@
|
||||
"answer": "b",
|
||||
"explanation": "公司餐厅订餐使用中米新订餐系统,不是 OA 或 ERP。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. OA" },
|
||||
{ "id": "b", "label": "B. 中米新订餐系统" },
|
||||
{ "id": "c", "label": "C. ERP" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. OA"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 中米新订餐系统"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. ERP"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1060,10 +1232,22 @@
|
||||
"answer": "abcd",
|
||||
"explanation": "试卷给出的四个选项都是公司产品范畴,前端以组合选项形式展示为全选。",
|
||||
"options": [
|
||||
{ "id": "abcd", "label": "A/B/C/D 全部都是" },
|
||||
{ "id": "ab", "label": "A/B" },
|
||||
{ "id": "cd", "label": "C/D" },
|
||||
{ "id": "a", "label": "仅 A" }
|
||||
{
|
||||
"id": "abcd",
|
||||
"label": "A/B/C/D 全部都是"
|
||||
},
|
||||
{
|
||||
"id": "ab",
|
||||
"label": "A/B"
|
||||
},
|
||||
{
|
||||
"id": "cd",
|
||||
"label": "C/D"
|
||||
},
|
||||
{
|
||||
"id": "a",
|
||||
"label": "仅 A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1073,10 +1257,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "请假必须发起 OA 请假申请单,不能使用加班申请单或联络单。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 加班申请单" },
|
||||
{ "id": "b", "label": "B. 联络单" },
|
||||
{ "id": "c", "label": "C. 请假申请单" },
|
||||
{ "id": "d", "label": "D. 员工需求单" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 加班申请单"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 联络单"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 请假申请单"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. 员工需求单"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1086,9 +1282,18 @@
|
||||
"answer": "a",
|
||||
"explanation": "QC080000 对应有害物质过程管理体系认证标准。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 有害物质过程管理体系认证标准" },
|
||||
{ "id": "b", "label": "B. 职业健康安全管理体系" },
|
||||
{ "id": "c", "label": "C. 环境管理体系" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 有害物质过程管理体系认证标准"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 职业健康安全管理体系"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 环境管理体系"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1098,8 +1303,14 @@
|
||||
"answer": "a",
|
||||
"explanation": "5S 标准表述为整理、整顿、清扫、清洁和素养。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 整理、整顿、清扫、清洁和素养" },
|
||||
{ "id": "b", "label": "B. 整理、整顿、打扫、清洁和素养" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 整理、整顿、清扫、清洁和素养"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 整理、整顿、打扫、清洁和素养"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1109,8 +1320,14 @@
|
||||
"answer": "a",
|
||||
"explanation": "使用灭火器要站在上风口,避免烟雾和火势倒灌。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 上风口" },
|
||||
{ "id": "b", "label": "B. 下风口" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 上风口"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 下风口"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1207,6 +1424,142 @@
|
||||
]
|
||||
},
|
||||
"shippingOrderReview": {
|
||||
"title": "订单人工复核", "run": "识别批次 {runNo}", "back": "返回对话", "readOnly": "只读预览", "loading": "正在加载复核结果...", "unavailable": "暂时无法加载复核结果,请稍后重试。", "documentNavigation": "PDF 导航", "documents": "PDF 文件", "unnamedDocument": "未命名 PDF", "caseStatus": "{status} · {count} 个问题", "previewTitle": "PDF 预览", "previewLoading": "正在加载 PDF 预览...", "previewUnavailable": "PDF 预览不可用,草稿编辑不受影响。", "evidenceSummary": "选择字段旁的定位图标可查看证据。", "evidenceAt": "PDF 第 {page} 页", "evidenceNoHighlight": "该证据没有可靠坐标,仅提供页码与引文,不显示虚假高亮。", "viewEvidence": "查看证据", "orderFields": "订单字段", "schemaVersion": "冻结 Schema #{version}", "issues": "待处理问题", "machineSource": "来源:机器识别", "manualSource": "来源:人工修改", "restoreMachine": "恢复机器值", "saved": "已保存", "saving": "保存中", "saveFailed": "保存失败", "saveNow": "立即保存并校验", "addLine": "新增行", "copyLine": "复制行", "deleteLine": "删除行", "noMachineOrder": "未识别到可信订单。", "lines": "订单明细", "line": "第 {index} 行", "noLines": "未识别到订单明细。", "moreFields": "更多订单信息({count})", "emptyValue": "未提供", "unknownField": "订单字段", "createManualDraft": "手工创建订单草稿", "markNonOrder": "标记为非订单", "markQualityIssue": "文件质量异常", "reparse": "重新识别此 PDF", "uploadReplacement": "上传替代 PDF", "confirmCreate": "确认并创建任务", "confirmPrompt": "确认后将冻结当前草稿并创建独立任务,且不能继续编辑。是否继续?", "confirmSuccess": "已创建任务 {taskNo}", "confirmAutoProgress": "已创建任务 {taskNo},已进入自动推进"
|
||||
"title": "订单人工复核",
|
||||
"run": "识别批次 {runNo}",
|
||||
"back": "返回对话",
|
||||
"readOnly": "只读预览",
|
||||
"loading": "正在加载复核结果...",
|
||||
"unavailable": "暂时无法加载复核结果,请稍后重试。",
|
||||
"documentNavigation": "PDF 导航",
|
||||
"documents": "PDF 文件",
|
||||
"unnamedDocument": "未命名 PDF",
|
||||
"caseStatus": "{status} · {count} 个问题",
|
||||
"caseStatuses": {
|
||||
"unreviewed": "待处理",
|
||||
"draft": "草稿待完善",
|
||||
"ready": "可确认",
|
||||
"confirmed": "已创建任务",
|
||||
"non_order": "已标记非订单",
|
||||
"quality_issue": "文件质量异常",
|
||||
"reparse_pending": "正在重新识别",
|
||||
"superseded": "已由新版结果替代",
|
||||
"unknown": "状态未知"
|
||||
},
|
||||
"previewTitle": "PDF 预览",
|
||||
"previewLoading": "正在加载 PDF 预览...",
|
||||
"previewUnavailable": "PDF 预览不可用,草稿编辑不受影响。",
|
||||
"previewCollapsed": "该证据只有页码和引文,没有可靠坐标;已收起 PDF 预览。",
|
||||
"expandPreview": "展开 PDF 预览",
|
||||
"evidenceSummary": "选择字段旁的定位图标可查看证据。",
|
||||
"evidenceAt": "PDF 第 {page} 页",
|
||||
"evidenceNoHighlight": "该证据没有可靠坐标,仅提供页码与引文,不显示虚假高亮。",
|
||||
"viewEvidence": "查看证据",
|
||||
"locateSource": "定位原文:{field}",
|
||||
"orderFields": "订单字段",
|
||||
"schemaVersion": "冻结 Schema #{version}",
|
||||
"issues": "待处理问题",
|
||||
"machineSource": "来源:机器识别",
|
||||
"manualSource": "来源:人工修改",
|
||||
"restoreMachine": "恢复机器值",
|
||||
"saved": "已保存",
|
||||
"saving": "保存中",
|
||||
"saveFailed": "保存失败",
|
||||
"saveNow": "立即保存并校验",
|
||||
"addLine": "新增行",
|
||||
"copyLine": "复制行",
|
||||
"deleteLine": "删除行",
|
||||
"noMachineOrder": "机器识别结果待人工确认,可创建草稿进行修正。",
|
||||
"lines": "订单明细",
|
||||
"line": "第 {index} 行",
|
||||
"noLines": "未识别到订单明细。",
|
||||
"moreFields": "更多订单信息({count})",
|
||||
"emptyValue": "未提供",
|
||||
"unknownField": "订单字段",
|
||||
"createManualDraft": "手工创建订单草稿",
|
||||
"markNonOrder": "标记为非订单",
|
||||
"markQualityIssue": "文件质量异常",
|
||||
"reparse": "重新识别此 PDF",
|
||||
"uploadReplacement": "上传替代 PDF",
|
||||
"confirmCreate": "确认并创建任务",
|
||||
"confirmPrompt": "确认后将冻结当前草稿并创建独立任务,且不能继续编辑。是否继续?",
|
||||
"confirmSuccess": "已创建任务 {taskNo}",
|
||||
"confirmAutoProgress": "已创建任务 {taskNo},已进入自动推进",
|
||||
"autoProgress": {
|
||||
"result": "自动推进结果:{status}",
|
||||
"checkpoint": "当前检查点:{checkpoint}",
|
||||
"viewTask": "查看订单进度",
|
||||
"status": {
|
||||
"ok": "已完成当前可自动执行步骤",
|
||||
"running": "正在处理中",
|
||||
"needs_human": "需要人工处理",
|
||||
"failed": "自动推进失败",
|
||||
"unknown": "状态待确认"
|
||||
}
|
||||
},
|
||||
"backToSession": "返回本次处理",
|
||||
"workItemHeader": "工作项 {itemNo} · {version}",
|
||||
"jumpToCurrentVersion": "跳转当前版本",
|
||||
"showContext": "对话上下文",
|
||||
"hideContext": "收起对话上下文",
|
||||
"contextTitle": "对话上下文",
|
||||
"contextDesc": "当前会话中最近的订单抽取消息。",
|
||||
"contextUser": "用户",
|
||||
"contextAi": "AI",
|
||||
"statusBanner": {
|
||||
"superseded": "您正在查看历史版本,当前版本已更新;编辑与确认已禁用。",
|
||||
"reparse_in_progress": "此 PDF 正在重新识别,请等待完成后继续复核。",
|
||||
"restored": "重识别失败已恢复上一版本,可继续编辑。"
|
||||
},
|
||||
"versionHistory": {
|
||||
"title": "版本历史",
|
||||
"itemNo": "工作项 {itemNo}",
|
||||
"result": "结果",
|
||||
"createdAt": "创建时间",
|
||||
"confirmedAt": "确认时间",
|
||||
"viewReadonly": "只读查看",
|
||||
"open": "打开"
|
||||
},
|
||||
"confirmDialog": {
|
||||
"reasonLabel": "原因(必填)",
|
||||
"reasonPlaceholder": "请说明操作原因...",
|
||||
"reasonRequired": "请填写原因",
|
||||
"confirm": {
|
||||
"title": "确认并创建任务",
|
||||
"impact": "确认后将冻结当前草稿并创建独立任务,且不能继续编辑。",
|
||||
"confirm": "确认建单"
|
||||
},
|
||||
"reparse": {
|
||||
"title": "重新识别此 PDF",
|
||||
"impact": "将创建新的识别批次;当前版本将变为只读历史。",
|
||||
"confirm": "开始重识别"
|
||||
},
|
||||
"non_order": {
|
||||
"title": "标记为非订单",
|
||||
"impact": "关闭此 PDF 工作项并标记为非订单,不可恢复为可确认状态。",
|
||||
"confirm": "确认标记"
|
||||
},
|
||||
"replace": {
|
||||
"title": "上传替代 PDF",
|
||||
"impact": "将用新 PDF 替代当前文档并触发重新识别;当前版本将变为只读。",
|
||||
"confirm": "确认上传"
|
||||
},
|
||||
"reasonCodeLabel": "原因类型",
|
||||
"reasonCodeRequired": "请选择原因类型",
|
||||
"quality_issue": {
|
||||
"title": "标记文件质量异常",
|
||||
"impact": "保留当前 PDF、草稿与机器识别结果,供补件或重新识别;须选择原因并在选择「其他」时填写说明。",
|
||||
"confirm": "确认标记"
|
||||
},
|
||||
"qualityReasons": {
|
||||
"blurred": "图像模糊",
|
||||
"incomplete_pages": "页码不全",
|
||||
"password_protected": "受密码保护",
|
||||
"corrupted": "文件损坏",
|
||||
"wrong_orientation": "方向错误",
|
||||
"unsupported_layout": "版式不支持",
|
||||
"missing_order_table": "缺少订单表格",
|
||||
"other": "其他(须填写说明)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,15 @@
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_NOT_RETRYABLE": "只有识别失败的订单任务可以重新识别。",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_SNAPSHOT_OBSOLETE": "该识别任务使用旧版输入契约,无法重试。请重新发送邮件及附件发起新识别。",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_CONVERSATION_ACTIVE": "当前对话已有订单识别任务正在处理,请等待完成后再继续。",
|
||||
"SHIPPING_NOTICE.CANCEL_FORBIDDEN": "无权取消该订单识别任务。",
|
||||
"SHIPPING_NOTICE.CANCEL_REASON_REQUIRED": "取消他人任务时必须填写原因。",
|
||||
"SHIPPING_NOTICE.CANCEL_NOT_ACTIVE": "该任务已结束或不可取消。",
|
||||
"SHIPPING_NOTICE.CANCEL_CONFLICT": "取消请求与当前进度冲突,请刷新后重试。",
|
||||
"SHIPPING_NOTICE.CANCEL_FEATURE_DISABLED": "订单识别取消功能已关闭,请联系管理员。",
|
||||
"SHIPPING_NOTICE.AUDIT_EXPORT_FEATURE_DISABLED": "审计导出功能已关闭,请联系管理员。",
|
||||
"SHIPPING_NOTICE.AUDIT_PERSIST_FAILED": "审计记录写入失败,操作未完成,请稍后重试。",
|
||||
"SHIPPING_NOTICE.AUDIT_METADATA_FORBIDDEN": "审计写入包含禁止的敏感字段。",
|
||||
"SHIPPING_NOTICE.AUDIT_SNAPSHOT_FORBIDDEN": "审计快照包含禁止的敏感字段。",
|
||||
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "尚未初始化订单模板。",
|
||||
"SHIPPING_ORDER_SCHEMA_EXISTS": "订单模板已存在。",
|
||||
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "已有订单模板草稿,请先完成或发布当前草稿。",
|
||||
@@ -378,6 +387,7 @@
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_REQUIRED": "确认建单缺少幂等键,请重试。",
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_CONFLICT": "确认请求冲突,请刷新后重试。",
|
||||
"SHIPPING_REVIEW_CONFIRM_VALIDATION_FAILED": "草稿尚未通过完整校验,不能确认建单。",
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "复核 PDF 已不可用,不能确认建单。"
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "复核 PDF 已不可用,不能确认建单。",
|
||||
"SHIPPING_REVIEW_QUALITY_COMMENT_REQUIRED": "选择「其他」时必须填写质量异常说明。"
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,12 @@
|
||||
"archived": "已归档"
|
||||
},
|
||||
"disposition": {
|
||||
"actions": { "delete": "删除", "archive": "归档", "restore": "恢复", "purge": "永久删除" },
|
||||
"actions": {
|
||||
"delete": "删除",
|
||||
"archive": "归档",
|
||||
"restore": "恢复",
|
||||
"purge": "永久删除"
|
||||
},
|
||||
"reasonPrompt": "请输入删除/作废原因:",
|
||||
"purgeReasonPrompt": "请输入永久删除原因(仅管理员且仅纯误建任务可执行):",
|
||||
"confirm": "确认{action}选中的 {count} 个任务吗?",
|
||||
@@ -377,6 +382,25 @@
|
||||
"uploaded": "已上传货代",
|
||||
"upload_failed": "上传货代失败",
|
||||
"backend_orchestrator_task_finished": "后台任务已完成"
|
||||
},
|
||||
"myRuns": {
|
||||
"title": "我的识别",
|
||||
"subtitle": "查看处理中、失败、已取消的订单识别任务,并可返回会话续办。",
|
||||
"status": "状态",
|
||||
"allStatuses": "全部状态",
|
||||
"runNo": "识别编号",
|
||||
"stage": "当前阶段",
|
||||
"summary": "附件进度",
|
||||
"summaryCounts": "共 {total}:完成 {done} / 复核 {review} / 失败 {failed} / 取消 {cancelled}",
|
||||
"elapsed": "已用时",
|
||||
"actions": "操作",
|
||||
"openChat": "打开会话",
|
||||
"loading": "正在加载识别任务...",
|
||||
"empty": "暂无识别任务",
|
||||
"loadFailed": "加载识别任务失败",
|
||||
"total": "共 {count} 条",
|
||||
"previous": "上一页",
|
||||
"next": "下一页"
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
"shippingOrderExtractionRuns": "識別任務",
|
||||
"shippingOrderDocumentProfiles": "文件範本",
|
||||
"shippingFieldAssets": "欄位資產庫",
|
||||
"shippingOrderSchema": "訂單 Schema"
|
||||
"shippingOrderSchema": "訂單 Schema",
|
||||
"shippingAudit": "運行與稽核中心",
|
||||
"shippingReviewSupervision": "覆核監管台"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "唯讀執行診斷",
|
||||
@@ -54,6 +56,9 @@
|
||||
"createdAt": "建立時間",
|
||||
"totalDuration": "總耗時",
|
||||
"viewDetail": "查看詳情",
|
||||
"actions": "操作",
|
||||
"cancelRun": "取消運行",
|
||||
"cancelFailed": "取消運行失敗",
|
||||
"previous": "上一頁",
|
||||
"next": "下一頁",
|
||||
"loading": "正在載入...",
|
||||
@@ -167,6 +172,24 @@
|
||||
"review_required": "全部待人工處理",
|
||||
"failed": "失敗",
|
||||
"cancelled": "已取消"
|
||||
},
|
||||
"healthStatus": "健康狀態",
|
||||
"healthStatuses": {
|
||||
"healthy": "正常",
|
||||
"degraded": "降級"
|
||||
},
|
||||
"activeCount": "活動 Run",
|
||||
"staleCount": "卡住/積壓",
|
||||
"failureRate": "失敗率",
|
||||
"latencySummary": "總耗時 P50 {p50} / P95 {p95} / Max {max}",
|
||||
"staleRuns": "異常編號:{runs}",
|
||||
"healthUnavailable": "暫時無法載入健康彙總",
|
||||
"staleOnly": "僅卡住/積壓",
|
||||
"cancellationInFlight": "僅取消中",
|
||||
"cancellation": "取消狀態",
|
||||
"cancellationStates": {
|
||||
"in_flight": "正在取消",
|
||||
"completed": "已取消完成"
|
||||
}
|
||||
},
|
||||
"shippingOrderSchema": {
|
||||
@@ -343,8 +366,8 @@
|
||||
"placementHeader": "訂單資訊",
|
||||
"placementLine": "貨品明細",
|
||||
"placement": {
|
||||
"header": "訂單資訊",
|
||||
"line": "貨品明細"
|
||||
"header": "表頭",
|
||||
"line": "表身"
|
||||
},
|
||||
"fieldType": {
|
||||
"string": "文字",
|
||||
@@ -551,10 +574,6 @@
|
||||
"suggestPreviewEmpty": "建議欄位均已採用,無需變更。",
|
||||
"suggestConfirm": "確認採用",
|
||||
"suggestCancel": "取消",
|
||||
"placement": {
|
||||
"header": "表頭",
|
||||
"line": "表身"
|
||||
},
|
||||
"operationFailed": "訂單範本操作失敗",
|
||||
"fieldCategory": "欄位分類",
|
||||
"fieldCategoryOption": {
|
||||
@@ -2569,7 +2588,48 @@
|
||||
"time": "建立時間",
|
||||
"empty": "尚無驗證執行。",
|
||||
"completed": "驗證執行已完成。",
|
||||
"failed": "驗證執行失敗。", "currentDraft": "目前草稿驗證", "currentDraftHint": "系統會檢查設定,並以目前樣本試讀一次。", "validateCurrent": "驗證目前草稿", "validating": "驗證中…", "goPublishCheck": "進入發布檢查", "structureCheck": "設定檢查", "structureCheckHint": "檢查欄位繫結、座標範圍、頁碼及明細結構。", "sampleCheck": "目前樣本試讀", "sampleCheckHint": "檢查目前標註能否從樣本讀取欄位與明細。", "state": { "ready": "目前草稿可進入發布檢查", "stale": "設定已變更,請重新驗證", "failed": "驗證未通過,請返回編輯器修正", "pending": "尚未驗證目前草稿" }, "stateHint": { "ready": "設定檢查和目前樣本試讀均已通過。", "stale": "歷史驗證屬於較早草稿,不能用於發布。", "failed": "請調整標註後再次驗證。", "pending": "完成標註並儲存後,執行一次驗證。" }, "runStatus": { "passed": "已通過", "failed": "未通過", "stale": "已過期", "pending": "未執行", "running": "驗證中" }, "resultsTitle": "本次樣本辨識結果", "resultsHint": "只顯示目前草稿依目前標註即時讀取的結果;已刪除明細僅供核對,不會進入訂單結果。", "refreshResults": "重新讀取", "resultsLoading": "正在讀取目前樣本...", "resultsFailed": "未讀取到值或讀取失敗,請返回編輯器檢查標註。", "headerResults": "訂單表頭", "lineResults": "訂單明細", "noHeaderResults": "目前樣本未讀取到訂單表頭欄位。", "noLineResults": "目前樣本未讀取到訂單明細。", "noValue": "未讀取到值", "rowStatus": "狀態", "deleted": "已刪除,不納入結果", "read": "已讀取"
|
||||
"failed": "驗證執行失敗。",
|
||||
"currentDraft": "目前草稿驗證",
|
||||
"currentDraftHint": "系統會檢查設定,並以目前樣本試讀一次。",
|
||||
"validateCurrent": "驗證目前草稿",
|
||||
"validating": "驗證中…",
|
||||
"goPublishCheck": "進入發布檢查",
|
||||
"structureCheck": "設定檢查",
|
||||
"structureCheckHint": "檢查欄位繫結、座標範圍、頁碼及明細結構。",
|
||||
"sampleCheck": "目前樣本試讀",
|
||||
"sampleCheckHint": "檢查目前標註能否從樣本讀取欄位與明細。",
|
||||
"state": {
|
||||
"ready": "目前草稿可進入發布檢查",
|
||||
"stale": "設定已變更,請重新驗證",
|
||||
"failed": "驗證未通過,請返回編輯器修正",
|
||||
"pending": "尚未驗證目前草稿"
|
||||
},
|
||||
"stateHint": {
|
||||
"ready": "設定檢查和目前樣本試讀均已通過。",
|
||||
"stale": "歷史驗證屬於較早草稿,不能用於發布。",
|
||||
"failed": "請調整標註後再次驗證。",
|
||||
"pending": "完成標註並儲存後,執行一次驗證。"
|
||||
},
|
||||
"runStatus": {
|
||||
"passed": "已通過",
|
||||
"failed": "未通過",
|
||||
"stale": "已過期",
|
||||
"pending": "未執行",
|
||||
"running": "驗證中"
|
||||
},
|
||||
"resultsTitle": "本次樣本辨識結果",
|
||||
"resultsHint": "只顯示目前草稿依目前標註即時讀取的結果;已刪除明細僅供核對,不會進入訂單結果。",
|
||||
"refreshResults": "重新讀取",
|
||||
"resultsLoading": "正在讀取目前樣本...",
|
||||
"resultsFailed": "未讀取到值或讀取失敗,請返回編輯器檢查標註。",
|
||||
"headerResults": "訂單表頭",
|
||||
"lineResults": "訂單明細",
|
||||
"noHeaderResults": "目前樣本未讀取到訂單表頭欄位。",
|
||||
"noLineResults": "目前樣本未讀取到訂單明細。",
|
||||
"noValue": "未讀取到值",
|
||||
"rowStatus": "狀態",
|
||||
"deleted": "已刪除,不納入結果",
|
||||
"read": "已讀取"
|
||||
},
|
||||
"orderProfilePublishCheck": {
|
||||
"eyebrow": "發布閘門",
|
||||
@@ -2585,7 +2645,16 @@
|
||||
"noBlocking": "無阻斷項。",
|
||||
"warnings": "警告(必須逐項確認)",
|
||||
"confirm": "確認發布",
|
||||
"failed": "發布檢查失敗。", "readyTitle": "已驗證草稿", "readyHint": "目前樣本驗證已通過。產生檢查後可查看發布前置條件和變更。", "reportTitle": "發布檢查結果", "blockedHint": "以下問題必須修正,不能透過確認略過。", "reviewHint": "確認所有列出的變更後即可發布此版本。", "confirmHint": "請確認已審核上述變更。", "currentValidationRequired": "目前草稿必須先通過目前樣本驗證。", "semanticDiffReview": "此版本包含語義差異,請確認已審核。", "unknownIssue": "發布檢查發現需要處理的問題。"
|
||||
"failed": "發布檢查失敗。",
|
||||
"readyTitle": "已驗證草稿",
|
||||
"readyHint": "目前樣本驗證已通過。產生檢查後可查看發布前置條件和變更。",
|
||||
"reportTitle": "發布檢查結果",
|
||||
"blockedHint": "以下問題必須修正,不能透過確認略過。",
|
||||
"reviewHint": "確認所有列出的變更後即可發布此版本。",
|
||||
"confirmHint": "請確認已審核上述變更。",
|
||||
"currentValidationRequired": "目前草稿必須先通過目前樣本驗證。",
|
||||
"semanticDiffReview": "此版本包含語義差異,請確認已審核。",
|
||||
"unknownIssue": "發布檢查發現需要處理的問題。"
|
||||
},
|
||||
"shippingOrderProfiles": {
|
||||
"title": "訂單文件範本",
|
||||
@@ -2978,15 +3047,22 @@
|
||||
"gateTitle": "發佈前盲測",
|
||||
"gateRequiredHint": "必須完成獨立樣本盲測並批准後,才能進入發佈檢查。",
|
||||
"gateApprovedHint": "目前草稿的盲測已批准,可進入發佈檢查。",
|
||||
"status": { "missing": "未建立", "draft": "待完成", "approved": "已批准", "superseded": "已失效" },
|
||||
"status": {
|
||||
"missing": "未建立",
|
||||
"draft": "待完成",
|
||||
"approved": "已批准",
|
||||
"superseded": "已失效"
|
||||
},
|
||||
"samples": "樣本:{count} · {status}",
|
||||
"notRun": "尚未執行",
|
||||
"approvedHint": "盲測已批准,無須重複執行或批准。",
|
||||
"selectIndependentSample": "選擇獨立樣本",
|
||||
"loadIndependentSamples": "載入可選樣本",
|
||||
"loadingIndependentSamples": "正在載入可選樣本…",
|
||||
"loadIndependentSamplesTimedOut": "載入可選樣本逾時,請確認後端服務正常後重試。",
|
||||
"loadIndependentSamplesHint": "需要新增盲測樣本時再載入候選,避免開啟頁面時等待歷史樣本掃描。",
|
||||
"selectSamplePlaceholder": "請選擇未參與目前範本標註的訂單",
|
||||
"sampleOption": "{filename} · P{page} · 表 {table} · {rows} 列 × {columns} 欄 · {header}",
|
||||
"noIndependentSamples": "沒有可用的獨立樣本;請先上傳並完成解析另一份同類訂單。",
|
||||
"reviewHint": "請逐項勾選正確或錯誤;標示錯誤時填寫更正值,未勾選不能加入盲測。",
|
||||
"row": "明細 {index}",
|
||||
@@ -3019,13 +3095,23 @@
|
||||
"execution": "執行與批准",
|
||||
"runHint": "執行會按目前草稿重新解析全部盲測樣本;只有全數通過才能批准。",
|
||||
"unknownSample": "未知樣本",
|
||||
"failure": { "title": "本次執行失敗明細", "hint": "請依原因返回編輯器調整標註或重新確認盲測真值,再次執行。", "fieldMismatch": "{sample}:訂單欄位 {field} 的重新讀取值與人工真值不一致。", "fieldNeedsReview": "{sample}:訂單欄位 {field} 未達可確認狀態,請檢查錨點和座標範圍。", "fieldUnavailable": "{sample}:訂單欄位 {field} 未讀取到可用值,請檢查錨點、頁面和座標證據。", "coordinateEvidenceMissing": "{sample}:缺少表格或頁面座標證據,無法完成盲測。", "rowsMismatch": "{sample}:重新解析的訂單明細與人工真值不一致。", "unknown": "{sample}:盲測執行未通過,請檢查下方原始診斷碼。" },
|
||||
"failure": {
|
||||
"title": "本次執行失敗明細",
|
||||
"hint": "請依原因返回編輯器調整標註或重新確認盲測真值,再次執行。",
|
||||
"fieldMismatch": "{sample}:訂單欄位 {field} 的重新讀取值與人工真值不一致。",
|
||||
"fieldNeedsReview": "{sample}:訂單欄位 {field} 未達可確認狀態,請檢查錨點和座標範圍。",
|
||||
"fieldUnavailable": "{sample}:訂單欄位 {field} 未讀取到可用值,請檢查錨點、頁面和座標證據。",
|
||||
"coordinateEvidenceMissing": "{sample}:缺少表格或頁面座標證據,無法完成盲測。",
|
||||
"rowsMismatch": "{sample}:重新解析的訂單明細與人工真值不一致。",
|
||||
"unknown": "{sample}:盲測執行未通過,請檢查下方原始診斷碼。"
|
||||
},
|
||||
"run": "執行",
|
||||
"approve": "批准"
|
||||
},
|
||||
"workbench": {
|
||||
"boundHistoricalSchema": "已綁定歷史版本",
|
||||
"intro": "在受控文件頁面拖曳證據區域;儲存定義不含 HTML 或儲存位址。", "returnToLibrary": "返回文件範本",
|
||||
"intro": "在受控文件頁面拖曳證據區域;儲存定義不含 HTML 或儲存位址。",
|
||||
"returnToLibrary": "返回文件範本",
|
||||
"structure": "結構",
|
||||
"saveStatus": {
|
||||
"saved": "已儲存",
|
||||
@@ -3041,7 +3127,31 @@
|
||||
"acceptSuggestion": "接受",
|
||||
"acceptAdjustedSuggestion": "調整後接受",
|
||||
"rejectSuggestion": "拒絕",
|
||||
"suggestionAdjustmentField": "選擇替代欄位", "sampleValueUnavailable": "未讀取到值", "orderFieldValueReading": "讀取中", "orderFieldValueFailed": "讀取失敗", "currentSampleValue": "目前樣本值", "selectedRegion": "目前標註", "recognitionResults": "識別結果", "orderHeaderResults": "訂單表頭欄位", "orderLineResults": "訂單明細行欄位", "noRecognitionResults": "暫未讀取到結構化結果", "lineResultField": "第 {row} 行 · {field}", "previewState": { "idle": "等待識別", "updating": "正在識別", "ready": "已更新", "failed": "識別失敗" }, "evidenceStatus": { "read": "已讀取", "review": "需覆核", "loading": "讀取中", "failed": "讀取失敗", "deleted": "已刪除,不納入結果", "unavailable": "未讀取到值" },
|
||||
"suggestionAdjustmentField": "選擇替代欄位",
|
||||
"sampleValueUnavailable": "未讀取到值",
|
||||
"orderFieldValueReading": "讀取中",
|
||||
"orderFieldValueFailed": "讀取失敗",
|
||||
"currentSampleValue": "目前樣本值",
|
||||
"selectedRegion": "目前標註",
|
||||
"recognitionResults": "識別結果",
|
||||
"orderHeaderResults": "訂單表頭欄位",
|
||||
"orderLineResults": "訂單明細行欄位",
|
||||
"noRecognitionResults": "暫未讀取到結構化結果",
|
||||
"lineResultField": "第 {row} 行 · {field}",
|
||||
"previewState": {
|
||||
"idle": "等待識別",
|
||||
"updating": "正在識別",
|
||||
"ready": "已更新",
|
||||
"failed": "識別失敗"
|
||||
},
|
||||
"evidenceStatus": {
|
||||
"read": "已讀取",
|
||||
"review": "需覆核",
|
||||
"loading": "讀取中",
|
||||
"failed": "讀取失敗",
|
||||
"deleted": "已刪除,不納入結果",
|
||||
"unavailable": "未讀取到值"
|
||||
},
|
||||
"openCanvas": "建立草稿並開啟畫布",
|
||||
"loadingPage": "正在載入頁面…",
|
||||
"canvasZoom": "頁面縮放",
|
||||
@@ -3067,6 +3177,15 @@
|
||||
"drawHeader": "繪製表頭",
|
||||
"drawOrderField": "繪製訂單欄位",
|
||||
"drawOrderAnchor": "繪製訂單欄位標籤",
|
||||
"drawDocumentMatchAnchor": "繪製文件匹配錨點(先標籤,後固定值)",
|
||||
"drawDocumentMatchAnchorShortcut": "文件匹配錨點(M):先框標籤,再框固定值",
|
||||
"drawOrderAnchorShortcut": "訂單欄位標籤(A)",
|
||||
"drawOrderFieldShortcut": "訂單欄位(O)",
|
||||
"drawHeaderShortcut": "明細表頭(H)",
|
||||
"drawLineShortcut": "明細行項(L)",
|
||||
"drawFieldShortcut": "明細欄位(F)",
|
||||
"drawExclusionShortcut": "排除區域(X)",
|
||||
"autoSuggestShortcut": "自動標記(G)",
|
||||
"drawLine": "繪製實體行",
|
||||
"drawField": "繪製欄位",
|
||||
"drawExclusion": "繪製排除區",
|
||||
@@ -3101,6 +3220,13 @@
|
||||
"suggestedValue": "識別值",
|
||||
"orderAnchor": "訂單欄位標籤",
|
||||
"orderAnchorTool": "欄位標籤",
|
||||
"documentMatchAnchorTool": "匹配錨點",
|
||||
"documentMatchAnchorLabel": "匹配錨點標籤",
|
||||
"documentMatchAnchorValue": "匹配錨點值",
|
||||
"documentMatchAnchorHint": "從左側工具框選標籤和固定值;系統只使用框內文字匹配,不會命中備註中的相同文字。",
|
||||
"documentMatchAnchorEmpty": "請使用左側「匹配錨點」工具,先框選標籤,再框選固定值。",
|
||||
"documentMatchAnchorTextMissing": "框選區域未識別到文字;請調整框選範圍後重試。",
|
||||
"orderFieldAnchorNext": "已讀取欄位標籤,請框選欄位值。",
|
||||
"headerTool": "明細表頭",
|
||||
"lineTool": "明細行項",
|
||||
"fieldTool": "明細欄位",
|
||||
@@ -3288,5 +3414,100 @@
|
||||
"identity_rule_set": "客戶識別規則集",
|
||||
"identity_rule": "客戶識別規則"
|
||||
}
|
||||
},
|
||||
"shippingAudit": {
|
||||
"title": "運行與稽核",
|
||||
"subtitle": "依時間、操作者、Run/Task、事件類型查詢貨代統一稽核;詳情僅展示白名單前後差異,匯出受控且留痕。",
|
||||
"refresh": "重新整理",
|
||||
"export": "匯出 CSV",
|
||||
"exporting": "正在匯出...",
|
||||
"apply": "套用",
|
||||
"loading": "正在載入...",
|
||||
"empty": "暫無稽核事件",
|
||||
"loadFailed": "載入稽核列表失敗",
|
||||
"detailFailed": "載入稽核詳情失敗",
|
||||
"exportFailed": "匯出失敗",
|
||||
"detailTitle": "稽核詳情",
|
||||
"diff": "前後差異",
|
||||
"before": "變更前",
|
||||
"after": "變更後",
|
||||
"noDiff": "無可展示的白名單差異",
|
||||
"total": "共 {count} 條",
|
||||
"previous": "上一頁",
|
||||
"next": "下一頁",
|
||||
"filters": {
|
||||
"eventType": "事件類型",
|
||||
"actorType": "操作者類型",
|
||||
"runNo": "Run 編號",
|
||||
"taskNo": "Task 編號",
|
||||
"operationId": "operation_id",
|
||||
"q": "編號檢索",
|
||||
"all": "全部",
|
||||
"actorId": "操作者 ID",
|
||||
"documentId": "文件 ID",
|
||||
"conversationId": "會話 ID",
|
||||
"sessionItemId": "工作項編號",
|
||||
"reviewCaseNo": "覆核 Case",
|
||||
"ownerUserId": "屬主使用者 ID",
|
||||
"requestId": "request_id",
|
||||
"result": "結果",
|
||||
"createdFrom": "開始時間",
|
||||
"createdTo": "結束時間"
|
||||
},
|
||||
"columns": {
|
||||
"time": "時間",
|
||||
"event": "事件",
|
||||
"actor": "操作者",
|
||||
"run": "Run",
|
||||
"task": "Task",
|
||||
"result": "結果",
|
||||
"conversation": "會話",
|
||||
"sessionItem": "工作項",
|
||||
"reviewCase": "Case"
|
||||
}
|
||||
},
|
||||
"shippingReviewSupervision": {
|
||||
"title": "覆核監管台",
|
||||
"subtitle": "跨使用者檢視會話 PDF 工作項;終止或撤銷確認須填寫理由並二次確認。",
|
||||
"refresh": "重新整理",
|
||||
"apply": "套用篩選",
|
||||
"loading": "載入中...",
|
||||
"empty": "暫無工作項",
|
||||
"loadFailed": "載入監管清單失敗",
|
||||
"actionFailed": "操作失敗,請稍後重試",
|
||||
"terminate": "終止",
|
||||
"revoke": "撤銷確認",
|
||||
"terminateTitle": "終止工作項",
|
||||
"revokeTitle": "撤銷確認",
|
||||
"terminateImpact": "將強制關閉工作項 {itemNo},屬主將無法繼續覆核。",
|
||||
"revokeImpact": "將撤銷工作項 {itemNo} 的確認結果(24 小時內且未匹配庫存)。",
|
||||
"reasonLabel": "操作理由(必填)",
|
||||
"reasonRequired": "請填寫操作理由",
|
||||
"confirmTerminate": "我確認終止此工作項(CONFIRM_TERMINATE)",
|
||||
"confirmRevoke": "我確認撤銷此確認結果(CONFIRM_REVOKE)",
|
||||
"confirmRequired": "請勾選確認後再提交",
|
||||
"submit": "確認提交",
|
||||
"submitting": "提交中...",
|
||||
"terminateSuccess": "工作項已終止",
|
||||
"revokeSuccess": "確認已撤銷",
|
||||
"total": "共 {count} 條",
|
||||
"previous": "上一頁",
|
||||
"next": "下一頁",
|
||||
"filters": {
|
||||
"lifecycleStatus": "生命週期",
|
||||
"ownerUserId": "屬主使用者 ID",
|
||||
"conversationId": "會話 ID",
|
||||
"q": "編號檢索",
|
||||
"all": "全部"
|
||||
},
|
||||
"columns": {
|
||||
"itemNo": "工作項",
|
||||
"owner": "屬主",
|
||||
"conversation": "會話",
|
||||
"document": "目前 PDF",
|
||||
"status": "狀態",
|
||||
"updated": "更新時間",
|
||||
"actions": "操作"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,8 +109,16 @@
|
||||
"shortCode": "客戶簡稱",
|
||||
"site": "送貨站點",
|
||||
"statusLabel": "匹配狀態",
|
||||
"roles": { "bill_to": "帳款客戶", "ship_to": "送貨客戶" },
|
||||
"status": { "unmatched": "未匹配", "unique_candidate": "唯一候選", "ambiguous": "多個候選", "confirmed": "已確認" }
|
||||
"roles": {
|
||||
"bill_to": "帳款客戶",
|
||||
"ship_to": "送貨客戶"
|
||||
},
|
||||
"status": {
|
||||
"unmatched": "未匹配",
|
||||
"unique_candidate": "唯一候選",
|
||||
"ambiguous": "多個候選",
|
||||
"confirmed": "已確認"
|
||||
}
|
||||
},
|
||||
"shippingCandidateCount": "共 {count} 個訂單",
|
||||
"shippingCandidateReady": "可建單",
|
||||
@@ -138,12 +146,14 @@
|
||||
"completed": "已完成 {count}",
|
||||
"running": "處理中 {count}",
|
||||
"needsHuman": "需人工 {count}",
|
||||
"pendingConfirmation": "待確認 {count}",
|
||||
"failed": "失敗 {count}",
|
||||
"pending": "排隊 {count}",
|
||||
"empty": "上傳後將在此顯示本次任務進度。",
|
||||
"unnamedPdf": "未命名 PDF",
|
||||
"progressIndex": "{current}/{total}",
|
||||
"exception": "異常",
|
||||
"pendingConfirmationBadge": "待確認",
|
||||
"duplicateBadge": "重複",
|
||||
"openReview": "進入人工覆核",
|
||||
"openTask": "開啟任務處理",
|
||||
@@ -152,6 +162,7 @@
|
||||
"compactProgress": "{total} 個 PDF:{auto} 自動推進,{review} 需覆核,{failed} 失敗",
|
||||
"processNoticeProcessing": "正在處理附件,進度見右側「本次處理」",
|
||||
"processNoticeNeedsAction": "部分附件需人工處理,請查看右側「本次處理」",
|
||||
"processNoticeCandidateConfirmation": "訂單候選已生成,請在右側逐份人工確認",
|
||||
"processNoticeDuplicateLinked": "發現重複檔案,已關聯已有任務,請在右側查看",
|
||||
"processNoticeCompleted": "處理完成,詳情見右側「本次處理」",
|
||||
"processNoticeFailed": "處理失敗,可在右側重試或查看詳情",
|
||||
@@ -160,7 +171,77 @@
|
||||
"waitingUpload": "待人工上傳",
|
||||
"needsReview": "需人工覆核",
|
||||
"duplicateProcessing": "重複處理中",
|
||||
"existingTaskNo": "已有任務 {taskNo}"
|
||||
"existingTaskNo": "已有任務 {taskNo}",
|
||||
"cancelled": "已取消 {count}"
|
||||
},
|
||||
"shippingSessionWorkItem": {
|
||||
"status": {
|
||||
"pending_review": "待覆核",
|
||||
"extracting": "識別中",
|
||||
"reparse_failed": "重識別失敗",
|
||||
"closed": "已完成"
|
||||
},
|
||||
"versionLabel": "V{version}",
|
||||
"versionReplaced": "已產生新版本,舊版唯讀",
|
||||
"versionRestored": "已還原上一版本",
|
||||
"completedCollapsed": "已完成 {count} 項",
|
||||
"openOnlyFilter": "僅看待處理",
|
||||
"enterManualReview": "人工覆核",
|
||||
"viewVersionHistory": "版本歷史",
|
||||
"requestReparse": "重新識別",
|
||||
"markNonOrder": "標記非訂單",
|
||||
"replaceFile": "替換檔案",
|
||||
"cancelProcessing": "取消本次處理",
|
||||
"cancelReasonPrompt": "請填寫取消原因",
|
||||
"nonOrderReasonPrompt": "請填寫標記非訂單的原因",
|
||||
"reparseReasonPrompt": "請填寫重新識別的原因",
|
||||
"reasonRequired": "必須填寫原因後才能繼續",
|
||||
"caseRequired": "目前工作項缺少覆核 Case,請先進入人工覆核",
|
||||
"versionHistoryTitle": "版本歷史",
|
||||
"currentVersion": "目前",
|
||||
"readonlyVersion": "唯讀",
|
||||
"noVersions": "暫無版本記錄",
|
||||
"loading": "載入中…",
|
||||
"loadFailed": "載入工作項失敗",
|
||||
"closedReason": {
|
||||
"confirmed": "已確認建單",
|
||||
"non_order": "已標記非訂單",
|
||||
"user_cancelled": "使用者取消",
|
||||
"admin_terminated": "管理員終止"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionHandling": {
|
||||
"title": "待處理事項",
|
||||
"count": "{count} 項",
|
||||
"reasonPrefix": "原因:",
|
||||
"affectedPrefix": "影響對象:",
|
||||
"category": {
|
||||
"document_review": "PDF 需人工覆核",
|
||||
"candidate_missing_info": "訂單待補資訊",
|
||||
"candidate_conflict": "訂單存在衝突",
|
||||
"candidate_confirmation": "候選待人工確認",
|
||||
"technical_failure": "附件處理失敗",
|
||||
"auto_freeze_blocked": "自動凍結受阻",
|
||||
"budget_stopped": "首輪預算已用盡"
|
||||
},
|
||||
"primaryNotice": {
|
||||
"document_review": "部分 PDF 需人工覆核,請按下方事項處理",
|
||||
"candidate_missing_info": "訂單缺少必填資訊,請補全後確認",
|
||||
"candidate_conflict": "訂單存在衝突,請人工判定後繼續",
|
||||
"candidate_confirmation": "訂單候選已生成,請逐份人工確認",
|
||||
"technical_failure": "部分附件處理失敗,可重試或查看詳情",
|
||||
"auto_freeze_blocked": "自動凍結未通過門禁,請查看原因並處理",
|
||||
"budget_stopped": "首輪識別預算已用盡,請查看未處理附件"
|
||||
},
|
||||
"reason": {
|
||||
"profile_not_auto_freeze_approved": "模板未通過自動凍結資格審批",
|
||||
"multiple_profiles_detected": "偵測到多個模板,無法自動凍結",
|
||||
"profile_auto_freeze_qualification_missing": "缺少自動凍結資格設定",
|
||||
"profile_manual_confirmation_required": "模板要求人工確認後凍結",
|
||||
"auto_freeze_not_enabled": "本輪未啟用自動凍結",
|
||||
"auto_freeze_policy_missing": "缺少自動凍結策略",
|
||||
"budget_initial_limit": "已達首輪附件預算上限"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionCardTitle": {
|
||||
"queued": "訂單解析排隊中",
|
||||
@@ -177,11 +258,14 @@
|
||||
"shippingOrderExtractionFailed": "訂單解析失敗",
|
||||
"shippingOrderExtractionSummary": {
|
||||
"total": "共 {count} 個 PDF",
|
||||
"processing": "處理中 {count} 個",
|
||||
"completed": "成功 {count} 個",
|
||||
"completedProgress": "附件進度 {value}",
|
||||
"candidates": "候選 {count} 個",
|
||||
"reviewRequired": "需覆核 {count} 個",
|
||||
"failed": "失敗 {count} 個"
|
||||
"failed": "失敗 {count} 個",
|
||||
"cancelled": "已取消 {count} 個",
|
||||
"pending": "排隊 {count} 個"
|
||||
},
|
||||
"shippingOrderExtractionCurrentFile": "目前:{fileName}",
|
||||
"shippingOrderExtractionRefreshFailed": "暫時無法刷新狀態,系統仍會繼續處理。",
|
||||
@@ -229,7 +313,10 @@
|
||||
"technical_failed": "系統未能完成該附件處理。",
|
||||
"budget_stopped": "已達目前附件預算,剩餘附件等待人工覆核。",
|
||||
"run_completed": "本次訂單解析已完成。",
|
||||
"generic_processing": "系統正在處理訂單附件。"
|
||||
"generic_processing": "系統正在處理訂單附件。",
|
||||
"cancellation_requested": "已收到取消請求,正在安全停止。",
|
||||
"cancellation_completed": "取消已完成。",
|
||||
"unit_cancelled": "該附件已取消。"
|
||||
},
|
||||
"shippingOrderExtractionAction": {
|
||||
"view_details": "查看處理詳情",
|
||||
@@ -237,7 +324,10 @@
|
||||
"retry_failed_attachments": "重試失敗附件",
|
||||
"view_evidence": "查看證據",
|
||||
"review_candidate": "人工確認",
|
||||
"manual_review": "人工覆核"
|
||||
"manual_review": "人工覆核",
|
||||
"refresh_status": "重新整理狀態",
|
||||
"cancel_run": "取消本次識別",
|
||||
"cancel_unit": "取消此 PDF"
|
||||
},
|
||||
"shippingOrderExtractionDocumentStatus": {
|
||||
"pending": "等待處理",
|
||||
@@ -276,12 +366,23 @@
|
||||
"same_business_content": "業務內容與已有任務相同。",
|
||||
"duplicate_decision_required": "偵測到重複,需要人工決定如何處理。",
|
||||
"open_existing_reconciliation_required": "開啟已有任務前仍需核對欄位。",
|
||||
"field_conflict": "欄位存在衝突,需要人工確認。"
|
||||
"field_conflict": "欄位存在衝突,需要人工確認。",
|
||||
"SHIPPING_NOTICE": {
|
||||
"ORDER_EXTRACTION_JOB_FAILED": "訂單識別後台任務失敗。常見原因是附件版面解析未就緒,請確認版面服務已開啟後重試。",
|
||||
"ORDER_EXTRACTION_LAYOUT_SCHEDULING_FAILED": "訂單附件版面解析任務未能建立。請確認版面服務已開啟後重試。",
|
||||
"ORDER_EXTRACTION_LAYOUT_PREREQUISITE_FAILED": "訂單附件版面條件不完整,請重試或重新上傳附件。",
|
||||
"ORDER_EXTRACTION_LAYOUT_FAILED": "訂單附件版面解析失敗,請重試。",
|
||||
"ORDER_EXTRACTION_FAILED": "訂單識別失敗,請重試。",
|
||||
"ORDER_EXTRACTION_TIMEOUT": "訂單識別逾時,請稍後重試。"
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionPoNumber": "PO:{value}",
|
||||
"shippingOrderExtractionLineCount": "訂單行:{count}",
|
||||
"shippingOrderExtractionReviewDetail": "第 {line} 行:{field}需要補充或修正",
|
||||
"shippingOrderExtractionReviewField": { "qty": "數量", "unknown": "明細欄位" },
|
||||
"shippingOrderExtractionReviewField": {
|
||||
"qty": "數量",
|
||||
"unknown": "明細欄位"
|
||||
},
|
||||
"shippingOrderExtractionProfileSummary": "模板:{name} V{version}",
|
||||
"shippingOrderExtractionPlanSummary": "本輪從 {total} 個附件中規劃 {groups} 個訂單組,首輪最多識別 {attachments} 個附件,並發 {concurrency} 個。",
|
||||
"shippingOrderExtractionPlanSelected": "已選 {count} 個附件",
|
||||
@@ -860,7 +961,17 @@
|
||||
"empty": "暫無符合條件的資料"
|
||||
}
|
||||
},
|
||||
"shippingCustomer": { "title": "確認標準客戶", "subtitle": "請選擇管理員維護的正式客戶。解析名稱僅作為線索,不會自動綁定。", "searchPlaceholder": "搜尋客戶名稱或簡碼", "search": "搜尋", "empty": "未找到啟用客戶,請聯絡管理員維護客戶資料", "confirm": "確認客戶", "loadFailed": "載入客戶清單失敗", "confirmed": "標準客戶已確認", "confirmFailed": "確認客戶失敗" },
|
||||
"shippingCustomer": {
|
||||
"title": "確認標準客戶",
|
||||
"subtitle": "請選擇管理員維護的正式客戶。解析名稱僅作為線索,不會自動綁定。",
|
||||
"searchPlaceholder": "搜尋客戶名稱或簡碼",
|
||||
"search": "搜尋",
|
||||
"empty": "未找到啟用客戶,請聯絡管理員維護客戶資料",
|
||||
"confirm": "確認客戶",
|
||||
"loadFailed": "載入客戶清單失敗",
|
||||
"confirmed": "標準客戶已確認",
|
||||
"confirmFailed": "確認客戶失敗"
|
||||
},
|
||||
"training": {
|
||||
"badge": "員工培訓工作區",
|
||||
"title": "",
|
||||
@@ -1024,8 +1135,14 @@
|
||||
"管理端需要能匯出入職日期、完成日期、部門、姓名、工號和分數。"
|
||||
],
|
||||
"booleanOptions": [
|
||||
{ "id": "true", "label": "正確" },
|
||||
{ "id": "false", "label": "錯誤" }
|
||||
{
|
||||
"id": "true",
|
||||
"label": "正確"
|
||||
},
|
||||
{
|
||||
"id": "false",
|
||||
"label": "錯誤"
|
||||
}
|
||||
],
|
||||
"questionBank": [
|
||||
{
|
||||
@@ -1035,10 +1152,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "根據新人培訓試卷,工資固定在每月 15 號發放。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 8號" },
|
||||
{ "id": "b", "label": "B. 9號" },
|
||||
{ "id": "c", "label": "C. 15號" },
|
||||
{ "id": "d", "label": "D. 27號" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 8號"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 9號"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 15號"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. 27號"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1048,9 +1177,18 @@
|
||||
"answer": "b",
|
||||
"explanation": "公司餐廳訂餐使用中米新訂餐系統,不是 OA 或 ERP。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. OA" },
|
||||
{ "id": "b", "label": "B. 中米新訂餐系統" },
|
||||
{ "id": "c", "label": "C. ERP" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. OA"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 中米新訂餐系統"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. ERP"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1060,10 +1198,22 @@
|
||||
"answer": "abcd",
|
||||
"explanation": "試卷給出的四個選項都屬於公司產品範疇,前端以組合選項呈現為全選。",
|
||||
"options": [
|
||||
{ "id": "abcd", "label": "A/B/C/D 全部都是" },
|
||||
{ "id": "ab", "label": "A/B" },
|
||||
{ "id": "cd", "label": "C/D" },
|
||||
{ "id": "a", "label": "僅 A" }
|
||||
{
|
||||
"id": "abcd",
|
||||
"label": "A/B/C/D 全部都是"
|
||||
},
|
||||
{
|
||||
"id": "ab",
|
||||
"label": "A/B"
|
||||
},
|
||||
{
|
||||
"id": "cd",
|
||||
"label": "C/D"
|
||||
},
|
||||
{
|
||||
"id": "a",
|
||||
"label": "僅 A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1073,10 +1223,22 @@
|
||||
"answer": "c",
|
||||
"explanation": "請假必須發起 OA 請假申請單,不能使用加班申請單或聯絡單。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 加班申請單" },
|
||||
{ "id": "b", "label": "B. 聯絡單" },
|
||||
{ "id": "c", "label": "C. 請假申請單" },
|
||||
{ "id": "d", "label": "D. 員工需求單" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 加班申請單"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 聯絡單"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 請假申請單"
|
||||
},
|
||||
{
|
||||
"id": "d",
|
||||
"label": "D. 員工需求單"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1086,9 +1248,18 @@
|
||||
"answer": "a",
|
||||
"explanation": "QC080000 對應有害物質過程管理體系認證標準。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 有害物質過程管理體系認證標準" },
|
||||
{ "id": "b", "label": "B. 職業健康安全管理體系" },
|
||||
{ "id": "c", "label": "C. 環境管理體系" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 有害物質過程管理體系認證標準"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 職業健康安全管理體系"
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"label": "C. 環境管理體系"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1098,8 +1269,14 @@
|
||||
"answer": "a",
|
||||
"explanation": "5S 標準表述為整理、整頓、清掃、清潔和素養。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 整理、整頓、清掃、清潔和素養" },
|
||||
{ "id": "b", "label": "B. 整理、整頓、打掃、清潔和素養" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 整理、整頓、清掃、清潔和素養"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 整理、整頓、打掃、清潔和素養"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1109,26 +1286,280 @@
|
||||
"answer": "a",
|
||||
"explanation": "使用滅火器要站在上風口,避免煙霧與火勢倒灌。",
|
||||
"options": [
|
||||
{ "id": "a", "label": "A. 上風口" },
|
||||
{ "id": "b", "label": "B. 下風口" }
|
||||
{
|
||||
"id": "a",
|
||||
"label": "A. 上風口"
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"label": "B. 下風口"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "id": "q8", "type": "boolean", "prompt": "正常出勤必須打卡,加班需要提前申請提報。", "answer": "true", "explanation": "出勤與加班都需要遵循公司考勤制度。" },
|
||||
{ "id": "q9", "type": "boolean", "prompt": "忘記刷卡需要 OA 開補刷卡單。", "answer": "true", "explanation": "漏打卡需要透過 OA 補刷卡流程修正考勤記錄。" },
|
||||
{ "id": "q10", "type": "boolean", "prompt": "每月工資從上月 21 日至本月 20 日為止計算。", "answer": "true", "explanation": "試卷中明確了工資核算週期的起止時間。" },
|
||||
{ "id": "q11", "type": "boolean", "prompt": "餐廳用餐需提前預定,可以直接刷臉用餐。", "answer": "true", "explanation": "公司餐廳支援提前預定並刷臉用餐。" },
|
||||
{ "id": "q12", "type": "boolean", "prompt": "發生火災、爆炸事故時,應立即撥打 119。", "answer": "true", "explanation": "火災事故首先要聯絡消防,119 是基本應急要求。" },
|
||||
{ "id": "q13", "type": "boolean", "prompt": "住宿人員應保持高度防火意識,不准私拉亂接電線和使用高功率電器。", "answer": "true", "explanation": "宿舍防火是紅線要求,私拉電線和使用大功率電器都被禁止。" },
|
||||
{ "id": "q14", "type": "boolean", "prompt": "遵守安全生產規章制度是從業人員應履行的安全生產義務。", "answer": "true", "explanation": "安全制度不僅是要求,也是員工必須履行的義務。" },
|
||||
{ "id": "q15", "type": "boolean", "prompt": "工牌可以隨意借由他人使用。", "answer": "false", "explanation": "工牌屬於個人身份憑證,嚴禁外借。" },
|
||||
{ "id": "q16", "type": "boolean", "prompt": "RoHS 主要用於規範電子電氣產品的材料及工藝標準,使之更加有利於人體健康及環境保護。", "answer": "true", "explanation": "RoHS 的核心目標就是限制有害物質、降低環境與人體風險。" },
|
||||
{ "id": "q17", "type": "boolean", "prompt": "我們公司的 HSF 方針是:綠色設計,環保採購;節約資源,綠色產出。", "answer": "true", "explanation": "這是試卷給出的公司 HSF 方針原文。" },
|
||||
{ "id": "q18", "type": "boolean", "prompt": "EHS(Environment、Health、Safety)指環境健康安全。", "answer": "true", "explanation": "EHS 是環境、健康、安全三個維度的統一簡稱。" },
|
||||
{ "id": "q19", "type": "boolean", "prompt": "對於外來文件,組織不需對其進行控制與管理。", "answer": "false", "explanation": "外來文件同樣需要受控管理,確保版本與使用正確。" },
|
||||
{ "id": "q20", "type": "boolean", "prompt": "與產品有關的要求應包括有關法律法規規定的要求及顧客的要求等。", "answer": "true", "explanation": "產品要求必須同時覆蓋法規和客戶要求,這是品質體系基礎。" }
|
||||
{
|
||||
"id": "q8",
|
||||
"type": "boolean",
|
||||
"prompt": "正常出勤必須打卡,加班需要提前申請提報。",
|
||||
"answer": "true",
|
||||
"explanation": "出勤與加班都需要遵循公司考勤制度。"
|
||||
},
|
||||
{
|
||||
"id": "q9",
|
||||
"type": "boolean",
|
||||
"prompt": "忘記刷卡需要 OA 開補刷卡單。",
|
||||
"answer": "true",
|
||||
"explanation": "漏打卡需要透過 OA 補刷卡流程修正考勤記錄。"
|
||||
},
|
||||
{
|
||||
"id": "q10",
|
||||
"type": "boolean",
|
||||
"prompt": "每月工資從上月 21 日至本月 20 日為止計算。",
|
||||
"answer": "true",
|
||||
"explanation": "試卷中明確了工資核算週期的起止時間。"
|
||||
},
|
||||
{
|
||||
"id": "q11",
|
||||
"type": "boolean",
|
||||
"prompt": "餐廳用餐需提前預定,可以直接刷臉用餐。",
|
||||
"answer": "true",
|
||||
"explanation": "公司餐廳支援提前預定並刷臉用餐。"
|
||||
},
|
||||
{
|
||||
"id": "q12",
|
||||
"type": "boolean",
|
||||
"prompt": "發生火災、爆炸事故時,應立即撥打 119。",
|
||||
"answer": "true",
|
||||
"explanation": "火災事故首先要聯絡消防,119 是基本應急要求。"
|
||||
},
|
||||
{
|
||||
"id": "q13",
|
||||
"type": "boolean",
|
||||
"prompt": "住宿人員應保持高度防火意識,不准私拉亂接電線和使用高功率電器。",
|
||||
"answer": "true",
|
||||
"explanation": "宿舍防火是紅線要求,私拉電線和使用大功率電器都被禁止。"
|
||||
},
|
||||
{
|
||||
"id": "q14",
|
||||
"type": "boolean",
|
||||
"prompt": "遵守安全生產規章制度是從業人員應履行的安全生產義務。",
|
||||
"answer": "true",
|
||||
"explanation": "安全制度不僅是要求,也是員工必須履行的義務。"
|
||||
},
|
||||
{
|
||||
"id": "q15",
|
||||
"type": "boolean",
|
||||
"prompt": "工牌可以隨意借由他人使用。",
|
||||
"answer": "false",
|
||||
"explanation": "工牌屬於個人身份憑證,嚴禁外借。"
|
||||
},
|
||||
{
|
||||
"id": "q16",
|
||||
"type": "boolean",
|
||||
"prompt": "RoHS 主要用於規範電子電氣產品的材料及工藝標準,使之更加有利於人體健康及環境保護。",
|
||||
"answer": "true",
|
||||
"explanation": "RoHS 的核心目標就是限制有害物質、降低環境與人體風險。"
|
||||
},
|
||||
{
|
||||
"id": "q17",
|
||||
"type": "boolean",
|
||||
"prompt": "我們公司的 HSF 方針是:綠色設計,環保採購;節約資源,綠色產出。",
|
||||
"answer": "true",
|
||||
"explanation": "這是試卷給出的公司 HSF 方針原文。"
|
||||
},
|
||||
{
|
||||
"id": "q18",
|
||||
"type": "boolean",
|
||||
"prompt": "EHS(Environment、Health、Safety)指環境健康安全。",
|
||||
"answer": "true",
|
||||
"explanation": "EHS 是環境、健康、安全三個維度的統一簡稱。"
|
||||
},
|
||||
{
|
||||
"id": "q19",
|
||||
"type": "boolean",
|
||||
"prompt": "對於外來文件,組織不需對其進行控制與管理。",
|
||||
"answer": "false",
|
||||
"explanation": "外來文件同樣需要受控管理,確保版本與使用正確。"
|
||||
},
|
||||
{
|
||||
"id": "q20",
|
||||
"type": "boolean",
|
||||
"prompt": "與產品有關的要求應包括有關法律法規規定的要求及顧客的要求等。",
|
||||
"answer": "true",
|
||||
"explanation": "產品要求必須同時覆蓋法規和客戶要求,這是品質體系基礎。"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shippingOrderReview": {
|
||||
"title": "訂單人工覆核", "run": "識別批次 {runNo}", "back": "返回對話", "readOnly": "唯讀預覽", "loading": "正在載入覆核結果...", "unavailable": "暫時無法載入覆核結果,請稍後再試。", "documentNavigation": "PDF 導覽", "documents": "PDF 檔案", "unnamedDocument": "未命名 PDF", "caseStatus": "{status} · {count} 個問題", "previewTitle": "PDF 預覽", "previewLoading": "正在載入 PDF 預覽...", "previewUnavailable": "PDF 預覽不可用,草稿編輯不受影響。", "evidenceSummary": "選擇欄位旁的定位圖示即可查看證據。", "evidenceAt": "PDF 第 {page} 頁", "evidenceNoHighlight": "此證據沒有可靠座標,僅提供頁碼與引文,不顯示虛假高亮。", "viewEvidence": "查看證據", "orderFields": "訂單欄位", "schemaVersion": "凍結 Schema #{version}", "issues": "待處理問題", "machineSource": "來源:機器識別", "manualSource": "來源:人工修改", "restoreMachine": "恢復機器值", "saved": "已儲存", "saving": "儲存中", "saveFailed": "儲存失敗", "saveNow": "立即儲存並驗證", "addLine": "新增行", "copyLine": "複製行", "deleteLine": "刪除行", "noMachineOrder": "未識別到可信訂單。", "lines": "訂單明細", "line": "第 {index} 行", "noLines": "未識別到訂單明細。", "moreFields": "更多訂單資訊({count})", "emptyValue": "未提供", "unknownField": "訂單欄位", "createManualDraft": "手動建立訂單草稿", "markNonOrder": "標記為非訂單", "markQualityIssue": "檔案品質異常", "reparse": "重新識別此 PDF", "uploadReplacement": "上傳替代 PDF", "confirmCreate": "確認並建立任務", "confirmPrompt": "確認後將凍結目前草稿並建立獨立任務,且無法繼續編輯。是否繼續?", "confirmSuccess": "已建立任務 {taskNo}", "confirmAutoProgress": "已建立任務 {taskNo},已進入自動推進"
|
||||
"title": "訂單人工覆核",
|
||||
"run": "識別批次 {runNo}",
|
||||
"back": "返回對話",
|
||||
"readOnly": "唯讀預覽",
|
||||
"loading": "正在載入覆核結果...",
|
||||
"unavailable": "暫時無法載入覆核結果,請稍後再試。",
|
||||
"documentNavigation": "PDF 導覽",
|
||||
"documents": "PDF 檔案",
|
||||
"unnamedDocument": "未命名 PDF",
|
||||
"caseStatus": "{status} · {count} 個問題",
|
||||
"caseStatuses": {
|
||||
"unreviewed": "待處理",
|
||||
"draft": "草稿待完善",
|
||||
"ready": "可確認",
|
||||
"confirmed": "已建立任務",
|
||||
"non_order": "已標記非訂單",
|
||||
"quality_issue": "檔案品質異常",
|
||||
"reparse_pending": "正在重新識別",
|
||||
"superseded": "已由新版結果替代",
|
||||
"unknown": "狀態未知"
|
||||
},
|
||||
"previewTitle": "PDF 預覽",
|
||||
"previewLoading": "正在載入 PDF 預覽...",
|
||||
"previewUnavailable": "PDF 預覽不可用,草稿編輯不受影響。",
|
||||
"previewCollapsed": "此證據只有頁碼和引文,沒有可靠座標;已收起 PDF 預覽。",
|
||||
"expandPreview": "展開 PDF 預覽",
|
||||
"evidenceSummary": "選擇欄位旁的定位圖示即可查看證據。",
|
||||
"evidenceAt": "PDF 第 {page} 頁",
|
||||
"evidenceNoHighlight": "此證據沒有可靠座標,僅提供頁碼與引文,不顯示虛假高亮。",
|
||||
"viewEvidence": "查看證據",
|
||||
"locateSource": "定位原文:{field}",
|
||||
"orderFields": "訂單欄位",
|
||||
"schemaVersion": "凍結 Schema #{version}",
|
||||
"issues": "待處理問題",
|
||||
"machineSource": "來源:機器識別",
|
||||
"manualSource": "來源:人工修改",
|
||||
"restoreMachine": "恢復機器值",
|
||||
"saved": "已儲存",
|
||||
"saving": "儲存中",
|
||||
"saveFailed": "儲存失敗",
|
||||
"saveNow": "立即儲存並驗證",
|
||||
"addLine": "新增行",
|
||||
"copyLine": "複製行",
|
||||
"deleteLine": "刪除行",
|
||||
"noMachineOrder": "機器識別結果待人工確認,可建立草稿進行修正。",
|
||||
"lines": "訂單明細",
|
||||
"line": "第 {index} 行",
|
||||
"noLines": "未識別到訂單明細。",
|
||||
"moreFields": "更多訂單資訊({count})",
|
||||
"emptyValue": "未提供",
|
||||
"unknownField": "訂單欄位",
|
||||
"createManualDraft": "手動建立訂單草稿",
|
||||
"markNonOrder": "標記為非訂單",
|
||||
"markQualityIssue": "檔案品質異常",
|
||||
"reparse": "重新識別此 PDF",
|
||||
"uploadReplacement": "上傳替代 PDF",
|
||||
"confirmCreate": "確認並建立任務",
|
||||
"confirmPrompt": "確認後將凍結目前草稿並建立獨立任務,且無法繼續編輯。是否繼續?",
|
||||
"confirmSuccess": "已建立任務 {taskNo}",
|
||||
"confirmAutoProgress": "已建立任務 {taskNo},已進入自動推進",
|
||||
"autoProgress": {
|
||||
"result": "自動推進結果:{status}",
|
||||
"checkpoint": "目前檢查點:{checkpoint}",
|
||||
"viewTask": "查看訂單進度",
|
||||
"status": {
|
||||
"ok": "已完成目前可自動執行步驟",
|
||||
"running": "正在處理中",
|
||||
"needs_human": "需要人工處理",
|
||||
"failed": "自動推進失敗",
|
||||
"unknown": "狀態待確認"
|
||||
}
|
||||
},
|
||||
"backToSession": "返回本次處理",
|
||||
"workItemHeader": "工作項 {itemNo} · {version}",
|
||||
"jumpToCurrentVersion": "跳轉目前版本",
|
||||
"showContext": "對話上下文",
|
||||
"hideContext": "收起對話上下文",
|
||||
"contextTitle": "對話上下文",
|
||||
"contextDesc": "目前會話中最近的訂單抽取訊息。",
|
||||
"contextUser": "使用者",
|
||||
"contextAi": "AI",
|
||||
"statusBanner": {
|
||||
"superseded": "您正在查看歷史版本,目前版本已更新;編輯與確認已停用。",
|
||||
"reparse_in_progress": "此 PDF 正在重新識別,請等待完成後繼續覆核。",
|
||||
"restored": "重識別失敗已恢復上一版本,可繼續編輯。"
|
||||
},
|
||||
"versionHistory": {
|
||||
"title": "版本歷史",
|
||||
"itemNo": "工作項 {itemNo}",
|
||||
"result": "結果",
|
||||
"createdAt": "建立時間",
|
||||
"confirmedAt": "確認時間",
|
||||
"viewReadonly": "唯讀查看",
|
||||
"open": "開啟"
|
||||
},
|
||||
"confirmDialog": {
|
||||
"reasonLabel": "原因(必填)",
|
||||
"reasonPlaceholder": "請說明操作原因...",
|
||||
"reasonRequired": "請填寫原因",
|
||||
"confirm": {
|
||||
"title": "確認並建立任務",
|
||||
"impact": "確認後將凍結目前草稿並建立獨立任務,且無法繼續編輯。",
|
||||
"confirm": "確認建單"
|
||||
},
|
||||
"reparse": {
|
||||
"title": "重新識別此 PDF",
|
||||
"impact": "將建立新的識別批次;目前版本將變為唯讀歷史。",
|
||||
"confirm": "開始重識別"
|
||||
},
|
||||
"non_order": {
|
||||
"title": "標記為非訂單",
|
||||
"impact": "關閉此 PDF 工作項並標記為非訂單,不可恢復為可確認狀態。",
|
||||
"confirm": "確認標記"
|
||||
},
|
||||
"replace": {
|
||||
"title": "上傳替代 PDF",
|
||||
"impact": "將以新 PDF 替代目前文件並觸發重新識別;目前版本將變為唯讀。",
|
||||
"confirm": "確認上傳"
|
||||
},
|
||||
"reasonCodeLabel": "原因類型",
|
||||
"reasonCodeRequired": "請選擇原因類型",
|
||||
"quality_issue": {
|
||||
"title": "標記檔案品質異常",
|
||||
"impact": "保留目前 PDF、草稿與機器識別結果,供補件或重新識別;須選擇原因並在選擇「其他」時填寫說明。",
|
||||
"confirm": "確認標記"
|
||||
},
|
||||
"qualityReasons": {
|
||||
"blurred": "影像模糊",
|
||||
"incomplete_pages": "頁碼不全",
|
||||
"password_protected": "受密碼保護",
|
||||
"corrupted": "檔案損壞",
|
||||
"wrong_orientation": "方向錯誤",
|
||||
"unsupported_layout": "版式不支援",
|
||||
"missing_order_table": "缺少訂單表格",
|
||||
"other": "其他(須填寫說明)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"shippingOrderExtractionElapsed": "已用時 {elapsed}",
|
||||
"shippingOrderExtractionQueuePosition": "佇列第 {position} 位",
|
||||
"shippingOrderExtractionRefreshing": "正在重新整理...",
|
||||
"shippingOrderExtractionUserStage": {
|
||||
"pending": "等待處理",
|
||||
"document_queued": "已入佇列,等待處理",
|
||||
"waiting_layout": "等待版面解析",
|
||||
"layout_parsing_started": "正在解析版面",
|
||||
"routing": "分析文件結構中",
|
||||
"matching_profile": "匹配訂單範本中",
|
||||
"extracting": "提取訂單欄位中",
|
||||
"merging_supplement": "合併正文補充資訊中",
|
||||
"candidate_ready": "候選已產生",
|
||||
"review_required": "需要人工覆核",
|
||||
"technical_retrying": "系統正在重試",
|
||||
"failed": "處理失敗",
|
||||
"cancellation_requested": "正在取消…",
|
||||
"cancelled": "已取消",
|
||||
"completed": "已完成"
|
||||
},
|
||||
"shippingOrderExtractionHealthTip": {
|
||||
"processing_slow": "處理時間偏長,系統仍在繼續,可稍後重新整理。",
|
||||
"queue_backlog": "前方排隊較多,請稍候。",
|
||||
"processing_attention": "處理時間較長,如持續無進展可聯繫管理員。"
|
||||
},
|
||||
"shippingOrderExtractionCancel": {
|
||||
"confirmTitle": "確認取消本次識別?",
|
||||
"confirmImpact": "排隊中的附件將立即取消;正在處理的附件會在安全點停止。已完成結果會保留。",
|
||||
"reasonRequired": "請填寫取消原因",
|
||||
"reasonOptional": "可選:填寫取消原因",
|
||||
"submitting": "正在提交取消…",
|
||||
"dismiss": "暫不取消",
|
||||
"failed": "取消請求失敗,請稍後重試。"
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,15 @@
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_NOT_RETRYABLE": "只有識別失敗的訂單任務可以重新識別。",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_RUN_SNAPSHOT_OBSOLETE": "此識別任務使用舊版輸入契約,無法重試。請重新傳送郵件及附件以開始新的識別。",
|
||||
"SHIPPING_NOTICE.ORDER_EXTRACTION_CONVERSATION_ACTIVE": "目前對話已有訂單識別任務正在處理,請等待完成後再繼續。",
|
||||
"SHIPPING_NOTICE.CANCEL_FORBIDDEN": "無權取消該訂單識別任務。",
|
||||
"SHIPPING_NOTICE.CANCEL_REASON_REQUIRED": "取消他人任務時必須填寫原因。",
|
||||
"SHIPPING_NOTICE.CANCEL_NOT_ACTIVE": "該任務已結束或不可取消。",
|
||||
"SHIPPING_NOTICE.CANCEL_CONFLICT": "取消請求與目前進度衝突,請重新整理後重試。",
|
||||
"SHIPPING_NOTICE.CANCEL_FEATURE_DISABLED": "訂單識別取消功能已關閉,請聯繫管理員。",
|
||||
"SHIPPING_NOTICE.AUDIT_EXPORT_FEATURE_DISABLED": "稽核匯出功能已關閉,請聯繫管理員。",
|
||||
"SHIPPING_NOTICE.AUDIT_PERSIST_FAILED": "稽核記錄寫入失敗,操作未完成,請稍後重試。",
|
||||
"SHIPPING_NOTICE.AUDIT_METADATA_FORBIDDEN": "稽核寫入包含禁止的敏感欄位。",
|
||||
"SHIPPING_NOTICE.AUDIT_SNAPSHOT_FORBIDDEN": "稽核快照包含禁止的敏感欄位。",
|
||||
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "尚未初始化訂單範本。",
|
||||
"SHIPPING_ORDER_SCHEMA_EXISTS": "訂單範本已存在。",
|
||||
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "已有訂單範本草稿,請先完成或發布目前草稿。",
|
||||
@@ -378,6 +387,7 @@
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_REQUIRED": "確認建單缺少冪等鍵,請重試。",
|
||||
"SHIPPING_REVIEW_IDEMPOTENCY_KEY_CONFLICT": "確認請求衝突,請重新整理後再試。",
|
||||
"SHIPPING_REVIEW_CONFIRM_VALIDATION_FAILED": "草稿尚未通過完整驗證,不能確認建單。",
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "覆核 PDF 已不可用,不能確認建單。"
|
||||
"SHIPPING_REVIEW_CONFIRM_DOCUMENT_INVALID": "覆核 PDF 已不可用,不能確認建單。",
|
||||
"SHIPPING_REVIEW_QUALITY_COMMENT_REQUIRED": "選擇「其他」時必須填寫品質異常說明。"
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,12 @@
|
||||
"archived": "已歸檔"
|
||||
},
|
||||
"disposition": {
|
||||
"actions": { "delete": "刪除", "archive": "歸檔", "restore": "恢復", "purge": "永久刪除" },
|
||||
"actions": {
|
||||
"delete": "刪除",
|
||||
"archive": "歸檔",
|
||||
"restore": "恢復",
|
||||
"purge": "永久刪除"
|
||||
},
|
||||
"reasonPrompt": "請輸入刪除/作廢原因:",
|
||||
"purgeReasonPrompt": "請輸入永久刪除原因(僅管理員且僅純誤建任務可執行):",
|
||||
"confirm": "確認{action}選取的 {count} 個任務嗎?",
|
||||
@@ -377,6 +382,25 @@
|
||||
"uploaded": "已上傳貨代",
|
||||
"upload_failed": "上傳貨代失敗",
|
||||
"backend_orchestrator_task_finished": "後台任務已完成"
|
||||
},
|
||||
"myRuns": {
|
||||
"title": "我的識別",
|
||||
"subtitle": "查看處理中、失敗、已取消的訂單識別任務,並可返回會話續辦。",
|
||||
"status": "狀態",
|
||||
"allStatuses": "全部狀態",
|
||||
"runNo": "識別編號",
|
||||
"stage": "目前階段",
|
||||
"summary": "附件進度",
|
||||
"summaryCounts": "共 {total}:完成 {done} / 覆核 {review} / 失敗 {failed} / 取消 {cancelled}",
|
||||
"elapsed": "已用時",
|
||||
"actions": "操作",
|
||||
"openChat": "開啟會話",
|
||||
"loading": "正在載入識別任務...",
|
||||
"empty": "暫無識別任務",
|
||||
"loadFailed": "載入識別任務失敗",
|
||||
"total": "共 {count} 條",
|
||||
"previous": "上一頁",
|
||||
"next": "下一頁"
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
|
||||
Reference in new issue
Block a user