feat : 新增历史数据导出csv文件

This commit is contained in:
2024-03-13 11:21:18 +08:00
parent 7df3f5251f
commit 499de290ab
9 changed files with 329 additions and 47 deletions

View File

@@ -18,9 +18,22 @@ export const dateFormat = (time = new Date().getTime(),flag) => { //YYYY年MM月
return `${Y}${M}${D}日 星期${week}`;
}
}
export const getNowFormatDate = (flag) => {
let date = new Date(),
year = date.getFullYear(), //获取完整的年份(4位)
month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
strDate = date.getDate() // 获取当前日(1-31)
if (month < 10) month = `0${month}` // 如果月份是个位数在前面补0
if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数在前面补0
if(flag){
return `${year}-${month}-${strDate}`
}else {
return `${year}-${month}`
}
}
export default {
dateFormat
dateFormat,
getNowFormatDate
}