Просмотр исходного кода

Merge branch 'test' into dev_zyh

zhouyuhao 6 месяцев назад
Родитель
Сommit
b8326b9e17

+ 15 - 0
src/components/NotificationMessageCard/src/NotificationMessageCard.vue

@@ -6,6 +6,7 @@ import { useNotificationMessage } from '@/stores/modules/notificationMessage'
 import { cloneDeep } from 'lodash'
 import { DynamicScroller, DynamicScrollerItem } from 'vue3-virtual-scroller'
 import 'vue3-virtual-scroller/dist/vue3-virtual-scroller.css'
+import { formatTimezone } from '@/utils/tools'
 
 const notificationMsgStore = useNotificationMessage()
 const props = withDefaults(
@@ -15,6 +16,7 @@ const props = withDefaults(
     isScrollPadding?: boolean // 是否有padding
     updateReadCardsOnChange?: boolean // 是否在数据变化时请求接口更新已读卡片
     topOffset?: number // 应减去高度
+    isShowInsertionTime?: boolean // 是否显示插入时间
   }>(),
   {
     isObserver: true,
@@ -228,6 +230,9 @@ const scrollParentBoxStyle = computed(() => {
             :data="item.info"
           />
           <slot></slot>
+          <div class="insertion-time" v-if="isShowInsertionTime">
+            {{ formatTimezone(item.info.first_notifiation_date) }}
+          </div>
         </div>
       </DynamicScrollerItem>
     </template>
@@ -242,4 +247,14 @@ const scrollParentBoxStyle = computed(() => {
     padding: 0px 140px 0px 16px;
   }
 }
+.notification-message-card {
+  position: relative;
+  .insertion-time {
+    position: absolute;
+    right: 0;
+    top: 4px;
+    font-size: 12px;
+    color: var(--color-neutral-2);
+  }
+}
 </style>

+ 3 - 0
src/views/SystemMessage/src/SystemMessage.vue

@@ -176,6 +176,7 @@ onMounted(() => {
                 :data="notificationList"
                 @hasCardRead="changeCardRead"
                 :isScrollPadding="true"
+                :isShowInsertionTime="true"
                 :updateReadCardsOnChange="false"
               ></NotificationMessageCard>
             </div>
@@ -196,6 +197,7 @@ onMounted(() => {
                 v-if="activeTabName === 'Unread'"
                 :data="unreadNotificationList"
                 :isScrollPadding="true"
+                :isShowInsertionTime="true"
                 :updateReadCardsOnChange="false"
               ></NotificationMessageCard>
             </div>
@@ -207,6 +209,7 @@ onMounted(() => {
                 v-if="activeTabName === 'Read'"
                 :updateReadCardsOnChange="false"
                 :isScrollPadding="true"
+                :isShowInsertionTime="true"
                 :data="readNotificationList"
               >
               </NotificationMessageCard>