@@ -143,6 +147,14 @@ export default {
initial: false,
ws: null,
roomInfo: {
+ mag: '',
+ status: '',
+ statusMapText: {
+ 0: '待推演',
+ 1: '推演中',
+ 2: '暂停推演',
+ 3: '推演结束',
+ },
remainTimeStr: '',
remainTime: '',
duringTime: '',
@@ -301,6 +313,10 @@ export default {
this.ws = new window.MyWebsocket(`/ws/${this.scenarioId}/${this.roomId}`, (error, response) => {
if (error) return this.$message.error(error.message)
switch (response.cmdType) {
+ case 'room_info':
+ this.roomInfo.mag = response.data.mag
+ this.roomInfo.status = response.data.status
+ break
case 'update_time':
this.roomInfo.remainTimeStr = response.data.update_time_str
this.roomInfo.remainTime = response.data.remain_time
@@ -339,6 +355,8 @@ export default {
this.ws.send({ cmdType: 'editScenarioInfo' })
// 初始化路径
this.ws.send({ cmdType: 'get_init_path' })
+ // 初始化倍速、状态
+ this.ws.send({ cmdType: 'get_room_info' })
},
closeWebsocket() {
this.ws && this.ws.close()
diff --git a/src/views/subsystem/scene/index.vue b/src/views/subsystem/scene/index.vue
index a78eafc..972d6db 100644
--- a/src/views/subsystem/scene/index.vue
+++ b/src/views/subsystem/scene/index.vue
@@ -1,8 +1,8 @@