diff --git a/src/api/modules/http.js b/src/api/modules/http.js index 75e8da6..8408949 100644 --- a/src/api/modules/http.js +++ b/src/api/modules/http.js @@ -1399,3 +1399,12 @@ export function biRankingData(data) { }) } +// 重新转写 +export function toMergeRecord(params) { + return request({ + url: 'autoSR/customer/toMergeRecord', + method: 'get', + params + }) +} + diff --git a/src/page/bi/bi.vue b/src/page/bi/bi.vue index 889052b..66edaa0 100644 --- a/src/page/bi/bi.vue +++ b/src/page/bi/bi.vue @@ -8,7 +8,7 @@ - + - + +
+
+ +
+
+
+ @@ -386,7 +383,6 @@ import titles from "./common/title.vue"; import * as dialogConstList from "./index"; import { mapGetters } from "vuex"; - export default { components: { titles }, data() { @@ -466,11 +462,10 @@ export default { return name == this.headIndex; }; }, - }, created() { - this.checkAuthority() + this.checkAuthority(); }, mounted() { @@ -480,23 +475,26 @@ export default { methods: { // 检测权限 checkAuthority() { - this.headList.forEach(item => { + this.headList.forEach((item) => { if (this.permissions[item.methods]) { - item.show = true + item.show = true; } else { - item.show = false + item.show = false; } - }) + }); let hIndex = sessionStorage.getItem("BIHeadIndex") || "实时总览"; - let obj = this.headList.find(item => item.title == hIndex) + let obj = this.headList.find((item) => item.title == hIndex); if (obj.show) { - this.selectNav(obj) + this.selectNav(obj); } else { - let obj1 = this.headList.find(item => item.show === true) - this.selectNav(obj1) + let obj1 = this.headList.find((item) => item.show === true); + this.selectNav(obj1); } }, + // 清除数据 + clearData() {}, + // 初始化页面 initPage() { this.biGetOrgCodeList(); @@ -514,7 +512,9 @@ export default { // 案场排名 initCaseRanking() { this.biTopStatisticData(); - this.biRankingData(); + this.$nextTick(() => { + this.biRankingData(); + }); }, // 案场排名顶部对比数据 @@ -549,31 +549,61 @@ export default { this.$api.http.biRankingData(params).then((res) => { if (res.code == 10000) { this.rankingEchartsBarList.forEach((ob) => { - let xAxis = res.data[ob.params].data.map((item) => { + let object = res.data[ob.params]; + console.log(object, ob.params); + let xAxis = object.data.map((item) => { return item.name; }); let avgList = []; + let yAxis = {}; if (this.companyValue) { avgList.push({ - yAxis: res.data[ob.params].companyAvg, + yAxis: object.companyAvg, name: "集团平均", }); + try { + if ( + object.data[this.orderBy == 1 ? 0 : object.data.length - 1] + .value < object.companyAvg + ) { + yAxis.max = object.companyAvg; + } + } catch (e) { + console.log(e); + } } else { avgList.push({ - yAxis: res.data[ob.params].allAvg, + yAxis: object.allAvg, name: "行业平均", }); + try { + if ( + object.data[this.orderBy == 1 ? 0 : object.data.length - 1] + .value < object.allAvg + ) { + yAxis.max = object.allAvg; + } + } catch (e) { + console.log(e); + } } + if (ob.unit == "%") { + yAxis = { + max: 100, + }; + } + this.$nextTick(() => { this.creatBar({ id: ob.params, xAxis: xAxis, + yAxis: yAxis, series: [ { type: "bar", - barMaxWidth: "10%", + barMaxWidth: "20%", name: ob.title, - data: res.data[ob.params].data || [], + data: object.data || [], itemStyle: { normal: { //柱体的颜色 @@ -1055,7 +1085,7 @@ export default { radius: ["45%", "60%"], labelLine: { length: 5, - showAbove: true + showAbove: true, }, minAngle: 5, avoidLabelOverlap: true, @@ -1113,7 +1143,7 @@ export default { series: [ { type: "bar", - barMaxWidth: "10%", + barMaxWidth: "20%", name: name, data: this[params], itemStyle: { @@ -1175,7 +1205,7 @@ export default { series: [ { type: "bar", - barMaxWidth: "10%", + barMaxWidth: "20%", name: list.title, data: this[list.params], itemStyle: { @@ -1224,7 +1254,7 @@ export default { series: [ { type: "bar", - barMaxWidth: "10%", + barMaxWidth: "20%", name: list.title, data: this[list.params1], itemStyle: { @@ -1273,6 +1303,7 @@ export default { // 生成柱状图 creatBar(obj) { + console.log(obj, obj.id); // 基于准备好的dom,初始化echarts实例 let myChart = echarts.init(document.getElementById(obj.id)); myChart.clear(); @@ -1318,8 +1349,8 @@ export default { ], yAxis: [ { + ...obj.yAxis, type: "value", - nameTextStyle: { color: "#fff", fontSize: 12, @@ -1579,7 +1610,6 @@ export default { .search { margin: 0 0 0 40px; - } .text { @@ -1872,7 +1902,7 @@ export default { padding: 0 0 30px 0; width: 100%; - .head-box { + .head-boxs { padding: 0 16px; width: 100%; height: 114px; @@ -1880,7 +1910,7 @@ export default { grid-template-columns: repeat(8, 1fr); grid-column-gap: 16px; - .head-box-item { + .head-box-items { padding: 24px 28px; background: url("/img/bidata/itemBg.png") no-repeat; background-size: 222px; @@ -2118,7 +2148,7 @@ export default { } /deep/.search .el-button--primary { - background-color: #2ED1EE !important; + background-color: #2ed1ee !important; }