Merge branch 'dev'
This commit is contained in:
commit
4458f4c49f
@ -135,7 +135,18 @@ const convertApiDataToMockFormat = async (timeRange: string) => {
|
||||
])]
|
||||
break
|
||||
case 'week':
|
||||
datavalues = [['时间', '数值'], ...dataArray.map(item => [
|
||||
// 找到第一个周一的索引
|
||||
const firstMondayIndex = dataArray.findIndex(item => {
|
||||
const date = new Date(item.alarm_time_)
|
||||
return date.getDay() === 1 // 周一
|
||||
})
|
||||
|
||||
// 如果找到周一,则从周一开始截取数据;否则保持原数据
|
||||
const filteredData = firstMondayIndex !== -1
|
||||
? dataArray.slice(firstMondayIndex)
|
||||
: dataArray
|
||||
|
||||
datavalues = [['时间', '数值'], ...filteredData.map(item => [
|
||||
convertToChineseWeekday(item.alarm_time_),
|
||||
item.avg_handle_time_seconds || 0
|
||||
])]
|
||||
|
Loading…
Reference in New Issue
Block a user