style: 格式化后端改造代码
This commit is contained in:
@@ -238,7 +238,11 @@ function toFleetUnit(item: BatteryInfo, index: number, prediction?: BatteryPredi
|
||||
const temperature = round1(29.5 + thermalPressure * 2.1 + (item.isLowPower ? 1.4 : 0))
|
||||
const chargeEfficiency = round1(clamp(91 + item.power / 12 - riskFactors.length * 1.8, 80, 98))
|
||||
const riskScore = Math.round(
|
||||
clamp(prediction?.riskScore ?? 18 + riskFactors.length * 10 + thermalPressure * 4 + (item.isLowPower ? 18 : 0), 8, 96),
|
||||
clamp(
|
||||
prediction?.riskScore ?? 18 + riskFactors.length * 10 + thermalPressure * 4 + (item.isLowPower ? 18 : 0),
|
||||
8,
|
||||
96,
|
||||
),
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
@@ -10,7 +10,11 @@ import { isPredictionEnabled, predictSoh } from '@/server/prediction/client'
|
||||
|
||||
const dashboardPredictionConcurrency = 5
|
||||
|
||||
async function mapWithConcurrency<T, R>(items: T[], concurrency: number, handler: (item: T) => Promise<R>): Promise<R[]> {
|
||||
async function mapWithConcurrency<T, R>(
|
||||
items: T[],
|
||||
concurrency: number,
|
||||
handler: (item: T) => Promise<R>,
|
||||
): Promise<R[]> {
|
||||
const results: R[] = []
|
||||
let nextIndex = 0
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ function createLatestWhere(input: LatestBatteryPageInput, cursor: PageCursor | n
|
||||
|
||||
if (input.search) {
|
||||
clauses.push(
|
||||
'(current_record.mac LIKE :search ESCAPE \'\\\\\' OR current_record.dev_name LIKE :search ESCAPE \'\\\\\' OR current_record.dev_model LIKE :search ESCAPE \'\\\\\')',
|
||||
"(current_record.mac LIKE :search ESCAPE '\\\\' OR current_record.dev_name LIKE :search ESCAPE '\\\\' OR current_record.dev_model LIKE :search ESCAPE '\\\\')",
|
||||
)
|
||||
params.search = `%${escapeLike(input.search)}%`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user