From 21e196d58f851c44ff1a2949269c1ecd8ce3431e Mon Sep 17 00:00:00 2001 From: zhangjun1 Date: Tue, 23 Jun 2020 14:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/workbench/workPlace.vue | 64 ++++++++++++++++++------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/src/pages/workbench/workPlace.vue b/src/pages/workbench/workPlace.vue index 6f5a092..3079014 100644 --- a/src/pages/workbench/workPlace.vue +++ b/src/pages/workbench/workPlace.vue @@ -134,7 +134,7 @@

服务应用总况 - + { console.log(response); let data = response.data.data; - this.init_fwyy(data.appusedata.xarr, data.appusedata.yarr); + this.service_app_count = data + this.init_fwyy(this.service_app_count.serviceData.xAxisData, this.service_app_count.serviceData.seriesData,this.fw_value); }) .catch(function(response) {}); }, getfwlxdata() { this.$http - .get("./static/workpalce.json") + .get("/apaas/service/v3/workplace/statistics/service/type") .then((response) => { console.log(response); let data = response.data.data; - this.init_fwlx_asy(data.fwlxdata); + this.init_fwlx_asy(data.seriesData); }) .catch(function(response) {}); }, @@ -1202,11 +1212,13 @@ export default { }, getHealth() { this.$http - .get("./static/workpalce.json") + .get("/apaas/service/v3/workplace/statistics/health/status") .then((response) => { console.log(response); let data = response.data.data; - this.init_health(data.health); + var temp = Math.round(data.seriesData[0].value/(data.seriesData[0].value+data.seriesData[1].value)*100) + console.log(temp); + this.init_health(temp); }) .catch(function(response) {}); }, @@ -1222,16 +1234,16 @@ export default { }, getInfoData() { this.$http - .get("./static/workpalce.json") + .get("/apaas/service/v3/workplace/statistics/basic") .then((response) => { console.log(response); let data = response.data.data; this.menu_arr[this.now_user].forEach((e, idx) => { - if (data.infodata[e.type]) { + if (data[e.type]||data[e.type]==0) { this.$set( this.menu_arr[this.now_user][idx], "num", - data.infodata[e.type] + data[e.type] ); } }); @@ -1566,7 +1578,7 @@ export default { window[this.yy_asy] = echarts.init(document.getElementById(this.yy_asy)); window[this.yy_asy].setOption(options, true); }, - init_fwyy(xarr, yarr) { + init_fwyy(xarr, yarr,n) { var dataname = ["服务总数", "应用总数"]; var options = { tooltip: { @@ -1578,7 +1590,7 @@ export default { }, }, legend: { - data: [dataname[0]], + data: [dataname[n]], itemWidth: 14, itemHeight: 10, bottom: 0, @@ -1615,7 +1627,7 @@ export default { { data: yarr, type: "line", - name: dataname[0], + name: dataname[n], smooth: true, sampling: "average", symbol: "circle", -- 2.26.0