|
|
@@ -10,21 +10,21 @@
|
|
|
<template #tab>
|
|
|
<span>
|
|
|
公告
|
|
|
- <a-badge count="25"
|
|
|
+ <a-badge :count="getUnReadNoticeByType([1])"
|
|
|
:number-style="{ backgroundColor: '#FF9000' }" />
|
|
|
</span>
|
|
|
</template>
|
|
|
- <NoticeContent :noticeList="noticeList" />
|
|
|
+ <NoticeContent :noticeList="getNoticeByType([1])" />
|
|
|
</a-tab-pane>
|
|
|
<a-tab-pane key="2">
|
|
|
<template #tab>
|
|
|
<span>
|
|
|
系统消息
|
|
|
- <a-badge count="25"
|
|
|
+ <a-badge :count="getUnReadNoticeByType([2])"
|
|
|
:number-style="{ backgroundColor: '#FF9000' }" />
|
|
|
</span>
|
|
|
</template>
|
|
|
- <NoticeContent />
|
|
|
+ <NoticeContent :noticeList="getNoticeByType([2])" />
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
</a-modal>
|
|
|
@@ -35,8 +35,7 @@ import { defineComponent, ref } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import NoticeContent from './components/noticeContent.vue';
|
|
|
import { initData } from '@/common/methods';
|
|
|
-import { queryNotice } from '@/services/go/commonService/index';
|
|
|
-import { QueryNoticeRsp } from '@/services/go/commonService/interface';
|
|
|
+import { handleNotice } from './setup';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'notice',
|
|
|
@@ -46,17 +45,18 @@ export default defineComponent({
|
|
|
setup() {
|
|
|
const { visible, cancel } = closeModal('notice');
|
|
|
// 公告消息
|
|
|
- const noticeList = ref<QueryNoticeRsp[]>([]);
|
|
|
+ const { noticeList, queryNoticeAction, getNoticeByType, updateNotice, getUnReadNoticeByType } = handleNotice();
|
|
|
|
|
|
initData(() => {
|
|
|
- queryNotice().then((res) => {
|
|
|
- noticeList.value = res.filter((e) => e.msgtype === 1);
|
|
|
- });
|
|
|
+ queryNoticeAction();
|
|
|
+ updateNotice();
|
|
|
});
|
|
|
return {
|
|
|
visible,
|
|
|
cancel,
|
|
|
noticeList,
|
|
|
+ getNoticeByType,
|
|
|
+ getUnReadNoticeByType,
|
|
|
activeKey: ref('1'),
|
|
|
};
|
|
|
},
|