<template>
  <div class="about">
    <el-config-provider :locale="zhCn">
      <v-header />
      <v-sidebar />
      <div class="content-box" :class="{ 'content-collapse': collapse }">
        <v-tags></v-tags>
        <div class="content">
          <router-view />
        </div>
      </div>
    </el-config-provider>
  </div>
</template>
<script setup>
import { ElConfigProvider } from "element-plus";
import zhCn from "element-plus/lib/locale/lang/zh-cn";

import { computed, onBeforeMount } from "vue";
import { useStore } from "vuex";
import vHeader from "../components/Header.vue";
import vSidebar from "../components/Sidebar.vue";
import vTags from "../components/Tags.vue";

import { fetchStationListAll, fetchBooststation } from "/@/api/api.js";
const store = useStore();
const collapse = computed(() => store.state.collapse);
onBeforeMount(async () => {
  await getStationListAll();
  await getBooststation();
});
// //get 场站
// const getStationList = async () => {
// //   const resold = await fetchStationList();

//   const resnew = await getStationinfoAll();
// //   console.log("resold>>>>>>>>qweqwe", resold);
//   let arr = [];
//   resnew.data.forEach((item) => {
//     let ddd = {

//     id :item.id,
//     name: item.name,
//     model:item.model,
//     modelList : item.modelList,
//     equipmentmodel: null,
// };
//     arr.push(ddd);
//   });

//   // console.log("resnew>>>>>>>>123", resnew);
//   // console.log("arr>>>>>>>>456", arr);
//   store.dispatch("actionsStationList", arr);
// };
const getStationListAll = async () => {
  const { data } = await fetchStationListAll();
  store.dispatch("actionsStationListAll", data);
};
const getBooststation = async () => {
  const { data } = await fetchBooststation();
  store.dispatch("actionsBooststationList", data);
};
</script>
