|
@@ -1,6 +1,27 @@
|
|
|
<template>
|
|
|
<div class="realtime-container">
|
|
|
- <div ref="chart" class="chart" :style="{height: '500px', width: '100%'}" />
|
|
|
+ <div ref="chart" class="chart" :style="{height: '400px', width: '100%'}" />
|
|
|
+ <div class="realtime-foot">
|
|
|
+ <div class="realtime-foot-title">实时动态模拟</div>
|
|
|
+ <div class="realtime-foot-actions">
|
|
|
+ <div class="realtime-foot-action" v-if="task.status === 0">
|
|
|
+ <svg-icon icon-class="realtime-pause" class-name="realtime-foot-action-icon" @click="pause" />
|
|
|
+ <div class="realtime-foot-action-label">暂停任务</div>
|
|
|
+ </div>
|
|
|
+ <div class="realtime-foot-action" v-if="task.status === 3">
|
|
|
+ <svg-icon icon-class="realtime-play" class-name="realtime-foot-action-icon" @click="play" />
|
|
|
+ <div class="realtime-foot-action-label">开始任务</div>
|
|
|
+ </div>
|
|
|
+ <div class="realtime-foot-action" v-if="task.status === 0 || task.status === 3">
|
|
|
+ <svg-icon icon-class="realtime-stop" class-name="realtime-foot-action-icon" @click="stop" />
|
|
|
+ <div class="realtime-foot-action-label">中止任务</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="realtime-foot-time">
|
|
|
+ <div class="realtime-foot-time-label">施测时间:</div>
|
|
|
+ <div class="realtime-foot-time-value">2024-4-2 12:50:32</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -10,7 +31,7 @@ require('echarts/theme/macarons') // echarts theme
|
|
|
import resize from '@/utils/resize'
|
|
|
import { getConfig } from '@/api/site/site'
|
|
|
import { getSiteSection } from '@/api/site/berthing'
|
|
|
-import { getCarLocation, getWaterLevel } from '@/api/analysis/achievement'
|
|
|
+import { getCarLocation, getWaterLevel, taskAction } from '@/api/analysis/achievement'
|
|
|
import CarSvg from '@/assets/images/car.svg'
|
|
|
|
|
|
export default {
|
|
@@ -19,6 +40,8 @@ export default {
|
|
|
siteId: Number | String,
|
|
|
positions: Array,
|
|
|
measureLine: Array,
|
|
|
+ siteRealTime: Object,
|
|
|
+ task: Object,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -48,6 +71,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ pause() {
|
|
|
+ this.$modal.confirm('是否确认暂停当前任务?').then(() => {
|
|
|
+ return taskAction(this.siteId, 1);
|
|
|
+ }).then(() => {
|
|
|
+ this.$emit('refresh');
|
|
|
+ this.$modal.msgSuccess("暂停成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ play() {
|
|
|
+ this.$modal.confirm('是否确认重启当前任务?').then(() => {
|
|
|
+ return taskAction(this.siteId, 2);
|
|
|
+ }).then(() => {
|
|
|
+ this.$emit('refresh');
|
|
|
+ this.$modal.msgSuccess("重启成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ stop() {
|
|
|
+ this.$modal.confirm('是否确认中止当前任务?').then(() => {
|
|
|
+ return taskAction(this.siteId, 0);
|
|
|
+ }).then(() => {
|
|
|
+ this.$emit('refresh');
|
|
|
+ this.$modal.msgSuccess("中止成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
loadCarLocation() {
|
|
|
getCarLocation(this.siteId).then((res) => {
|
|
|
this.location = res.data?.position || 0;
|
|
@@ -253,5 +300,49 @@ export default {
|
|
|
height: 500px;
|
|
|
background: linear-gradient(0, #FFFFFF 57%, #D1E8FF 100%);
|
|
|
border-radius: 4px;
|
|
|
+ padding: 0 20px;
|
|
|
+}
|
|
|
+.realtime-foot {
|
|
|
+ height: 100px;
|
|
|
+ background: #fff;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.realtime-foot-title {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #1D2738;
|
|
|
+}
|
|
|
+.realtime-foot-actions {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.realtime-foot-action {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ margin: 0 25px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.realtime-foot-action-icon {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+}
|
|
|
+.realtime-foot-action-label {
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #54606C;
|
|
|
+}
|
|
|
+.realtime-foot-time {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+.realtime-foot-time-label {
|
|
|
+ color: #54606C;
|
|
|
+}
|
|
|
+.realtime-foot-time-value {
|
|
|
+ color: #1D2738;
|
|
|
}
|
|
|
</style>
|