liding
2 天以前 303d42574231d0cc57f18a736bf8047d158233ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 历史单日记录按同一天的范围回显,接口保留 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,
  }
}