59 lines
1.2 KiB
JavaScript
59 lines
1.2 KiB
JavaScript
/**
|
|
* 实训状态数据
|
|
*/
|
|
const scriptRecord = {
|
|
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) => {
|
|
state.mapLocation = mapLocation;
|
|
},
|
|
setSimulationPause: (state, simulationPause) => {
|
|
state.simulationPause = simulationPause;
|
|
},
|
|
setscriptId: (state, scriptId) => {
|
|
state.scriptId = scriptId;
|
|
},
|
|
setBgSet: (state, bgSet) => {
|
|
state.bgSet = bgSet;
|
|
}
|
|
},
|
|
actions: {
|
|
/**
|
|
* 设置地图定位
|
|
*/
|
|
updateMapLocation: ({ commit }, mapLocation) => {
|
|
commit('setMapLocation', mapLocation);
|
|
},
|
|
updateSimulationPause: ({ commit }, simulationPause) => {
|
|
commit('setSimulationPause', simulationPause);
|
|
},
|
|
updateScriptId: ({ commit }, scriptId) => {
|
|
commit('setscriptId', scriptId);
|
|
},
|
|
updateBgSet: ({ commit }, bgSet) => {
|
|
commit('setBgSet', bgSet);
|
|
}
|
|
}
|
|
};
|
|
export default scriptRecord;
|