feat: 大屏改为纯流式自适应布局,新增KPI带与产线动态拓扑地图

This commit is contained in:
SunYF
2026-10-28 10:10:17 +08:00
parent 1f10c3091e
commit 4d3c4e2c3a
131 changed files with 18118 additions and 1728 deletions
+35 -7
View File
@@ -221,10 +221,8 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
// 附件中心(系统管理 → 附件中心)
{Method: http.MethodGet, Path: "/api/attachments/all", Handler: requirePerm(ctx, "attachment:view", listAllAttachmentsHandler(ctx))},
{Method: http.MethodGet, Path: "/api/attachments/disk-status", Handler: requirePerm(ctx, "attachment:view", diskStatusHandler(ctx))},
{Method: http.MethodPost, Path: "/api/attachments/archive", Handler: requirePerm(ctx, "attachment:manage", archiveAttachmentsHandler(ctx))},
// 空间清理(需求2):物理清理已删附件归 attachment:manage;日志清理仅管理员
// 空间清理(需求2):物理清理已删附件归 attachment:manage
{Method: http.MethodPost, Path: "/api/attachments/purge-deleted", Handler: requirePerm(ctx, "attachment:manage", purgeDeletedHandler(ctx))},
{Method: http.MethodPost, Path: "/api/attachments/clean-logs", Handler: requireAdmin(cleanLogsHandler(ctx))},
},
)
@@ -232,9 +230,39 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{Method: http.MethodGet, Path: "/api/display/overview", Handler: internalDisplayHandler(ctx)},
{Method: http.MethodGet, Path: "/api/display/analytics", Handler: internalDisplayAnalyticsHandler(ctx)},
{Method: http.MethodGet, Path: "/api/display/calls", Handler: internalDisplayCallsHandler(ctx)},
{Method: http.MethodGet, Path: "/api/display/config", Handler: displayConfigHandler(ctx)},
},
)
// 数据归档(系统管理 → 备份到 U 盘 / 腾空间):仅管理员。
// 备份=流式导出到外部存储并记 backup_record;清理=物理删除(严格覆盖校验,不可逆)。
server.AddRoutes(
[]rest.Route{
{Method: http.MethodGet, Path: "/api/backup/items", Handler: requireAdmin(backupItemsHandler(ctx))},
{Method: http.MethodPost, Path: "/api/backup/start", Handler: requireAdmin(backupStartHandler(ctx))},
{Method: http.MethodGet, Path: "/api/backup/progress", Handler: requireAdmin(backupProgressHandler(ctx))},
{Method: http.MethodPost, Path: "/api/cleanup/check", Handler: requireAdmin(cleanupCheckHandler(ctx))},
{Method: http.MethodPost, Path: "/api/cleanup/start", Handler: requireAdmin(cleanupStartHandler(ctx))},
{Method: http.MethodGet, Path: "/api/cleanup/progress", Handler: requireAdmin(cleanupProgressHandler(ctx))},
// 数据归档增强:目录选择器 / 提醒 / 预览 / 历史
{Method: http.MethodGet, Path: "/api/backup/drives", Handler: requireAdmin(backupDrivesHandler(ctx))},
{Method: http.MethodGet, Path: "/api/backup/listdir", Handler: requireAdmin(backupListDirHandler(ctx))},
{Method: http.MethodGet, Path: "/api/backup/reminder", Handler: requireAdmin(backupReminderHandler(ctx))},
{Method: http.MethodPost, Path: "/api/cleanup/preview", Handler: requireAdmin(cleanupPreviewHandler(ctx))},
{Method: http.MethodGet, Path: "/api/backup/records", Handler: requireAdmin(backupRecordsHandler(ctx))},
},
)
// 系统基础设置(admin-only):保存即生效,无需重启。
server.AddRoutes(
[]rest.Route{
{Method: http.MethodGet, Path: "/api/settings", Handler: requireAdmin(SettingsHandler(ctx))},
{Method: http.MethodPut, Path: "/api/settings", Handler: requireAdmin(SaveSettingsHandler(ctx))},
},
)
// 项目间内部 API(X-API-TOKEN 写死 token 保护)
// 与 JWT 侧业务接口同实现,仅供 MES(B)/工位终端(D) 等服务间调用
server.AddRoutes(
@@ -261,8 +289,8 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{Method: http.MethodGet, Path: "/api/internal/materials", Handler: wrapInternal(ctx)(queryMaterialsHandler(ctx))},
{Method: http.MethodGet, Path: "/api/internal/material/list-all", Handler: wrapInternal(ctx)(listMaterialsHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/return-order", Handler: wrapInternal(ctx)(createReturnOrderInternalHandler(ctx))},
// MES 质量检验(过程检/完工检)判不合格 → 联动 WMS 在库处置(按物料+SN/批次定位库存行)
{Method: http.MethodPost, Path: "/api/internal/inventory/dispose", Handler: wrapInternal(ctx)(internalInventoryDisposeHandler(ctx))},
},
)
// MES 质量检验(过程检/完工检)判不合格 → 联动 WMS 在库处置(按物料+SN/批次定位库存行)
{Method: http.MethodPost, Path: "/api/internal/inventory/dispose", Handler: wrapInternal(ctx)(internalInventoryDisposeHandler(ctx))},
},
)
}