feat(i18n): 将前端用户可见中文硬编码改为四语言

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
sophieandCursor committed 2026-07-30 14:39:16 +08:00
1 parent dce915ea30
commit ac7b53a523
105 files changed
+2928 -647

No files matched your search

@@ -1,7 +1,7 @@
/**
* features/admin/modules/procurement-contract/ProcurementContractPage.vue
* 用途:采购合同审查管理——模板库 / 风险规则 / 审查历史(Tab),含鉴权下载。
* 依赖:procurement-contract.api、ContractRiskRulesPanel、DeleteConfirmDialog、useMessage、vue-i18n。
* 依赖:procurement-contract.api、contract-ocr-match-tokens、ContractRiskRulesPanel、DeleteConfirmDialog、useMessage、vue-i18n。
* 逻辑:Admin 路由挂载;会话 Agent 读模板列表走 /api/procurement-contract。
*/
<script setup lang="ts">
@@ -27,6 +27,7 @@ import {
type ContractReviewRow,
type ContractTemplateRow,
} from '@/features/admin/api/procurement-contract.api';
import { V4_REGION_CONFIG } from './contract-ocr-match-tokens';
import ContractRiskRulesPanel from './components/ContractRiskRulesPanel.vue';
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
import { useMessage } from '@/shared/composables/useMessage';
@@ -44,7 +45,7 @@ const reviewTotal = ref(0);
const showUpload = ref(false);
const uploading = ref(false);
const editingTemplate = ref<ContractTemplateRow | null>(null);
const uploadName = ref('标准采购合同');
const uploadName = ref(t('admin.procurementContract.defaultTemplateName'));
const uploadVersion = ref('V1.0');
const uploadStatus = ref<'enabled' | 'disabled'>('enabled');
const uploadDefault = ref(false);
@@ -89,14 +90,6 @@ const regionSignatureTerms = ref('');
const regionAttachmentStart = ref('');
let reviewFilterTimer: ReturnType<typeof setTimeout> | undefined;
const V4_REGION_CONFIG: ContractComparisonRegionConfig = {
metadata_fields: ['contract_no', 'buyer', 'seller', 'version'],
body_start_anchors: ['兹因甲方向乙方购买设备'],
body_end_anchors: ['本合同一式两份', '以下无正文', '本页以下无正文'],
signature_terms: ['甲方', '乙方', '盖章', '签署日期', '合同专用章'],
attachment_start_anchors: ['附件', '性能需求表', '技术协议', '设备配置清单'],
attachment_policy: 'page_count_only',
};
const metadataFieldOptions: ContractMetadataField[] = ['contract_no', 'buyer', 'seller', 'version'];
/**
@@ -172,7 +165,7 @@ async function switchTab(next: 'templates' | 'rules' | 'reviews'): Promise<void>
*/
function resetUploadForm(): void {
editingTemplate.value = null;
uploadName.value = '标准采购合同';
uploadName.value = t('admin.procurementContract.defaultTemplateName');
uploadVersion.value = 'V1.0';
uploadStatus.value = 'enabled';
uploadDefault.value = false;
@@ -0,0 +1,20 @@
/**
* features/admin/modules/procurement-contract/contract-ocr-match-tokens.ts
* 用途:采购合同比对区域的 V4 默认 OCR/正文匹配锚点与签章关键词(检测用 token,非 UI 文案)。
* 依赖:procurement-contract.api 的 ContractComparisonRegionConfig 类型。
* 逻辑:ProcurementContractPage「恢复 V4 默认配置」与新建区域配置时引用;勿当作 i18n 展示文案。
*
* NOTE: Strings below are OCR match tokens for Chinese contract PDFs. Keep them in Chinese
* regardless of UI locale so region recognition against Chinese source documents still works.
*/
import type { ContractComparisonRegionConfig } from '@/features/admin/api/procurement-contract.api';
/** V4 默认比对区域配置(锚点/关键词为中文 OCR 匹配 token)。 */
export const V4_REGION_CONFIG: ContractComparisonRegionConfig = {
metadata_fields: ['contract_no', 'buyer', 'seller', 'version'],
body_start_anchors: ['兹因甲方向乙方购买设备'],
body_end_anchors: ['本合同一式两份', '以下无正文', '本页以下无正文'],
signature_terms: ['甲方', '乙方', '盖章', '签署日期', '合同专用章'],
attachment_start_anchors: ['附件', '性能需求表', '技术协议', '设备配置清单'],
attachment_policy: 'page_count_only',
};