From 40804a7b9d573b125785ff787e46f095dfebff8e Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Fri, 1 Jul 2022 18:59:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E8=B0=83=E7=94=A8=E8=83=BD=E5=8A=9B=E4=BA=91=E5=9B=BE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=BB=84=E4=BB=B6=E6=9C=8D=E5=8A=A1=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E8=B6=8B=E5=8A=BF=E5=92=8C=E6=80=BB=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=AC=A1=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ComponentServices.vue | 75 +++++++++++-------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/front/src/views/capabilityCloud/components/ComponentServices.vue b/front/src/views/capabilityCloud/components/ComponentServices.vue index f2dd031d..8f0751ba 100644 --- a/front/src/views/capabilityCloud/components/ComponentServices.vue +++ b/front/src/views/capabilityCloud/components/ComponentServices.vue @@ -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)