2023-03-24 17:42:37 +08:00
|
|
|
<template>
|
|
|
|
<div class="sci-navigation--notificaitons-flyout-notification">
|
|
|
|
<div class="sci-navigation--notificaitons-flyout-notification-date">
|
2023-10-17 18:02:55 +08:00
|
|
|
{{ notification.attributes.created_at }}
|
2023-03-24 17:42:37 +08:00
|
|
|
</div>
|
2023-04-17 21:23:52 +08:00
|
|
|
<div class="sci-navigation--notificaitons-flyout-notification-title"
|
2023-10-17 18:02:55 +08:00
|
|
|
v-html="notification.attributes.title"
|
|
|
|
:data-seen="notification.attributes.checked"></div>
|
|
|
|
<div v-html="notification.attributes.message" class="sci-navigation--notificaitons-flyout-notification-message"></div>
|
|
|
|
<div v-if="notification.attributes.breadcrumbs" class="flex items-center flex-wrap gap-0.5">
|
2023-11-24 17:58:38 +08:00
|
|
|
<template v-for="(breadcrumb, index) in notification.attributes.breadcrumbs" :key="index">
|
|
|
|
<div class="flex items-center gap-0.5">
|
2023-10-17 18:02:55 +08:00
|
|
|
<i v-if="index > 0" class="sn-icon sn-icon-right"></i>
|
|
|
|
<a :href="breadcrumb.url" :title="breadcrumb.name" class="truncate max-w-[20ch] inline-block">{{ breadcrumb.name }}</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</div>
|
2023-03-24 17:42:37 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'NotificationItem',
|
|
|
|
props: {
|
|
|
|
notification: Object
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
icon() {
|
2023-10-17 18:02:55 +08:00
|
|
|
switch(this.notification.attributes.type_of) {
|
2023-03-24 17:42:37 +08:00
|
|
|
case 'deliver':
|
2023-09-21 20:07:34 +08:00
|
|
|
return 'fas fa-truck';
|
2023-03-24 17:42:37 +08:00
|
|
|
case 'assignment':
|
2023-09-21 20:07:34 +08:00
|
|
|
return 'fas fa-list-alt';
|
2023-03-24 17:42:37 +08:00
|
|
|
case 'recent_changes':
|
2023-09-21 20:07:34 +08:00
|
|
|
return 'fas fa-list-alt';
|
|
|
|
case 'deliver_error':
|
|
|
|
return 'sn-icon sn-icon-alert-warning';
|
2023-03-24 17:42:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|