refactor: 清理废弃模块并重构管理端与全端代码
- 移除所有废弃的旧首页配置模块,包括destinationHero、demand相关、HomeExperience、vehicleService等表结构与代码,新增数据库迁移删除遗留表 - 重构管理端后台布局为标准RuoYi风格,新增Sidebar、Navbar、SettingsDrawer等组件,替换旧的过渡菜单实现 - 调整移动端响应断点为768px,更新布局相关测试用例,新增布局组件测试 - 删除OperationsTools发布/重置页面,移除/tools菜单入口,清理对应的API调用与测试代码 - 重构玩法模块编辑器:替换旧的图片手动输入框为图片上传组件,移除冗余的取消按钮 - 新增线索查询offset参数支持,完善查询参数处理逻辑 - 优化rbac菜单构建逻辑,新增可见性控制参数 - 修正管家编辑器提示文案,优化系统资源编辑器表单初始化逻辑 - 清理小程序端废弃的体验推荐组件与相关测试代码 - 更新文档与种子脚本,匹配新的API契约与使用说明
This commit is contained in:
@@ -7,42 +7,47 @@ describe("WonderQ shared data helpers", () => {
|
||||
expect(normalizeSiteConfig({}, fallbackData)).toEqual(fallbackData);
|
||||
});
|
||||
|
||||
it("normalizes active site modules and ignores incomplete records", () => {
|
||||
it("normalizes the supported home modules and keeps the local vehicle fallback", () => {
|
||||
const config: PublicSiteConfig = {
|
||||
destinationHero: [
|
||||
heroSlides: [
|
||||
{
|
||||
id: "hero-1",
|
||||
title: "后台主视觉标题",
|
||||
title: "后台首页主视觉",
|
||||
kicker: "后台小标题",
|
||||
image: "https://cdn.example.test/hero.jpg",
|
||||
isActive: true,
|
||||
sortOrder: 0,
|
||||
},
|
||||
],
|
||||
demandForm: [
|
||||
vehicleOptions: [
|
||||
{
|
||||
id: "form-1",
|
||||
destinationLabel: "想去哪里",
|
||||
submitLabel: "提交给管家",
|
||||
chips: [" 贵州 ", "", "黄果树"],
|
||||
id: "vehicle-1",
|
||||
title: "舒适型用车",
|
||||
description: "适合家庭出行",
|
||||
image: "https://cdn.example.test/vehicle.jpg",
|
||||
isActive: true,
|
||||
sortOrder: 0,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const data = normalizeSiteConfig(config, fallbackData);
|
||||
|
||||
expect(data.destinationHero).toMatchObject({
|
||||
id: "hero-1",
|
||||
title: "后台主视觉标题",
|
||||
image: "https://cdn.example.test/hero.jpg",
|
||||
});
|
||||
expect(data.demandForm).toMatchObject({
|
||||
id: "form-1",
|
||||
destinationLabel: "想去哪里",
|
||||
submitLabel: "提交给管家",
|
||||
chips: ["贵州", "黄果树"],
|
||||
});
|
||||
expect(data.heroSlides).toMatchObject([
|
||||
{
|
||||
id: "hero-1",
|
||||
title: "后台首页主视觉",
|
||||
image: "https://cdn.example.test/hero.jpg",
|
||||
},
|
||||
]);
|
||||
expect(data.vehicleOptions).toMatchObject([
|
||||
{
|
||||
id: "vehicle-1",
|
||||
title: "舒适型用车",
|
||||
description: "适合家庭出行",
|
||||
},
|
||||
]);
|
||||
expect(data.vehicleService.introTitle).toBe("旅游出行专属用车服务");
|
||||
});
|
||||
|
||||
it("returns a stable submit error message", () => {
|
||||
@@ -50,32 +55,4 @@ describe("WonderQ shared data helpers", () => {
|
||||
expect(getSubmitErrorMessage("unknown")).toBe("提交失败,请稍后再试。");
|
||||
});
|
||||
|
||||
it("normalizes the vehicle service module and falls back incomplete sections", () => {
|
||||
const config: PublicSiteConfig = {
|
||||
vehicleService: {
|
||||
id: "vehicle-service-1",
|
||||
introTitle: "旅游专属用车",
|
||||
intro: " 提交需求后由管家跟进。 ",
|
||||
serviceSections: [{ title: " 包车服务 ", description: " 灵活安排 " }],
|
||||
advantages: [" 车型齐全 ", ""],
|
||||
processSteps: [{ title: "提交需求", description: " 填写出行信息 " }],
|
||||
isActive: true,
|
||||
},
|
||||
};
|
||||
|
||||
const data = normalizeSiteConfig(config, fallbackData);
|
||||
|
||||
expect(data.vehicleService).toMatchObject({
|
||||
id: "vehicle-service-1",
|
||||
introTitle: "旅游专属用车",
|
||||
intro: "提交需求后由管家跟进。",
|
||||
advantages: ["车型齐全"],
|
||||
});
|
||||
expect(data.vehicleService.serviceSections).toEqual([
|
||||
{ title: "包车服务", description: "灵活安排" },
|
||||
]);
|
||||
expect(data.vehicleService.processSteps).toEqual([
|
||||
{ title: "提交需求", description: "填写出行信息" },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user