报价模板下线分类字段,匹配只靠业务类型与关键词;并补后台站点标题配置。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-09-15 14:31:52 +08:00
co-authored by Cursor
parent 0a3c74e3a1
commit 235ecd8c83
10 changed files with 45 additions and 117 deletions
@@ -3,11 +3,14 @@
* placeholderCount 语义改为 mappingPointCount(映射点数)。
*/
/**
* 列表行类型。分类字段已从运营页移除(筛选项/列/表单均不展示);
* 主账库仍可存 category,由服务端按业务默认,前端不再读写。
*/
export type TemplateRow = {
id: string;
name: string;
bizType: "空运" | "海运" | "陆运";
category: string;
fileLabel: string;
fileName: string;
format: "excel" | "pdf";
@@ -28,34 +31,6 @@ export type TemplateRow = {
objectKey?: string;
};
/** 业务 → 分类(与 contracts/quote-template-mapping-v1.json 一致) */
export const CATEGORY_BY_BIZ: Record<TemplateRow["bizType"], string[]> = {
海运: ["海运报价单模板"],
空运: ["空运到港报价单模板", "空运到门报价单模板"],
陆运: [
"双清或中越",
"国内整车",
"国内拼车",
"跨境整车",
"跨境集拼",
"中港",
"凭祥保税仓&普仓仓储",
],
};
export const ALL_CATEGORIES = [
"空运到港报价单模板",
"空运到门报价单模板",
"海运报价单模板",
"双清或中越",
"国内整车",
"国内拼车",
"跨境整车",
"跨境集拼",
"中港",
"凭祥保税仓&普仓仓储",
];
/** 将主账 list 记录规范为页面行 */
export function mapApiRow(raw: any): TemplateRow {
const created =
@@ -68,7 +43,6 @@ export function mapApiRow(raw: any): TemplateRow {
id: String(raw.id || ""),
name: raw.name || "",
bizType: (raw.bizType || "海运") as TemplateRow["bizType"],
category: raw.category || "",
fileLabel: raw.fileLabel || raw.name || "",
fileName: raw.fileName || "",
format: raw.format === "pdf" ? "pdf" : "excel",