This commit is contained in:
aihe 2025-01-17 19:08:39 +08:00
parent 9ffa5622aa
commit 78a87ce71a

View File

@ -9,6 +9,9 @@ let curMYush = curMonth % 3
if(curMYush == 0) { if(curMYush == 0) {
curMYush = 3 curMYush = 3
} }
// 获取周几
let weekNum = dayjs().day()
let mondayDiff = 0 - ( (weekNum == 0 ? 7 : weekNum) - 1 )
const dateRangeList = [ const dateRangeList = [
{ title: '今天', val: 1, { title: '今天', val: 1,
@ -19,8 +22,8 @@ const dateRangeList = [
}, },
{ title: '本周', val: 2, { title: '本周', val: 2,
range: [ range: [
dayjs().startOf('week').add(-6, 'day').format(formatStr), dayjs().add(mondayDiff, 'day').format(formatStr),
dayjs().endOf('week').add(-6, 'day').format(formatStr) dayjs().add(mondayDiff + 6, 'day').format(formatStr),
], ],
}, },
{ title: '当月', val: 3, { title: '当月', val: 3,
@ -43,6 +46,8 @@ const dateRangeList = [
}, },
{ title: '自定义', val: '-1', range: [] }, { title: '自定义', val: '-1', range: [] },
] ]
const costRateTypeEnum = { const costRateTypeEnum = {
cny: 'CNY', cny: 'CNY',
usd: 'USD', usd: 'USD',