2023-03-24 17:42:37 +08:00
|
|
|
<template>
|
|
|
|
<div class="sci-navigation--notificaitons-flyout-notification">
|
2023-10-17 18:02:55 +08:00
|
|
|
<div class="sci-navigation--notificaitons-flyout-notification-icon" :class="notification.attributes.type_of">
|
2023-09-21 20:07:34 +08:00
|
|
|
<i :class="icon"></i>
|
2023-03-24 17:42:37 +08:00
|
|
|
</div>
|
|
|
|
<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">
|
|
|
|
<template v-for="(breadcrumb, index) in notification.attributes.breadcrumbs">
|
|
|
|
<div :key="index" class="flex items-center gap-0.5">
|
|
|
|
<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>
|