Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
b87d946f
Commit
b87d946f
authored
Sep 24, 2024
by
袁玲利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周报设置一周从周一开始周日结束
parent
7373093f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
src/pages/SchoolReport/SchoolReport.vue
src/pages/SchoolReport/SchoolReport.vue
+21
-2
No files found.
src/pages/SchoolReport/SchoolReport.vue
View file @
b87d946f
...
...
@@ -1893,7 +1893,7 @@ export default {
},
// 当天11:00 ~ 13:00属于高峰期
isPeakPeriod
()
{
let
first
=
this
.
timeIn
(
"
11:00:00
"
,
"
1
1:01
:00
"
);
let
first
=
this
.
timeIn
(
"
11:00:00
"
,
"
1
3:00
:00
"
);
return
first
;
},
nodataClick
:
function
()
{
...
...
@@ -2122,17 +2122,36 @@ export default {
this
.
dataRangeIndex
=
e
.
target
.
value
;
this
.
getDataRangeArr
(
this
.
reportTypeIndex
);
},
// 获取一年中的所有周
getAllWeeksInYear
(
year
)
{
let
currentDate
=
dayjs
(
new
Date
(
year
,
0
,
1
));
// 设置为年份的第一天
const
weeks
=
[];
while
(
currentDate
.
year
()
===
year
)
{
const
startOfWeek
=
currentDate
.
startOf
(
'
week
'
);
const
endOfWeek
=
currentDate
.
endOf
(
'
week
'
);
weeks
.
push
({
startDate
:
startOfWeek
.
format
(
'
YYYY-MM-DD
'
),
endDate
:
endOfWeek
.
format
(
'
YYYY-MM-DD
'
)
});
currentDate
=
currentDate
.
add
(
1
,
'
week
'
);
}
return
weeks
;
},
getDataRangeArr
:
async
function
(
num
)
{
if
(
num
)
{
// 一年 52周 周报
let
tmpArr
=
[];
for
(
let
i
=
1
;
i
<=
52
;
i
++
)
{
let
startWeek
=
dayjs
().
subtract
(
i
,
"
week
"
).
startOf
(
"
week
"
);
// 设置 locale,将一周的开始日设置为周一 (1)
let
startWeek
=
dayjs
().
subtract
(
i
,
"
week
"
).
startOf
(
"
week
"
).
add
(
1
,
'
day
'
);
let
endWeek
=
dayjs
().
$d
.
getTime
()
>
dayjs
().
subtract
(
i
,
"
week
"
).
endOf
(
"
week
"
).
$d
.
getTime
()
?
dayjs
().
subtract
(
i
,
"
week
"
).
endOf
(
"
week
"
)
:
dayjs
();
endWeek
=
endWeek
.
add
(
1
,
'
day
'
);
tmpArr
.
push
({
week
:
startWeek
.
format
(
"
YYYY/MM/DD
"
)
+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment