|
@@ -1,27 +1,63 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import EventCard from '@/components/NotificationMessageCard/src/components/EventCard.vue'
|
|
import EventCard from '@/components/NotificationMessageCard/src/components/EventCard.vue'
|
|
|
|
|
+import NotificationMessageCard from '@/components/NotificationMessageCard/src/NotificationMessageCard.vue'
|
|
|
|
|
|
|
|
const collapseVModel = ref<string[]>(['1'])
|
|
const collapseVModel = ref<string[]>(['1'])
|
|
|
|
|
|
|
|
|
|
+const unreadCount = ref(33)
|
|
|
|
|
+const readCount = ref(22)
|
|
|
|
|
+const allCount = ref(135)
|
|
|
|
|
+const tabCountList = [2, 1, 99, 0, 23]
|
|
|
|
|
+const handleCount = (count: number) => {
|
|
|
|
|
+ if (!count) return 0
|
|
|
|
|
+ return count > 99 ? '99+' : count
|
|
|
|
|
+}
|
|
|
const navList = [
|
|
const navList = [
|
|
|
|
|
+ 'Milestone Update',
|
|
|
|
|
+ 'Container Status Update',
|
|
|
|
|
+ 'Departure/Arrival Delay',
|
|
|
|
|
+ 'ETD/ETA Change'
|
|
|
|
|
+]
|
|
|
|
|
+const cardList = [
|
|
|
{
|
|
{
|
|
|
- title: 'Milestone Update',
|
|
|
|
|
- count: 2
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: 'Container Status Update',
|
|
|
|
|
- count: 1
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: 'Departure/Arrival Delay',
|
|
|
|
|
- count: '99+'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: 'ETD/ETA Change',
|
|
|
|
|
- count: 0
|
|
|
|
|
|
|
+ notificationType: 'event',
|
|
|
|
|
+ info: {
|
|
|
|
|
+ type: 'milestone',
|
|
|
|
|
+ isMultiple: true,
|
|
|
|
|
+ numericRecords: 3,
|
|
|
|
|
+ isRead: true,
|
|
|
|
|
+ title: 'Milestone Update',
|
|
|
|
|
+ mode: 'Ocean Freight',
|
|
|
|
|
+ no: 'HBOL: SHJN2301234',
|
|
|
|
|
+ tag: 'Booking Confirmed',
|
|
|
|
|
+ location: 'Hong Kong',
|
|
|
|
|
+ time: 'Jan 10, 2025 14:30 UTC+8',
|
|
|
|
|
+ info: {
|
|
|
|
|
+ route: ['Hong Kong', 'Shanghai', 'Ningbo']
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+const result = {
|
|
|
|
|
+ countList: [2, 1, 99, 0, 33],
|
|
|
|
|
+ allCount: 135,
|
|
|
|
|
+ unreadCount: 33,
|
|
|
|
|
+ readCount: 22,
|
|
|
|
|
+ cardList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ notificationType: 'feature',
|
|
|
|
|
+ info: {
|
|
|
|
|
+ isRead: true,
|
|
|
|
|
+ title: 'Feature Update',
|
|
|
|
|
+ header: 'New feature online: Quick search has been released!',
|
|
|
|
|
+ content:
|
|
|
|
|
+ 'We are pleased to announce that the quick search function is now officially online! You can now quickly find what you need by entering keywords, greatly improving your work efficiency. Go and experience it!'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const activeItem = ref('Milestone Update')
|
|
const activeItem = ref('Milestone Update')
|
|
|
const setActiveItem = (item: string) => {
|
|
const setActiveItem = (item: string) => {
|
|
|
activeItem.value = item
|
|
activeItem.value = item
|
|
@@ -181,6 +217,39 @@ const notificationList = [
|
|
|
// onMounted(() => {
|
|
// onMounted(() => {
|
|
|
// getNotificationList()
|
|
// getNotificationList()
|
|
|
// })
|
|
// })
|
|
|
|
|
+
|
|
|
|
|
+const featureList = [
|
|
|
|
|
+ {
|
|
|
|
|
+ notificationType: 'feature',
|
|
|
|
|
+ info: {
|
|
|
|
|
+ isRead: true,
|
|
|
|
|
+ title: 'Feature Update',
|
|
|
|
|
+ header: 'New feature online: Quick search has been released!',
|
|
|
|
|
+ content:
|
|
|
|
|
+ 'We are pleased to announce that the quick search function is now officially online! You can now quickly find what you need by entering keywords, greatly improving your work efficiency. Go and experience it!'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ notificationType: 'feature',
|
|
|
|
|
+ info: {
|
|
|
|
|
+ isRead: true,
|
|
|
|
|
+ title: 'Feature Update',
|
|
|
|
|
+ header: 'New feature online: Quick search has been released!',
|
|
|
|
|
+ content:
|
|
|
|
|
+ 'We are pleased to announce that the quick search function is now officially online! You can now quickly find what you need by entering keywords, greatly improving your work efficiency. Go and experience it!'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ notificationType: 'feature',
|
|
|
|
|
+ info: {
|
|
|
|
|
+ isRead: true,
|
|
|
|
|
+ title: 'Feature Update',
|
|
|
|
|
+ header: 'New feature online: Quick search has been released!',
|
|
|
|
|
+ content:
|
|
|
|
|
+ 'We are pleased to announce that the quick search function is now officially online! You can now quickly find what you need by entering keywords, greatly improving your work efficiency. Go and experience it!'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+]
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -190,16 +259,16 @@ const notificationList = [
|
|
|
<el-collapse v-model="collapseVModel">
|
|
<el-collapse v-model="collapseVModel">
|
|
|
<el-collapse-item title="Event Notifications" name="1">
|
|
<el-collapse-item title="Event Notifications" name="1">
|
|
|
<div
|
|
<div
|
|
|
- @click="setActiveItem(item.title)"
|
|
|
|
|
|
|
+ @click="setActiveItem(item)"
|
|
|
class="collapse-item"
|
|
class="collapse-item"
|
|
|
- :class="{ 'is-active': item.title === activeItem }"
|
|
|
|
|
- v-for="item in navList"
|
|
|
|
|
- :key="item.title"
|
|
|
|
|
|
|
+ :class="{ 'is-active': item === activeItem }"
|
|
|
|
|
+ v-for="(item, index) in navList"
|
|
|
|
|
+ :key="item"
|
|
|
>
|
|
>
|
|
|
- <div v-if="item.title === activeItem" class="active-sign"></div>
|
|
|
|
|
- <span>{{ item.title }}</span>
|
|
|
|
|
- <div class="count" v-if="item.count">
|
|
|
|
|
- <span>{{ item.count }}</span>
|
|
|
|
|
|
|
+ <div v-if="item === activeItem" class="active-sign"></div>
|
|
|
|
|
+ <span>{{ item }}</span>
|
|
|
|
|
+ <div class="count">
|
|
|
|
|
+ <span>{{ handleCount(tabCountList?.[index]) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
@@ -213,30 +282,39 @@ const notificationList = [
|
|
|
<div v-if="activeItem === 'Feature Update'" class="active-sign"></div>
|
|
<div v-if="activeItem === 'Feature Update'" class="active-sign"></div>
|
|
|
<span>Feature Update</span>
|
|
<span>Feature Update</span>
|
|
|
<div class="count">
|
|
<div class="count">
|
|
|
- <span>33</span>
|
|
|
|
|
|
|
+ <span>{{ handleCount(tabCountList?.[tabCountList.length - 1]) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="right-content">
|
|
<div class="right-content">
|
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
<el-tab-pane label="All Notifications" name="first">
|
|
<el-tab-pane label="All Notifications" name="first">
|
|
|
|
|
+ <template #label>
|
|
|
|
|
+ <span style="margin-right: 4px">All Notifications</span>
|
|
|
|
|
+ <div class="count">
|
|
|
|
|
+ <span>{{ handleCount(allCount) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
<div style="padding: 10px 140px 0px 16px">
|
|
<div style="padding: 10px 140px 0px 16px">
|
|
|
- <EventCard
|
|
|
|
|
- v-for="(item, index) in notificationList"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :data="item"
|
|
|
|
|
- ></EventCard>
|
|
|
|
|
|
|
+ <NotificationMessageCard :data="cardList"></NotificationMessageCard>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="Unread" name="second">
|
|
<el-tab-pane label="Unread" name="second">
|
|
|
<template #label>
|
|
<template #label>
|
|
|
<span style="margin-right: 4px">Unread</span>
|
|
<span style="margin-right: 4px">Unread</span>
|
|
|
<div class="count">
|
|
<div class="count">
|
|
|
- <span>33</span>
|
|
|
|
|
|
|
+ <span>{{ handleCount(unreadCount) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="Read" name="third">Role</el-tab-pane>
|
|
|
|
|
|
|
+ <el-tab-pane label="Read" name="third">
|
|
|
|
|
+ <template #label
|
|
|
|
|
+ ><span style="margin-right: 4px">Read</span>
|
|
|
|
|
+ <div class="count">
|
|
|
|
|
+ <span>{{ handleCount(readCount) }}</span>
|
|
|
|
|
+ </div></template
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -260,6 +338,7 @@ const notificationList = [
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
height: 18px;
|
|
height: 18px;
|
|
|
min-width: 18px;
|
|
min-width: 18px;
|
|
|
|
|
+ padding-top: 1px;
|
|
|
padding-left: 4px;
|
|
padding-left: 4px;
|
|
|
padding-right: 5px;
|
|
padding-right: 5px;
|
|
|
background-color: var(--color-theme);
|
|
background-color: var(--color-theme);
|