const state = { sparepartId: '', sparepart: null, executorInfo: null, selectSparepart: null, }; const mutations = { SET_SPAREPART: (state, data) => { //存放备品备件 state.sparepart = data; }, SET_EXECUTOR: (state, data) => { //转派人员信息 state.executorInfo = data; }, SET_SELECTSPAREPART: (state, data) => { state.selectSparepart = data } }; const actions = { setSelectSparepart({ commit, state }, data) { commit('SET_SELECTSPAREPART', data); }, setSparepart({ commit, state }, data) { commit('SET_SPAREPART', data); }, setExecutor({ commit }, data) { commit('SET_EXECUTOR', data); }, }; export default { namespaced: true, state, mutations, actions };