Ver código fonte

Merge branch 'master' of http://git.cc-lotus.info/new_train/frame

guhongwei 4 anos atrás
pai
commit
74c19771ab
3 arquivos alterados com 10 adições e 2 exclusões
  1. 6 0
      store/bedroom.js
  2. 2 2
      store/tea-plan.js
  3. 2 0
      utils/axios-wrapper.js

+ 6 - 0
store/bedroom.js

@@ -6,6 +6,7 @@ Vue.use(Vuex);
 const api = {
   interface: `/api/train/bedroom`,
   apart: `/api/train/bedroom/apart`,
+  updateBat: `/api/train/bedroom/batch`,
 };
 const state = () => ({});
 const mutations = {};
@@ -39,6 +40,11 @@ const actions = {
     const res = await this.$axios.$get(`${api.interface}/student/${payload}`);
     return res;
   },
+  // 批量修改寝室
+  async updateBat({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.updateBat}`, payload);
+    return res;
+  },
   async mergeRequest({ commit, dispatch }, { method, data }) {
     let toRequest = () => {
       let res = [];

+ 2 - 2
store/tea-plan.js

@@ -56,8 +56,8 @@ const actions = {
     return res;
   },
   // 计划-给指定期安排的教师发送通知
-  async sendMsg({ commit }, { ids, planid }) {
-    const res = await this.$axios.$post(`${api.sendmsg}/${planid}`, { ids });
+  async sendMsg({ commit }, { planid, ...info }) {
+    const res = await this.$axios.$post(`${api.sendmsg}/${planid}`, info);
     return res;
   },
   // 计划-给指定期安排的教师确认状态

+ 2 - 0
utils/axios-wrapper.js

@@ -52,6 +52,8 @@ export default class AxiosWrapper {
   }
 
   async $request(uri, data, query, options) {
+    // 过滤key:''的情况
+    query = _.pickBy(query, val => val !== '');
     if (!uri) console.error('uri不能为空');
     if (_.isObject(query) && _.isObject(options)) {
       const params = query.params ? query.params : query;