|
@@ -0,0 +1,48 @@
|
|
|
|
+import Vue from 'vue';
|
|
|
|
+import Vuex from 'vuex';
|
|
|
|
+import _ from 'lodash';
|
|
|
|
+Vue.use(Vuex);
|
|
|
|
+const api = {
|
|
|
|
+ groupInfo: `/api/train/group`,
|
|
|
|
+ // insertInfo: `/api/train/group/insert`,
|
|
|
|
+ // exitInfo: `/api/train/group/exit`,
|
|
|
|
+};
|
|
|
|
+const state = () => ({});
|
|
|
|
+const mutations = {};
|
|
|
|
+
|
|
|
|
+const actions = {
|
|
|
|
+ async query({ commit }, { skip = 0, limit, termid, batchid, classid, ...info } = {}) {
|
|
|
|
+ const res = await this.$axios.$get(`${api.groupInfo}`, { skip, limit, ...info, termid, batchid, classid });
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+ async create({ commit }, payload) {
|
|
|
|
+ const res = await this.$axios.$post(`${api.groupInfo}`, payload);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+ async fetch({ commit }, payload) {
|
|
|
|
+ const res = await this.$axios.$get(`${api.groupInfo}/${payload}`);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+ async update({ commit }, { id, ...data }) {
|
|
|
|
+ const res = await this.$axios.$post(`${api.groupInfo}/update/${id}`, data);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+ async delete({ commit }, payload) {
|
|
|
|
+ const res = await this.$axios.$delete(`${api.groupInfo}/${payload}`);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+ async insert({ commit }, payload) {
|
|
|
|
+ const res = await this.$axios.$post(`${api.groupInfo}/insert`, payload);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+ async exit({ commit }, payload) {
|
|
|
|
+ const res = await this.$axios.$post(`${api.groupInfo}/exit`, payload);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+export default {
|
|
|
|
+ namespaced: true,
|
|
|
|
+ state,
|
|
|
|
+ mutations,
|
|
|
|
+ actions,
|
|
|
|
+};
|