/** * 运行管理 / 服务统计:服务类别 code → 中文(与后台返回的 type 字段对应) * 服务类 */ export const YXGL_SERVICE_CATEGORY_LABELS = { pro: "第三方公开服务", api: "一张图鉴权服务", icon: "地图符号服务", dms: "一张图数据中台服务", oauth: "一张图共享服务", proxy: "转发服务", /** 门户/业务侧常见 code,接口未统一命名时前端兜底展示 */ qpyzt: "一张图门户服务", }; /** * @param {string} type 后台返回的类别 code * @param {string} [unmappedAs='其它'] 未命中字典时的展示文案(表格可传入 type 以保留原 code) */ export function formatYxglServiceCategory(type, unmappedAs = "其它") { if (type == null || type === "") { return "未知"; } const raw = String(type).trim(); if (raw === "未知") { return raw; } const key = raw.toLowerCase(); return YXGL_SERVICE_CATEGORY_LABELS[key] ?? unmappedAs; }