Commit 23400f2f by liimin

feat(报表管理): 为里程通用明细页面添加每日里程日历展示功能

新增报表服务模拟接口GET_JOURNEYS_DAILYMILEAGE生成里程统计数据
优化日期选择器,支持日期范围校验、禁用未来日期选择以及自定义单元格渲染
添加SCSS样式实现日历单元格的红点标记和里程标签展示
绑定日历头部翻页事件,防止跳转至当前月份之后的页面
1 parent 4069b271
This diff could not be displayed because it is too large.
...@@ -109,6 +109,42 @@ export const GET_JOURNEYS_DAILYEXPORT = params => { ...@@ -109,6 +109,42 @@ export const GET_JOURNEYS_DAILYEXPORT = params => {
return request(params, '/trialdrive/journeys/dailyExport') return request(params, '/trialdrive/journeys/dailyExport')
} }
// 报表管理-里程统计(通用)-里程日历
export const GET_JOURNEYS_DAILYMILEAGE = params => {
const list = []
const fixedDays = [1, 5, 9, 12, 15, 19, 24, 28]
let cursor = new Date(`${params.mileageStartTime}-01T00:00:00`)
const endCursor = new Date(`${params.mileageEndTime}-01T00:00:00`)
const seed = String(params.sn || '')
.split('')
.reduce((sum, char) => sum + char.charCodeAt(0), 0)
while (cursor <= endCursor) {
const year = cursor.getFullYear()
const month = cursor.getMonth() + 1
const maxDay = new Date(year, month, 0).getDate()
fixedDays.forEach((day, index) => {
if (day > maxDay) return
const mileage = ((seed + month * 17 + day * 13 + index * 7) % 180) + 1
list.push({
date: `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`,
totalMileage: mileage
})
})
cursor = new Date(year, month, 1)
}
return new Promise(resolve => {
setTimeout(() => {
resolve({ data: list })
}, 1240)
})
// return request(params, '/trialdrive/journeys/dailyMileage')
}
// 报表管理-假性离线报警-获取列表 // 报表管理-假性离线报警-获取列表
export const GET_FAKEOFFLINE_LIST = params => { export const GET_FAKEOFFLINE_LIST = params => {
return request(params, '/trialdrive/fakeoffline/search') return request(params, '/trialdrive/fakeoffline/search')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!