/*
 * @Author: your name
 * @Date: 2022-02-25 13:53:11
 * @LastEditTime: 2023-07-12 16:53:46
 * @LastEditors: 纪泽龙 jizelong@qq.com
 * @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: {},
  //应急处置消息详情
  emergencyData:{
    eventId:99999,
    eventName:"",
  }
};

const mutations = {
  SET_COMPANY: (state, company) => {
    state.company = company.map((item) => ({
      conpanyId: item.enterpriseId,
      companyName: item.enterpriseName,
      companyType:item.enterpriseType,
    }));
    console.log(state.company);
  },
    SET_EMERGENCY: (state, emergencyData) => {
      state.emergencyData=emergencyData
    }




};

const actions = {
  // 登录
  GetCompany({ commit }) {
    return getCompany().then((res) => {
      commit("SET_COMPANY", res);
      console.log('aa??')
      return true
    });
  },
};

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