From aa76bf92fd421cf2c7816fe4fc3f04a457ebe35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 5 Sep 2025 17:25:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/board/index.js | 43 ++ src/components/Charts/Chart.vue | 5 +- src/views/board/index.vue | 861 +++++++++++++++++++++++++++++++- vue.config.js | 2 +- 4 files changed, 884 insertions(+), 27 deletions(-) create mode 100644 src/api/board/index.js diff --git a/src/api/board/index.js b/src/api/board/index.js new file mode 100644 index 0000000..c905a07 --- /dev/null +++ b/src/api/board/index.js @@ -0,0 +1,43 @@ +import request from '@/utils/request' + +export function realTimeData(query) { + return request({ + url: '/ems/board/realTimeData', method: 'get', params: query + }) +} + +export function deviceOverview(query) { + return request({ + url: '/ems/board/deviceOverview', method: 'get', params: query + }) +} + +export function monthConsumptionRanking(query) { + return request({ + url: '/ems/board/monthConsumptionRanking', method: 'get', params: query + }) +} + +export function peaksValleysConsumption(query) { + return request({ + url: '/ems/board/peaksValleysConsumption', method: 'get', params: query + }) +} + +export function fiveConsumptionStatistics(query) { + return request({ + url: '/ems/board/fiveConsumptionStatistics', method: 'get', params: query + }) +} + +export function energyConsumptionStatistics(query) { + return request({ + url: '/ems/board/energyConsumptionStatistics', method: 'get', params: query + }) +} + +export function realTimeAlarm(query) { + return request({ + url: '/ems/board/realTimeAlarm', method: 'get', params: query + }) +} \ No newline at end of file diff --git a/src/components/Charts/Chart.vue b/src/components/Charts/Chart.vue index 0899129..033c13c 100644 --- a/src/components/Charts/Chart.vue +++ b/src/components/Charts/Chart.vue @@ -6,7 +6,7 @@ import * as echarts from 'echarts'; export default { - expose: ['setData'], + expose: ['setData', 'getChart'], data() { return { chart: null, @@ -29,6 +29,9 @@ export default { this.chart = echarts.init(this.$el, 'macarons') this.chart.setOption(option) + }, + getChart() { + return this.chart } } } diff --git a/src/views/board/index.vue b/src/views/board/index.vue index f798d6e..01dff70 100644 --- a/src/views/board/index.vue +++ b/src/views/board/index.vue @@ -9,12 +9,12 @@
实时预警
近7天尖峰平谷统计
-
200
-
200
-
200
-
200
-
200
-
200
+
{{ deviceOverviewData.deviceSum }}
+
{{ deviceOverviewData.waterSum }}
+
{{ deviceOverviewData.dnbSum }}
+
{{ deviceOverviewData.airSum }}
+
{{ deviceOverviewData.steamSum }}
+
{{ deviceOverviewData.nitrogenSum }}
网关总数
水表总数
电表总数
@@ -28,50 +28,648 @@
用压缩空气量(m³)
用蒸汽量(m³)
用氮气量(m³)
-
6554
-
6554
-
6554
-
6554
-
6554
+
{{ fiveConsumptionStatisticsData.dnbSum }}
+
{{ fiveConsumptionStatisticsData.waterSum }}
+
{{ fiveConsumptionStatisticsData.airSum }}
+
{{ fiveConsumptionStatisticsData.steamSum }}
+
{{ fiveConsumptionStatisticsData.nitrogenSum }}
- {{ 1 === 1 ? '上升' : '下降' }}9.6% -
+ {{ + fiveConsumptionStatisticsData.dnbRate > 0 ? '上升' : '下降' + }}{{ fiveConsumptionStatisticsData.dnbRate }}% +
- {{ 1 === 1 ? '上升' : '下降' }}9.6% -
+ {{ + fiveConsumptionStatisticsData.waterRate > 0 ? '上升' : '下降' + }}{{ fiveConsumptionStatisticsData.waterRate }}% +
- {{ 1 === 1 ? '上升' : '下降' }}9.6% -
+ {{ + fiveConsumptionStatisticsData.airRate > 0 ? '上升' : '下降' + }}{{ fiveConsumptionStatisticsData.airRate }}% +
- {{ 1 === 1 ? '上升' : '下降' }}9.6% -
+ {{ + fiveConsumptionStatisticsData.steamRate > 0 ? '上升' : '下降' + }}{{ fiveConsumptionStatisticsData.steamRate }}% +
- {{ 1 === 1 ? '上升' : '下降' }}9.6% -
+ {{ + fiveConsumptionStatisticsData.nitrogenRate > 0 ? '上升' : '下降' + }}{{ fiveConsumptionStatisticsData.nitrogenRate }}% +
+ +
+
+
+ +
+
+ A区 +
+
+ A区 +
+
+ A区 +
+
+ A区 +
+
+ 合计 +
+
+ +
+
+
+ {{ item.no }} +
+
+ {{ item.no }} +
+
+ {{ item.no }} +
+
+ {{ item.no }} +
+
+ {{ item.no }} +
+
+ {{ item.no }} +
+
+
+
+
+
+
+
+ 区域 +
+
+ 设备 +
+
+ 报警时间 +
+
+ +
+
+
+ {{ item.deviceName }} +
+
+ {{ item.monitorName }}:{{ item.alarmData }} +
+
+ {{ item.collectTime }} +
+
+
+
+
+ + + + +
+
+
+
+
+ {{ i[0] }}段用电 +
+
+ + {{ i[2] }} + % +
+
+
+
+
+ +
\ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 48a78f8..066e97f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,7 +35,7 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://localhost:8010`, + target: `http://192.168.100.100:8010`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''