diff --git a/src/views/sevenLargeScreen/digitalConstruction/loadometerManage/topLeft.vue b/src/views/sevenLargeScreen/digitalConstruction/loadometerManage/topLeft.vue
index 52c218d..ff5e81e 100644
--- a/src/views/sevenLargeScreen/digitalConstruction/loadometerManage/topLeft.vue
+++ b/src/views/sevenLargeScreen/digitalConstruction/loadometerManage/topLeft.vue
@@ -19,6 +19,11 @@ import { getAirQualityStatisticsApi } from "@/api/modules/headNoise";
import * as echarts from "echarts";
import { onMounted, reactive, ref } from "vue";
import Card from "@/components/card.vue";
+import firstIcon from "@/assets/images/loadometerManage/first.png";
+import secondIcon from "@/assets/images/loadometerManage/second.png";
+import thirdIcon from "@/assets/images/loadometerManage/third.png";
+import fourthIcon from "@/assets/images/loadometerManage/fourth.png";
+
const store = GlobalStore();
const airType = ref(1);
// 选中
@@ -49,11 +54,11 @@ const airTypeEchart = ref([
"某某某有限公司8",
"某某某有限公司9"
]);
-const airTypeData = ref([100, 99, 89, 69, 50, 39, 35, 25, 20]);
+const airTypeData = ref([100, 89, 79, 69, 50, 39, 35, 25, 20]);
const option = reactive({
grid: {
left: "0%",
- right: "5%",
+ right: "0%",
bottom: "0%",
top: "5%",
containLabel: true
@@ -72,19 +77,11 @@ const option = reactive({
show: true,
inside: true,
verticalAlign: "bottom",
- padding: [0, 0, 10, 0],
+ padding: [0, 0, 8, 30],
lineHeight: "20",
textStyle: {
color: "#FFFFFF",
fontSize: "14"
- },
- formatter: function (val, index) {
- console.log("val", val, index);
- if (index === 0 || index === 1 || index === 2) {
- return index + 1 + " " + val;
- } else {
- return val;
- }
}
},
splitLine: {
@@ -104,17 +101,27 @@ const option = reactive({
axisLine: "none",
axisLabel: {
inside: true,
- verticalAlign: "bottom",
- padding: [0, 0, 10, 50],
+ padding: [0, 0, 20, 30],
lineHeight: "20",
textStyle: {
color: "#FFFFFF",
fontSize: "12"
+ },
+ formatter: function (val: any, index: any) {
+ if (index < 3) {
+ return `{color1|${val}}`;
+ } else {
+ return `{color2|${val}}`;
+ }
+ },
+ rich: {
+ color1: {
+ color: "#EEA959"
+ },
+ color2: {
+ color: "#A0B8E5"
+ }
}
- // formatter: function (val, index) {
- // // console.log("val", val, index);
- // return val + " %";
- // }
},
data: airTypeData.value
},
@@ -137,27 +144,94 @@ const option = reactive({
},
barGap: "-100%",
label: {
- show: false,
- // position:'right',
- // formatter:'{@score}%',
- textStyle: {
- color: "#03fcfe",
- fontSize: "12"
+ normal: {
+ color: "#FFFFFF",
+ show: true,
+ position: [0, "-24px"],
+ textStyle: {
+ fontSize: 16
+ },
+ formatter: function (a) {
+ let num = "";
+ let str = "";
+ if (a.dataIndex + 1 < 10) {
+ // num = "No." + (a.dataIndex + 1);
+ } else {
+ // num = a.dataIndex + 1;
+ }
+ if (a.dataIndex === 0) {
+ str = `{color1|${num}}`;
+ } else if (a.dataIndex === 1) {
+ str = `{color2|${num}}`;
+ } else if (a.dataIndex === 2) {
+ str = `{color3|${num}}`;
+ } else {
+ str = `{color4|${a.dataIndex + 1}}`;
+ }
+ return str;
+ },
+ rich: {
+ color1: {
+ width: 30,
+ height: 20,
+ backgroundColor: {
+ image: firstIcon
+ }
+ },
+ color2: {
+ width: 30,
+ height: 20,
+ backgroundColor: {
+ image: secondIcon
+ }
+ },
+ color3: {
+ width: 30,
+ height: 20,
+ backgroundColor: {
+ image: thirdIcon
+ }
+ },
+ color4: {
+ align: "center",
+ color: "#FFFFFF",
+ backgroundColor: {
+ image: fourthIcon
+ }
+ }
+ }
}
},
itemStyle: {
normal: {
barBorderRadius: 10,
- color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
- {
- offset: 0,
- color: "#194077"
- },
- {
- offset: 1,
- color: "#4CC4F8"
+ color: (val: any) => {
+ if (val.dataIndex < 3) {
+ let topColor = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
+ {
+ offset: 0,
+ color: "rgba(238, 169, 89, 0)"
+ },
+ {
+ offset: 1,
+ color: "rgba(238, 169, 89, 1)"
+ }
+ ]);
+ return topColor;
+ } else {
+ let nowColor = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
+ {
+ offset: 0,
+ color: "#194077"
+ },
+ {
+ offset: 1,
+ color: "#4CC4F8"
+ }
+ ]);
+ return nowColor;
}
- ])
+ }
}
},
barWidth: 2,
@@ -174,7 +248,7 @@ const option = reactive({
itemStyle: {
normal: {
borderColor: "#fff",
- borderWidth: 4,
+ borderWidth: 3,
color: "#fff",
opacity: 1
}
@@ -188,13 +262,12 @@ const option = reactive({
yAxisIndex: 0,
data: [0, 0, 0, 0, 0, 0, 0, 0, 0], //小白点外圈,数据静态
label: false,
- symbolSize: 15,
+ symbolSize: 16,
itemStyle: {
normal: {
- borderColor: "#4CC4F8",
- borderWidth: 2,
- color: "#14346c",
- opacity: 1
+ borderColor: "#FFFFFF",
+ borderWidth: 1,
+ color: "#14346c"
}
},
z: 2