<template>
  <view>
    <InfoCard>
      <template #head>
      <Title title="新闻"></Title>
      </template>
      <template #content>
      <Item v-for="it in newsList" :title="it.briefHead" :time="it.releaseTime" :key="it.id"></Item> 
      </template>
    </InfoCard>

    <InfoCard>
      <template #head>
        <Title  title="通知公告"></Title>
      </template>
      <template #content>
        <Item v-for="it in noticeList" :title="it.briefHead" :time="it.releaseTime" :key="it.id"></Item> 
      </template>
    </InfoCard>
  </view>
</template>

<script setup>
import {onMounted, ref} from 'vue';
import InfoCard from "@/components/info/InfoCard.vue";
import Title from "@/components/info/Title.vue";
import Item from "./Item.vue";
import {getNewsPage} from '@/common/api/system/dictionary/index.js';
const newsList=ref([])
const noticeList=ref([])
onMounted(()=>{
	getNewsPage({
		limit: 1,
		size: 10,
		type: 1,
		PK: 'id',
		enabledMark:1
	}).then(res=>{
		newsList.value=res.data.list
	})
	getNewsPage({
		limit: 1,
		size: 10,
		type: 2,
		PK: 'id',
		enabledMark:1
	}).then(res=>{
		noticeList.value=res.data.list
	})
})

</script>
