From 3e827bf564c0221ced2417040ba6988fb358a134 Mon Sep 17 00:00:00 2001 From: liudianxin Date: Fri, 14 Aug 2020 18:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E4=BC=98=E5=8C=96=EF=BC=8C=E6=9C=8D=E5=8A=A1=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E4=BD=BF=E7=94=A8=E6=9C=8D=E5=8A=A1=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B5=81=E7=A8=8B=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/data-analysis/data-analysis.vue | 2 - src/pages/data-analysis/my-service.vue | 209 ++++++++++-------- .../process-design/index.vue | 2 +- src/pages/workbench/fwzc_fwcs.vue | 5 +- src/router/index.js | 4 +- 5 files changed, 121 insertions(+), 101 deletions(-) diff --git a/src/pages/data-analysis/data-analysis.vue b/src/pages/data-analysis/data-analysis.vue index a974e67..20e57e8 100644 --- a/src/pages/data-analysis/data-analysis.vue +++ b/src/pages/data-analysis/data-analysis.vue @@ -94,10 +94,8 @@ export default { this.navList = this.userNav; } else if (this.is_admin == 2) { this.navList = this.userNav1; - this.$router.push({ name: "orgServiceDataAnalysis" }); } else if (this.is_admin == 1) { this.navList = this.userNav2; - this.$router.push({ name: "superServiceDataAnalysis" }); } }, }, diff --git a/src/pages/data-analysis/my-service.vue b/src/pages/data-analysis/my-service.vue index 577f659..0765e66 100644 --- a/src/pages/data-analysis/my-service.vue +++ b/src/pages/data-analysis/my-service.vue @@ -12,7 +12,7 @@ }} - + @@ -276,11 +276,11 @@ export default { BarChart, ApassTable, Graph, - Topology + Topology, }, data: () => ({ overview: { - serviceTotal: 0 + serviceTotal: 0, }, left_1_state: 0, left_2_state: 0, @@ -297,66 +297,66 @@ export default { spRefLineStyles3: { stroke: "#d14", strokeOpacity: 0, - strokeDasharray: "2, 2" + strokeDasharray: "2, 2", }, spCurveStyles2: { stroke: "#274fee", - fill: "#274fee" + fill: "#274fee", }, spCurveStyles3: { stroke: "#e56600", - fill: "#e56600" + fill: "#e56600", }, sparkline1: { - num:0, - up:0, - arr:[] + num: 0, + up: 0, + arr: [], }, sparkline2: { - num:0, - up:0, - arr:[] + num: 0, + up: 0, + arr: [], }, text: "服务总数", single_data: { num: 0, color: "#25bdb1", - text: "共享" + text: "共享", }, single_data1: { num: 0, color: "#f5ab4c", - text: "受限" + text: "受限", }, single_data2: { num: 0, color: "#e15260", - text: "敏感" + text: "敏感", }, line_data: { xAxisData: [], seriesData: [ { name: "", - data: [] + data: [], }, { name: "", - data: [] - } - ] + data: [], + }, + ], }, das_data: { data: 90, - text: "健康占比" + text: "健康占比", }, bar_data: { legendData: [], - seriesData: [] + seriesData: [], }, bar_data_org: { legendData: [], - seriesData: [] + seriesData: [], }, toplistData: [], // 服务调用排名分析 toplistTargetValue: 0, // 服务调用排名分析 目标值 @@ -366,148 +366,173 @@ export default { count: 6, percent: 75, title: "0.1% 错误", - unit: "个" + unit: "个", }, { count: 2, percent: 25, title: "0.1 - 20% 错误", - unit: "个" + unit: "个", }, { count: 0, percent: 0, title: "20% 错误", - unit: "个" + unit: "个", }, { count: 0, percent: 0, title: "TCP连接", - unit: "个" + unit: "个", }, { count: 0, percent: 0, title: "Idle", - unit: "个" - } + unit: "个", + }, ], // 服务状态统计 starlistData: [ { star: 5, count: 5, - unit: "个" + unit: "个", }, { star: 4, count: 4, - unit: "个" + unit: "个", }, { star: 3, count: 3, - unit: "个" + unit: "个", }, { star: 2, count: 2, - unit: "个" + unit: "个", }, { star: 1, count: 1, - unit: "个" - } + unit: "个", + }, ], // 服务评分 starlistTotal: 15, hotSearchHeader: [], // 热门搜索 表头 hotSearchData: [], // 热门搜索 数据 graph_arr: { legend: { - data: [] + data: [], }, data: [], - series: [{ data: [] }, { data: [] }] + series: [{ data: [] }, { data: [] }], }, - topology_datas: {} + topology_datas: {}, + is_general_user: false, }), mounted() { - this.getServiceOverview(); - this.getServiceHealth(); - this.getServiceTrend(); - this.getServiceType(); - this.getServiceSectorse(); - this.getServiceOrg(); - this.getServiceOpenness(); - this.getServiceRequest(); - this.getServiceOnlineState(); - this.getServiceEstimated(); - this.getServiceHotSearch(); + this.checkAuthority(); this.hotSearchHeader = [ { label: "服务排名", type: "hot-index", width: 100, - align: "center" + align: "center", }, { label: "服务名称", prop: "name", type: "button", - callback: this.detailHotSearch + callback: this.detailHotSearch, }, { label: "搜索次数", prop: "count", width: 100, - align: "center" + align: "center", }, { label: "日涨幅", prop: "increases", width: 100, sortType: "0", // 0:升序 1:降序 - align: "center" - } + align: "center", + }, ]; - this.getTopologyData(); }, methods: { - getServiceHotSearch(){ - this.$api.dataAnalysis.getServiceHotSearch().then(response => { + checkAuthority() { + let is_admin = this.$store.state.userInfo.is_admin; + if (is_admin == 3 || is_admin == 4) { + this.is_general_user = true; + this.getServiceOverview(); + this.getServiceHealth(); + this.getServiceTrend(); + this.getServiceType(); + this.getServiceSectorse(); + this.getServiceOrg(); + this.getServiceOpenness(); + this.getServiceRequest(); + this.getServiceOnlineState(); + this.getServiceEstimated(); + this.getServiceHotSearch(); + this.getTopologyData(); + } else if (is_admin == 2) { + this.$router.push("/data_analysis/org_service"); + } else if (is_admin == 1) { + this.$router.push("/data_analysis/super_service"); + } + }, + getServiceHotSearch() { + this.$api.dataAnalysis.getServiceHotSearch().then((response) => { if (response.data.success == 1) { - let data = response.data.data + let data = response.data.data; this.sparkline1 = { - num:data.search_user.count, - up:data.trend=='up'?data.search_user.per:data.trend=='down'?0-data.search_user.per:data.search_user.per, - arr:data.search_user_trend.seriesData - } + num: data.search_user.count, + up: + data.trend == "up" + ? data.search_user.per + : data.trend == "down" + ? 0 - data.search_user.per + : data.search_user.per, + arr: data.search_user_trend.seriesData, + }; this.sparkline2 = { - num:data.search_user_avg.count, - up:data.trend=='up'?data.search_user_avg.per:data.trend=='down'?0-data.search_user_avg.per:data.search_user_avg.per, - arr:data.search_user_avg_trend.seriesData - } + num: data.search_user_avg.count, + up: + data.trend == "up" + ? data.search_user_avg.per + : data.trend == "down" + ? 0 - data.search_user_avg.per + : data.search_user_avg.per, + arr: data.search_user_avg_trend.seriesData, + }; // top5_rank - this.hotSearchData = [] - if(data.top5_rank&&data.top5_rank.length){ - data.top5_rank.forEach((e,idx) => { - this.hotSearchData.push( - { - id:e.service_id, - hotIndex: top_rank, - name: e.service_name, - count: e.search_count, - increases: e.trend=='up'?e.search_user.per:e.trend=='down'?0-e.search_user.per:e.search_user.per - } - ) + this.hotSearchData = []; + if (data.top5_rank && data.top5_rank.length) { + data.top5_rank.forEach((e, idx) => { + this.hotSearchData.push({ + id: e.service_id, + hotIndex: top_rank, + name: e.service_name, + count: e.search_count, + increases: + e.trend == "up" + ? e.search_user.per + : e.trend == "down" + ? 0 - e.search_user.per + : e.search_user.per, + }); }); } } }); }, getServiceOverview() { - this.$api.dataAnalysis.getServiceOverview().then(response => { + this.$api.dataAnalysis.getServiceOverview().then((response) => { if (response.data.success == 1) { this.overview = response.data.data; this.das_data.data = Math.round( @@ -520,7 +545,7 @@ export default { }); }, getServiceHealth() { - this.$api.dataAnalysis.getServiceHealth().then(response => { + this.$api.dataAnalysis.getServiceHealth().then((response) => { if (response.data.success == 1) { this.mult_data_state = response.data.data.seriesData; } @@ -529,7 +554,7 @@ export default { getServiceTrend() { this.$api.dataAnalysis .getServiceTrend({ type: this.right_1_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.graph_arr = response.data.data; } @@ -538,7 +563,7 @@ export default { getServiceType() { this.$api.dataAnalysis .getServiceType({ type: this.left_2_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.mult_data = response.data.data.seriesData; } @@ -547,7 +572,7 @@ export default { getServiceSectorse() { this.$api.dataAnalysis .getServiceSectorse({ type: this.left_3_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.bar_data = response.data.data; } @@ -556,7 +581,7 @@ export default { getServiceOrg() { this.$api.dataAnalysis .getServiceOrg({ type: this.left_3_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.bar_data_org = response.data.data; } @@ -565,7 +590,7 @@ export default { getServiceOpenness() { this.$api.dataAnalysis .getServiceOpenness({ type: this.right_2_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.single_data.num = response.data.data.shared; this.single_data1.num = response.data.data.privacy; @@ -576,7 +601,7 @@ export default { getServiceRequest() { this.$api.dataAnalysis .getServiceRequest({ type: this.right_0_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.toplistData = response.data.data; if (this.toplistData && this.toplistData.length != 0) { @@ -588,7 +613,7 @@ export default { getServiceOnlineState() { this.$api.dataAnalysis .getServiceOnlineState({ type: this.center_3_state }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.line_data = response.data.data; console.log(this.line_data); @@ -599,9 +624,9 @@ export default { this.$api.dataAnalysis .getServiceEstimated({ type: this.right_3_state, - last_id: this.last_id + last_id: this.last_id, }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.commentlistData = response.data.data.concat( this.commentlistData @@ -611,7 +636,7 @@ export default { }); }, detailHotSearch(item) { - this.$router.push('/fwgl/0/0/servicedetail/'+item.id) + this.$router.push("/fwgl/0/0/servicedetail/" + item.id); }, changeServiceTypeBtn(index) { this.left_2_state = index; @@ -642,7 +667,7 @@ export default { this.getServiceOnlineState(); }, getTopologyData() { - this.$api.workbench.getServiceTopology().then(response => { + this.$api.workbench.getServiceTopology().then((response) => { this.topology_datas = response.data.elements; }); }, @@ -653,8 +678,8 @@ export default { } else { this.a(); } - } - } + }, + }, };