<template>
  <div>
      <dev v-if="saberTenantId != 409341">
          <div v-if="billType && saberTenantId != 212186 && saberTenantId != 504978 && billType != 11">
              <tongjiSchool v-if="billType == 1"></tongjiSchool>
              <landTransportation v-else-if="billType == 7"></landTransportation>
              <jiatongPage v-else-if="billType == 8"></jiatongPage>
              <noctite v-else-if="billType == 9"></noctite>
              <equipment-control v-else-if="billType == 10"></equipment-control>
              <tireindex v-else-if="billType == 11" :sysType="billType"></tireindex>
              <defaultPage v-else :sysType="billType"></defaultPage>
          </div>
          <div v-else-if="saberTenantId == 212186" style="padding: 10px">
              <el-card class="home-container__card">
                  <div class="title">
                <span>
                    快速发起
                </span>
                  </div>
                  <div class="content">
                      <div class="content-icon" @click="inPage('/productionManagement/index')">
                          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
                          <span style="font-size: 14px">模拟生产</span>
                      </div>
                  </div>
              </el-card>
          </div>
          <div v-else-if="saberTenantId == 504978" style="padding: 10px">
              <el-card class="home-container__card">
                  <div class="title">
                <span>
                    快速发起
                </span>
                  </div>
                  <div class="content">
                      <div class="content-icon" @click="inPage('/EquipmentArchives/index')">
                          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
                          <span style="font-size: 14px">设备档案</span>
                      </div>
                      <div class="content-icon" @click="inPage('/maintenanceQ/index')">
                          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
                          <span style="font-size: 14px">设备维修</span>
                      </div>
                  </div>
              </el-card>
          </div>
          <!--青岛鑫动力新的首页-->
          <div v-else-if="billType == 11">
              <xindongPower :sysType="billType"></xindongPower>
          </div>
      </dev>
      <!--货代首页-->
      <div v-if="saberTenantId == 409341">
          <los-home></los-home>
      </div>
  </div>
</template>

<script>
import tireindex from '@/views/wel/home/tirezujian/tireindex';
import defaultPage from "@/views/wel/home/defaultPage";
import tongjiSchool from "@/views/wel/home/tongjiSchool";
import landTransportation from "@/views/wel/home/landTransportation/landTransportation";
import jiatongPage from "@/views/wel/home/jiatongPage/landTransportation";
import noctite from "@/views/wel/home/noctite/landTransportation";
import equipmentControl from "@/views/wel/home/equipmentControl/landTransportation";
import { getUserInfo } from "@/api/system/user";
import { setStore } from "@/util/store";
import { areaTypeTree } from "@/api/basicData/customerInformation";
import xindongPower from "@/views/wel/home/xindongPower/xindongPower.vue";
import losHome from "@/views/wel/components/losHome.vue";
export default {
  name: "wel",
  data() {
    return {
      billType: "",
        saberTenantId:''
    };
  },
  created() {
      console.log(JSON.parse(localStorage.getItem('saber-tenantId')).content)
      this.saberTenantId = JSON.parse(localStorage.getItem('saber-tenantId')).content
      // console.log(localStorage.getItem('saber-tenantId'))
    getUserInfo().then(res => {
      this.billType = res.data.data.billType;
      localStorage.setItem('sysitemType', this.billType)
    });
    if (!localStorage.getItem('areaTypeTree')) {
      areaTypeTree().then(res => {
        localStorage.setItem('areaTypeTree', JSON.stringify(res.data.data));
      })
    }

  },
  components: {
      tireindex,
    tongjiSchool,
    defaultPage,
    jiatongPage,
    noctite,
    equipmentControl,
    landTransportation,
      xindongPower,
      losHome
  },
  methods: {
      inPage(url){
          this.$router.push(url);
      },
  }
};
</script>
<style lang="scss" scoped>
.content {
    display: flex;

    &-icon {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 1.5vh 1vw 0vh 1vw;

        span {
            margin-top: 0.2vh;
        }
    }
}
.tradingIcon {
    font-size: 36px;
}
</style>
