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)