refactor: 清理废弃模块并重构管理端与全端代码
- 移除所有废弃的旧首页配置模块,包括destinationHero、demand相关、HomeExperience、vehicleService等表结构与代码,新增数据库迁移删除遗留表 - 重构管理端后台布局为标准RuoYi风格,新增Sidebar、Navbar、SettingsDrawer等组件,替换旧的过渡菜单实现 - 调整移动端响应断点为768px,更新布局相关测试用例,新增布局组件测试 - 删除OperationsTools发布/重置页面,移除/tools菜单入口,清理对应的API调用与测试代码 - 重构玩法模块编辑器:替换旧的图片手动输入框为图片上传组件,移除冗余的取消按钮 - 新增线索查询offset参数支持,完善查询参数处理逻辑 - 优化rbac菜单构建逻辑,新增可见性控制参数 - 修正管家编辑器提示文案,优化系统资源编辑器表单初始化逻辑 - 清理小程序端废弃的体验推荐组件与相关测试代码 - 更新文档与种子脚本,匹配新的API契约与使用说明
This commit is contained in:
1 parent
f6c5ad589f
commit
fbf2c772a8
63 files changed
+2272
-1991
No files matched your search
@@ -1,6 +1,6 @@
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
from ..models import DemandFeatureCard, DemandForm, DemandHero, DestinationHero, HeroSlide, VehicleOption, VehicleServiceConfig
|
||||
from ..models import HeroSlide, VehicleOption
|
||||
from ..serializers import model_dict
|
||||
|
||||
|
||||
@@ -13,32 +13,15 @@ def public_model_dict(item) -> dict:
|
||||
|
||||
def site_config(db: Session, active_only: bool, include_public_extras: bool = True) -> dict:
|
||||
hero_stmt = select(HeroSlide).order_by(HeroSlide.sortOrder.asc())
|
||||
destination_hero_stmt = select(DestinationHero).order_by(DestinationHero.sortOrder.asc())
|
||||
vehicle_stmt = select(VehicleOption).order_by(VehicleOption.sortOrder.asc())
|
||||
demand_hero_stmt = select(DemandHero).order_by(DemandHero.sortOrder.asc())
|
||||
demand_feature_card_stmt = select(DemandFeatureCard).order_by(DemandFeatureCard.sortOrder.asc())
|
||||
demand_form_stmt = select(DemandForm).order_by(DemandForm.createdAt.asc())
|
||||
vehicle_service_stmt = select(VehicleServiceConfig).order_by(VehicleServiceConfig.createdAt.asc())
|
||||
if active_only:
|
||||
hero_stmt = hero_stmt.where(HeroSlide.isActive.is_(True))
|
||||
destination_hero_stmt = destination_hero_stmt.where(DestinationHero.isActive.is_(True))
|
||||
vehicle_stmt = vehicle_stmt.where(VehicleOption.isActive.is_(True))
|
||||
demand_hero_stmt = demand_hero_stmt.where(DemandHero.isActive.is_(True))
|
||||
demand_feature_card_stmt = demand_feature_card_stmt.where(DemandFeatureCard.isActive.is_(True))
|
||||
demand_form_stmt = demand_form_stmt.where(DemandForm.isActive.is_(True))
|
||||
vehicle_service_stmt = vehicle_service_stmt.where(VehicleServiceConfig.isActive.is_(True))
|
||||
|
||||
hero_slides = db.scalars(hero_stmt).all()
|
||||
destination_hero = db.scalars(destination_hero_stmt).all()
|
||||
result = {
|
||||
"heroSlides": [public_model_dict(item) for item in hero_slides],
|
||||
"destinationHero": [public_model_dict(item) for item in destination_hero],
|
||||
}
|
||||
if include_public_extras:
|
||||
result["vehicleOptions"] = [public_model_dict(item) for item in db.scalars(vehicle_stmt).all()]
|
||||
vehicle_service = db.scalars(vehicle_service_stmt).first()
|
||||
result["vehicleService"] = public_model_dict(vehicle_service) if vehicle_service else None
|
||||
result["demandHero"] = [public_model_dict(item) for item in db.scalars(demand_hero_stmt).all()]
|
||||
result["demandFeatureCards"] = [public_model_dict(item) for item in db.scalars(demand_feature_card_stmt).all()]
|
||||
result["demandForm"] = [public_model_dict(item) for item in db.scalars(demand_form_stmt).all()]
|
||||
return result
|
||||
Reference in new issue
Block a user