Browse Source

修改保利中央空调能耗分析系统-首页

bl_ers
selia-zx 5 days ago
parent
commit
58254adbf3
  1. 3
      .env.development
  2. 36
      src/api/index.js
  3. BIN
      src/assets/images/cold-bg.png
  4. BIN
      src/assets/images/home-icon1.png
  5. BIN
      src/assets/images/home-icon2.png
  6. BIN
      src/assets/images/home-icon3.png
  7. BIN
      src/assets/images/home-icon4.png
  8. BIN
      src/assets/images/home-icon5.png
  9. BIN
      src/assets/images/home-icon6.png
  10. BIN
      src/assets/images/home-icon7.png
  11. BIN
      src/assets/images/noactive-0.png
  12. BIN
      src/assets/images/noactive-1.png
  13. 37
      src/assets/styles/index.scss
  14. 32
      src/views/centerairC/energyAnalysis/components/ynyQnqAnalysis.vue
  15. 596
      src/views/components/chartsData.vue
  16. 144
      src/views/components/hotWater.vue
  17. 517
      src/views/components/sysEnergy.vue
  18. 514
      src/views/components/viewColdSys.vue
  19. 2
      src/views/components/viewEnergy.vue
  20. 1076
      src/views/index.vue

3
.env.development

@ -8,8 +8,7 @@ ENV = 'development'
# VUE_APP_BASE_API = '/dev-api'
# 后台
VUE_APP_BASE_API = 'http://192.168.1.222:8080'
# 梅州云端
# VUE_APP_BASE_API = 'http://106.55.173.225:8091'
# 广合
# VUE_APP_BASE_API = 'http://106.55.173.225:8092'

36
src/api/index.js

@ -60,3 +60,39 @@ export function getCoeData() {
method: "get",
});
}
// 图表
export function homeCharts() {
return request({
url: "/home/charts",
method: "get",
});
}
// 运行天数
export function homeRunTime() {
return request({
url: "/home/runTime",
method: "get",
});
}
// 实时总功率、总冷量
export function getCurrentRate() {
return request({
url: "/home/getCurrentRate",
method: "get",
});
}
// 实时能耗系数
export function getCoe() {
return request({
url: "/home/getCoe",
method: "get",
});
}
// 日月年供冷量、日月年EER
export function homeStatical() {
return request({
url: "/home/statical",
method: "get",
});
}

BIN
src/assets/images/cold-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/images/home-icon1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
src/assets/images/home-icon2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
src/assets/images/home-icon3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
src/assets/images/home-icon4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
src/assets/images/home-icon5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/assets/images/home-icon6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
src/assets/images/home-icon7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/assets/images/noactive-0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/assets/images/noactive-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

37
src/assets/styles/index.scss

@ -218,6 +218,43 @@ aside {
box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.4);
border-radius: 14px;
}
/** 科技感面板标题 - 左侧竖线 + 渐变底线 */
.panel-title {
position: relative;
padding: 0.1rem 0 0.1rem 0.18rem;
margin-bottom: 0.1rem;
&::before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 0.06rem;
height: 0.24rem;
background: linear-gradient(180deg, #00d7e9, #0078d7);
border-radius: 0.03rem;
box-shadow: 0 0 0.08rem rgba(0, 215, 233, 0.5);
}
&::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 1px;
background: linear-gradient(90deg, rgba(0, 215, 233, 0.4), transparent);
}
.panel-title-text {
font-size: 0.2rem;
font-weight: bold;
color: #e3fff9;
letter-spacing: 0.04rem;
text-shadow: 0 0 0.06rem rgba(0, 215, 233, 0.3);
}
}
.special-div {
display: flex;

32
src/views/centerairC/energyAnalysis/components/ynyQnqAnalysis.vue

@ -100,9 +100,9 @@
<div class="success-btn" style="margin-left: 0.24rem">
<el-button type="success" @click="findData">查询</el-button>
</div>
<!-- <div class="warning-bnt" style="margin-left: 0.24rem">
<div class="warning-bnt" style="margin-left: 0.24rem">
<el-button type="warning" @click="exportData">导出</el-button>
</div> -->
</div>
</div>
</div>
<div class="charts-table" v-loading="listLoading">
@ -891,20 +891,20 @@ export default {
this.exportArr.push(newData);
}
// // console.log("", this.exportArr);
// import("@/assets/excel/Export2Excel").then((excel) => {
// let filterVal = ["dateList", "curValue2", "lastValue2", "yoy2", "mom2"]; // excel
// let tHeader = ["", "", "", "", ""]; // excel
// const data = this.formatJson(filterVal, this.exportArr);
// const autoWidth = true;
// excel.export_json_to_excel({
// header: tHeader, //
// data, //
// filename: `${this.checkList}`, //
// autoWidth: true, //
// });
// this.$message.success("!");
// });
// console.log("", this.exportArr);
import("@/assets/excel/Export2Excel").then((excel) => {
let filterVal = ["dateList", "curValue2", "lastValue2", "yoy2", "mom2"]; // excel
let tHeader = ["时间", "本期", "同期", "同比", "环比"]; // excel
const data = this.formatJson(filterVal, this.exportArr);
const autoWidth = true;
excel.export_json_to_excel({
header: tHeader, //
data, //
filename: `${this.checkList}同比环比分析报表`, //
autoWidth: true, //
});
this.$message.success("导出成功!");
});
},
//,
formatJson(filterVal, jsonData) {

596
src/views/components/chartsData.vue

@ -0,0 +1,596 @@
<template>
<div class="chart-content">
<div class="home-chart">
<div
class="legend-li"
v-for="(item, index) in timeData2"
:key="index"
@click="handleEnter(index)"
:class="{ timeStyle: timeIndex2 == index }"
>
{{ item.title }}
</div>
<div class="home-chart-right">
<div
class="imgDiv"
v-for="(item, index) in imgData"
:key="index"
@click="handleImg(index)"
:class="{ imgStyle: imgIndex == index }"
>
<img
:src="item.imgSrc"
class="choice-icon"
id="svgImg "
alt=""
:title="item.title"
/>
</div>
</div>
</div>
<div class="charts-div" ref="analyse_ref"></div>
</div>
</template>
<script>
import { homeCharts } from "@/api/index";
export default {
data() {
return {
timeData2: [
{ title: "系统EER" },
{ title: "瞬时冷量(kwr)" },
{ title: "瞬时电量(kwh)" },
// { title: "(kwh)" },
{ title: "冷冻水供回水温度(℃)" },
// { title: "()" },
],
timeIndex2: 0, //
imgData: [
{
title: "轮播",
imgSrc: require("../../assets/images/noactive-0.png"),
},
{
title: "手动",
imgSrc: require("../../assets/images/noactive-1.png"),
},
],
imgIndex: 0, //
chartInstance2: null,
option2: {},
xTimeData: [], // 线x
//线
electData: [],
electTime: [],
waterData: [],
waterTime: [],
EERData: [],
EERTime: [],
proximityData: [],
proximityTime: [],
chartInstance2: null,
option2: {},
allDataObj: {}, //
xData: [],
chartsAeries: [],
};
},
mounted() {
this.initChart2();
this.screenAdapter2();
window.addEventListener("resize", this.screenAdapter2);
this.getChartsData();
this.move();
},
destroyed() {
//mounted
window.removeEventListener("resize", this.screenAdapter2);
//
clearInterval(this.timer);
},
methods: {
// or
handleImg(index) {
this.imgIndex = index;
// console.log("this.timeData2[index].imgSrc", this.timeData2[index].title)
//
for (let i = 0; i < this.imgData.length; i++) {
const imgSrc =
i === index ? `active-${index}.png` : `noactive-${i}.png`;
this.imgData[i].imgSrc = require(`../../assets/images/${imgSrc}`);
}
if (index == 0) {
this.move();
} else {
clearInterval(this.timer);
}
},
handleEnter(index) {
this.timeIndex2 = index;
console.log("有打印瞬时冷量的index吗", this.allDataObj);
this.chartInstance2.dispose();
this.initChart2();
this.xData = [];
this.chartsAeries = [];
if (index == 1) {
// 线
var singleSeries = {
smooth: true,
symbol: "circle",
//
showSymbol: false,
itemStyle: {
color: "#44a2ff", // 线
lineStyle: {
color: "#44a2ff", // 线
},
},
areaStyle: {
color: {
type: "linear", // 线
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(11, 117, 211, 1)", // 0%
},
{
offset: 0.8,
color: "rgba(11, 117, 211, 0.2)", // 100%
},
],
},
},
};
this.allDataObj.cloudChart.series[0] = {
...this.allDataObj.cloudChart.series[0],
...singleSeries,
};
this.chartsAeries = this.allDataObj.cloudChart.series;
this.xData = this.allDataObj.cloudChart.xaxis.data;
this.option2.xAxis.data = this.xData;
this.option2.series = this.chartsAeries;
} else if (index == 2) {
// 线
var singleSeries = {
smooth: true,
symbol: "circle",
//
showSymbol: false,
itemStyle: {
color: "#01c29b", // 线
lineStyle: {
color: "#01c29b", // 线
},
},
areaStyle: {
color: {
type: "linear", // 线
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(1, 194, 155, 1)", // 0%
},
{
offset: 0.8,
color: "rgba(1, 194, 155, 0.2)", // 100%
},
],
},
},
};
this.allDataObj.eleRateChart.series[0] = {
...this.allDataObj.eleRateChart.series[0],
...singleSeries,
};
this.chartsAeries = this.allDataObj.eleRateChart.series;
this.xData = this.allDataObj.eleRateChart.xaxis.data;
this.option2.xAxis.data = this.xData;
this.option2.series = this.chartsAeries;
} else if (index == 3) {
//
let legendData = [];
this.allDataObj.tempChart.series.forEach((element) => {
legendData.push(element.name);
});
console.log("图例数组", legendData);
this.chartsAeries = this.allDataObj.tempChart.series;
this.xData = this.allDataObj.tempChart.xaxis.data;
this.option2.legend.show = true;
this.option2.legend.data = legendData;
this.option2.xAxis.data = this.xData;
// seriesshowSymbol = false; //,
for (var i = 0; i < this.chartsAeries.length; i++) {
this.chartsAeries[i].showSymbol = false;
}
this.option2.series = this.chartsAeries;
} else if (index == 0) {
// 线
var singleSeries = {
smooth: true,
symbol: "circle",
//
showSymbol: false,
itemStyle: {
color: "#ffb219", // 线
lineStyle: {
color: "#ffb219", // 线
},
},
areaStyle: {
color: {
type: "linear", // 线
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(255, 178,25 , 0.8)", // 0%
},
{
offset: 0.8,
color: "rgba(255, 178,25 , 0.2)", // 100%
},
],
},
},
};
this.allDataObj.copChart.series[0] = {
...this.allDataObj.copChart.series[0],
...singleSeries,
};
this.chartsAeries = this.allDataObj.copChart.series;
this.xData = this.allDataObj.copChart.xaxis.data;
this.option2.xAxis.data = this.xData;
this.option2.series = this.chartsAeries;
} else if (index == 4) {
//
let legendData = [];
this.allDataObj.appChart.series.forEach((element) => {
legendData.push(element.name);
});
console.log("图例数组", legendData);
this.chartsAeries = this.allDataObj.appChart.series;
this.xData = this.allDataObj.appChart.xaxis.data;
this.option2.legend.show = true;
this.option2.legend.data = legendData;
this.option2.xAxis.data = this.xData;
// seriesshowSymbol = false; //,
for (var i = 0; i < this.chartsAeries.length; i++) {
this.chartsAeries[i].showSymbol = false;
}
this.option2.series = this.chartsAeries;
}
console.log("折线图的xAxis详情", this.xData);
console.log("折线图的series详情", this.chartsAeries);
//.chartInstanceoptiondataoption
this.chartInstance2.setOption(this.option2);
//resize
this.chartInstance2.resize();
},
//chartInstance2 线
initChart2() {
this.chartInstance2 = this.$echarts.init(this.$refs.analyse_ref);
this.option2 = {
tooltip: {
trigger: "axis",
// 使 formatter tooltip
// formatter: function (params) {
// let seriesHTML = "";
// params.forEach(function (item) {
// seriesHTML +=
// "<div>" +
// item.seriesName +
// ': <span style="color: #000000; font-weight: bold;">' +
// item.value +
// "</span></div>";
// });
// return "<div>" + params[0].name + "</div>" + seriesHTML;
// },
// tooltip
formatter: function (params) {
var res = params[0].name + "<br/>";
for (var i = 0, l = params.length; i < l; i++) {
var seriesName = params[i].seriesName;
var value = params[i].value;
var marker =
'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' +
params[i].color +
'"></span>';
// seriesName
if (seriesName.indexOf("瞬时冷量") !== -1) {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
"kwr" +
"</span><br>";
} else if (seriesName.indexOf("用电量") !== -1) {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
"kwh" +
"</span><br>";
} else if (
seriesName.indexOf("温度") !== -1 ||
seriesName.indexOf("趋近度") !== -1
) {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
"℃" +
"</span><br>";
} else if (seriesName.indexOf("瞬时功率") !== -1) {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
"kwh" +
"</span><br>";
} else {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
"</span><br>";
}
}
return res;
},
},
legend: {
show: false, //
// data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
textStyle: { color: "#ffffff" },
// left: "0%",
top: "-1%",
},
grid: {
top: "9%",
left: "3%",
right: "2%",
bottom: "25%",
containLabel: true,
},
xAxis: {
type: "category",
boundaryGap: true,
// data: ["2021", "2022", "2023"],
axisLabel: {
// interval: 0, //x
color: "rgba(255,255,255,1)",
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
},
yAxis: {
min: 0,
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255,255,255,1)",
},
// y
axisLine: {
show: true,
lineStyle: {
// X
color: "#7b918c",
},
},
// y线
splitLine: {
lineStyle: {
color: "#7b918c",
},
},
},
// X
dataZoom: [
{
type: "slider", //inside
show: this.showZoom,
height: 15, // 20
// fillerColor: 'rgba(255, 0, 0, 0.5)', //
// backgroundColor: 'rgba(0, 0, 0, 0.1)', // 0.1
start: 0,
end: 100,
xAxisIndex: [0],
handleSize: "120%", // 120%
},
],
series: [
// {
// name: "",
// type: "line",
// smooth: true,
// // data: ["1", "2", "3"],
// symbol: "circle",
// //
// symbolSize: 8,
// //
// // itemStyle: {
// // color: "#0184d5",
// // borderColor: "rgba(221, 220, 107, .1)",
// // borderWidth: 12
// // },
// //
// showSymbol: false,
// sampling: 'lttb',//
// //线
// itemStyle: {
// color: "#44a2ff", //线
// lineStyle: {
// color: "#44a2ff", //线
// },
// },
// areaStyle: {
// color: {
// //线
// type: "linear",
// x: 0,
// y: 0,
// x2: 0,
// y2: 1,
// colorStops: [
// {
// offset: 0,
// color: "rgba(11, 117, 211, 1)", // 0%
// },
// {
// offset: 0.8,
// color: "rgba(11, 117, 211,0.2)", // 100%
// },
// ],
// // global: false, // false
// },
// },
// },
],
};
//
this.chartInstance2.setOption(this.option2, true);
},
screenAdapter2() {
//,2.6 mes_ref
const titleFontSize = this.$refs.analyse_ref.offsetWidth / 130;
//optionoption
const adapterOption = {
// x
xAxis: {
axisLabel: {
fontSize: titleFontSize * 1.5,
},
},
yAxis: {
axisLabel: {
fontSize: titleFontSize * 1.5,
},
},
};
//.chartInstanceoptiondataoption
this.chartInstance2.setOption(adapterOption);
//resize
this.chartInstance2.resize();
},
//
getChartsData() {
this.chartInstance2.dispose();
this.initChart2();
homeCharts().then((res) => {
console.log("图表数据查询返回", res);
if (res.code == 200) {
this.allDataObj = res.rows;
console.log("全部的数据", this.allDataObj);
//
this.handleEnter(this.timeIndex2);
} else {
this.chartsAeries = [];
const adapterOption = {
xAxis: {
data: [],
},
series: [],
};
//.chartInstanceoptiondataoption
this.chartInstance2.setOption(adapterOption);
//resize
this.chartInstance2.resize();
}
});
},
//
move() {
//
this.timer = setInterval(() => {
this.handleEnter((this.timeIndex2 + 1) % 4);
}, 1000 * 5 * 60);
},
},
};
</script>
<style lang="scss" scoped>
.home-chart {
display: flex;
flex-direction: row;
overflow: hidden;
cursor: pointer;
width: 100%;
position: relative;
.legend-li {
text-align: center;
font-size: 0.2rem;
color: #95adc8;
padding: 0.08rem 0.2rem;
white-space: nowrap;
margin-right: 0.3rem;
border: 1px solid #0076c1;
border-radius: 0.06rem;
}
.home-chart-right {
position: absolute;
right: 0;
display: flex;
flex-direction: row;
.imgDiv {
width: 0.35rem;
height: 0.35rem;
margin: 0.05rem;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.choice-icon {
width: 0.2rem;
height: 0.2rem;
}
.imgStyle {
background-color: #0076c1;
border-radius: 50%;
}
}
}
.charts-div {
margin-top: 0.3rem;
width: 100%;
height: 3.6rem;
}
</style>

144
src/views/components/hotWater.vue

@ -1,144 +0,0 @@
<template>
<div class="card-div">
<!-- 二通阀 -->
<div class="card-li">
<div class="card-header">
<h2 class="card-title">二通阀开度:</h2>
</div>
<div class="thermometer">
<div class="temprogress" :style="{ width: twoValveValue + '%' }"></div>
</div>
<div class="temperature">
<span
v-if="twoValveItem && twoValveItem.status === 1"
class="error-text"
>异常</span
>
<span v-else>{{ twoValveValue }}%</span>
</div>
</div>
<!-- 三通阀 -->
<div class="card-li">
<div class="card-header">
<h2 class="card-title">三通阀开度:</h2>
</div>
<div class="thermometer">
<div
class="temprogress"
:style="{ width: threeValveValue + '%' }"
></div>
</div>
<div class="temperature">
<span
v-if="threeValveItem && threeValveItem.status === 1"
class="error-text"
>异常</span
>
<span v-else>{{ threeValveValue }}%</span>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
subData: {
type: Array,
required: true,
},
},
data() {
return {
temData1: "",
temData2: "",
temData: [],
};
},
computed: {
//
twoValveItem() {
return this.subData.find(
(item) => item.deviceTypeName === "二通阀阀门开度"
);
},
//
threeValveItem() {
return this.subData.find(
(item) => item.deviceTypeName === "三通阀阀门开度"
);
},
//
twoValveValue() {
if (!this.twoValveItem || this.twoValveItem.status === 1) return 0;
// 0-100
const value = parseFloat(this.twoValveItem.curValue) || 0;
return Math.min(Math.max(value, 0), 100);
},
//
threeValveValue() {
if (!this.threeValveItem || this.threeValveItem.status === 1) return 0;
// 0-100
const value = parseFloat(this.threeValveItem.curValue) || 0;
return Math.min(Math.max(value, 0), 100);
},
},
};
</script>
<style lang="scss" scoped>
.card-div {
width: 100%;
padding: 20px;
.card-li {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin: 10px;
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
.card-title {
font-size: 15px;
font-weight: 600;
color: #ffffff;
}
}
.temperature {
font-size: 20px;
font-weight: 700;
color: #2ecc71;
position: relative;
display: inline-block;
}
.thermometer {
width: calc(100% - 250px);
min-width: 200px;
height: 15px;
background: #3d5581;
border-radius: 20px;
margin: 0 0.1rem;
overflow: hidden;
box-shadow: inset 0 0 1rem rgba(0, 0, 0, 0.1);
position: relative;
}
.temprogress {
position: absolute;
left: 0;
height: 100%;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
background: linear-gradient(to right, #3498db, #2ecc71) !important;
}
}
}
@media (min-width: 2000px) {
}
</style>

517
src/views/components/sysEnergy.vue

@ -1,4 +1,8 @@
<template>
<div>
<div class="panel-title">
<span class="panel-title-text">实时EER系数</span>
</div>
<div class="sys_content">
<div class="sys_charts" ref="sys_charts"></div>
<div class="score">
@ -8,6 +12,7 @@
<div class="improve">需要改进</div>
</div>
</div>
</div>
</template>
<script>
@ -23,10 +28,10 @@ export default {
data5: "0",
chartInstance2: null,
option2: {},
}
};
},
mounted() {
this.getCoe()
this.getCoe();
this.initChart2();
this.screenAdapter2();
window.addEventListener("resize", this.screenAdapter2);
@ -58,18 +63,20 @@ export default {
},
//chartInstance2 线
initChart2() {
const titleFontSize = this.$refs.sys_charts.offsetWidth / 180;
const titleFontSize = this.$refs.sys_charts.offsetWidth / 130;
this.chartInstance2 = echarts.init(this.$refs.sys_charts);
this.option2 = {
tooltip: { //
formatter: "{a} <br/>{b} : {c}"
tooltip: {
//
formatter: "{a} <br/>{b} : {c}",
},
// cavas
// backgroundColor: "#f5f5f5",
series: [
{ //
name: '实时EER系数',
type: 'gauge',
{
//
name: "实时EER系数",
type: "gauge",
radius: "65%", // :number, string , 75%
center: ["48%", "40%"],
startAngle: 180,
@ -78,12 +85,14 @@ export default {
min: 0,
max: 15,
splitNumber: 4, // , 10
axisTick: { // (线)
axisTick: {
// (线)
distance: titleFontSize * 0.2,
length: titleFontSize,
show: true, // (线), true
splitNumber: 5, // 线, 5
lineStyle: { // 线
lineStyle: {
// 线
color: "auto", //线, #eee
opacity: 1, // 0 1 0
width: titleFontSize * 0.1,
@ -93,29 +102,34 @@ export default {
},
},
pointer: {
length: '40%', //
length: "40%", //
width: titleFontSize * 0.4,
offsetCenter: ['0', '-20%'], //
offsetCenter: ["0", "-20%"], //
itemStyle: {
color: 'auto'// 线
}
color: "auto", // 线
},
},
axisLine: { // 线(线)
axisLine: {
// 线(线)
show: true, // 线(线), true
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize,
color: [ // 线
[0.35, '#ffb219'],
[0.38, '#00be97'],
[1, '#208fff'],
]
}
color: [
// 线
[0.35, "#ffb219"],
[0.38, "#00be97"],
[1, "#208fff"],
],
},
},
splitLine: { // 线
splitLine: {
// 线
distance: titleFontSize * 0.35,
show: true, // 线, true
length: titleFontSize,
lineStyle: { // 线
lineStyle: {
// 线
color: "auto", //线, #eee
opacity: 1, // 0 1 0
width: titleFontSize * 0.2,
@ -128,28 +142,31 @@ export default {
show: true, // , true
fontSize: titleFontSize * 1.5,
distance: titleFontSize * 1.5,
color: 'inherit',
color: "inherit",
},
title: {
color: '#ffffff',
color: "#ffffff",
fontSize: titleFontSize * 2,
offsetCenter: ['-30%', '20%'],//
offsetCenter: ["-30%", "20%"], //
},
detail: {
valueAnimation: true,
animationDuration: 2000,
color: '#c5fff3',
color: "#c5fff3",
fontSize: titleFontSize * 2,
offsetCenter: ['28%', '20%'], //
offsetCenter: ["28%", "20%"], //
},
data: [{
data: [
{
value: 0,
name: '主机'
}]
name: "主机",
},
],
},
{//
name: '实时EER系数',
type: 'gauge',
{
//
name: "实时EER系数",
type: "gauge",
radius: "65%",
center: ["48%", "90%"],
startAngle: 180,
@ -171,23 +188,23 @@ export default {
},
},
pointer: {
length: '40%',
length: "40%",
width: titleFontSize * 0.4, //
offsetCenter: [0, '-25%'],
offsetCenter: [0, "-25%"],
itemStyle: {
color: 'auto'
}
color: "auto",
},
},
axisLine: {
show: true,
lineStyle: {
width: titleFontSize,
color: [
[0.407, '#ffb219'],
[0.446, '#00be97'],
[1, '#208fff'],
]
}
[0.407, "#ffb219"],
[0.446, "#00be97"],
[1, "#208fff"],
],
},
},
splitLine: {
distance: titleFontSize * 0.35,
@ -198,35 +215,38 @@ export default {
opacity: 1,
width: titleFontSize * 0.2,
type: "solid",
}
},
},
axisLabel: {
show: true,
fontSize: titleFontSize * 1.5, //线
distance: titleFontSize * 1.5,
color: 'inherit',
color: "inherit",
},
title: {
fontSize: titleFontSize * 2,
offsetCenter: ['-33%', '20%'],
color: '#ffffff'
offsetCenter: ["-33%", "20%"],
color: "#ffffff",
},
detail: {
valueAnimation: true,
animationDuration: 2000,
color: '#c5fff3',
color: "#c5fff3",
fontSize: titleFontSize * 2,
offsetCenter: ['28%', '20%'], //
offsetCenter: ["28%", "20%"], //
},
data: [{
data: [
{
value: 0,
name: "冷却塔"
}]
name: "冷却塔",
},
{//
name: '实时EER系数',
type: 'gauge',
detail: { formatter: '{value}' },
],
},
{
//
name: "实时EER系数",
type: "gauge",
detail: { formatter: "{value}" },
radius: "90%",
center: ["15%", "55%"],
startAngle: 225,
@ -248,27 +268,27 @@ export default {
},
},
axisLabel: {
color: 'inherit',
color: "inherit",
fontSize: titleFontSize * 1.8,
distance: titleFontSize * 3,
},
pointer: {
width: titleFontSize * 0.6,
itemStyle: {
color: 'auto'
}
color: "auto",
},
},
axisLine: {
show: true,
lineStyle: {
width: titleFontSize * 1.6,
color: [
[0.35, '#ee5e5e'],
[0.415, '#ffb219'],
[0.5, '#00be97'],
[1, '#208fff'],
[0.35, "#ee5e5e"],
[0.415, "#ffb219"],
[0.5, "#00be97"],
[1, "#208fff"],
],
}
},
},
splitLine: {
distance: titleFontSize * 0.35,
@ -279,28 +299,31 @@ export default {
opacity: 1,
width: titleFontSize * 0.2,
type: "solid",
}
},
},
title: {
fontSize: titleFontSize * 2.6,
color: '#ffffff',
offsetCenter: ['-25%', '90%'],//
color: "#ffffff",
offsetCenter: ["-25%", "90%"], //
},
detail: {
valueAnimation: true,
animationDuration: 2000,
color: '#c5fff3',
color: "#c5fff3",
fontSize: titleFontSize * 2.6,
offsetCenter: ['35%', '90%'], //
offsetCenter: ["35%", "90%"], //
},
data: [{
data: [
{
value: 0,
name: '系统EER',
}]
name: "系统EER",
},
],
},
{//
name: '实时EER系数',
type: 'gauge',
{
//
name: "实时EER系数",
type: "gauge",
radius: "65%",
center: ["75%", "40%"],
startAngle: 180,
@ -322,24 +345,24 @@ export default {
},
},
pointer: {
length: '40%',
length: "40%",
width: titleFontSize * 0.4, //
offsetCenter: [0, '-20%'],
offsetCenter: [0, "-20%"],
// width: 3.5, //
itemStyle: {
color: 'auto'
}
color: "auto",
},
},
axisLine: {
show: true,
lineStyle: {
width: titleFontSize,
color: [
[0.417, '#ffb219'],
[0.459, '#00be97'],
[1, '#208fff'],
]
}
[0.417, "#ffb219"],
[0.459, "#00be97"],
[1, "#208fff"],
],
},
},
splitLine: {
show: true,
@ -350,34 +373,37 @@ export default {
opacity: 1,
width: titleFontSize * 0.2,
type: "solid",
}
},
},
axisLabel: {
show: true,
fontSize: titleFontSize * 1.5,
distance: titleFontSize * 1.5,
color: 'inherit',
color: "inherit",
},
title: {
fontSize: titleFontSize * 2,
offsetCenter: ['-33%', '20%'],
color: '#ffffff'
offsetCenter: ["-33%", "20%"],
color: "#ffffff",
},
detail: {
valueAnimation: true,
animationDuration: 2000,
color: '#c5fff3',
color: "#c5fff3",
fontSize: titleFontSize * 2,
offsetCenter: ['28%', '20%'], //
offsetCenter: ["28%", "20%"], //
},
data: [{
data: [
{
value: 0,
name: '冷冻泵'
}]
name: "冷冻泵",
},
],
},
{//
name: '实时EER系数',
type: 'gauge',
{
//
name: "实时EER系数",
type: "gauge",
radius: "65%",
center: ["75%", "90%"],
startAngle: 180,
@ -399,23 +425,23 @@ export default {
},
},
pointer: {
length: '40%',
width: titleFontSize * 0.4,//
offsetCenter: [0, '-20%'],
length: "40%",
width: titleFontSize * 0.4, //
offsetCenter: [0, "-20%"],
itemStyle: {
color: 'auto'
}
color: "auto",
},
},
axisLine: {
show: true,
lineStyle: {
width: titleFontSize,
color: [
[0.417, '#ffb219'],
[0.459, '#00be97'],
[1, '#208fff'],
]
}
[0.417, "#ffb219"],
[0.459, "#00be97"],
[1, "#208fff"],
],
},
},
splitLine: {
distance: titleFontSize * 0.35,
@ -426,39 +452,41 @@ export default {
opacity: 1,
width: titleFontSize * 0.2,
type: "solid",
}
},
},
axisLabel: {
show: true,
fontSize: titleFontSize * 1.5,
distance: titleFontSize * 1.5,
color: 'inherit',
color: "inherit",
},
title: {
fontSize: titleFontSize * 2,
offsetCenter: ['-33%', '20%'],
color: '#ffffff'
offsetCenter: ["-33%", "20%"],
color: "#ffffff",
},
detail: {
valueAnimation: true,
animationDuration: 2000,
color: '#c5fff3',
color: "#c5fff3",
fontSize: titleFontSize * 2,
offsetCenter: ['28%', '20%'], //
offsetCenter: ["28%", "20%"], //
},
data: [{
data: [
{
value: 0,
name: "冷却泵"
}]
}
]
name: "冷却泵",
},
],
},
],
};
//
this.chartInstance2.setOption(this.option2, true);
},
//
nowData() {//option.series[0].data[0].value使random()
nowData() {
//option.series[0].data[0].value使random()
const v0 = (Math.random() * 7).toFixed(2);
const v1 = (Math.random() * 10).toFixed(2);
const v2 = (Math.random() * 2).toFixed(2);
@ -466,11 +494,32 @@ export default {
const v4 = (Math.random() * 10).toFixed(2);
// detail
const color0 = this.getGaugeColor(v0, 0, 15, [[0.35, '#ffb219'], [0.38, '#00be97'], [1, '#208fff']]);
const color1 = this.getGaugeColor(v1, 0, 120, [[0.407, '#ffb219'], [0.446, '#00be97'], [1, '#208fff']]);
const color2 = this.getGaugeColor(v2, 0, 10, [[0.35, '#ee5e5e'], [0.415, '#ffb219'], [0.5, '#00be97'], [1, '#208fff']]);
const color3 = this.getGaugeColor(v3, 0, 100, [[0.417, '#ffb219'], [0.459, '#00be97'], [1, '#208fff']]);
const color4 = this.getGaugeColor(v4, 0, 100, [[0.417, '#ffb219'], [0.459, '#00be97'], [1, '#208fff']]);
const color0 = this.getGaugeColor(v0, 0, 15, [
[0.35, "#ffb219"],
[0.38, "#00be97"],
[1, "#208fff"],
]);
const color1 = this.getGaugeColor(v1, 0, 120, [
[0.407, "#ffb219"],
[0.446, "#00be97"],
[1, "#208fff"],
]);
const color2 = this.getGaugeColor(v2, 0, 10, [
[0.35, "#ee5e5e"],
[0.415, "#ffb219"],
[0.5, "#00be97"],
[1, "#208fff"],
]);
const color3 = this.getGaugeColor(v3, 0, 100, [
[0.417, "#ffb219"],
[0.459, "#00be97"],
[1, "#208fff"],
]);
const color4 = this.getGaugeColor(v4, 0, 100, [
[0.417, "#ffb219"],
[0.459, "#00be97"],
[1, "#208fff"],
]);
// 使 merge detail.color
this.chartInstance2.setOption({
@ -480,7 +529,7 @@ export default {
{ detail: { color: color2 }, data: [{ value: v2 }] },
{ detail: { color: color3 }, data: [{ value: v3 }] },
{ detail: { color: color4 }, data: [{ value: v4 }] },
]
],
});
setInterval(this.nowData, 100000);
this.clear();
@ -490,31 +539,38 @@ export default {
this.nowData = null;
},
screenAdapter2() {
const titleFontSize = this.$refs.sys_charts.offsetWidth / 180;
const titleFontSize = this.$refs.sys_charts.offsetWidth / 130;
const adapterOption = {
series: [
{ //
name: '实时EER系数',
type: 'gauge',
axisTick: { // (线)
{
//
name: "实时EER系数",
type: "gauge",
axisTick: {
// (线)
distance: titleFontSize * 0.2, //线
length: titleFontSize, // 线, 8
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.1, //线, 1
},
},
pointer: {
width: titleFontSize * 0.4, //
},
axisLine: { // 线(线)
lineStyle: { // 线
axisLine: {
// 线(线)
lineStyle: {
// 线
width: titleFontSize, //线, 30
}
},
splitLine: { // 线
},
splitLine: {
// 线
distance: titleFontSize * 0.35, //线
length: titleFontSize, // 线线, 30
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.2, //线, 2
},
},
@ -529,28 +585,35 @@ export default {
fontSize: titleFontSize * 2,
},
},
{ //
name: '实时EER系数',
type: 'gauge',
axisTick: { // (线)
{
//
name: "实时EER系数",
type: "gauge",
axisTick: {
// (线)
distance: titleFontSize * 0.2, //线
length: titleFontSize, // 线, 8
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.1, //线, 1
},
},
pointer: {
width: titleFontSize * 0.4, //
},
axisLine: { // 线(线)
lineStyle: { // 线
axisLine: {
// 线(线)
lineStyle: {
// 线
width: titleFontSize, //线, 30
}
},
splitLine: { // 线
},
splitLine: {
// 线
distance: titleFontSize * 0.35, //线
length: titleFontSize, // 线线, 30
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.2, //线, 2
},
},
@ -565,28 +628,35 @@ export default {
fontSize: titleFontSize * 2,
},
},
{ //
name: '实时EER系数',
type: 'gauge',
axisTick: { // (线)
{
//
name: "实时EER系数",
type: "gauge",
axisTick: {
// (线)
distance: titleFontSize * 0.4, //线
length: titleFontSize * 1.2, // 线, 8
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.2, //线, 1
},
},
pointer: {
width: titleFontSize * 0.6, //
},
axisLine: { // 线(线)
lineStyle: { // 线
axisLine: {
// 线(线)
lineStyle: {
// 线
width: titleFontSize * 1.6, //线, 30
}
},
splitLine: { // 线
},
splitLine: {
// 线
distance: titleFontSize * 0.35, //线
length: titleFontSize * 2, // 线线, 30
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.2, //线, 2
},
},
@ -601,28 +671,35 @@ export default {
fontSize: titleFontSize * 2.6,
},
},
{ //
name: '实时EER系数',
type: 'gauge',
axisTick: { // (线)
{
//
name: "实时EER系数",
type: "gauge",
axisTick: {
// (线)
distance: titleFontSize * 0.2, //线
length: titleFontSize, // 线, 8
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.1, //线, 1
},
},
pointer: {
width: titleFontSize * 0.4, //
},
axisLine: { // 线(线)
lineStyle: { // 线
axisLine: {
// 线(线)
lineStyle: {
// 线
width: titleFontSize, //线, 30
}
},
splitLine: { // 线
},
splitLine: {
// 线
distance: titleFontSize * 0.35, //线
length: titleFontSize, // 线线, 30
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.2, //线, 2
},
},
@ -637,28 +714,35 @@ export default {
fontSize: titleFontSize * 2,
},
},
{ //
name: '实时EER系数',
type: 'gauge',
axisTick: { // (线)
{
//
name: "实时EER系数",
type: "gauge",
axisTick: {
// (线)
distance: titleFontSize * 0.2, //线
length: titleFontSize, // 线, 8
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.1, //线, 1
},
},
pointer: {
width: titleFontSize * 0.4, //
},
axisLine: { // 线(线)
lineStyle: { // 线
axisLine: {
// 线(线)
lineStyle: {
// 线
width: titleFontSize, //线, 30
}
},
splitLine: { // 线
},
splitLine: {
// 线
distance: titleFontSize * 0.35, //线
length: titleFontSize, // 线线, 30
lineStyle: { // 线
lineStyle: {
// 线
width: titleFontSize * 0.2, //线, 2
},
},
@ -672,7 +756,8 @@ export default {
detail: {
fontSize: titleFontSize * 2,
},
},]
},
],
};
this.chartInstance2.setOption(adapterOption);
this.chartInstance2.resize();
@ -680,7 +765,7 @@ export default {
//
getCoe() {
getCoeData().then((res) => {
console.log("系统系数返回", res)
console.log("系统系数返回", res);
if (res.code == 200) {
this.data1 = res.rows[0].sysCoe || this.data1;
this.data2 = res.rows[0].chillerCoe || this.data2;
@ -689,45 +774,81 @@ export default {
this.data5 = res.rows[0].towerCoe || this.data5;
//
const color0 = this.getGaugeColor(this.data2, 0, 15, [[0.35, '#ffb219'], [0.38, '#00be97'], [1, '#208fff']]);
const color0 = this.getGaugeColor(this.data2, 0, 15, [
[0.35, "#ffb219"],
[0.38, "#00be97"],
[1, "#208fff"],
]);
this.option2.series[0].data[0].value = this.data2;
this.option2.series[0].detail.color = color0;
//
const color1 = this.getGaugeColor(this.data5, 0, 120, [[0.407, '#ffb219'], [0.446, '#00be97'], [1, '#208fff']]);
const color1 = this.getGaugeColor(this.data5, 0, 120, [
[0.407, "#ffb219"],
[0.446, "#00be97"],
[1, "#208fff"],
]);
this.option2.series[1].data[0].value = this.data5;
this.option2.series[1].detail.color = color1;
// EER
const color2 = this.getGaugeColor(this.data1, 0, 10, [[0.35, '#ee5e5e'], [0.415, '#ffb219'], [0.5, '#00be97'], [1, '#208fff']]);
const color2 = this.getGaugeColor(this.data1, 0, 10, [
[0.35, "#ee5e5e"],
[0.415, "#ffb219"],
[0.5, "#00be97"],
[1, "#208fff"],
]);
this.option2.series[2].data[0].value = this.data1;
this.option2.series[2].detail.color = color2;
//
const color3 = this.getGaugeColor(this.data3, 0, 100, [[0.417, '#ffb219'], [0.459, '#00be97'], [1, '#208fff']]);
const color3 = this.getGaugeColor(this.data3, 0, 100, [
[0.417, "#ffb219"],
[0.459, "#00be97"],
[1, "#208fff"],
]);
this.option2.series[3].data[0].value = this.data3;
this.option2.series[3].detail.color = color3;
//
const color4 = this.getGaugeColor(this.data4, 0, 100, [[0.417, '#ffb219'], [0.459, '#00be97'], [1, '#208fff']]);
const color4 = this.getGaugeColor(this.data4, 0, 100, [
[0.417, "#ffb219"],
[0.459, "#00be97"],
[1, "#208fff"],
]);
this.option2.series[4].data[0].value = this.data4;
this.option2.series[4].detail.color = color4;
// 使 merge detail.color
this.chartInstance2.setOption({
series: [
{ detail: { color: color0 }, data: [{ value: this.data2, name: '主机' }] },
{ detail: { color: color1 }, data: [{ value: this.data5, name: '冷却塔' }] },
{ detail: { color: color2 }, data: [{ value: this.data1, name: '系统EER' }] },
{ detail: { color: color3 }, data: [{ value: this.data3, name: '冷冻泵' }] },
{ detail: { color: color4 }, data: [{ value: this.data4, name: '冷却泵' }] },
]
{
detail: { color: color0 },
data: [{ value: this.data2, name: "主机" }],
},
{
detail: { color: color1 },
data: [{ value: this.data5, name: "冷却塔" }],
},
{
detail: { color: color2 },
data: [{ value: this.data1, name: "系统EER" }],
},
{
detail: { color: color3 },
data: [{ value: this.data3, name: "冷冻泵" }],
},
{
detail: { color: color4 },
data: [{ value: this.data4, name: "冷却泵" }],
},
],
});
}
})
});
},
}
}
},
};
</script>
<style lang="scss" scoped>
@ -737,17 +858,17 @@ export default {
justify-content: space-between;
align-items: flex-start;
width: 100%;
height:3rem;
height: 2.7rem;
padding: 20px;
.sys_charts {
width: 90%;
height: 2.5rem;
width: 85%;
height: 2rem;
margin-bottom: -0.9rem;
}
.score {
width: 10%;
width: 15%;
height: 100%;
display: flex;
flex-direction: column;
@ -772,7 +893,7 @@ export default {
.bad::before,
.improve::before {
display: block;
content: '';
content: "";
width: 0.15rem;
height: 0.14rem;
margin-right: 0.16rem;

514
src/views/components/viewColdSys.vue

@ -1,514 +0,0 @@
<template>
<div class="energy_content">
<div class="sys_charts" ref="sys_charts"></div>
<div class="eer">{{ title }}</div>
<div class="bad" v-if="subData.status === 1">异常</div>
</div>
</template>
<script>
import * as echarts from "echarts";
export default {
props: {
subData: {
type: Object,
required: true,
},
title: "",
},
data() {
return {
chartInstance: null,
option: {},
useForm: {
useData: 5,
maxData: 10, //
},
};
},
watch: {
subData: {
immediate: true, //
handler(newVal) {
// console.log("", this.subData);
if (Object.keys(newVal).length > 0) {
console.log("newval", newVal);
this.$nextTick(() => {
this.initChart();
});
}
},
},
},
mounted() {
this.initChart();
this.screenAdapter();
window.addEventListener("resize", this.screenAdapter);
},
destroyed() {
//mounted
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
//
getAxisLineColor(useData, maxData) {
//
// 0.75使
const threshold = maxData * 0.75;
//
if (useData > threshold) {
return [
[
useData / maxData,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "rgba(0,127,208,1)" },
{ offset: 0.6, color: "rgba(0,127,208,1)" },
{ offset: 1, color: "rgba(69, 235, 167,0.5)" },
]),
],
[1, "rgba(28,128,245,.0)"],
];
} else {
return [
[
useData / maxData,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "rgba(0,127,208,1)" },
{ offset: 0.5, color: "rgba(0,127,208,1)" },
{ offset: 1, color: "rgba(0,127,208,1)" },
]),
],
[1, "rgba(28,128,245,.0)"],
];
}
},
//chartInstance2 线
initChart() {
this.chartInstance = echarts.init(this.$refs.sys_charts);
var dataArr = this.subData.curValue; //
var maxData = 10; //
this.option = {
// backgroundColor: "#0E1327",
tooltip: {
formatter: "{a} <br/>{b} : {c}%",
},
series: [
{
name: "外部线",
type: "gauge",
radius: "100%", //
startAngle: 225,
endAngle: -45,
axisLine: {
lineStyle: {
color: [
[1, "#31F3FF"], //
],
width: 1,
},
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
detail: {
show: false,
},
title: {
//
show: false,
},
},
{
name: "外部刻度",
type: "gauge",
radius: "100%",
min: 0, //
max: maxData, //
splitNumber: 10, //
startAngle: 225,
endAngle: -45,
axisLine: {
show: false,
lineStyle: {
color: [[1, "rgba(0,0,0,0)"]],
},
}, //线
axisLabel: {
show: true,
color: "#31F3FF",
fontSize: 9, //
distance: -15, //
}, //
axisTick: {
show: false,
}, //
splitLine: {
show: false,
},
},
{
name: "内部宽线条",
type: "gauge",
radius: "77%",
startAngle: 225,
endAngle: -45,
axisLine: {
lineStyle: {
color: [[1, "#122B3C"]],
width: 20,
},
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
detail: {
show: false,
},
title: {
show: false,
},
},
{
name: "内部细线条",
type: "gauge",
radius: "43%",
startAngle: 225,
endAngle: -45,
axisLine: {
lineStyle: {
color: [[1, "#385264"]],
width: 1,
},
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
detail: {
show: false,
},
title: {
show: false,
},
},
{
name: "间隔条形",
type: "gauge",
radius: "98%",
z: 4,
splitNumber: 20, //
startAngle: 225,
endAngle: -45,
axisLine: {
lineStyle: {
opacity: 0,
},
},
axisLabel: {
show: false,
},
axisTick: {
show: true,
length: 10,
splitNumber: 1,
lineStyle: {
color: "#122B3C",
width: 0.5,
},
},
splitLine: {
show: false,
},
detail: {
show: false,
},
title: {
show: false,
},
},
{
name: "数据",
type: "gauge",
radius: "70.5%",
z: 3,
startAngle: 225,
max: maxData,
endAngle: -45,
axisLine: {
lineStyle: {
color: [
[dataArr / maxData, "#31F3FF"], //
[1, "#16414D"], //-
],
width: 10,
},
},
tooltip: {
show: false,
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
detail: {
show: true,
fontWeight: "bold",
fontSize: 18,
offsetCenter: [0, "60%"], //
color: "#31F3FF",
},
pointer: {
show: true,
length: "75%", //
width: 2, //
itemStyle: {
color: "#31F3FF", //
borderWidth: 0,
shadowColor: "rgba(255, 107, 53, 0.5)", //
shadowBlur: 10, //
},
},
data: [
{
name: "",
value: dataArr,
},
],
},
// -
{
name: "内圆环",
type: "pie",
radius: "10%",
hoverAnimation: false,
tooltip: {
show: false,
},
cursor: "default",
labelLine: {
normal: {
show: false,
},
},
itemStyle: {
color: "#08ACDF",
},
animation: false,
data: [1],
},
// -
{
name: "内圆环2",
type: "pie",
radius: "5%",
hoverAnimation: false,
cursor: "default",
tooltip: {
show: false,
},
labelLine: {
normal: {
show: false,
},
},
itemStyle: {
color: "#31F3FF",
},
animation: false,
data: [1],
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
screenAdapter() {
const titleFontSize = this.$refs.sys_charts.offsetWidth / 18;
const adapterOption = {
series: [],
};
this.chartInstance.setOption(adapterOption);
this.chartInstance.resize();
},
//
echartsData() {
if (this.subData.length > 0) {
this.useForm.maxData = 10;
this.useForm.useData = this.subData[0].value;
let that = this;
// 使
const axisLineColor = this.getAxisLineColor(
this.useForm.useData,
this.useForm.maxData
);
const titleFontSize = this.$refs.sys_charts.offsetWidth / 20;
const adapterOption = {
// series: [
// {
// name: "",
// axisLine: {
// lineStyle: {
// color: axisLineColor,
// //
// // width: 80,
// },
// },
// },
// {
// name: "",
// min: 0,
// max: this.useForm.maxData,
// },
// {
// name: "",
// data: [
// {
// value: 5,
// },
// ],
// },
// {
// name: "",
// label: {
// show: true,
// position: "center", //
// offset: [0, -titleFontSize * 0.6], // 10
// formatter: function () {
// // HTML 使 rich
// return `{line|${that.useForm.useData}}`;
// },
// rich: {
// line: {
// color: "#fff", //
// fontSize: titleFontSize, //
// lineHeight: 5, //
// },
// },
// },
// data: [
// {
// value: 0,
// itemStyle: {
// //
// color: {
// type: "linear",
// x: 0,
// y: 0,
// x2: 0,
// y2: 1,
// colorStops: [
// {
// offset: 0,
// color: "rgb(4,112,212)", //
// },
// {
// offset: 0.3,
// color: "rgba(0, 46, 93)", //
// },
// ],
// global: false, // false
// },
// },
// },
// ],
// },
// {
// //
// name: this.energyCostText,
// max: this.useForm.maxData, //
// axisLabel: {
// formatter: (value) => {
// // 0
// if (value === 0 || value == this.useForm.maxData) {
// // 100
// return value;
// }
// return "";
// },
// },
// data: [
// {
// name: this.dateUse,
// value: this.useForm.useData,
// },
// ],
// },
// ],
};
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
}
},
},
};
</script>
<style lang="scss" scoped>
.energy_content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100% !important;
height: 100%;
.sys_charts {
width: 100%;
height: 150px;
}
.eer {
font-size: 18px;
}
}
.bad {
font-size: 18px;
margin-top: 5px;
color: red;
// animation: colorBlink 1s infinite;
}
@keyframes colorBlink {
0%,
100% {
color: #ff0000;
} /* 亮红 */
50% {
color: #cc0000;
} /* 暗红 */
}
// 2000px
@media (min-width: 2000px) {
.sys_charts {
height: 1.5rem !important;
}
.eer {
font-size: 0.18rem !important;
margin-top: 0.25rem !important;
}
}
</style>

2
src/views/components/viewEnergy.vue

@ -81,7 +81,7 @@ export default {
);
console.log("当前要渲染的数据对象", chartsObj);
console.log("当前要渲染的颜色对象", colorObj);
const titleFontSize = this.$refs.chart_ref.offsetWidth / 50;
const titleFontSize = this.$refs.chart_ref.offsetWidth / 100;
let adapterOption = {};
// 线
adapterOption = {

1076
src/views/index.vue

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save