实现单机版
This commit is contained in:
30
src/render/store/modules/satelliteSystem.js
Normal file
30
src/render/store/modules/satelliteSystem.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const state = {
|
||||
name: ''
|
||||
}
|
||||
|
||||
// getters
|
||||
// const getters = {
|
||||
// get: (state) => state.name
|
||||
// }
|
||||
|
||||
// actions
|
||||
const actions = {
|
||||
set ({ commit }, { satelliteSystem }) {
|
||||
commit('set', satelliteSystem)
|
||||
}
|
||||
}
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
set (state, satelliteSystem) {
|
||||
state.name = satelliteSystem
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
// getters,
|
||||
actions,
|
||||
mutations
|
||||
}
|
||||
@@ -3,16 +3,16 @@ const state = {
|
||||
}
|
||||
|
||||
// getters
|
||||
const getters = {
|
||||
getSatelliteList: (state) => state.all
|
||||
}
|
||||
// const getters = {
|
||||
// getSatelliteList: (state) => state.all
|
||||
// }
|
||||
|
||||
// actions
|
||||
const actions = {
|
||||
load ({ commit }, { satellites }) {
|
||||
commit('set', satellites)
|
||||
}
|
||||
}
|
||||
// const actions = {
|
||||
// load ({ commit }, { satellites }) {
|
||||
// commit('set', satellites)
|
||||
// }
|
||||
// }
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
@@ -23,13 +23,15 @@ const mutations = {
|
||||
toggleShow (state, id) {
|
||||
const satellite = state.all.find(satellite => satellite.id === id)
|
||||
satellite.show = !satellite.show
|
||||
}
|
||||
},
|
||||
|
||||
track () {}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
// getters,
|
||||
// actions,
|
||||
mutations
|
||||
}
|
||||
30
src/render/store/modules/trackedSatellite.js
Normal file
30
src/render/store/modules/trackedSatellite.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const state = {
|
||||
id: null
|
||||
}
|
||||
|
||||
// getters
|
||||
// const getters = {
|
||||
// get: (state) => state.value
|
||||
// }
|
||||
|
||||
// actions
|
||||
const actions = {
|
||||
set ({ commit }, { trackedSatelliteId }) {
|
||||
commit('set', trackedSatelliteId)
|
||||
}
|
||||
}
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
set (state, trackedSatelliteId) {
|
||||
state.id = trackedSatelliteId
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
// getters,
|
||||
actions,
|
||||
mutations
|
||||
}
|
||||
Reference in New Issue
Block a user