Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 62840d05
authored
Feb 05, 2026
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V5.6.0' of
http://192.168.3.233:8090/saas_plus/dj-car-life-sy…
…stem into SAAS+V5.6.0
2 parents
769b0cfe
70c18034
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
10 deletions
src/views/earlyWarningManager/strategyCentre/compoments/clendarCustom.vue
src/views/earlyWarningManager/strategyCentre/compoments/clendarCustom.vue
View file @
62840d0
...
...
@@ -162,8 +162,8 @@ const DateRangeStrategies = {
let
newEndDate
;
if
(
newStart
.
getTime
()
===
currentWeekMonday
.
getTime
())
{
// 当前周:结束时间为
当前时间
newEndDate
=
new
Date
(
now
)
;
// 当前周:结束时间为
整周的周日(即使时间未到也按整周显示)
newEndDate
=
new
Sunday
;
}
else
if
(
newSunday
>
now
)
{
// 未来周:不应该执行(由canSwitchNext控制)
return
null
;
...
...
@@ -180,9 +180,20 @@ const DateRangeStrategies = {
// 检查是否可以切换到下一个时间段
canSwitchNext
(
currentRange
,
now
)
{
const
currentWeekMonday
=
DateUtils
.
getCurrentWeekMonday
(
now
);
const
currentWeekSunday
=
DateUtils
.
getWeekSunday
(
currentWeekMonday
);
// 如果当前范围是当前周,则不能再往前切换
if
(
currentRange
.
startDate
.
getTime
()
===
currentWeekMonday
.
getTime
())
{
return
false
;
}
// 计算下一个时间段的结束日期
const
newEndDate
=
new
Date
(
currentRange
.
endDate
);
newEndDate
.
setDate
(
currentRange
.
endDate
.
getDate
()
+
7
);
return
newEndDate
<=
now
;
// 允许切换到当前周(即使当前周还没结束)
return
newEndDate
<=
currentWeekSunday
;
}
},
...
...
@@ -205,11 +216,15 @@ const DateRangeStrategies = {
const
newStartDate
=
DateUtils
.
getMonthFirstDay
(
targetDate
);
const
currentMonthFirstDay
=
DateUtils
.
getMonthFirstDay
(
now
);
const
currentMonthLastDay
=
DateUtils
.
getMonthLastDay
(
now
);
let
newEndDate
;
if
(
newStartDate
>=
currentMonthFirstDay
)
{
// 当前月或未来月:结束时间限制为当前时间
newEndDate
=
new
Date
(
now
);
if
(
newStartDate
.
getTime
()
===
currentMonthFirstDay
.
getTime
())
{
// 当前月:结束时间为整月的最后一天(即使时间未到也按整月取值)
newEndDate
=
currentMonthLastDay
;
}
else
if
(
newStartDate
>
currentMonthFirstDay
)
{
// 未来月:不应该执行(由canSwitchNext控制)
return
null
;
}
else
{
// 过去月:结束时间为该月的最后一天
newEndDate
=
DateUtils
.
getMonthLastDay
(
targetDate
);
...
...
@@ -223,9 +238,21 @@ const DateRangeStrategies = {
// 检查是否可以切换到下一个时间段
canSwitchNext
(
currentRange
,
now
)
{
const
newEndDate
=
new
Date
(
currentRange
.
endDate
);
newEndDate
.
setMonth
(
currentRange
.
endDate
.
getMonth
()
+
1
);
return
newEndDate
<=
now
;
const
currentMonthFirstDay
=
DateUtils
.
getMonthFirstDay
(
now
);
// 如果当前范围是当前月,则不能再往前切换
if
(
currentRange
.
startDate
.
getTime
()
===
currentMonthFirstDay
.
getTime
())
{
return
false
;
}
// 计算下一个月的第一天
const
nextMonthDate
=
new
Date
(
currentRange
.
startDate
);
nextMonthDate
.
setMonth
(
currentRange
.
startDate
.
getMonth
()
+
1
);
const
nextMonthStart
=
DateUtils
.
getMonthFirstDay
(
nextMonthDate
);
// 如果下一个时间段是当前月或之前,则允许切换
// 允许切换到当前月(即使当前月还没结束)
return
nextMonthStart
.
getTime
()
<=
currentMonthFirstDay
.
getTime
();
}
},
...
...
@@ -684,4 +711,3 @@ $bg-white: #fff;
}
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment