diff --git a/common/enum.js b/common/enum.js index 15f3d96..d9f7686 100644 --- a/common/enum.js +++ b/common/enum.js @@ -8,7 +8,10 @@ let curMYush = curMonth % 3 // 如果被整除,diff就要设置成被除以的数 if(curMYush == 0) { curMYush = 3 -} +} +// 获取周几 +let weekNum = dayjs().day() +let mondayDiff = 0 - ( (weekNum == 0 ? 7 : weekNum) - 1 ) const dateRangeList = [ { title: '今天', val: 1, @@ -19,8 +22,8 @@ const dateRangeList = [ }, { title: '本周', val: 2, range: [ - dayjs().startOf('week').add(-6, 'day').format(formatStr), - dayjs().endOf('week').add(-6, 'day').format(formatStr) + dayjs().add(mondayDiff, 'day').format(formatStr), + dayjs().add(mondayDiff + 6, 'day').format(formatStr), ], }, { title: '当月', val: 3, @@ -42,7 +45,9 @@ const dateRangeList = [ ], }, { title: '自定义', val: '-1', range: [] }, -] +] + + const costRateTypeEnum = { cny: 'CNY', usd: 'USD',