<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>
<script>
import autofit from 'autofit.js'
export default {
  name: 'app',
  created() {
    // console.log(this.$route)
    // localStorage.setItem('token', this.$route.query.token)
    var link =
      document.querySelector("link[rel*='icon']") ||
      document.createElement('link')
    link.type = 'image/x-icon'
    link.rel = 'shortcut icon'
    link.href = require('./assets/img/myImage/logo.png')
    document.getElementsByTagName('head')[0].appendChild(link)
  },
  mounted() {
    autofit.init({
      designHeight: 1080, //高度
      designWidth: 1920, //宽度
      renderDom: '#app',
      resize: true,
    })
  },

  watch: {
    $route: {
      handler(newValue) {
        console.log(newValue, '路由监听--')
        if (newValue.query.token) {
          localStorage.setItem('token', newValue.query.token)
        }
      },
      deep: true,
    },
  },
}
</script>
<style lang="less">
.el-dialog {
  // 背景色透明
  background: rgba(0, 0, 0, 0.5) !important;
  background-image: url('./assets/img/dialog/window.png') !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  .el-dialog__headerbtn {
    width: 83px;
    height: 44px;
    background-image: url('./assets/img/dialog/icon_close.png') !important;
    background-size: cover;
    // 去除原来的 x 按钮
    .el-dialog__close {
      display: none;
    }
  }
  .el-form-item__label {
    color: #fff !important;
  }

  .el-table th {
    // #253855  #30619B 背景色从上到下渐变
    background: linear-gradient(to bottom, #2b313d, #3267a7) !important;
    color: #fff !important;
    border-bottom: 1px solid #84fcfd !important;
  }
  .el-table tr {
    background-color: #335684 !important;
    color: #fff !important;
  }
  .el-table--striped .el-table__body tr.el-table__row--striped td {
    background-color: #25447d !important;
    color: #fff !important;
  }
  .el-table td,
  .building-top .el-table th.is-leaf {
    border-bottom: 1px solid #6983a5 !important;
  }
  .el-table::before {
    border-bottom: 1px solid #6983a5 !important;
    background-color: #6983a5 !important;
    height: 1px !important;
  }
  .el-table--enable-row-hover .el-table__body tr:hover > td {
    background-color: #6983a5 !important;
  }
  .el-pagination__total {
    color: #e1e3e6 !important;
  }
  .el-pagination__jump {
    color: #e1e3e6 !important;
  }
  .el-input__inner {
    background-color: transparent !important;
    border: 1px solid #77e2e7 !important;
    color: #e1e3e6 !important;
  }
  .el-pagination__sizes .el-input .el-input__inner {
    color: #e3e4e7 !important;
    border: 1px solid #e3e4e7 !important;
  }
  .el-pagination__editor.el-input .el-input__inner {
    color: #e3e4e7 !important;
    border: 1px solid #e3e4e7 !important;
  }
  .el-pagination.is-background .btn-prev,
  .el-pagination.is-background .el-pager li {
    color: #e3e4e7 !important;
    border: 1px solid #e3e4e7 !important;
    background-color: transparent !important;
  }
  .el-pagination.is-background .btn-next {
    color: #e3e4e7 !important;
    border: 1px solid #e3e4e7 !important;
    background-color: transparent !important;
  }
  .el-pagination.is-background .el-pager li:not(.disabled).active {
    background-color: #98f4fb !important;
    color: #000 !important;
  }
  .el-button--primary {
    background-color: #84fcfd !important;
    border: #84fcfd !important;
    color: #285050 !important;
  }
  .el-button--default {
    background-color: transparent !important;
    border: 1px solid #84fcfd !important;
    color: #d5d6da !important;
  }
  .el-table__empty-block {
    background-color: #335684 !important;
    .el-table__empty-text {
      color: #d5d6da !important;
    }
  }
}
</style>
