|
@@ -0,0 +1,133 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="18">
|
|
|
+ <Simulation :site-id="2" />
|
|
|
+ <el-row :gutter="20" style="margin-top: 10px">
|
|
|
+ <el-col :span="8">
|
|
|
+ <Site :siteRealTime="siteRealTime" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <Car :carInfo="carInfo" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <Message :messages="messages" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <Movie />
|
|
|
+ <Flow ref="flow" style="margin-top: 10px" />
|
|
|
+ <Water ref="water" style="margin-top: 10px" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <Report :measureLine="measureLine" style="margin-top: 10px" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Simulation from './simulation'
|
|
|
+import Site from './site'
|
|
|
+import Car from './car'
|
|
|
+import Message from './message'
|
|
|
+import Movie from './movie'
|
|
|
+import Flow from './flow'
|
|
|
+import Water from './water'
|
|
|
+import Report from './report'
|
|
|
+import { getCarInfo, getSiteRealTime, getTaskNotice, listMeasureLine, listWaterLevel } from "@/api/analysis/achievement";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ Simulation,
|
|
|
+ Site,
|
|
|
+ Car,
|
|
|
+ Message,
|
|
|
+ Movie,
|
|
|
+ Flow,
|
|
|
+ Water,
|
|
|
+ Report,
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ siteId: Number | String,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ carInfo: {},
|
|
|
+ siteRealTime: {},
|
|
|
+ messages: [],
|
|
|
+ measureLine: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ loadCarInfo() {
|
|
|
+ getCarInfo(this.siteId).then((res) => {
|
|
|
+ this.carInfo = res.data || {};
|
|
|
+ }).finally(() => {
|
|
|
+ this.timer1 = setTimeout(() => this.loadCarInfo(), 5e3)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadMeasureLine() {
|
|
|
+ listMeasureLine(this.siteId).then((res) => {
|
|
|
+ const measureLine = res.data || [];
|
|
|
+ this.measureLine = measureLine;
|
|
|
+ this.$refs.flow.setOptions(measureLine)
|
|
|
+ }).finally(() => {
|
|
|
+ this.timer2 = setTimeout(() => this.loadMeasureLine(), 5e3)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadTaskNotice() {
|
|
|
+ getTaskNotice(this.siteId, this.id).then((res) => {
|
|
|
+ this.messages = res.data.records || [];
|
|
|
+ }).finally(() => {
|
|
|
+ this.timer3 = setTimeout(() => this.loadTaskNotice(), 5e3)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadSiteRealTime() {
|
|
|
+ getSiteRealTime(this.siteId).then((res) => {
|
|
|
+ this.siteRealTime = res.data || {};
|
|
|
+ }).finally(() => {
|
|
|
+ this.timer4 = setTimeout(() => this.loadSiteRealTime(), 5e3)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadWaterLevel() {
|
|
|
+ const endTime = new Date()
|
|
|
+ const startTime = new Date()
|
|
|
+ startTime.setHours(0)
|
|
|
+ startTime.setMinutes(0)
|
|
|
+ startTime.setSeconds(0)
|
|
|
+ startTime.setMilliseconds(0)
|
|
|
+ const params = {
|
|
|
+ startTime: this.parseTime(startTime),
|
|
|
+ endTime: this.parseTime(endTime),
|
|
|
+ siteId: this.siteId,
|
|
|
+ type: 1,
|
|
|
+ page: 1,
|
|
|
+ size: 10000
|
|
|
+ }
|
|
|
+ listWaterLevel(params).then((res) => {
|
|
|
+ this.$refs.water.setOptions(res.data?.records || [])
|
|
|
+ }).finally(() => {
|
|
|
+ this.timer5 = setTimeout(() => this.loadWaterLevel(), 5e3)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.loadCarInfo();
|
|
|
+ this.loadMeasureLine();
|
|
|
+ this.loadTaskNotice();
|
|
|
+ this.loadSiteRealTime();
|
|
|
+ this.loadWaterLevel();
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ if (this.timer1) clearTimeout(this.timer1);
|
|
|
+ if (this.timer2) clearTimeout(this.timer2);
|
|
|
+ if (this.timer3) clearTimeout(this.timer3);
|
|
|
+ if (this.timer4) clearTimeout(this.timer4);
|
|
|
+ if (this.timer5) clearTimeout(this.timer5);
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|