2019-08-08 10:31:46 +08:00
|
|
|
/**
|
|
|
|
* 实训状态数据
|
|
|
|
*/
|
|
|
|
const scriptRecord = {
|
2020-03-31 14:52:19 +08:00
|
|
|
namespaced: true,
|
|
|
|
state: {
|
|
|
|
mapLocation: {}, // 地图定位,
|
|
|
|
simulationPause: true,
|
|
|
|
scriptId: '',
|
|
|
|
bgSet: false,
|
|
|
|
isScriptCommand:false, // 当前是否为添加剧本动作指令状态
|
2020-06-22 18:37:09 +08:00
|
|
|
scriptCommand:{}, // 剧本动作添加的指令
|
|
|
|
updateRoleStatus:0, // 剧本更新角色标志
|
2020-06-23 10:57:35 +08:00
|
|
|
updateCoversitionStatus:0, // 剧本仿真更新会话信息
|
2020-06-22 18:37:09 +08:00
|
|
|
userRole:null // 剧本更新的角色
|
2020-03-31 14:52:19 +08:00
|
|
|
},
|
|
|
|
getters: {
|
|
|
|
mapLocation: (state)=>{
|
|
|
|
return state.mapLocation;
|
|
|
|
},
|
|
|
|
simulationPause: (state)=>{
|
|
|
|
return state.simulationPause;
|
|
|
|
},
|
|
|
|
scriptId: (state)=>{
|
|
|
|
return state.scriptId;
|
|
|
|
},
|
|
|
|
bgSet: (state)=>{
|
|
|
|
return state.bgSet;
|
|
|
|
},
|
|
|
|
isScriptCommand:(state)=>{
|
|
|
|
return state.isScriptCommand;
|
|
|
|
},
|
|
|
|
scriptCommand:(state)=>{
|
|
|
|
return state.scriptCommand;
|
2020-06-22 18:37:09 +08:00
|
|
|
},
|
|
|
|
updateRoleStatus:(state)=>{
|
|
|
|
return state.updateRoleStatus;
|
2020-03-31 14:52:19 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mutations: {
|
|
|
|
setMapLocation: (state, mapLocation) => {
|
|
|
|
state.mapLocation = mapLocation;
|
|
|
|
},
|
|
|
|
setSimulationPause: (state, simulationPause) => {
|
|
|
|
state.simulationPause = simulationPause;
|
|
|
|
},
|
|
|
|
setscriptId: (state, scriptId) => {
|
|
|
|
state.scriptId = scriptId;
|
|
|
|
},
|
|
|
|
setBgSet: (state, bgSet) => {
|
|
|
|
state.bgSet = bgSet;
|
|
|
|
},
|
|
|
|
setIsScriptCommand:(state, isScriptCommand) => {
|
|
|
|
state.isScriptCommand = isScriptCommand;
|
|
|
|
},
|
|
|
|
setScriptCommand:(state, scriptCommand) => {
|
|
|
|
state.scriptCommand = scriptCommand;
|
2020-06-22 18:37:09 +08:00
|
|
|
},
|
|
|
|
updateRole:(state, userRole) => {
|
2020-06-24 09:24:08 +08:00
|
|
|
if (state.userRole == userRole) {
|
|
|
|
state.updateRoleStatus += 1;
|
|
|
|
}
|
2020-06-22 18:37:09 +08:00
|
|
|
state.userRole = userRole;
|
2020-06-23 10:57:35 +08:00
|
|
|
},
|
|
|
|
updateCoversitionInfo:(state) => {
|
|
|
|
state.updateCoversitionStatus += 1;
|
2020-03-31 14:52:19 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
/**
|
2019-08-08 17:32:38 +08:00
|
|
|
* 设置地图定位
|
|
|
|
*/
|
2020-03-31 14:52:19 +08:00
|
|
|
updateMapLocation: ({ commit }, mapLocation) => {
|
|
|
|
commit('setMapLocation', mapLocation);
|
|
|
|
},
|
|
|
|
updateSimulationPause: ({ commit }, simulationPause) => {
|
|
|
|
commit('setSimulationPause', simulationPause);
|
|
|
|
},
|
|
|
|
updateScriptId: ({ commit }, scriptId) => {
|
|
|
|
commit('setscriptId', scriptId);
|
|
|
|
},
|
|
|
|
updateBgSet: ({ commit }, bgSet) => {
|
|
|
|
commit('setBgSet', bgSet);
|
|
|
|
},
|
|
|
|
updateIsScriptCommand:({ commit }, isScriptCommand) => {
|
|
|
|
commit('setIsScriptCommand', isScriptCommand);
|
|
|
|
},
|
|
|
|
updateScriptCommand:({ commit }, scriptCommand) => {
|
|
|
|
commit('setScriptCommand', scriptCommand);
|
2020-06-22 18:37:09 +08:00
|
|
|
},
|
|
|
|
updateRole:({ commit }, userRole) => {
|
|
|
|
commit('updateRole', userRole);
|
2020-06-23 10:57:35 +08:00
|
|
|
},
|
|
|
|
updateCoversitionInfo:({ commit }) => {
|
|
|
|
commit('updateCoversitionInfo');
|
2020-03-31 14:52:19 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-08 10:31:46 +08:00
|
|
|
};
|
2019-08-29 17:16:33 +08:00
|
|
|
export default scriptRecord;
|