feat: 迁移预警规则管理和历史分类查询

This commit is contained in:
Yvan
2026-11-03 20:19:26 +08:00
parent cd42a1d3f0
commit 7203c34409
31 changed files with 1264 additions and 15 deletions
+2
View File
@@ -9,6 +9,8 @@ import (
func Definition() module.Definition {
return module.Definition{Name: "business", Migrations: databusiness.Migrations(), Surface: module.Surface{
Menus: []module.Menu{
{Name: "sw_AlertCenter", Path: "sw-AlertCenter", Component: "view/routerHolder.vue", Title: "预警中心", Icon: "warn", Sort: 4},
{Name: "sw_AlertRules", Path: "AlertRules", ParentName: "sw_AlertCenter", Component: "view/sw/AlertRules.vue", Title: "预警规则", Icon: "warn", Sort: 2},
{Name: "sw_BusMgmt", Path: "sw-BusMgmt", Component: "view/routerHolder.vue", Title: "商务管理", Icon: "user", Sort: 2},
{Name: "sw_BusinessList", Path: "BusinessList", ParentName: "sw_BusMgmt", Component: "view/sw/BusinessList.vue", Title: "商务列表", Icon: "user", Sort: 1},
},
+4 -4
View File
@@ -25,16 +25,16 @@ func TestCatalogContainsBuiltInModulesInDependencyOrder(t *testing.T) {
t.Fatalf("definition[%d] = %q, want %q", index, got, name)
}
}
if got := catalog.MigrationSteps(); len(got) != 19 {
t.Fatalf("module migrations = %d, want 19", len(got))
if got := catalog.MigrationSteps(); len(got) != 20 {
t.Fatalf("module migrations = %d, want 20", len(got))
}
var menus, apis int
for _, definition := range catalog.Definitions {
menus += len(definition.Surface.Menus)
apis += len(definition.Surface.APIs)
}
if menus != 6 || apis != 29 {
t.Fatalf("admin surface = %d menus/%d APIs, want 6/29", menus, apis)
if menus != 8 || apis != 36 {
t.Fatalf("admin surface = %d menus/%d APIs, want 8/36", menus, apis)
}
if got := catalog.DefaultTimedTasks(); len(got) != 2 {
t.Fatalf("default timed tasks = %d, want 2", len(got))