From 78a87ce71a46ce17a8c296a40a7cf7825e07470e Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Fri, 17 Jan 2025 19:08:39 +0800 Subject: [PATCH] uu --- common/enum.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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',