<template>
  <div class="announcement flex flexc">
    <Header>
      <div slot="title" class="title">通知公告</div>
    </Header>
    <div class="main flex1 flex flexc">
      <PageTop>
        <div slot="count" class="count">
          共计<span class="data-count">142</span>个通知公告
        </div>
        <SearchBox
          slot="search-right"
          width="834px"
          v-model="searchVal"
          @click="handleSearch"
        >
        </SearchBox>
      </PageTop>
      <!-- 指南列表 -->
      <div class="announcement-box flex1">
        <div class="announcement-list flex flexwrap jcb">
          <div
            class="announcement-item flex jcb"
            v-for="v in 12"
            :key="v"
            @click="handleCheck(v)"
          >
            <div class="flex flex1 aic">
              <div class="icon"></div>
              <p class="text flex1">
                翻建建造大修自住住房提取翻建建造大修自住住房提取翻建建造大修自住住房提取翻建建造大修自住住房提取
              </p>
            </div>
            <div class="time flex aic">2022-12-12 12:00:00</div>
          </div>
        </div>
        <!-- 分页 -->
        <div class="tac">
          <el-pagination
            prev-text="上一页"
            next-text="下一页"
            layout="prev,next"
            :total="total"
            :current-page="current"
            :page-size="size"
            @current-change="changePage"
          >
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Header from "@/components/Header.vue";
import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue";
export default {
  components: {
    Header,
    PageTop,
    SearchBox,
  },
  data() {
    return {
      searchVal: "",
      total: 20,
      current: 1,
      size: 12,
    };
  },
  methods: {
    handleSearch() {
      console.log(this.searchVal);
    },
    handleCheck(row) {
      console.log(row);
      this.$router.push("announcementdetails");
    },
    changePage(cur) {
      this.current = cur;
    },
  },
};
</script>

<style lang="less" scoped>
.announcement {
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
}
.main {
  padding-right: 40px;
  padding-left: 40px;
  padding-bottom: 40px;
  .data-count {
    color: var(--main-assist-color3);
  }
}
.announcement-box {
  width: 100%;
  padding: 30px;
  padding-bottom: 0px;
  background: #ffffff;
  border-radius: 16px;
}
.announcement-item {
  width: 870px;
  height: 80px;
  margin-bottom: 30px;
  padding: 0px 20px;
  background: #edf6fe;
  border-radius: 8px;
  cursor: pointer;
  .icon {
    width: 17px;
    height: 17px;
    margin-right: 10px;
    background-color: var(--main-assist-color3);
    transform: rotate(45deg);
  }
  .text {
    width: 1px;
    font-size: 24px;
    font-family: Source Han Sans CN;
    font-weight: 500;
    color: #333333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .time {
    margin-left: 10px;
    font-size: 24px;
    font-family: Source Han Sans CN;
    font-weight: 500;
    color: #999999;
  }
}
/deep/.btn-prev {
  margin-right: 80px;
}
/deep/.btn-prev,
/deep/ .btn-next {
  width: 78px;
  height: 25px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: var(--main-theme-color1);
  line-height: 28px;
  span {
    font-size: 28px;
  }
}
</style>