1313 >
1414 <template #content >
1515 <div class =" content" >
16- <a-tag v-if =" item.type === 1 " color = " blue " size = " small " >通知</ a-tag >
17- <a-tag v-if = " item.type === 2 " color = " orangered " size = " small " >活动</ a-tag >
18- <a-tag v-if = " item.type === 3 " color = " cyan " size = " small " >消息 </a-tag >
19- <p >{{ item.content }}< /p >
16+ <GiCellTag :value =" item.type" :dict = " notice_type " / >
17+ <p >
18+ <a-link @click = " onDetail( item.id) " >{{ item.title }} </a-link >
19+ </p >
2020 </div >
2121 </template >
2222 </a-comment >
2323 </a-card >
24+
25+ <NoticeDetailModal ref =" NoticeDetailModalRef" />
2426</template >
2527
2628<script setup lang="ts">
27- const dataList = [
28- { type: 1 , content: ' v2.4.0 版本发布公告🎉' },
29- { type: 1 , content: ' v2.3.0 版本发布公告🎉' },
30- { type: 1 , content: ' v2.2.0 版本发布公告🎉' },
31- { type: 2 , content: ' 作者喊你来贡献代码了~' },
32- { type: 2 , content: ' 作者喊你来提需求了~' }
33- ]
29+ import { listDashboardNotice , type DashboardNoticeResp } from ' @/apis'
30+ import { useDict } from ' @/hooks/app'
31+ import NoticeDetailModal from ' @/views/system/notice/NoticeDetailModal.vue'
32+
33+ const { notice_type } = useDict (' notice_type' )
34+
35+ const dataList = ref <DashboardNoticeResp []>([])
36+ // 查询列表数据
37+ const getDataList = async () => {
38+ const res = await listDashboardNotice ()
39+ dataList .value = res .data
40+ }
41+
42+ const NoticeDetailModalRef = ref <InstanceType <typeof NoticeDetailModal >>()
43+ // 详情
44+ const onDetail = (id : string ) => {
45+ NoticeDetailModalRef .value ?.onDetail (id )
46+ }
47+
48+ onMounted (() => {
49+ getDataList ()
50+ })
3451 </script >
3552
3653<style lang="scss" scoped>
@@ -52,4 +69,16 @@ const dataList = [
5269 margin-left : 6px ;
5370 }
5471}
72+
73+ .arco-link {
74+ color : rgb (var (--gray-8 ));
75+ }
76+
77+ .icon {
78+ margin-right : 3px ;
79+ }
80+
81+ .update-time-row {
82+ text-align : right ;
83+ }
5584 </style >
0 commit comments