fix: 修复 QA 巡检发现的 console 告警——useForm 未连接、RangePicker 空值禁用、dashboard 占用率类型
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user