// 历史单日记录按同一天的范围回显,接口保留 detectionTime 作为开始日期。
|
export function readDetectionTimeRange(condition) {
|
return condition.detectionTime
|
? [condition.detectionTime, condition.detectionEndTime || condition.detectionTime]
|
: null
|
}
|
|
export function isCompleteDetectionTimeRange(range) {
|
return Array.isArray(range) && range.length === 2 && !!range[0] && !!range[1] && range[0] <= range[1]
|
}
|
|
export function toDetectionTimePayload(range) {
|
return {
|
detectionTime: range?.[0] || null,
|
detectionEndTime: range?.[1] || null,
|
}
|
}
|