2020-10-21 21:15:06 +08:00
|
|
|
<template>
|
2020-10-22 00:14:11 +08:00
|
|
|
<div class="layout-header__action-item notify-action">
|
2020-11-23 23:24:13 +08:00
|
|
|
<Popover title="" trigger="click" overlayClassName="layout-header__notify-action">
|
2020-11-01 01:07:41 +08:00
|
|
|
<Badge :count="count" dot :numberStyle="numberStyle">
|
2020-10-21 21:15:06 +08:00
|
|
|
<BellOutlined class="layout-header__action-icon" />
|
|
|
|
|
</Badge>
|
|
|
|
|
<template #content>
|
|
|
|
|
<Tabs>
|
|
|
|
|
<template v-for="item in tabListData" :key="item.key">
|
|
|
|
|
<TabPane>
|
|
|
|
|
<template #tab>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
<span v-if="item.list.length !== 0">({{ item.list.length }})</span>
|
|
|
|
|
</template>
|
|
|
|
|
<NoticeList :list="item.list" />
|
|
|
|
|
</TabPane>
|
|
|
|
|
</template>
|
|
|
|
|
</Tabs>
|
|
|
|
|
</template>
|
|
|
|
|
</Popover>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
|
import { Popover, Tabs, Badge } from 'ant-design-vue';
|
|
|
|
|
import { BellOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
import { tabListData } from './data';
|
|
|
|
|
import NoticeList from './NoticeList.vue';
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
components: { Popover, BellOutlined, Tabs, TabPane: Tabs.TabPane, Badge, NoticeList },
|
|
|
|
|
setup() {
|
|
|
|
|
let count = 0;
|
2020-11-23 23:24:13 +08:00
|
|
|
|
2020-10-21 21:15:06 +08:00
|
|
|
for (let i = 0; i < tabListData.length; i++) {
|
|
|
|
|
count += tabListData[i].list.length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
tabListData,
|
|
|
|
|
count,
|
|
|
|
|
numberStyle: {},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2020-10-22 00:14:11 +08:00
|
|
|
<style lang="less">
|
2020-11-23 23:24:13 +08:00
|
|
|
.layout-header__notify-action {
|
|
|
|
|
max-width: 360px;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-22 00:14:11 +08:00
|
|
|
.notify-action {
|
|
|
|
|
padding-top: 2px;
|
2020-10-21 21:15:06 +08:00
|
|
|
|
2020-10-22 00:14:11 +08:00
|
|
|
.ant-tabs-content {
|
|
|
|
|
width: 300px;
|
|
|
|
|
}
|
2020-10-21 21:15:06 +08:00
|
|
|
|
2020-10-22 00:14:11 +08:00
|
|
|
.ant-badge {
|
|
|
|
|
font-size: 18px;
|
2020-10-21 21:15:06 +08:00
|
|
|
|
2020-10-22 00:14:11 +08:00
|
|
|
.ant-badge-multiple-words {
|
|
|
|
|
padding: 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
svg {
|
|
|
|
|
width: 0.9em;
|
|
|
|
|
}
|
2020-10-21 21:15:06 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|