<template>
  <a-card
    title="通知公告"
    :bordered="false"
    class="task-card"
    :split="false"
    :body-style="{ padding: '5px' }"
  >
    <a-list
      :size="`small`"
      :bordered="false"
      :split="false"
      :data-source="articleList"
    >
      <template #renderItem="{ item }">
        <a-list-item @click="openNew('/cms/article/' + item.articleId)">
          <a class="ele-text-secondary">{{ item.title }}</a></a-list-item
        >
      </template>
    </a-list>
  </a-card>
</template>

<script setup lang="ts">
  import { openNew } from '@/utils/common';
  import { ref } from 'vue';
  import { Article } from '@/api/cms/article/model';
  import { pageArticle } from '@/api/cms/article';

  const articleList = ref<Article[]>([]);

  pageArticle({ categoryId: 92, limit: 4 }).then((res) => {
    articleList.value = res?.list || [];
  });
</script>

<style scoped lang="less"></style>
