talk.js 774 B

1234567891011121314151617181920212223242526272829303132
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import _ from 'lodash';
  4. Vue.use(Vuex);
  5. const api = {
  6. list: `/api/jobs/talks`,
  7. fetch: id => `/api/jobs/talks/${id}`,
  8. };
  9. export const state = () => ({});
  10. export const mutations = {};
  11. export const actions = {
  12. async getTalk({ state }, { type, data }) {
  13. let { skip = 0, limit } = data;
  14. let result;
  15. if (type !== 'fetch') {
  16. let { schid, date, ...searchInfo } = data;
  17. result = await this.$axios.$get(_.get(api, type), {
  18. schid: schid,
  19. skip: skip,
  20. limit: limit,
  21. date: date,
  22. status: '1',
  23. ...searchInfo,
  24. });
  25. }
  26. if (type === 'fetch') {
  27. let { id } = data;
  28. result = await this.$axios.$get(api.fetch(id));
  29. }
  30. return result;
  31. },
  32. };