diff --git a/src/api/simulation.js b/src/api/simulation.js index f4e14bbb6..bc3594bb6 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -210,10 +210,10 @@ export function getScriptMemberData(group) { } /** 清除仿真剧本数据*/ -export function dumpScriptData(scriptId) { +export function dumpScriptData(group) { return request({ - url: `/api/simulation/${scriptId}/clearScriptRecord`, - method: 'post' + url: `/api/simulation/${group}/scriptWrite/saveData`, + method: 'delete' }); } diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 24c3b19b3..b7a7dc200 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -77,9 +77,10 @@ export default { {label: '管理员', value: 'Admin'}, {label: '教员', value: 'Instructor'}, {label: '行调', value: 'Dispatcher'}, - {label: '车站', value: 'Attendant'}, + {label: '行值', value: 'Attendant'}, {label: '观众', value: 'Audience'}, - {label: '司机', value: 'Driver'} + {label: '司机', value: 'Driver'}, + {label: '通号', value: 'Repair'} ], SimulationType: [ diff --git a/src/views/display/menuScript.vue b/src/views/display/menuScript.vue index 0bfbe2be7..68ef4e807 100644 --- a/src/views/display/menuScript.vue +++ b/src/views/display/menuScript.vue @@ -8,7 +8,7 @@ --> 按计划行车 - 退出计划 + 返回 diff --git a/src/views/display/scriptRecord/addAction.vue b/src/views/display/scriptRecord/addAction.vue index de2b3e7e2..e4472aa66 100644 --- a/src/views/display/scriptRecord/addAction.vue +++ b/src/views/display/scriptRecord/addAction.vue @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -47,6 +47,7 @@ import Vue from 'vue'; import DeviceTypeDic from '@/scripts/DeviceTypeDic'; // import CommandForm from "./commandForm"; + import ConstConfig from '@/scripts/ConstConfig'; import {addScriptAction,modifyScriptAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType,getScriptMemberData} from '@/api/simulation'; export default { name: 'addAction', @@ -67,6 +68,14 @@ // components:{ // CommandForm, // }, + watch:{ + '$store.state.socket.simulationStart': function (val) { + if(val) + { + this.initData(); + } + } + }, data() { return { modalData:{ @@ -120,7 +129,14 @@ methods:{ initData(){ getScriptMemberData(this.group).then(resp => { - this.memberList=resp.data; + let roleTypeList=ConstConfig.ConstSelect.roleType; + let lastData=JSON.stringify(resp.data); + roleTypeList.forEach(function(element){ + let rolename=element.value; + lastData=lastData.replace(new RegExp(rolename,'g'),element.label); + }); + lastData=JSON.parse(lastData); + this.memberList=lastData; getAvailableDeviceCommand().then(response=>{ this.deviceCommandList=response.data; this.getDeviceCode(); @@ -131,7 +147,6 @@ let params = {deviceType:"StationStand"}; let group=this.group; getDeviceCodeByDeviceType(group,params).then(response =>{ - // debugger; let resultData=response.data; resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name")); this.stationList=resultData; @@ -182,7 +197,6 @@ resetDisabled(){ if(this.$refs['modalData']) { - debugger; this.$refs['modalData'].resetFields(); } }, diff --git a/src/views/display/scriptRecord/getAction.vue b/src/views/display/scriptRecord/getAction.vue index 21844fee6..b7240b635 100644 --- a/src/views/display/scriptRecord/getAction.vue +++ b/src/views/display/scriptRecord/getAction.vue @@ -1,7 +1,7 @@