fix: 修复 QA 巡检发现的 console 告警——useForm 未连接、RangePicker 空值禁用、dashboard 占用率类型

This commit is contained in:
2026-08-08 16:36:58 +08:00
parent 6c11fd7e16
commit 00cdb322d2
4 changed files with 6 additions and 5 deletions

View File

@@ -103,7 +103,7 @@ export class DashboardService {
const totalCapacity = await capQb.getRawOne<{ total: string | number | null }>();
// MySQL 的 SUM() 聚合默认以字符串返回,需显式转成 number
const cap = Number(totalCapacity?.total ?? 0) || 0;
const occupancyRate = cap > 0 ? ((occupiedBeds / cap) * 100).toFixed(1) : 0;
const occupancyRate = cap > 0 ? ((occupiedBeds / cap) * 100).toFixed(1) : '0.0';
const billStatsQb = this.billRepo
.createQueryBuilder('b')