调用趋势

This commit is contained in:
851673013@qq.com 2022-07-06 17:01:44 +08:00
parent eb08f86f21
commit 544ba02828
1 changed files with 14 additions and 5 deletions

View File

@ -174,7 +174,7 @@
} else {
for (let i = 0; i < 31; i++) {
let time = moment()
.subtract('days', 30 - i)
.subtract('days', 29 - i)
.format('MM-DD')
callTheTrendData.value.time.push(time)
console.log('time', callTheTrendData.value, name)
@ -186,14 +186,23 @@
if (!xinhaianIsShow) {
callTheTrendPort(start, end, 86400).then((res) => {
if (res.data.data.result) {
// res.data.data.result.splice(0, 1)
callTheTrendData.value.snum = []
res.data.data.result[0].values.map((item) => {
callTheTrendData.value.snum.push(
moment(item[0] * 1000).format('MM-DD')
)
callTheTrendData.value.snum.push(parseInt(item[1]))
})
if (res.data.data.result[0].values.length < 30) {
for (
let i = 0;
i < 30 - res.data.data.result[0].values.length;
i++
) {
callTheTrendData.value.snum.push(0)
}
}
console.log(
'callTheTrendData.value.snum',
callTheTrendData.value.snum
)
callTheTrend(callTheTrendData.value)
} else {
for (let i = 0; i < 30; i++) {