diff --git a/inquiry-agent/agent/quote_templates/__init__.py b/inquiry-agent/agent/quote_templates/__init__.py index 05ff1f9..fb8b063 100644 --- a/inquiry-agent/agent/quote_templates/__init__.py +++ b/inquiry-agent/agent/quote_templates/__init__.py @@ -34,7 +34,6 @@ class TemplateEntry: version_id: str = "" mapping_json: str = "" biz_type: str = "" - category: str = "" keywords: tuple[str, ...] = () is_default: bool = False @@ -94,7 +93,6 @@ def entries_from_ledger_response(resp: LedgerResponse) -> list[TemplateEntry]: version_id=str(it.get("versionId") or ""), mapping_json=str(it.get("mappingJson") or ""), biz_type=str(it.get("bizType") or ""), - category=str(it.get("category") or ""), keywords=tuple(str(x) for x in (it.get("keywords") or []) if str(x).strip()), is_default=bool(it.get("isDefault")), ) @@ -155,7 +153,6 @@ def registry_as_dicts() -> list[dict[str, Any]]: "template_id": e.template_id, "version_no": e.version_no, "biz_type": e.biz_type, - "category": e.category, } for e in list_template_registry() ] diff --git a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/controller/InquiryQuoteTemplateController.java b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/controller/InquiryQuoteTemplateController.java index e374ab7..6ef2290 100644 --- a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/controller/InquiryQuoteTemplateController.java +++ b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/controller/InquiryQuoteTemplateController.java @@ -50,11 +50,10 @@ public class InquiryQuoteTemplateController { @GetMapping("/list") public Result>> list(@RequestParam(required = false) String keyword, @RequestParam(required = false) String bizType, - @RequestParam(required = false) String category, @RequestParam(required = false) String status, @RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "20") Integer pageSize) { - return Result.OK(quoteTemplateService.pageWithVersion(keyword, bizType, category, status, pageNo, pageSize)); + return Result.OK(quoteTemplateService.pageWithVersion(keyword, bizType, status, pageNo, pageSize)); } @AutoLog(value = "报价模板-上传版本") @@ -64,13 +63,12 @@ public class InquiryQuoteTemplateController { public Result> upload(@RequestParam(required = false) String templateId, @RequestParam(required = false) String name, @RequestParam(required = false) String bizType, - @RequestParam(required = false) String category, @RequestParam(required = false) String keywordsJson, @RequestParam(required = false, defaultValue = "auto") String mode, @RequestParam(required = false, defaultValue = "false") Boolean isDefault, @RequestParam("file") MultipartFile file) { Map row = quoteTemplateService.uploadVersion( - templateId, name, bizType, category, keywordsJson, mode, + templateId, name, bizType, keywordsJson, mode, Boolean.TRUE.equals(isDefault), file, currentUser()); return Result.OK(row); } @@ -136,7 +134,7 @@ public class InquiryQuoteTemplateController { return Result.OK(quoteTemplateService.getById(id)); } - @ApiOperation("编辑逻辑头(名称/分类/关键词/模式,不换文件)") + @ApiOperation("编辑逻辑头(名称/业务/关键词/模式,不换文件)") @RequiresPermissions("inquiry:template:edit") @PutMapping("/editMeta") public Result editMeta(@RequestBody InquiryQuoteTemplate body) { @@ -153,9 +151,6 @@ public class InquiryQuoteTemplateController { if (StringUtils.isNotBlank(body.getBizType())) { db.setBizType(body.getBizType()); } - if (StringUtils.isNotBlank(body.getCategory())) { - db.setCategory(body.getCategory()); - } if (StringUtils.isNotBlank(body.getKeywordsJson())) { db.setKeywordsJson(body.getKeywordsJson()); } diff --git a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/entity/InquiryQuoteTemplate.java b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/entity/InquiryQuoteTemplate.java index 7d1706e..9f08546 100644 --- a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/entity/InquiryQuoteTemplate.java +++ b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/entity/InquiryQuoteTemplate.java @@ -17,7 +17,8 @@ import java.util.Date; /** * 报价模板逻辑头,对应 inq_quote_template。 *

- * 职责:业务身份(海陆空/分类/关键词/默认/启停/auto|manual)。 + * 职责:业务身份(海陆空/关键词/默认/启停/auto|manual)。 + * 分类字段已下线:匹配只靠 bizType + keywords + isDefault。 * 版式字节与映射在版本表;历史报价应绑 templateId + versionNo。 */ @Data @@ -38,9 +39,6 @@ public class InquiryQuoteTemplate implements Serializable { @ApiModelProperty("海运/空运/陆运") private String bizType; - @ApiModelProperty("分类") - private String category; - @ApiModelProperty("关键词 JSON 数组字符串") private String keywordsJson; diff --git a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/IInquiryQuoteTemplateService.java b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/IInquiryQuoteTemplateService.java index 8d7127f..bb38c7a 100644 --- a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/IInquiryQuoteTemplateService.java +++ b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/IInquiryQuoteTemplateService.java @@ -15,13 +15,13 @@ import java.util.Map; */ public interface IInquiryQuoteTemplateService extends IService { - IPage> pageWithVersion(String keyword, String bizType, String category, String status, + IPage> pageWithVersion(String keyword, String bizType, String status, int pageNo, int pageSize); /** * 新建逻辑模板并写入第一版;或对已有模板追加新版本。 */ - Map uploadVersion(String templateId, String name, String bizType, String category, + Map uploadVersion(String templateId, String name, String bizType, String keywordsJson, String mode, boolean isDefault, MultipartFile file, String operator); diff --git a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/impl/InquiryQuoteTemplateServiceImpl.java b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/impl/InquiryQuoteTemplateServiceImpl.java index 466392c..2b679a7 100644 --- a/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/impl/InquiryQuoteTemplateServiceImpl.java +++ b/inquiry-api/jeecg-module-inquiry/src/main/java/org/jeecg/modules/inquiry/service/impl/InquiryQuoteTemplateServiceImpl.java @@ -57,20 +57,17 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl> pageWithVersion(String keyword, String bizType, String category, String status, + public IPage> pageWithVersion(String keyword, String bizType, String status, int pageNo, int pageSize) { QueryWrapper qw = new QueryWrapper<>(); if (StringUtils.isNotBlank(bizType)) { qw.eq("biz_type", bizType); } - if (StringUtils.isNotBlank(category)) { - qw.eq("category", category); - } if (StringUtils.isNotBlank(status)) { qw.eq("status", status); } if (StringUtils.isNotBlank(keyword)) { - qw.and(w -> w.like("name", keyword).or().like("category", keyword).or().like("keywords_json", keyword)); + qw.and(w -> w.like("name", keyword).or().like("keywords_json", keyword)); } qw.orderByDesc("update_time").orderByDesc("create_time"); IPage page = page(new Page<>(pageNo, pageSize), qw); @@ -88,7 +85,6 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl uploadVersion(String templateId, String name, String bizType, String category, + public Map uploadVersion(String templateId, String name, String bizType, String keywordsJson, String mode, boolean isDefault, MultipartFile file, String operator) { if (file == null || file.isEmpty()) { @@ -138,7 +134,6 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl 0 ? name.substring(0, i) : name; } - - private static String defaultCategory(String bizType) { - if ("空运".equals(bizType)) { - return "空运到港报价单模板"; - } - if ("陆运".equals(bizType)) { - return "国内拼车"; - } - return "海运报价单模板"; - } } diff --git a/inquiry-backend/.env.production b/inquiry-backend/.env.production index 8168261..c1a8d0e 100644 --- a/inquiry-backend/.env.production +++ b/inquiry-backend/.env.production @@ -1,6 +1,12 @@ # 是否启用mock(生产必须 false,否则会走本地 Mock 像旧骨架) VITE_USE_MOCK = false +# 网站标题(浏览器标签后缀;缺省会显示「页面名 undefined」) +VITE_GLOB_APP_TITLE = 友通达询价系统 + +# 简称,用于生产 _app.config.js 变量名;勿空格/数字开头 +VITE_GLOB_APP_SHORT_NAME = YtdInquiryAdmin + # 发布路径 VITE_PUBLIC_PATH = / diff --git a/inquiry-backend/src/hooks/web/useTitle.ts b/inquiry-backend/src/hooks/web/useTitle.ts index ed28a21..de3d5f7 100644 --- a/inquiry-backend/src/hooks/web/useTitle.ts +++ b/inquiry-backend/src/hooks/web/useTitle.ts @@ -28,7 +28,9 @@ export function useTitle() { } const tTitle = t(route?.meta?.title as string); - pageTitle.value = tTitle ? ` ${tTitle} - ${title} ` : `${title}`; + // 生产 _app.config.js 若漏打 VITE_GLOB_APP_TITLE,title 会是 undefined → 标签出现「报价模板 undefined」 + const appTitle = title || '友通达询价系统'; + pageTitle.value = tTitle ? `${tTitle} - ${appTitle}` : `${appTitle}`; }, { immediate: true } ); diff --git a/inquiry-backend/src/views/inquiry/mock/templates.ts b/inquiry-backend/src/views/inquiry/mock/templates.ts index 3cc6ef1..1f9f8d2 100644 --- a/inquiry-backend/src/views/inquiry/mock/templates.ts +++ b/inquiry-backend/src/views/inquiry/mock/templates.ts @@ -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 = { - 海运: ["海运报价单模板"], - 空运: ["空运到港报价单模板", "空运到门报价单模板"], - 陆运: [ - "双清或中越", - "国内整车", - "国内拼车", - "跨境整车", - "跨境集拼", - "中港", - "凭祥保税仓&普仓仓储", - ], -}; - -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", diff --git a/inquiry-backend/src/views/inquiry/template/index.vue b/inquiry-backend/src/views/inquiry/template/index.vue index 1817637..fec9125 100644 --- a/inquiry-backend/src/views/inquiry/template/index.vue +++ b/inquiry-backend/src/views/inquiry/template/index.vue @@ -7,12 +7,7 @@ */ import { computed, onMounted, reactive, ref } from "vue"; import { message } from "ant-design-vue"; -import { - ALL_CATEGORIES, - CATEGORY_BY_BIZ, - mapApiRow, - type TemplateRow, -} from "/@/views/inquiry/mock/templates"; +import { mapApiRow, type TemplateRow } from "/@/views/inquiry/mock/templates"; import ProtoIcon from "/@/views/inquiry/components/ProtoIcon.vue"; import { disableTemplate, @@ -47,7 +42,6 @@ const rows = ref([]); const loading = ref(false); const keyword = ref(""); const bizFilter = ref(""); -const categoryFilter = ref(""); const statusFilter = ref(""); const formOpen = ref(false); @@ -59,10 +53,10 @@ const previewVm = ref(emptyPreviewViewModel()); const fileInputRef = ref(null); const pendingFile = ref(null); +/** 运营表单不含「分类」:主账上传时按业务自行补默认分类 */ const form = reactive({ name: "", bizType: "海运" as TemplateRow["bizType"], - category: "", mode: "auto" as "auto" | "manual", keywordItems: [""] as string[], isDefault: false, @@ -98,10 +92,6 @@ const previewTotalText = computed(() => { return `${vm.currency || "USD"} ${amt}`; }); -function defaultCategoryForBiz(biz: TemplateRow["bizType"]) { - return (CATEGORY_BY_BIZ[biz] || [])[0] || ""; -} - const filtered = computed(() => rows.value); function bizTag(biz: string) { @@ -110,13 +100,18 @@ function bizTag(biz: string) { return "tag-blue"; } +/** 列表展示用:关键词用顿号拼接;空则显示占位 */ +function formatKeywords(keywords: string[] | undefined) { + if (!keywords?.length) return ""; + return keywords.map((k) => String(k || "").trim()).filter(Boolean).join("、"); +} + async function loadList() { loading.value = true; try { const res: any = await getTemplateList({ keyword: keyword.value.trim() || undefined, bizType: bizFilter.value || undefined, - category: categoryFilter.value || undefined, status: statusFilter.value || undefined, pageNo: 1, pageSize: 200, @@ -139,7 +134,6 @@ function resetForm() { Object.assign(form, { name: "", bizType: "海运" as TemplateRow["bizType"], - category: defaultCategoryForBiz("海运"), mode: "auto" as const, keywordItems: [""], isDefault: false, @@ -165,7 +159,6 @@ function openEdit(row: TemplateRow) { Object.assign(form, { name: row.name, bizType: row.bizType, - category: row.category || defaultCategoryForBiz(row.bizType), mode: row.mode || "auto", keywordItems: row.keywords.length ? [...row.keywords] : [""], isDefault: Boolean(row.isDefault), @@ -318,8 +311,7 @@ async function submitForm() { message.warning("请至少填写一个关键词"); return; } - // 分类/模式不对运营展示:分类按业务默认,模式新建默认 auto,编辑保留原值 - const category = defaultCategoryForBiz(form.bizType); + // 模式不对运营展示:新建默认 auto,编辑保留原值;分类交主账按业务补默认 const mode = editing.value?.mode || "auto"; try { @@ -328,7 +320,6 @@ async function submitForm() { if (editing.value?.id) fd.append("templateId", editing.value.id); fd.append("name", form.name.trim()); fd.append("bizType", form.bizType); - fd.append("category", category); fd.append("keywordsJson", JSON.stringify(keywords)); fd.append("mode", mode); fd.append("isDefault", String(form.isDefault)); @@ -340,7 +331,6 @@ async function submitForm() { id: editing.value.id, name: form.name.trim(), bizType: form.bizType, - category, keywordsJson: JSON.stringify(keywords), mode, isDefault: form.isDefault ? 1 : 0, @@ -398,10 +388,6 @@ async function downloadPreviewOrOriginal() { -