From 656f78d42ee2397e2711e3b3e665b54f25700cf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=A3=8E=E7=BB=A7=E7=BB=AD=E5=90=B9?= <17611323298@163.com>
Date: Tue, 25 Apr 2023 15:22:16 +0800
Subject: [PATCH] =?UTF-8?q?bi=E5=A4=A7=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/modules/http.js | 9 +
src/page/bi/bi.vue | 442 ++++++++++++++-------------
src/page/bi/index.js | 7 +-
src/views/ReceivingRecords/index.vue | 16 +
vue.config.js | 103 +++----
5 files changed, 312 insertions(+), 265 deletions(-)
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 @@
@@ -64,6 +64,7 @@
v-model="companyValue"
placeholder="请选择"
clearable
+ filterable
@change="changeCompany"
:popper-append-to-body="false"
>
@@ -86,7 +87,7 @@
>
@@ -104,7 +105,7 @@
>
@@ -136,207 +137,203 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
待处理
-
-
+
+
+
+
待处理
+
+
-
-
- {{ data.data || 0 }}
-
-
{{ data.title }}
+
+
+ {{ data.data || 0 }}
+
{{ data.title }}
-
-
+
+
+
+
+
+
+
-
-
-
-
-
- {{ receptionCount }}
- 次
-
+
+ {{ receptionCount }}
+ 次
+
-
+
+
-
- {{ data.data || 0 }}{{ data.unit || "" }}
-
-
{{ data.title }}
+ {{ data.data || 0 }}{{ data.unit || "" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ data.title }}
-
-
-
- {{ data.resultA }}
- {{ data.unit }}
-
-
-
-
-
- +{{ data.resultB }}
- {{ data.resultB }}
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
{{ data.title }}
+
+
+
+ {{ data.resultA }}
+ {{ data.unit }}
+
+
+
+
+
+ +{{ data.resultB }}
+ {{ data.resultB }}
+
+
-
-
+
+
+
@@ -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;
}