Browse Source

fix(组件): fix bug

gemercheung 2 years ago
parent
commit
4a7ff53947
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/layouts/default/header/components/notify/index.vue

+ 8 - 2
src/layouts/default/header/components/notify/index.vue

@@ -22,7 +22,7 @@
   </div>
 </template>
 <script lang="ts">
-  import { onMounted, defineComponent, ref } from 'vue';
+  import { onMounted, defineComponent, ref, h } from 'vue';
   // Tabs, Badge
   import { Popover, Badge } from 'ant-design-vue';
   import { BellOutlined } from '@ant-design/icons-vue';
@@ -33,15 +33,18 @@
   import { unreadNoticeApi, readAllApi } from '/@/api/notification/list';
   import { useGo } from '/@/hooks/web/usePage';
   import { useMessage } from '/@/hooks/web/useMessage';
+  import { TableImg } from '/@/components/Table';
   // Tabs, TabPane: Tabs.TabPane, Badge, NoticeList
   export default defineComponent({
     components: { Popover, BellOutlined, Badge },
     setup() {
       const { prefixCls } = useDesign('header-notify');
       // const { createMessage } = useMessage();
+
       const listData = ref(tabListData);
       const go = useGo();
       const { createWarningModal } = useMessage();
+
       const count = ref(0);
       async function fetchNotice() {
         const unread = await unreadNoticeApi();
@@ -67,7 +70,10 @@
           if (list.type === 1) {
             createWarningModal({
               title: list.title,
-              content: `<img style="margin:0 auto" src="${list.content}"/>`,
+              content: h(TableImg, {
+                size: 330,
+                imgList: [list.content],
+              }),
               onOk: async () => {
                 await fetchNotice();
                 await readAllApi();