home.js 574 Bytes
import {
	getProjectListApi,
} from '@/config/api.js';

const state = () => ({
	projectList: [],
})

const getters = {
	
}

const actions = {

	async getProjectList({
		commit,
		dispatch,
		state
	}, params) {
		const result = await getProjectListApi(params);
		if (result&& result.records) {
			commit('setProjectList', result);
			return result;
		}
	},

}

const mutations = {

	setProjectList(state, result) {
		state.projectList = result.records;
	},

}

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