index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <a-modal class="notice"
  3. v-model:visible="visible"
  4. @cancel="cancel"
  5. width="890px"
  6. centered
  7. :footer="null">
  8. <a-tabs v-model:activeKey="activeKey">
  9. <a-tab-pane key="1">
  10. <template #tab>
  11. <span>
  12. 公告
  13. <a-badge :count="getUnReadNoticeByType([1])"
  14. :number-style="{ backgroundColor: '#FF9000' }" />
  15. </span>
  16. </template>
  17. <NoticeContent :noticeList="getNoticeByType([1])" />
  18. </a-tab-pane>
  19. <a-tab-pane key="2">
  20. <template #tab>
  21. <span>
  22. 系统消息
  23. <a-badge :count="getUnReadNoticeByType([2])"
  24. :number-style="{ backgroundColor: '#FF9000' }" />
  25. </span>
  26. </template>
  27. <NoticeContent :noticeList="getNoticeByType([2])" />
  28. </a-tab-pane>
  29. </a-tabs>
  30. </a-modal>
  31. </template>
  32. <script lang="ts">
  33. import { defineComponent, ref } from 'vue';
  34. import { closeModal } from '@/common/setup/modal/index';
  35. import NoticeContent from './components/noticeContent.vue';
  36. import { initData } from '@/common/methods';
  37. import { handleNotice } from './setup';
  38. export default defineComponent({
  39. name: 'notice',
  40. components: {
  41. NoticeContent,
  42. },
  43. setup() {
  44. const { visible, cancel } = closeModal('notice');
  45. // 公告消息
  46. const { noticeList, queryNoticeAction, getNoticeByType, updateNotice, getUnReadNoticeByType } = handleNotice();
  47. initData(() => {
  48. queryNoticeAction();
  49. updateNotice();
  50. });
  51. return {
  52. visible,
  53. cancel,
  54. noticeList,
  55. getNoticeByType,
  56. getUnReadNoticeByType,
  57. activeKey: ref('1'),
  58. };
  59. },
  60. });
  61. </script>
  62. <style lang="less">
  63. .notice {
  64. .ant-tabs {
  65. width: 100%;
  66. .ant-tabs-bar {
  67. border-bottom-color: #192125;
  68. margin-bottom: 0;
  69. }
  70. .ant-tabs-tab {
  71. width: 140px;
  72. text-align: center;
  73. margin-right: 0;
  74. }
  75. .ant-tabs-nav {
  76. height: 50px;
  77. font-size: 16px;
  78. color: #88a0ae;
  79. font-family: Adobe Heiti Std;
  80. font-weight: normal;
  81. .ant-tabs-tab-active {
  82. color: #ffffff;
  83. background: linear-gradient(0deg, #3163ba 0%, #4179db 100%);
  84. }
  85. }
  86. .ant-tabs-ink-bar {
  87. display: none !important;
  88. }
  89. }
  90. .ant-modal-close-x {
  91. height: 50px;
  92. line-height: 50px;
  93. svg {
  94. color: #7a8a94;
  95. }
  96. }
  97. .ant-modal-body {
  98. padding: 0;
  99. background: #252d34;
  100. }
  101. }
  102. </style
  103. >;