Browse Source

1.首页添加生活热水、温度系统、风柜系统的数据

2.冷源系统添加历史天气查询页面并对接
meizhou
selia-zx 2 weeks ago
parent
commit
bf2640958b
  1. 4
      .env.development
  2. 9
      src/api/centerairC/temHistory.js
  3. 8
      src/views/centerairC/sysMonitor/monitorCenter.vue
  4. 368
      src/views/centerairC/temHistoryQuery/index.vue
  5. 332
      src/views/components/aircAndWindcMeter.vue
  6. 142
      src/views/components/hotWater.vue
  7. 331
      src/views/components/temMeter.vue
  8. 33
      src/views/components/viewColdSys.vue
  9. 14
      src/views/components/viewEnergy.vue
  10. 102
      src/views/index.vue

4
.env.development

@ -7,9 +7,9 @@ ENV = 'development'
# 开发环境
# VUE_APP_BASE_API = '/dev-api'
# 后台
VUE_APP_BASE_API = 'http://192.168.1.222:8080'
# 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:8091'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

9
src/api/centerairC/temHistory.js

@ -0,0 +1,9 @@
import request from "@/utils/request";
// 历史天气查询
export function weatherTempData(query) {
return request({
url: "/device/cs/getWeatherTemp",
method: "get",
params: query,
});
}

8
src/views/centerairC/sysMonitor/monitorCenter.vue

@ -2506,7 +2506,7 @@ export default {
}
)
.then(() => {
this.operationConrol(item.frequencyId, item.frequencySet);
this.hadleOperationConrol(item.frequencyId, item.frequencySet);
})
.catch(() => {
//
@ -2535,7 +2535,7 @@ export default {
} else {
param = 0;
}
this.operationConrol(item.controlId, param);
this.hadleOperationConrol(item.controlId, param);
})
.catch(() => {
//
@ -2565,7 +2565,7 @@ export default {
} else {
param = 0;
}
this.operationConrol(item.automaticId, param);
this.hadleOperationConrol(item.automaticId, param);
})
.catch(() => {
//
@ -2595,7 +2595,7 @@ export default {
} else {
param = 0;
}
this.operationConrol(item.frequencyAutotextId, param);
this.hadleOperationConrol(item.frequencyAutotextId, param);
})
.catch(() => {
//

368
src/views/centerairC/temHistoryQuery/index.vue

@ -0,0 +1,368 @@
<template>
<div class="app-container">
<div class="btn-condition">
<div class="condition-left" v-show="showSearch">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="日期" prop="msgCode">
<el-date-picker
v-model="monthValue"
type="month"
placeholder="选择月"
value-format="yyyy-MM"
>
</el-date-picker>
</el-form-item>
</el-form>
<div class="primary-btn">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
</div>
<div class="cancel-btn">
<el-button
type="cancel"
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</div>
</div>
</div>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<div class="warning-btn" v-hasPermi="['system:post:export']">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</div>
</el-col> -->
</el-row>
<div class="charts" ref="chart_ref"></div>
<el-table
v-loading="loading"
:data="postList"
stripe
:cell-style="tableRowStyle"
>
<el-table-column label="日期" align="center" prop="dateAndWeek" />
<el-table-column label="最高气温" align="center" prop="maxTemp" />
<el-table-column label="最低气温" align="center" prop="minTemp" />
<el-table-column label="天气" align="center" prop="weatherConditions" />
<el-table-column label="风向" align="center" prop="windDirection" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { weatherTempData } from "@/api/centerairC/temHistory";
import * as echarts from "echarts";
export default {
name: "temHistoryQuery",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
postList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
startTime: "",
endTime: "",
},
monthValue: "",
chartInstance: null,
option: {},
};
},
created() {
//
const currentDate = new Date();
//
const year = currentDate.getFullYear();
// 0 1
const month = String(currentDate.getMonth() + 1).padStart(2, "0");
// yyyy-MM
this.monthValue = `${year}-${month}`;
},
mounted() {
this.initChart();
window.addEventListener("resize", this.screenAdapter);
this.screenAdapter();
this.getChartData();
this.getList();
},
methods: {
tableRowStyle({ row, column, rowIndex, columnIndex }) {
//
if (columnIndex === 1) {
return "color: #fd1e00;!important;text-align:center";
}
if (columnIndex === 2) {
return "color: #3390ff;!important;text-align:center";
}
if (columnIndex === 4) {
return "color: #75d148;!important;text-align:center";
}
// return "text-align:center";
},
/** 查询报警编码列表 */
getList() {
this.loading = true;
this.queryParams.startTime = this.queryParams.endTime = this.monthValue;
console.log("参数", this.queryParams);
weatherTempData(this.queryParams).then((response) => {
this.postList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getChartData() {
this.loading = true;
this.queryParams.pageNum = 0;
this.queryParams.startTime = this.queryParams.endTime = this.monthValue;
console.log("图表参数", this.queryParams);
weatherTempData(this.queryParams).then((response) => {
console.log("处理值然后渲染");
if (response.rows.length > 0) {
let data = response.rows;
let timeValue = [];
let hightValue = [];
let lowValue = [];
data.forEach((element) => {
timeValue.push(element.weatherDate);
hightValue.push(element.maxTemp);
lowValue.push(element.minTemp);
});
let adapterOption = {};
adapterOption = {
xAxis: {
data: timeValue,
},
series: [
{
data: hightValue,
//线
itemStyle: {
color: "rgb(18, 126, 226)", //线
},
lineStyle: {
color: "rgb(18, 126, 226)", //线
},
},
{
data: lowValue,
//线
itemStyle: {
color: "rgb(250, 169, 19)", //线
},
lineStyle: {
color: "rgb(250, 169, 19)", //线
},
},
],
};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
} else {
let adapterOption = {};
adapterOption = {
xAxis: {
data: [],
},
series: [
{
data: [],
},
{
data: [],
},
],
};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
}
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.getChartData();
},
/** 重置按钮操作 */
resetQuery() {
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download(
"device/gateway/export",
{
...this.queryParams,
},
`post_${new Date().getTime()}.xlsx`
);
},
// 线+ + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = this.$refs.chart_ref.offsetWidth / 130;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
//chartInstance
initChart() {
this.chartInstance = echarts.init(this.$refs.chart_ref);
this.option = {
tooltip: {
// axis x
trigger: "axis",
},
legend: {
show: false,
},
grid: {
top: "10%",
left: "4%",
right: "6%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
//true
boundaryGap: true,
// x
axisLabel: {
// interval: 0, //x
// rotate: 30, //x30
color: "rgba(255, 255, 255, 1)",
},
axisTick: {
show: false, // 线
},
// x
axisLine: {
show: true,
lineStyle: {
color: "#365576",
},
},
splitLine: {
lineStyle: {
color: "#e2e6f0",
},
}, //x线
},
yAxis: {
min: 0,
// max:20,
// // // min:'dataMin',
// // // max:'dataMax',
// name: "kwh", // y
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
},
// y
axisLine: {
show: true,
lineStyle: {
color: "#365576", // y 线
},
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
},
},
},
series: [
{
type: "line",
//
symbolSize: 8,
symbol: "circle",
name: "最高气温",
},
{
type: "line",
//
symbolSize: 8,
symbol: "circle",
name: "最低气温",
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
},
};
</script>
<style lang="scss" scoped>
.charts {
width: 100%;
height: 300px;
margin-bottom: 0.1rem;
}
</style>

332
src/views/components/aircAndWindcMeter.vue

@ -0,0 +1,332 @@
<template>
<div class="sys_content">
<div class="charts" ref="chart_ref"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
export default {
props: {
subData: {
type: Array,
required: true,
},
},
data() {
return {
chartInstance: null,
option: {},
chartData1: "",
chartData2: "",
allData: "",
};
},
watch: {
subData: {
immediate: true, //
handler(newVal) {
console.log("检测到传功来的数据", this.subData);
if (Object.keys(newVal).length > 0) {
console.log("newval", newVal);
let data = newVal;
this.chartData1 = "";
this.chartData2 = "";
data.forEach((item) => {
if (item.name.includes("运行")) {
this.chartData1 = parseInt(item.value);
}
if (item.name.includes("停止")) {
this.chartData2 = parseInt(item.value);
}
//
this.allData = this.chartData1 + this.chartData2;
});
this.$nextTick(() => {
// ECharts
if (this.chartInstance) {
this.chartInstance.dispose();
}
//
this.initChart();
});
}
},
},
},
mounted() {
this.initChart();
window.addEventListener("resize", this.screenAdapter);
this.screenAdapter();
},
destroyed() {
//
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
// 线+ + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = this.$refs.chart_ref.offsetWidth / 100;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
//chartInstance
initChart() {
var dataStyle = {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 40,
borderWidth: 10,
shadowColor: "rgba(0, 0, 0, 0)", //
},
};
var placeHolderStyle = {
normal: {
color: "#013e79",
label: {
show: false,
},
labelLine: {
show: false,
},
},
emphasis: {
color: "#013e79",
},
};
let that = this;
const titleFontSize = (this.$refs.chart_ref.offsetWidth / 100) * 2;
this.chartInstance = echarts.init(this.$refs.chart_ref);
this.option = {
title: {
subtext: "运行状态",
textStyle: {
color: "#ffffff",
},
subtextStyle: {
color: "#ffffff",
},
textAlign: "center",
x: "31%",
y: "43%", //
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
},
legend: {
//
right: 0,
//
top: "middle",
itemWidth: titleFontSize,
itemHeight: titleFontSize,
itemGap: titleFontSize * 2,
formatter: function (name) {
var arr = [];
// nameseries
let seriesIndex = -1;
for (let i = 0; i < that.option.series.length; i++) {
const seriesData = that.option.series[i].data;
if (seriesData.some((item) => item.name === name)) {
seriesIndex = i;
break;
}
}
if (seriesIndex === -1) return name; //
const data = that.option.series[seriesIndex].data; // 使
let total = that.allData;
let currentValue = 0;
//
data.forEach((item) => {
if (item.name) {
//
total += item.value;
if (item.name === name) {
currentValue = item.value;
}
}
});
const percentage =
currentValue === 0
? "0.00"
: ((currentValue / total) * 100).toFixed(2);
arr.push(
"{name|" + name + "}",
"{text|: \n}",
"{value|" + currentValue + " }",
"{percentage| " + percentage + "%}"
);
return arr.join("");
},
textStyle: {
color: function (name) {
//
for (let i = 0; i < that.option.series.length; i++) {
const item = that.option.series[i].data.find(
(d) => d.name === name
);
if (item) {
//
return (
item.itemStyle?.normal?.color?.colorStops?.[0]?.color ||
item.itemStyle?.color ||
"#ffffff"
);
}
}
return "#ffffff"; //
},
rich: {
name: {
align: "left",
fontSize: titleFontSize * 2.3,
//
lineHeight: titleFontSize * 3.3,
},
text: {
align: "left",
fontSize: titleFontSize * 2.3,
},
value: {
align: "left",
fontSize: titleFontSize * 2.3,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
percentage: {
align: "left",
fontSize: titleFontSize * 2.3,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
},
},
},
series: [
{
name: "风柜系统",
type: "pie",
clockWise: false,
radius: [66, 80],
center: ["32%", "50%"],
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
label: {
borderRadius: "10",
},
data: [
{
value: this.chartData1,
name: "运行数",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#277dff",
},
{
offset: 1,
color: "#277dff",
},
]),
},
},
},
{
value: this.allData,
name: "",
tooltip: {
show: false,
},
itemStyle: placeHolderStyle,
},
],
},
{
name: "风柜系统",
type: "pie",
clockWise: false,
radius: [36, 50],
center: ["32%", "50%"],
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
data: [
{
value: this.chartData2,
name: "停止数",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#9ab7dc",
},
{
offset: 1,
color: "#9ab7dc",
},
]),
},
},
},
{
value: this.allData,
name: "",
tooltip: {
show: false,
},
itemStyle: placeHolderStyle,
},
],
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
},
};
</script>
<style lang="scss" scoped>
.sys_content {
padding: 20px;
.charts {
width: 100%;
height: 250px;
}
}
// 2000px
@media (min-width: 2000px) {
.sys_content {
padding: 0.2rem !important;
.charts {
width: 100%;
height: 2.5rem !important;
}
}
}
</style>

142
src/views/components/hotWater.vue

@ -0,0 +1,142 @@
<template>
<div class="card-div">
<div class="card-li room-temp">
<div class="card-header">
<h2 class="card-title">回水平均温度</h2>
<div class="icon">
<i class="fas fa-home"></i>
</div>
</div>
<div class="thermometer">
<div class="temprogress" :style="{ height: temData1 * 2 + '%' }"></div>
</div>
<div class="temperature">{{temData1}}</div>
</div>
<div class="card-li amb-temp">
<div class="card-header">
<h2 class="card-title">供水平均温度</h2>
<div class="icon">
<i class="fas fa-home"></i>
</div>
</div>
<div class="thermometer">
<div class="temprogress" :style="{ height: temData2 * 2 + '%' }"></div>
</div>
<div class="temperature">{{temData2}}</div>
</div>
</div>
</template>
<script>
export default {
props: {
subData: {
type: Array,
required: true,
},
},
data() {
return {
temData1: "",
temData2: "",
};
},
watch: {
subData: {
immediate: true, //
handler(newVal) {
console.log("检测到传功来的数据", this.subData);
if (Object.keys(newVal).length > 0) {
console.log("newval", newVal);
let data = newVal;
this.temData1 = "";
this.temData2 = "";
data.forEach((item) => {
if (item.name.includes("回水")) {
this.temData1 = parseInt(item.value);
}
if (item.name.includes("供水")) {
this.temData2 = parseInt(item.value);
}
});
}
},
},
},
};
</script>
<style lang="scss" scoped>
.card-div {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.card-li {
width: 50%;
padding: 0.2rem 0;
display: flex;
flex-direction: column;
align-items: center;
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.1rem;
.card-title {
font-size: 15px;
font-weight: 600;
color: #ffffff;
}
}
.temperature {
font-size: 20px;
font-weight: 700;
position: relative;
display: inline-block;
}
.thermometer {
height: 180px;
width: 40px;
background: #3d5581;
border-radius: 20px;
margin: 0 auto 0.25rem;
overflow: hidden;
box-shadow: inset 0 0 1rem rgba(0, 0, 0, 0.1);
position: relative;
}
.temprogress {
position: absolute;
bottom: 0;
width: 100%;
border-top-left-radius: 20px;
border-top-right-radius:20px;
background: linear-gradient(to top, #3498db, #2ecc71) !important;
}
}
}
@media (min-width: 2000px) {
.card-div {
.card-li {
.card-header {
.card-title {
font-size: 0.15rem !important;
}
}
.temperature {
font-size: 0.2rem !important;
}
.thermometer {
height: 1.8rem !important;
width: 0.4rem !important;
border-radius: 0.2rem !important;
}
.temprogress {
border-top-left-radius: 0.2rem !important;
border-top-right-radius:0.2rem !important;
}
}
}
}
</style>

331
src/views/components/temMeter.vue

@ -0,0 +1,331 @@
<template>
<div class="sys_content">
<div class="charts" ref="chart_ref"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
export default {
props: {
subData: {
type: Array,
required: true,
},
},
data() {
return {
chartInstance: null,
option: {},
chartData1: "",
chartData2: "",
allData: "",
};
},
watch: {
subData: {
immediate: true, //
handler(newVal) {
console.log("检测到传功来的数据", this.subData);
if (Object.keys(newVal).length > 0) {
console.log("newval", newVal);
let data = newVal;
this.chartData1 = "";
this.chartData2 = "";
data.forEach((item) => {
if (item.name.includes("在线")) {
this.chartData1 = parseInt(item.value);
}
if (item.name.includes("离线")) {
this.chartData2 = parseInt(item.value);
}
//
this.allData = this.chartData1 + this.chartData2;
});
this.$nextTick(() => {
// ECharts
if (this.chartInstance) {
this.chartInstance.dispose();
}
//
this.initChart();
});
}
},
},
},
mounted() {
this.initChart();
window.addEventListener("resize", this.screenAdapter);
this.screenAdapter();
},
destroyed() {
//
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
// 线+ + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = this.$refs.chart_ref.offsetWidth / 100;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
//chartInstance
initChart() {
var dataStyle = {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 40,
borderWidth: 10,
shadowColor: "rgba(0, 0, 0, 0)", //
},
};
var placeHolderStyle = {
normal: {
color: "#393d50",
label: {
show: false,
},
labelLine: {
show: false,
},
},
emphasis: {
color: "#393d50",
},
};
let that = this;
const titleFontSize = (this.$refs.chart_ref.offsetWidth / 100) * 2;
this.chartInstance = echarts.init(this.$refs.chart_ref);
this.option = {
title: {
subtext: "在线状态",
textStyle: {
color: "#ffffff",
},
subtextStyle: {
color: "#ffffff",
},
textAlign: "center",
x: "31%",
y: "43%", //
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
},
legend: {
//
right: 0,
//
top: "middle",
itemWidth: titleFontSize,
itemHeight: titleFontSize,
itemGap: titleFontSize * 2,
formatter: function (name) {
var arr = [];
// nameseries
let seriesIndex = -1;
for (let i = 0; i < that.option.series.length; i++) {
const seriesData = that.option.series[i].data;
if (seriesData.some((item) => item.name === name)) {
seriesIndex = i;
break;
}
}
if (seriesIndex === -1) return name; //
const data = that.option.series[seriesIndex].data; // 使
let total = that.allData;
let currentValue = 0;
//
data.forEach((item) => {
if (item.name) {
//
if (item.name === name) {
currentValue = item.value;
}
}
});
const percentage =
currentValue === 0
? "0.00"
: ((currentValue / total) * 100).toFixed(2);
arr.push(
"{name|" + name + "}",
"{text|: \n}",
"{value|" + currentValue + " }",
"{percentage| " + percentage + "%}"
);
return arr.join("");
},
textStyle: {
color: function (name) {
//
for (let i = 0; i < that.option.series.length; i++) {
const item = that.option.series[i].data.find(
(d) => d.name === name
);
if (item) {
//
return (
item.itemStyle?.normal?.color?.colorStops?.[0]?.color ||
item.itemStyle?.color ||
"#ffffff"
);
}
}
return "#ffffff"; //
},
rich: {
name: {
align: "left",
fontSize: titleFontSize * 2.3,
//
lineHeight: titleFontSize * 3.3,
},
text: {
align: "left",
fontSize: titleFontSize * 2.3,
},
value: {
align: "left",
fontSize: titleFontSize * 2.3,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
percentage: {
align: "left",
fontSize: titleFontSize * 2.3,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
},
},
},
series: [
{
name: "温度监测",
type: "pie",
clockWise: false,
radius: [66, 80],
center: ["32%", "50%"],
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
label: {
borderRadius: "10",
},
data: [
{
value: this.chartData1,
name: "在线数",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#e87b4b",
},
{
offset: 1,
color: "#e87b4b",
},
]),
},
},
},
{
value: this.allData,
name: "",
tooltip: {
show: false,
},
itemStyle: placeHolderStyle,
},
],
},
{
name: "温度监测",
type: "pie",
clockWise: false,
radius: [36, 50],
center: ["32%", "50%"],
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
data: [
{
value: this.chartData2,
name: "离线数",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#ffe21e",
},
{
offset: 1,
color: "#ffe21e",
},
]),
},
},
},
{
value: this.allData,
name: "",
tooltip: {
show: false,
},
itemStyle: placeHolderStyle,
},
],
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
},
};
</script>
<style lang="scss" scoped>
.sys_content {
padding: 20px;
.charts {
width: 100%;
height: 250px;
}
}
// 2000px
@media (min-width: 2000px) {
.sys_content {
padding: 0.2rem !important;
.charts {
width: 100%;
height: 2.5rem !important;
}
}
}
</style>

33
src/views/components/viewColdSys.vue

@ -9,6 +9,12 @@
import * as echarts from "echarts";
import { viewMainParams } from "@/api/index";
export default {
props: {
subData: {
type: Array,
required: true,
},
},
data() {
return {
chartInstance: null,
@ -36,11 +42,24 @@ export default {
},
};
},
watch: {
subData: {
immediate: true, //
handler(newVal) {
// console.log("", this.subData);
if (Object.keys(newVal).length > 0) {
console.log("newval", newVal);
this.$nextTick(() => {
this.echartsData();
});
}
},
},
},
mounted() {
this.initChart();
this.screenAdapter();
window.addEventListener("resize", this.screenAdapter);
this.getChartsData();
},
destroyed() {
//mounted
@ -441,13 +460,10 @@ export default {
this.chartInstance.resize();
},
//
getChartsData() {
viewMainParams().then((res) => {
console.log("系统参数返回", res);
console.log("冷源监控返回",res.rows[0]);
if (res.code == 200) {
echartsData() {
if (this.subData.length > 0) {
this.useForm.maxData = 10;
this.useForm.useData = res.rows[0].values[0].value;
this.useForm.useData = this.subData[0].value;
let that = this;
// 使
const axisLineColor = this.getAxisLineColor(
@ -551,7 +567,6 @@ export default {
//resize
this.chartInstance.resize();
}
});
},
},
};
@ -568,7 +583,7 @@ export default {
.sys_charts {
width: 100%;
height: 1.6rem;
height: 150px;
}
.eer {
font-size: 18px;

14
src/views/components/viewEnergy.vue

@ -290,4 +290,18 @@ export default {
width: 100%;
height: 300px;
}
// 2000px
@media (min-width: 2000px) {
.right-table {
padding: 0.27rem 0.15rem 0.25rem 0.15rem !important;
}
.mr20 {
width: 0.92rem !important;
padding: 0.02rem !important;
}
.charts {
margin-top: 0.2rem !important;
height: 3rem !important;
}
}
</style>

102
src/views/index.vue

@ -119,15 +119,33 @@
<div class="special-top">
<div class="special-title">冷源系统</div>
</div>
<view-cold-sys></view-cold-sys>
<view-energy></view-energy>
</div>
</div>
<div class="project-bie">
<div class="special-div">
<div class="special-top">
<div class="special-title">能耗分析</div>
<div class="special-title">冷源能耗</div>
</div>
<view-energy></view-energy>
<view-cold-sys :subData="coldSys"></view-cold-sys>
</div>
<div class="special-div">
<div class="special-top">
<div class="special-title">热水系统</div>
</div>
<hot-water :subData="hotWaterSys"></hot-water>
</div>
<div class="special-div">
<div class="special-top">
<div class="special-title">风柜系统</div>
</div>
<airc-and-windc-meter :subData="airAndWindSys"></airc-and-windc-meter>
</div>
<div class="special-div">
<div class="special-top">
<div class="special-title">温度系统</div>
</div>
<tem-meter :subData="temSys"></tem-meter>
</div>
</div>
<el-dialog
@ -166,12 +184,26 @@
<script>
import * as echarts from "echarts";
import { imgUrl } from "@/utils/global";
import { introduction, changeLogo, viewProfile } from "@/api/index";
import {
introduction,
changeLogo,
viewProfile,
viewMainParams,
} from "@/api/index";
import viewEnergy from "./components/viewEnergy.vue";
import ViewColdSys from "./components/viewColdSys.vue";
import HotWater from "./components/hotWater.vue";
import AircAndWindcMeter from "./components/aircAndWindcMeter.vue";
import TemMeter from "./components/temMeter.vue";
export default {
components: { viewEnergy, ViewColdSys },
components: {
viewEnergy,
ViewColdSys,
HotWater,
AircAndWindcMeter,
TemMeter,
},
data() {
return {
imgUrl: "",
@ -203,11 +235,18 @@ export default {
chartsData1: null,
chartsData2: null,
isShowHome: true,
//
coldSys: [],
hotWaterSys: [],
airAndWindSys: [],
temSys: [],
};
},
mounted() {
this.getProject();
this.getHomeData();
this.getSubData();
// this.initChart();
// window.addEventListener("resize", this.screenAdapter);
// this.screenAdapter();
@ -474,7 +513,7 @@ export default {
//resize
this.chartInstance.resize();
},
// 30
//
getChartsData() {
const now = new Date();
const startDate = new Date(
@ -547,6 +586,34 @@ export default {
}
});
},
//
getSubData() {
viewMainParams().then((res) => {
console.log("系统参数返回", res);
console.log("冷源监控返回", res.rows[0]);
this.coldSys = [];
this.hotWaterSys = [];
this.airAndWindSys = [];
this.temSys = [];
if (res.code == 200 && res.rows) {
res.rows.forEach((val) => {
if (val.name.includes("冷源")) {
this.coldSys = val.values;
console.log("this.coldSys111111111111", this.coldSys);
}
if (val.name.includes("热水")) {
this.hotWaterSys = val.values;
}
if (val.name.includes("风柜")) {
this.airAndWindSys = val.values;
}
if (val.name.includes("温度")) {
this.temSys = val.values;
}
});
}
});
},
},
};
</script>
@ -653,7 +720,28 @@ export default {
align-items: stretch;
justify-content: space-between;
.special-div {
width: 100%;
width: 24.5%;
}
}
@media (max-width: 1485px) {
.overview-li {
width: calc(33.33%) !important;
height: 2rem !important;
background-size: 2rem 2rem !important;
margin-bottom: 0.3rem;
font-size: 0.22rem !important;
.overview-details {
font-size: 0.27rem !important;
}
}
.project-bie {
flex-wrap: wrap !important;
.special-div {
width: 49.5% !important;
margin-bottom: 0.25rem;
}
}
}
// 2000px
@media (min-width: 2000px) {}
</style>

Loading…
Cancel
Save