
const state = {
    state: {
        dvpId: undefined,
        mainDvpId: undefined,
        performanceModuleCode: undefined,
        dvpOwnerId: undefined,
        dvpOwnerName: undefined,
        ownerDepartmentId: undefined,
        dvpType: undefined,
        cpacId: undefined
    },
};
const mutations = {
  SET: (state, {key, value}) => {
    state[key] = value
  },
  CLEAR: state => {
    // 清除缓存
    state['dvpId'] = undefined
    state['mainDvpId'] = undefined
    state['performanceModuleCode'] = undefined
    state['dvpOwnerId'] = undefined
    state['dvpOwnerName'] = undefined
    state['ownerDepartmentId'] = undefined
    state['dvpType'] = undefined
    state['cpacId'] = undefined
  },
};
const actions = {
  set({commit}, data) {
    commit('SET', data)
  },
  clear({commit}) {
      commit('CLEAR')
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions
};
