<template>
  <el-card>
    <div slot="header">
      <span class="card-title">
        工厂公告
      </span>
    </div>
    <el-scrollbar class="article">
      <div>
        <ul class="factoryNotice">
          <div class="seeMore">
            <li>2023-06-03 至各供应商: 关于端午节放假期间的送货政策。</li>
            <a class="see">查看</a>
          </div>
          <div class="seeMore">
            <li>2023-06-05至各供应商: 5月未对账的供应商清单，请各位供应商务必.....</li>
            <a>查看</a>
          </div>
          <div class="seeMore">
            <li>2023-06-17 至各供应商: 6月30日年中盘点的配合支持。</li>
            <a>查看</a>
          </div>
        </ul>
      </div>
    </el-scrollbar>
  </el-card>
</template>

<script>
import { listNotice } from '@/api/system/notice'

export default {
  data() {
    return {
      queryParams: {
        page: 1,
        pageSize: 1,
        type: 2
      },
      loading: false,
      noticeContent: '',
      noticeTitle: ''
    }
  },
  created() {
    this.queryDetails()
  },
  methods: {
    queryDetails() {
      this.loading = true
      listNotice(this.queryParams).then(res => {
        const { data = {}} = res
        const { list = [] } = data
        if (list.length > 0) {
          const { content, title } = list[0]
          this.noticeContent = content
          this.noticeTitle = `【${title}】`
        }
      }).finally(() => {
        this.loading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.card-title {
  font-size: 14px;
}
.factoryNotice{
  list-style: none;
  line-height: 45px;
}
.seeMore {
  display: flex;
  font-size: 14px;
  justify-content: space-between;
}
.article {
  height: 300px;
  p {
    font-size: 13px;
    line-height: 1.5;
  }
}
</style>
