优化store

This commit is contained in:
叶志超
2021-12-23 11:16:54 +08:00
parent b8b8a09e3d
commit c92438a210
8 changed files with 42 additions and 63 deletions

View File

@@ -8,7 +8,9 @@ const load = (value) => {
// 将卫星状态信息存储到store中
const satellites = filter('Satellite')
const satellite_state_arr = satellites.map(({ id, show }) => { return { id, show } })
store.commit('satellites/set', satellite_state_arr)
store.dispatch('satelliteSystem/setSatellites', {
satellites: satellite_state_arr
})
}
const get = id => entities.find(entity => entity.id === id)