fix : 修复审核意见位置

This commit is contained in:
2024-06-05 00:51:27 +08:00
parent df6f49caeb
commit a7d91a8f32
11 changed files with 252 additions and 69 deletions

42
src/utils/date.js Normal file
View File

@@ -0,0 +1,42 @@
export const dateFormat = (time = new Date().getTime(),flag) => { //YYYY年MM月DD日 星期d
const _time = time.toString().length > 10 ? time : time * 1000
const weekList = ["日","一", "二", "三", "四", "五", "六" ];
const date = new Date(_time);
const Y = date.getFullYear();
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
const Mm = (date.getMonth() + 1 < 10 ? (date.getMonth() + 1) : date.getMonth() + 1);
const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
const s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
let weekDay = new Date().getDay();
const week= weekList[weekDay]
// const strDate = `${Y}/${M}/${D} ${h}:${m}:${s}`
if(flag){
return `${Mm}`;
}else {
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,
getNowFormatDate
}