bigWindowCompany.js 1.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
 * @Author: your name
 * @Date: 2022-02-25 13:53:11
 * @LastEditTime: 2022-02-25 15:01:59
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/store/modules/bigWindowDevice.js
 */
import { getCompany } from "@/api/bigWindow/getDevice";

const state = {
  // 公司名称
  company: {},
14 15 16 17 18
  //应急处置消息详情
  emergencyData:{
    eventId:99999,
    eventName:"",
  }
19 20 21 22 23 24 25 26 27 28
};

const mutations = {
  SET_COMPANY: (state, company) => {
    state.company = company.map((item) => ({
      conpanyId: item.enterpriseId,
      companyName: item.enterpriseName,
    }));
    console.log(state.company);
  },
29 30 31 32 33 34 35
    SET_EMERGENCY: (state, emergencyData) => {
      state.emergencyData=emergencyData
    }




36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
};

const actions = {
  // 登录
  GetCompany({ commit }) {
    getCompany().then((res) => {
      commit("SET_COMPANY", res);
    });
  },
};

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