Merge branch 'hi-ucs-dev' of http://15.2.21.221:3000/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
a0049873 2022-07-01 19:02:56 +08:00
commit 3f77db2ff8
1 changed files with 43 additions and 32 deletions

View File

@ -121,6 +121,7 @@
totalCallsSnum,
} from '@/api/capabilityCloud'
import * as moment from 'moment'
let xinhaianIsShow = whoShow.itShowXiHaiAn //西
let snum = ref([
{ title: '上架总量', num: '0000' },
{ title: '总调用次数(API)', num: '0' },
@ -153,18 +154,22 @@
(Date.parse(new Date()) - 168 * 60 * 60 * 1000) / 1000
)
const end = Date.parse(new Date()) / 1000
callTheTrendPort(start, end, 86400).then((res) => {
if (res.data.data.result) {
res.data.data.result[0].values.splice(0, 1)
res.data.data.result[0].values.map((item) => {
callTheTrendData.value.snum.push(parseInt(item[1]))
})
callTheTrend(callTheTrendData.value)
} else {
callTheTrendData.value.snum = ['0', '0', '0', '0', '0', '0', '0']
callTheTrend(callTheTrendData.value)
}
})
if (!xinhaianIsShow) {
callTheTrendPort(start, end, 86400).then((res) => {
if (res.data.data.result) {
res.data.data.result[0].values.splice(0, 1)
res.data.data.result[0].values.map((item) => {
callTheTrendData.value.snum.push(parseInt(item[1]))
})
callTheTrend(callTheTrendData.value)
} else {
callTheTrendData.value.snum = ['0', '0', '0', '0', '0', '0', '0']
callTheTrend(callTheTrendData.value)
}
})
} else {
callTheTrend(callTheTrendData.value)
}
} else {
for (let i = 0; i < 31; i++) {
let time = moment()
@ -177,24 +182,28 @@
(Date.parse(new Date()) - 720 * 60 * 60 * 1000) / 1000
)
const end = Date.parse(new Date()) / 1000
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]))
})
callTheTrend(callTheTrendData.value)
} else {
for (let i = 0; i < 30; i++) {
callTheTrendData.value.snum.push('0')
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]))
})
callTheTrend(callTheTrendData.value)
} else {
for (let i = 0; i < 30; i++) {
callTheTrendData.value.snum.push('0')
}
callTheTrend(callTheTrendData.value)
}
callTheTrend(callTheTrendData.value)
}
})
})
} else {
callTheTrend(callTheTrendData.value)
}
}
}
//echarts
@ -355,9 +364,11 @@
//
const TotalCallsAPI = () => {
const end = Date.parse(new Date()) / 1000
totalCallsSnum(end).then((res) => {
snum.value[1].num = res.data.data.result[0].value[1]
})
if (!xinhaianIsShow) {
totalCallsSnum(end).then((res) => {
snum.value[1].num = res.data.data.result[0].value[1]
})
}
}
const init = () => {
timeSwitch(timeSwitchindex.value)