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
d075bda8
Commit
d075bda8
authored
Jul 04, 2022
by
aifen@azjy1.onexmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校园报告优化提交更新1
parent
4dddf400
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
347 additions
and
249 deletions
+347
-249
src/pages/SchoolReport/SchoolReport.vue
src/pages/SchoolReport/SchoolReport.vue
+347
-249
src/static/images/breakfastTimeBg.png
src/static/images/breakfastTimeBg.png
+0
-0
No files found.
src/pages/SchoolReport/SchoolReport.vue
View file @
d075bda8
...
...
@@ -137,12 +137,12 @@
<view
class=
"school-report-context-card-one-context-dot-item"
>
</view>
</view>
<view
class=
"school-report-context-card-one-context-txt"
>
<view
v-if=
"!abnormalStr"
class=
"school-report-context-card-one-context-txt"
>
早、中、晚餐就餐时间较稳定,按时吃饭,自律如昔,你就赢了大多数人
</view>
<
!--
<view
class=
"school-report-context-card-one-context-txt"
>
<text
class=
"txt-important"
>
12日、17日早餐、22日、28日中餐、25日晚餐
</text>
的就餐时间跟同班同学相差超20分钟,如果快乐很难,那么按时吃饭
</view>
-->
<
view
v-else
class=
"school-report-context-card-one-context-txt"
>
<text
class=
"txt-important"
>
{{
abnormalStr
}}
</text>
的就餐时间跟同班同学相差超20分钟,如果快乐很难,那么按时吃饭
</view>
</view>
<view
class=
"school-report-context-card-one-context-item school-report-context-card-one-context-item-last"
>
...
...
@@ -408,13 +408,13 @@
</view>
<view
class=
"school-report-context-card-six-conclusion"
>
<view
class=
"school-report-context-card-six-conclusion-item"
>
<text>
早、中、晚餐就餐时间较稳定,按时吃饭,自律如昔,你就赢了大多数人
</text>
<
!--
<text
>
<text
class=
"abnormal-date"
>
12日、17日早餐、22日、28日中餐、25日晚餐
</text>
的就餐时间跟同班同学相差超20分钟,如果快乐很难,那么按时吃饭
</text>
-->
<text
v-if=
"!abnormalStr"
>
早、中、晚餐就餐时间较稳定,按时吃饭,自律如昔,你就赢了大多数人
</text>
<
text
v-else
>
<text
class=
"abnormal-date"
>
{{
abnormalStr
}}
</text>
的就餐时间跟同班同学相差超20分钟,如果快乐很难,那么按时吃饭
</text>
</view>
</view>
<view
class=
"mealtime-trends"
>
<view
v-if=
"mealtypeArr.indexOf(1)!=-1"
class=
"mealtime-trends"
>
<view
class=
"mealtime-trends-theme"
>
<view
class=
"meal-type"
>
<text>
早餐
</text>
...
...
@@ -448,7 +448,81 @@
</view>
</view>
</view>
<view
id=
"breakfast-time-line"
>
<view
v-if=
"mealtypeArr.indexOf(1)!=-1"
id=
"breakfast-time-line"
>
</view>
<view
v-if=
"mealtypeArr.indexOf(2)!=-1"
class=
"mealtime-trends"
style=
"position: relative;top:-134rpx"
>
<view
class=
"mealtime-trends-theme"
>
<view
class=
"meal-type"
>
<text>
中餐
</text>
</view>
<view
class=
"user-meal-time"
>
<view
class=
"user-meal-time-logo"
>
<view
class=
"user-meal-time-logo-left"
>
</view>
<view
class=
"user-meal-time-logo-middle"
>
</view>
<view
class=
"user-meal-time-logo-right"
>
</view>
</view>
<view
class=
"user-meal-time-txt"
>
<text>
就餐时间
</text>
</view>
</view>
<view
class=
"class-meal-time"
>
<view
class=
"user-meal-time-logo"
>
<view
class=
"user-meal-time-logo-left"
style=
"background: rgba(0, 0, 0, 0.5)"
>
</view>
<view
class=
"user-meal-time-logo-middle"
style=
"border: 3rpx solid rgba(0, 0, 0, 0.5)"
>
</view>
<view
class=
"user-meal-time-logo-right"
style=
"background: rgba(0, 0, 0, 0.5)"
>
</view>
</view>
<view
class=
"user-meal-time-txt"
>
<text>
班级集中就餐时间
</text>
</view>
</view>
</view>
</view>
<view
v-if=
"mealtypeArr.indexOf(2)!=-1"
id=
"lunch-time-line"
>
</view>
<view
v-if=
"mealtypeArr.indexOf(3)!=-1"
class=
"mealtime-trends"
style=
"position: relative;top:-286rpx"
>
<view
class=
"mealtime-trends-theme"
>
<view
class=
"meal-type"
>
<text>
晚餐
</text>
</view>
<view
class=
"user-meal-time"
>
<view
class=
"user-meal-time-logo"
>
<view
class=
"user-meal-time-logo-left"
>
</view>
<view
class=
"user-meal-time-logo-middle"
>
</view>
<view
class=
"user-meal-time-logo-right"
>
</view>
</view>
<view
class=
"user-meal-time-txt"
>
<text>
就餐时间
</text>
</view>
</view>
<view
class=
"class-meal-time"
>
<view
class=
"user-meal-time-logo"
>
<view
class=
"user-meal-time-logo-left"
style=
"background: rgba(0, 0, 0, 0.5)"
>
</view>
<view
class=
"user-meal-time-logo-middle"
style=
"border: 3rpx solid rgba(0, 0, 0, 0.5)"
>
</view>
<view
class=
"user-meal-time-logo-right"
style=
"background: rgba(0, 0, 0, 0.5)"
>
</view>
</view>
<view
class=
"user-meal-time-txt"
>
<text>
班级集中就餐时间
</text>
</view>
</view>
</view>
</view>
<view
v-if=
"mealtypeArr.indexOf(3)!=-1"
id=
"dinner-time-line"
>
</view>
</view>
<view
v-show=
"tabIndex==1&&isOpen"
class=
"school-report-context-card-seven"
>
...
...
@@ -986,8 +1060,7 @@
maxDate
:
new
Date
(),
imgUrl
:
''
,
// 存储base64图片
dialogShow
:
false
,
// tabIndex: 0,
tabIndex
:
1
,
tabIndex
:
0
,
// 就餐情况
diningSituations
:
{
diningSituationsDate
:
''
,
...
...
@@ -1016,6 +1089,12 @@
mealPalData
:
[],
mealPalArr
:
[],
mealPalStr
:
''
,
// 就餐时间趋势
breakfastAbnormalStr
:
''
,
lunchAbnormalStr
:
''
,
dinnerAbnormalStr
:
''
,
mealtypeArr
:
[],
mealtimeTrendsData
:
[],
// 出入校报告数据
attendanceSituations
:
{
attendanceDate
:
''
,
...
...
@@ -1058,150 +1137,24 @@
containerHeight
:
''
,
pubTalkSummaryHeight
:
275
,
pubTalkNoopenHeight
:
1260
,
isnodataClick
:
false
,
mealtimeTrendsData
:
[{
userId
:
4018927
,
mealtype
:
1
,
cateringList
:
[{
classmealtime
:
"
05:25
"
,
repasttime
:
"
2022-05-01
"
,
usermealtime
:
"
07:00
"
,
repastType
:
2
},
{
classmealtime
:
"
05:45
"
,
repasttime
:
"
2022-05-02
"
,
usermealtime
:
"
06:00
"
,
repastType
:
1
},
{
classmealtime
:
"
06:00
"
,
repasttime
:
"
2022-05-03
"
,
usermealtime
:
"
05:55
"
,
repastType
:
1
},
{
classmealtime
:
"
06:05
"
,
repasttime
:
"
2022-05-04
"
,
usermealtime
:
"
06:00
"
,
repastType
:
1
},
{
classmealtime
:
"
05:25
"
,
repasttime
:
"
2022-05-05
"
,
usermealtime
:
"
05:35
"
,
repastType
:
2
},
{
classmealtime
:
"
05:35
"
,
repasttime
:
"
2022-05-06
"
,
usermealtime
:
"
05:35
"
,
repastType
:
2
},
{
classmealtime
:
"
05:55
"
,
repasttime
:
"
2022-05-07
"
,
usermealtime
:
"
05:55
"
,
repastType
:
1
}
],
earliestTime
:
"
05:25
"
},
{
userId
:
4018927
,
mealtype
:
2
,
cateringList
:
[{
classmealtime
:
"
11:25
"
,
repasttime
:
"
2022-05-01
"
,
usermealtime
:
"
11:00
"
,
repastType
:
2
,
},
{
classmealtime
:
"
11:45
"
,
repasttime
:
"
2022-05-02
"
,
usermealtime
:
"
12:00
"
,
repastType
:
1
},
{
classmealtime
:
"
12:00
"
,
repasttime
:
"
2022-05-03
"
,
usermealtime
:
"
11:55
"
,
repastType
:
1
},
{
classmealtime
:
"
12:05
"
,
repasttime
:
"
2022-05-04
"
,
usermealtime
:
"
12:00
"
,
repastType
:
1
},
{
classmealtime
:
"
11:25
"
,
repasttime
:
"
2022-05-05
"
,
usermealtime
:
"
11:35
"
,
repastType
:
2
},
{
classmealtime
:
"
11:35
"
,
repasttime
:
"
2022-05-06
"
,
usermealtime
:
"
11:35
"
,
repastType
:
2
},
{
classmealtime
:
"
11:55
"
,
repasttime
:
"
2022-05-07
"
,
usermealtime
:
"
11:55
"
,
repastType
:
1
}
],
earliestTime
:
"
11:25
"
},
{
userId
:
4018927
,
mealtype
:
3
,
cateringList
:
[{
classmealtime
:
"
17:00
"
,
repasttime
:
"
2022-05-01
"
,
usermealtime
:
"
17:05
"
,
repastType
:
2
},
{
classmealtime
:
"
17:45
"
,
repasttime
:
"
2022-05-02
"
,
usermealtime
:
"
18:00
"
,
repastType
:
1
},
{
classmealtime
:
"
18:00
"
,
repasttime
:
"
2022-05-03
"
,
usermealtime
:
"
17:55
"
,
repastType
:
1
},
{
classmealtime
:
"
18:05
"
,
repasttime
:
"
2022-05-04
"
,
usermealtime
:
"
18:00
"
,
repastType
:
1
},
{
classmealtime
:
"
11:25
"
,
repasttime
:
"
2022-05-05
"
,
usermealtime
:
"
11:35
"
,
repastType
:
2
},
{
classmealtime
:
"
17:35
"
,
repasttime
:
"
2022-05-06
"
,
usermealtime
:
"
17:35
"
,
repastType
:
2
},
{
classmealtime
:
"
17:55
"
,
repasttime
:
"
2022-05-07
"
,
usermealtime
:
"
17:55
"
,
repastType
:
1
}
],
earliestTime
:
"
17:00
"
}]
isnodataClick
:
false
}
},
computed
:
{
abnormalStr
()
{
if
(
this
.
mealtypeArr
.
length
)
{
var
breakfastAbnormalStr
=
this
.
mealtimeAbnormalDate
(
1
);
var
lunchAbnormalStr
=
this
.
mealtimeAbnormalDate
(
2
);
var
dinnerAbnormalStr
=
this
.
mealtimeAbnormalDate
(
3
);
var
str1
=
breakfastAbnormalStr
?
breakfastAbnormalStr
+
'
早餐
'
:
''
;
var
str2
=
lunchAbnormalStr
?
lunchAbnormalStr
+
'
中餐
'
:
''
;
var
str3
=
dinnerAbnormalStr
?
dinnerAbnormalStr
+
'
晚餐
'
:
''
;
var
str
=
str1
?
(
str1
+
(
str2
?
(
'
、
'
+
str2
+
(
str3
?
'
、
'
+
str3
:
''
))
:
(
str3
?
'
、
'
+
str3
:
''
)))
:
(
str2
?
(
str2
+
(
str3
?
'
、
'
+
str3
:
''
))
:
(
str3
?
str3
:
''
));
}
else
{
var
str
=
''
}
return
str
;
}
},
mounted
()
{
...
...
@@ -1238,9 +1191,8 @@
this
.
queryMemberValidTime
(
1002
).
then
(
e
=>
{
if
(
new
Date
(
this
.
memberInfo
.
invalidDate
).
getTime
()
<=
new
Date
(
'
2022/06/30
'
)
.
getTime
())
{
this
.
isOpen
=
true
;
this
.
flag
=
0
;
//
this.tabIndex = 1;
this
.
tabIndex
=
1
;
this
.
memberInfo
.
invalidDateStr
=
'
2022年6月30日
'
;
this
.
memberInfo
.
differDay
=
dayjs
(
'
2022/06/30
'
).
diff
(
dayjs
(),
'
day
'
)
+
1
;
this
.
containerHeight
=
4200
;
...
...
@@ -1248,14 +1200,49 @@
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
this
.
queryMealPalAnalyse
().
then
(()
=>
this
.
mealPalBarchart
());
this
.
queryRepastTimeTrend
().
then
(()
=>
{
if
(
this
.
mealtypeArr
.
indexOf
(
1
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
breakfast-time-line
'
,
1
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
2
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
lunch-time-line
'
,
2
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
3
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
dinner-time-line
'
,
3
);
}
})
}
else
{
//
this.tabIndex = 1;
this
.
tabIndex
=
1
;
this
.
queryIsDredgeMember
(
1002
,
1
).
then
(()
=>
{
this
.
queryConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
this
.
queryMealPalAnalyse
().
then
(()
=>
this
.
mealPalBarchart
());
this
.
queryRepastTimeTrend
().
then
(()
=>
{
if
(
this
.
mealtypeArr
.
indexOf
(
1
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
breakfast-time-line
'
,
1
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
2
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
lunch-time-line
'
,
2
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
3
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
dinner-time-line
'
,
3
);
}
})
});
}
})
...
...
@@ -1263,22 +1250,34 @@
if
(
new
Date
().
getTime
()
<=
new
Date
(
'
2022/06/30
'
).
getTime
())
{
this
.
isOpen
=
true
;
this
.
flag
=
0
;
//
this.tabIndex = 1;
this
.
tabIndex
=
1
;
this
.
memberInfo
.
invalidDateStr
=
'
2022年6月30日
'
;
this
.
memberInfo
.
differDay
=
dayjs
(
'
2022/06/30
'
).
diff
(
dayjs
(),
'
day
'
)
+
1
;
this
.
containerHeight
=
4200
;
this
.
queryConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
this
.
queryMealPalAnalyse
().
then
(()
=>
this
.
mealPalBarchart
());
}
// 删除
else
{
this
.
isOpen
=
true
;
this
.
flag
=
0
;
this
.
queryConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
this
.
queryMealPalAnalyse
().
then
(()
=>
this
.
mealPalBarchart
());
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
);
this
.
queryRepastTimeTrend
().
then
(()
=>
{
if
(
this
.
mealtypeArr
.
indexOf
(
1
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
breakfast-time-line
'
,
1
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
2
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
lunch-time-line
'
,
2
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
3
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
dinner-time-line
'
,
3
);
}
})
}
else
{
this
.
tabIndex
=
1
;
this
.
queryIsDredgeMember
(
1002
,
1
).
then
(()
=>
{
this
.
queryConsumerSummaryAmount
();
this
.
queryDayConsumerTrend
();
})
}
}
});
...
...
@@ -1368,13 +1367,29 @@
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
this
.
queryMealPalAnalyse
().
then
(()
=>
this
.
mealPalBarchart
());
this
.
queryRepastTimeTrend
().
then
(()
=>
{
if
(
this
.
mealtypeArr
.
indexOf
(
1
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
breakfast-time-line
'
,
1
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
2
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
lunch-time-line
'
,
2
);
}
if
(
this
.
mealtypeArr
.
indexOf
(
3
)
!=
-
1
)
{
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
,
'
dinner-time-line
'
,
3
);
}
})
}
else
{
this
.
queryConsumerSummaryAmount
();
this
.
queryDayConsumerTrend
();
}
})
// 删除
this
.
breakfastTimeLinechart
(
this
.
reportTypeIndex
);
}
else
if
(
num
==
2
)
{
if
(
flag
)
{
this
.
attendanceSituations
.
attendanceDate
=
this
.
formatDate
(
this
.
minDate
);
...
...
@@ -1770,12 +1785,14 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
myLineChart
.
resize
();
})
},
breakfastTimeLinechart
:
function
(
num
)
{
var
mySize
=
document
.
getElementById
(
'
breakfast-time-line
'
);
breakfastTimeLinechart
:
function
(
num
,
eleId
,
mealtype
)
{
var
mySize
=
document
.
getElementById
(
eleId
);
mySize
.
style
.
width
=
350
+
'
px
'
;
mySize
.
style
.
height
=
2
8
0
+
'
px
'
;
mySize
.
style
.
height
=
2
6
0
+
'
px
'
;
var
myBreakfastTimeLineChart
=
echarts
.
init
(
mySize
);
var
breakfastTimeData
=
this
.
mealtimeTrendsData
.
filter
(
e
=>
e
.
mealtype
==
1
)[
0
].
cateringList
;
var
cateringList
=
this
.
mealtimeTrendsData
.
filter
(
e
=>
e
.
mealtype
==
mealtype
)[
0
].
cateringList
;
var
breakfastTimeData
=
JSON
.
parse
(
JSON
.
stringify
(
cateringList
));
var
breakfastTimeDataTwo
=
JSON
.
parse
(
JSON
.
stringify
(
cateringList
));
breakfastTimeData
.
forEach
(
e
=>
{
if
(
'
itemStyle
'
in
e
)
delete
e
.
itemStyle
;
if
(
'
symbol
'
in
e
)
delete
e
.
symbol
;
...
...
@@ -1785,7 +1802,6 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
e
.
value
=
e
.
classmealtime
;
});
var
breakfastTimeDataTwo
=
this
.
mealtimeTrendsData
.
filter
(
e
=>
e
.
mealtype
==
1
)[
0
].
cateringList
;
breakfastTimeDataTwo
.
forEach
(
e
=>
{
if
(
'
itemStyle
'
in
e
)
delete
e
.
itemStyle
;
if
(
'
symbol
'
in
e
)
delete
e
.
symbol
;
...
...
@@ -1795,7 +1811,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
e
.
value
=
e
.
usermealtime
;
});
var
xInterval
=
this
.
reportTypeIndex
?
0
:
5
;
var
xInterval
=
this
.
reportTypeIndex
?
0
:
6
;
var
yMidPoint
=
"
2022/07/01
"
+
this
.
mealtimeTrendsData
.
filter
(
e
=>
e
.
mealtype
==
1
)[
0
].
earliestTime
;
var
maxDate
=
new
Date
(
yMidPoint
).
setHours
(
new
Date
(
yMidPoint
).
getHours
()
==
23
?
'
00
'
:
new
Date
(
yMidPoint
).
getHours
()
+
1
);
...
...
@@ -1854,49 +1870,49 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
}
});
//
breakfastTimeDataTwo.map(v => {
//
if (v.repastType == 1) {
//
if (v.repasttime == this.formatDateTwo(new Date(year, month, 0)) ||
//
saturdayList
//
.includes(v.repasttime)) {
//
seriesDataTwo.push(Object.assign(v, {
//
itemStyle: {
//
color: '#0BDB7E',
//
borderWidth: 1.5
//
},
//
symbolSize: 4
//
}))
//
} else {
//
seriesDataTwo.push(Object.assign(v, {
//
itemStyle: {
//
color: '#0BDB7E',
//
borderWidth: 1.5
//
},
//
symbol: 'none'
//
}))
//
}
//
} else {
//
if (v.repasttime == this.formatDateTwo(new Date(year, month, 0)) ||
//
saturdayList
//
.includes(v.repasttime)) {
//
seriesDataTwo.push(Object.assign(v, {
//
itemStyle: {
//
color: '#0BDB7E',
//
borderWidth: 1.5
//
},
//
symbolSize: 4
//
}))
//
} else {
//
seriesDataTwo.push(Object.assign(v, {
//
itemStyle: {
//
color: '#FF8646',
//
borderWidth: 1.5
//
},
//
symbol: 'none'
//
}))
//
}
//
}
//
});
breakfastTimeDataTwo
.
map
(
v
=>
{
if
(
v
.
repastType
==
1
)
{
if
(
v
.
repasttime
==
this
.
formatDateTwo
(
new
Date
(
year
,
month
,
0
))
||
saturdayList
.
includes
(
v
.
repasttime
))
{
seriesDataTwo
.
push
(
Object
.
assign
(
v
,
{
itemStyle
:
{
color
:
'
#0BDB7E
'
,
borderWidth
:
1.5
},
symbolSize
:
4
}))
}
else
{
seriesDataTwo
.
push
(
Object
.
assign
(
v
,
{
itemStyle
:
{
color
:
'
#0BDB7E
'
,
borderWidth
:
1.5
},
symbol
:
'
none
'
}))
}
}
else
{
if
(
v
.
repasttime
==
this
.
formatDateTwo
(
new
Date
(
year
,
month
,
0
))
||
saturdayList
.
includes
(
v
.
repasttime
))
{
seriesDataTwo
.
push
(
Object
.
assign
(
v
,
{
itemStyle
:
{
color
:
'
#0BDB7E
'
,
borderWidth
:
1.5
},
symbolSize
:
4
}))
}
else
{
seriesDataTwo
.
push
(
Object
.
assign
(
v
,
{
itemStyle
:
{
color
:
'
#FF8646
'
,
borderWidth
:
1.5
},
symbol
:
'
none
'
}))
}
}
});
break
;
case
1
:
// 周报
breakfastTimeData
.
map
(
v
=>
{
...
...
@@ -1918,25 +1934,25 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}))
}
});
//
breakfastTimeDataTwo.map(v => {
//
if (v.repastType == 1) {
//
seriesDataTwo.push(Object.assign(v, {
//
itemStyle: {
//
color: '#0BDB7E',
//
borderWidth: 1.5
//
},
//
symbolSize: 4
//
}))
//
} else {
//
seriesDataTwo.push(Object.assign(v, {
//
itemStyle: {
//
color: '#FF8646',
//
borderWidth: 1.5
//
},
//
symbolSize: 4
//
}))
//
}
//
});
breakfastTimeDataTwo
.
map
(
v
=>
{
if
(
v
.
repastType
==
1
)
{
seriesDataTwo
.
push
(
Object
.
assign
(
v
,
{
itemStyle
:
{
color
:
'
#0BDB7E
'
,
borderWidth
:
1.5
},
symbolSize
:
4
}))
}
else
{
seriesDataTwo
.
push
(
Object
.
assign
(
v
,
{
itemStyle
:
{
color
:
'
#FF8646
'
,
borderWidth
:
1.5
},
symbolSize
:
4
}))
}
});
break
;
}
var
option
=
{
...
...
@@ -1981,7 +1997,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
lineStyle
:
{
color
:
'
#0BDB7E
'
}
}],
}
,
],
tooltip
:
{
trigger
:
'
axis
'
,
axisPointer
:
{
...
...
@@ -1990,21 +2006,21 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
color
:
'
transparent
'
}
},
extraCssText
:
`width:1
09px;height:55px;line-height:33rpx;background: no-repeat center/100% url(./static/images/consumeTrendbgm
.png);
extraCssText
:
`width:1
50px;height:30px;line-height:33rpx;background: no-repeat center/100% url(./static/images/breakfastTimeBg
.png);
font-size:24rpx;font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;
color: #FF8646;padding:
13rpx 12rpx 30rpx 17rp
x;`
,
color: #FF8646;padding:
23px 0 30px 12px;box-sizing:border-bo
x;`
,
confine
:
true
,
position
:
function
(
pt
)
{
return
[
pt
[
0
]
-
27
,
pt
[
1
]
-
73
];
return
[
pt
[
0
]
-
30
,
pt
[
1
]
-
5
];
},
formatter
:
function
(
data
)
{
console
.
log
(
data
,
'
2222222222222
'
)
// if(data[0].data.repastType==2){
// desp="晚"
// }
// return data[0]. + desp;
if
(
data
[
0
].
data
.
repastType
==
2
&&
data
[
0
].
data
.
symbolSize
)
{
return
`
${
new
Date
(
data
[
0
].
data
.
repasttime
).
getMonth
()
+
1
}
月
${
new
Date
(
data
[
0
].
data
.
repasttime
).
getDate
()}
日就餐时间较晚`
;
}
else
if
(
data
[
0
].
data
.
repastType
==
3
&&
data
[
0
].
data
.
symbolSize
)
{
return
`
${
new
Date
(
data
[
0
].
data
.
repasttime
).
getMonth
()
+
1
}
月
${
new
Date
(
data
[
0
].
data
.
repasttime
).
getDate
()}
日就餐时间较早`
;
}
}
},
};
...
...
@@ -2619,6 +2635,74 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
})
}
},
// 异常就餐日期
mealtimeAbnormalDate
(
mealtype
)
{
// mealtype 1 早餐 2 中餐 3 晚餐
var
breakfastArr
=
this
.
mealtimeTrendsData
.
filter
(
e
=>
e
.
mealtype
==
mealtype
);
var
breakfastAbnormalArr
=
[];
var
breakfastAbnormalStr
=
''
;
if
(
breakfastArr
&&
breakfastArr
[
0
].
cateringList
)
{
breakfastAbnormalArr
=
breakfastArr
[
0
].
cateringList
.
filter
(
e
=>
e
.
repastType
==
2
||
e
.
repastType
==
3
)
.
map
(
e
=>
e
.
repasttime
.
slice
(
8
,
9
)
?
e
.
repasttime
.
slice
(
8
)
:
e
.
repasttime
.
slice
(
8
,
9
))
if
(
breakfastAbnormalArr
.
length
>
1
)
{
for
(
var
i
=
0
;
i
<
breakfastAbnormalArr
.
length
-
1
;
i
++
)
{
breakfastAbnormalStr
+=
breakfastAbnormalArr
[
i
]
+
'
日、
'
;
}
breakfastAbnormalStr
+=
breakfastAbnormalArr
[
breakfastAbnormalArr
.
length
-
1
]
+
'
日
'
;
}
else
if
(
breakfastAbnormalArr
.
length
==
1
)
{
breakfastAbnormalStr
+=
breakfastAbnormalArr
[
breakfastAbnormalArr
.
length
-
1
]
+
'
日
'
;
}
}
return
breakfastAbnormalStr
;
},
// 就餐时间趋势
async
queryRepastTimeTrend
()
{
try
{
let
data
=
await
this
.
$http
.
get
({
url
:
gHost
+
'
/report-push/campus-consumer-report/queryRepastTimeTrend
'
},
{
schoolId
:
getQueryParams
(
'
schoolId
'
),
userId
:
getQueryParams
(
'
userId
'
),
startDate
:
'
2022-05-01
'
,
endDate
:
'
2022-05-31
'
,
timeType
:
1
// startDate: this.dataRangeArr[this.dataRangeIndex].startDate,
// endDate: this.dataRangeArr[this.dataRangeIndex].endDate,
// timeType: this.dataRangeIndex == 0 ? 2 : 1
})
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
data
.
message
})
return
}
if
(
data
.
obj
)
{
this
.
mealtimeTrendsData
=
data
.
obj
}
if
(
data
.
obj
&&
data
.
obj
.
filter
(
e
=>
e
.
mealtype
==
1
)
&&
data
.
obj
.
filter
(
e
=>
e
.
mealtype
==
1
)[
0
]
.
cateringList
)
{
this
.
mealtypeArr
.
push
(
1
)
}
if
(
data
.
obj
&&
data
.
obj
.
filter
(
e
=>
e
.
mealtype
==
2
&&
data
.
obj
.
filter
(
e
=>
e
.
mealtype
==
2
)[
0
]
.
cateringList
))
{
this
.
mealtypeArr
.
push
(
2
)
}
if
(
data
.
obj
&&
data
.
obj
.
filter
(
e
=>
e
.
mealtype
==
3
&&
data
.
obj
.
filter
(
e
=>
e
.
mealtype
==
3
)[
0
]
.
cateringList
))
{
this
.
mealtypeArr
.
push
(
3
)
}
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
e
.
message
})
}
},
// 获取公话报告
async
getPubTalkReport
()
{
try
{
...
...
@@ -4389,7 +4473,21 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
#breakfast-time-line
{
position
:
relative
;
top
:
-106rpx
;
top
:
-95rpx
;
left
:
24rpx
;
z-index
:
100
;
}
#lunch-time-line
{
position
:
relative
;
top
:
-228rpx
;
left
:
24rpx
;
z-index
:
100
;
}
#dinner-time-line
{
position
:
relative
;
top
:
-376rpx
;
left
:
24rpx
;
z-index
:
100
;
}
...
...
src/static/images/breakfastTimeBg.png
0 → 100644
View file @
d075bda8
19.5 KB
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