1
1
<template >
2
2
<!-- 搜索工作栏 -->
3
3
<content-wrap >
4
- <el-form ref = " queryForm " class =" -mb-15px" :inline =" true" label-width =" 68px" >
4
+ <el-form class =" -mb-15px" ref = " queryForm " :inline =" true" label-width =" 68px" >
5
5
<el-form-item label =" 公众号" prop =" accountId" >
6
- <el-select v-model =" accountId" @change =" getSummary" >
6
+ <el-select v-model =" accountId" @change =" getSummary" class = " !w-240px " >
7
7
<el-option
8
8
v-for =" item in accountList"
9
9
:key =" item.id"
15
15
<el-form-item label =" 时间范围" prop =" dateRange" >
16
16
<el-date-picker
17
17
v-model =" dateRange"
18
- style =" width : 260px "
19
18
type =" daterange"
20
- range-separator =" -"
21
19
start-placeholder =" 开始日期"
22
20
end-placeholder =" 结束日期"
23
- :default-time =" defaultTime "
21
+ :default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')] "
24
22
@change =" getSummary"
23
+ class =" !w-240px"
25
24
/>
26
25
</el-form-item >
27
26
</el-form >
75
74
</template >
76
75
77
76
<script setup lang="ts" name="MpStatistics">
78
- import * as StatisticsApi from ' @/api/mp/statistics'
79
77
import { formatDate , addTime , betweenDay , beginOfDay , endOfDay } from ' @/utils/formatTime'
78
+ import * as StatisticsApi from ' @/api/mp/statistics'
80
79
import * as MpAccountApi from ' @/api/mp/account'
81
80
const message = useMessage () // 消息弹窗
82
81
83
- // 默认时间 开始时间00:00:00 结束时间23:59:59
84
- const defaultTime = ref <[Date , Date ]>([
85
- new Date (2000 , 1 , 1 , 0 , 0 , 0 ),
86
- new Date (2000 , 2 , 1 , 23 , 59 , 59 )
87
- ])
88
82
// 默认开始时间是当前日期-7,结束时间是当前日期-1
89
83
const dateRange = ref ([
90
84
beginOfDay (new Date (new Date ().getTime () - 3600 * 1000 * 24 * 7 )),
91
85
endOfDay (new Date (new Date ().getTime () - 3600 * 1000 * 24 ))
92
86
])
93
- const accountId = ref ()
87
+ const accountId = ref () // 选中的公众号编号
94
88
const accountList = ref <MpAccountApi .AccountVO []>([]) // 公众号账号列表
95
89
96
90
const xAxisDate = ref ([] as any []) // X 轴的日期范围
@@ -269,6 +263,7 @@ const getSummary = () => {
269
263
initUpstreamMessageChart ()
270
264
interfaceSummaryChart ()
271
265
}
266
+
272
267
/** 用户增减数据 */
273
268
const initUserSummaryChart = async () => {
274
269
userSummaryOption .xAxis .data = []
@@ -297,6 +292,7 @@ const initUserSummaryChart = async () => {
297
292
})
298
293
} catch {}
299
294
}
295
+
300
296
/** 累计用户数据 */
301
297
const initUserCumulateChart = async () => {
302
298
userCumulateOption .xAxis .data = []
@@ -314,6 +310,7 @@ const initUserCumulateChart = async () => {
314
310
})
315
311
} catch {}
316
312
}
313
+
317
314
/** 消息概况数据 */
318
315
const initUpstreamMessageChart = async () => {
319
316
upstreamMessageOption .xAxis .data = []
@@ -333,6 +330,7 @@ const initUpstreamMessageChart = async () => {
333
330
})
334
331
} catch {}
335
332
}
333
+
336
334
/** 接口分析数据 */
337
335
const interfaceSummaryChart = async () => {
338
336
interfaceSummaryOption .xAxis .data = []
0 commit comments