const state = {
	examineStatus: {}, //审批状态
	deptAll: [],
	staffAllList: [],
};
const mutations = {
	//审批状态
	SET_EXAMINE: (state, data) => {
		state.examineStatus = data || {};
		localStorage.setItem('examineStatus', JSON.stringify(data));
	},
	DELETE_SET_EXAMINE: (state) => {
		state.examineStatus = {};
		localStorage.removeItem('examineStatus');
	},
	//所有部门
	SET_DEPTALL: (state, detpAllData) => {
		state.deptAll = detpAllData || [];
		localStorage.setItem('deptAll', JSON.stringify(detpAllData));
	},
	DELETE_SET_DEPTALL: (state) => {
		state.deptAll = [];
		localStorage.removeItem('deptAll');
	},
	//审批流人员 staffAllList
	SET_STAFFALLLIST: (state, data) => {
		state.staffAllList = data || [];
		localStorage.setItem('staffAllList', JSON.stringify(data));
	},
	DELETE_SET_STAFFALLLIST: (state) => {
		state.staffAllList = [];
		localStorage.removeItem('staffAllList');
	},
};
const actions = {
	//所有部门
	//所有部门
	setDeptAll(context, detpAllData) {
		context.commit('SET_DEPTALL', detpAllData);
	},
	deleteAll(context) {
		context.commit('DELETE_SET_DEPTALL');
	},

	//审批流人员
	setStaffAllList(context, data) {
		context.commit('SET_STAFFALLLIST', data);
	},
	deleteStaffAllList(context) {
		context.commit('DELETE_SET_STAFFALLLIST');
	},

	//审批状态
	setExamine(context, data) {
		context.commit('SET_EXAMINE', data);
	},
	deleteExamine(context) {
		context.commit('DELETE_SET_EXAMINE');
	},
};
export default {
	namespaced: true,
	state,
	mutations,
	actions,
};
