From 737040fc3a64133694cf869e833932d4db8c4826 Mon Sep 17 00:00:00 2001 From: wren Date: Wed, 18 Mar 2026 21:53:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(constants):=20=E6=B7=BB=E5=8A=A0=E5=90=88?= =?UTF-8?q?=E5=90=8C=E7=B1=BB=E5=9E=8B=E5=B8=B8=E9=87=8F=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/contractTypes.ts | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/constants/contractTypes.ts diff --git a/app/constants/contractTypes.ts b/app/constants/contractTypes.ts new file mode 100644 index 0000000..15b09d5 --- /dev/null +++ b/app/constants/contractTypes.ts @@ -0,0 +1,43 @@ +/** + * 合同专属类型定义 + * 用于用户上传时手动选择,后端据此加载对应评查点规则 + */ +export interface ContractType { + value: string; // 类型代码,传递给后端 + label: string; // 显示名称 +} + +/** + * 支持的合同类型列表 + * + * 注意:"通用"类型会加载所有通用评查点 + * 其他类型会加载 "通用 + 该类型" 的评查点 + */ +export const CONTRACT_TYPES: ContractType[] = [ + { value: "通用", label: "通用合同" }, + { value: "技术", label: "技术合同" }, + { value: "租赁", label: "租赁合同" }, + { value: "买卖", label: "买卖合同" }, + { value: "服务", label: "服务合同" }, + { value: "委托", label: "委托合同" }, + { value: "建设工程", label: "建设工程合同" }, + { value: "培训", label: "培训合同" }, + { value: "赠与", label: "赠与合同" }, + { value: "运输", label: "运输合同" }, + { value: "仓储", label: "仓储合同" }, + { value: "合作", label: "合作合同" }, + { value: "承揽", label: "承揽合同" } +]; + +/** + * 根据值获取标签 + */ +export function getContractTypeLabel(value: string): string { + const type = CONTRACT_TYPES.find(t => t.value === value); + return type?.label || value; +} + +/** + * 默认合同类型(用于初始值) + */ +export const DEFAULT_CONTRACT_TYPE = "通用";