rt-sim-training-client/src/store/modules/scriptRecord.js

59 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-08-08 10:31:46 +08:00
/**
* 实训状态数据
*/
const scriptRecord = {
2019-08-29 17:16:33 +08:00
namespaced: true,
state: {
mapLocation: {}, // 地图定位,
simulationPause: true,
scriptId: '',
bgSet: false
},
getters: {
mapLocation: (state)=>{
return state.mapLocation;
},
simulationPause: (state)=>{
return state.simulationPause;
},
scriptId: (state)=>{
return state.scriptId;
},
bgSet: (state)=>{
return state.bgSet;
}
},
mutations: {
setMapLocation: (state, mapLocation) => {
2019-08-08 17:32:38 +08:00
state.mapLocation = mapLocation;
2019-08-29 17:16:33 +08:00
},
setSimulationPause: (state, simulationPause) => {
state.simulationPause = simulationPause;
},
setscriptId: (state, scriptId) => {
state.scriptId = scriptId;
},
setBgSet: (state, bgSet) => {
state.bgSet = bgSet;
}
},
actions: {
/**
2019-08-08 17:32:38 +08:00
* 设置地图定位
*/
2019-08-29 17:16:33 +08:00
updateMapLocation: ({ commit }, mapLocation) => {
2019-08-08 17:32:38 +08:00
commit('setMapLocation', mapLocation);
2019-08-29 17:16:33 +08:00
},
updateSimulationPause: ({ commit }, simulationPause) => {
commit('setSimulationPause', simulationPause);
},
updateScriptId: ({ commit }, scriptId) => {
commit('setscriptId', scriptId);
},
updateBgSet: ({ commit }, bgSet) => {
commit('setBgSet', bgSet);
}
}
2019-08-08 10:31:46 +08:00
};
2019-08-29 17:16:33 +08:00
export default scriptRecord;