apply.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import _ from 'lodash';
  4. Vue.use(Vuex);
  5. const api = {
  6. applyInfo: `/api/live/dock/apply`,
  7. };
  8. const state = () => ({});
  9. const mutations = {};
  10. const actions = {
  11. async query({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
  12. const res = await this.$axios.$get(api.applyInfo, { skip, limit, ...info });
  13. return res;
  14. },
  15. async create({ commit }, { id, ...info } = {}) {
  16. const res = await this.$axios.$post(`${api.applyInfo}/${id}`, { ...info });
  17. return res;
  18. },
  19. async fetch({ commit }, payload) {
  20. const res = await this.$axios.$get(`${api.applyInfo}/${payload}`);
  21. return res;
  22. },
  23. async update({ commit }, { dock_id, id, ...data }) {
  24. const res = await this.$axios.$post(
  25. `${api.applyInfo}/${dock_id}/check/${id}`,
  26. data
  27. );
  28. return res;
  29. },
  30. async delete({ commit }, payload) {
  31. const res = await this.$axios.$delete(`${api.applyInfo}/${payload}`);
  32. return res;
  33. },
  34. };
  35. export default {
  36. namespaced: true,
  37. state,
  38. mutations,
  39. actions,
  40. };