index.vue 3.0 KB

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