From e5c66a2eeb06fe25ef1c02da145e84e5d5261070 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Tue, 3 Aug 2021 11:00:41 +0800 Subject: [PATCH] fixed bug#2665 --- src/pages/data-analysis/my-service.vue | 30 +++------------ src/pages/data-analysis/org-service.vue | 12 ++++-- src/pages/data-analysis/super-service.vue | 46 ++++++++++++++--------- 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/src/pages/data-analysis/my-service.vue b/src/pages/data-analysis/my-service.vue index 5c82d41..18d0379 100644 --- a/src/pages/data-analysis/my-service.vue +++ b/src/pages/data-analysis/my-service.vue @@ -478,31 +478,11 @@ export default { }, ], // 服务状态统计 starlistData: [ - { - star: 5, - count: 0, - unit: "个", - }, - { - star: 4, - count: 0, - unit: "个", - }, - { - star: 3, - count: 0, - unit: "个", - }, - { - star: 2, - count: 0, - unit: "个", - }, - { - star: 1, - count: 0, - unit: "个", - }, + { star: 5, count: 0, unit: "个" }, + { star: 4, count: 0, unit: "个" }, + { star: 3, count: 0, unit: "个" }, + { star: 2, count: 0, unit: "个" }, + { star: 1, count: 0, unit: "个" }, ], // 服务评分 starlistTotal: 0, hotSearchHeader: [], // 热门搜索 表头 diff --git a/src/pages/data-analysis/org-service.vue b/src/pages/data-analysis/org-service.vue index 700241b..2788a80 100644 --- a/src/pages/data-analysis/org-service.vue +++ b/src/pages/data-analysis/org-service.vue @@ -497,8 +497,14 @@ export default { toplistTargetValue: 40, // 服务调用排名分析 目标值 commentlistData: [], // 服务评价 linelistData: [], // 服务状态统计 - starlistData: [], // 服务评分 - starlistTotal: 15, + starlistData: [ + { star: 5, count: 0, unit: "个" }, + { star: 4, count: 0, unit: "个" }, + { star: 3, count: 0, unit: "个" }, + { star: 2, count: 0, unit: "个" }, + { star: 1, count: 0, unit: "个" }, + ], // 服务评分 + starlistTotal: 0, hotSearchHeader: [], // 热门搜索 表头 hotSearchData: [], // 热门搜索 数据 graph_arr: { @@ -951,4 +957,4 @@ export default { word-break: break-all; white-space: nowrap; } - \ No newline at end of file + diff --git a/src/pages/data-analysis/super-service.vue b/src/pages/data-analysis/super-service.vue index 0fa8659..221ac3c 100644 --- a/src/pages/data-analysis/super-service.vue +++ b/src/pages/data-analysis/super-service.vue @@ -495,8 +495,14 @@ export default { toplistTargetValue: 40, // 服务调用排名分析 目标值 commentlistData: [], // 服务评价 linelistData: [], // 服务状态统计 - starlistData: [], // 服务评分 - starlistTotal: 15, + starlistData: [ + { star: 5, count: 0, unit: "个" }, + { star: 4, count: 0, unit: "个" }, + { star: 3, count: 0, unit: "个" }, + { star: 2, count: 0, unit: "个" }, + { star: 1, count: 0, unit: "个" }, + ], // 评分 + starlistTotal: 10, hotSearchHeader: [], // 热门搜索 表头 hotSearchData: [], // 热门搜索 数据 graph_arr: { @@ -715,26 +721,30 @@ export default { }) .then((response) => { if (response.data.success == 1) { + let _data = response.data.data; + if (this.right_3_state == 0) { - let data = response.data.data || []; - this.commentlistData = data.concat(this.commentlistData); + _data = _data || []; + + this.commentlistData = _data.concat(this.commentlistData); + if (this.commentlistData && this.commentlistData.length != 0) { this.last_id = this.commentlistData[0].last_id; } } else { - let data = response.data.data; - this.starlistData[0].count = data.score5; - this.starlistData[1].count = data.score4; - this.starlistData[2].count = data.score3; - this.starlistData[3].count = data.score2; - this.starlistData[4].count = data.score1; - this.starlistTotal = - data.score5 + - data.score4 + - data.score3 + - data.score2 + - data.score1; - console.log(this.starlistData, this.starlistTotal); + if (_data) { + this.starlistData[0].count = _data.score5; + this.starlistData[1].count = _data.score4; + this.starlistData[2].count = _data.score3; + this.starlistData[3].count = _data.score2; + this.starlistData[4].count = _data.score1; + this.starlistTotal = + _data.score5 + + _data.score4 + + _data.score3 + + _data.score2 + + _data.score1; + } } } }); @@ -957,4 +967,4 @@ export default { word-break: break-all; white-space: nowrap; } - \ No newline at end of file + -- 2.26.0