<template>
  <div class="app-container home">

    <el-card v-loading="loading" class="box-card">
      <div slot="header">
        <i class="el-icon-star-on" style="color: #ffd500;font-size: 18px;margin-right: 5px;"></i>
        <span style="font-size: 16px">常用网站</span>
      </div>
      <div v-for="item in siteList" :key="item.id" class="text item">
        <el-link :href="item.site" target="_blank">
          <i class="el-icon-star-on" style="color: #ffd500;font-size: 16px;margin-right: 5px;"></i>
          {{ item.siteName }}
        </el-link>
      </div>
    </el-card>
  </div>
</template>

<script>
import { listSite } from "@/api/bid/site"

export default {
  name: "Index",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 100000000,
        favorite: '1',
      },
      siteList: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询常用网站列表 */
    getList() {
      this.loading = true;
      listSite(this.queryParams).then(response => {
        this.siteList = response.rows;
        this.loading = false
      })
    },
  }
}
</script>

<style scoped lang="scss">
.box-card {
  width: 480px;
  min-height: 300px;

}

.text {
  font-size: 14px;
}
.item {
  padding: 10px 0;
}
</style>

