2024-01-07 20:30:47 +00:00
|
|
|
<template>
|
|
|
|
<ol class="timeline">
|
|
|
|
<li v-for="(item, index) in timeline" :key="index"
|
|
|
|
:class="{'timeline-item':true, 'extra-space': item.type === 'mail'}">
|
|
|
|
<span class="timeline-item-icon filled-icon" v-if="item.type === 'mail'">
|
|
|
|
<font-awesome-icon icon="envelope"/>
|
|
|
|
</span>
|
|
|
|
<span class="timeline-item-icon faded-icon" v-else-if="item.type === 'comment'">
|
|
|
|
<font-awesome-icon icon="comment"/>
|
|
|
|
</span>
|
2024-06-22 23:42:10 +00:00
|
|
|
<span class="timeline-item-icon faded-icon" v-else-if="item.type === 'state'"
|
|
|
|
:class="'bg-' + stateInfo(item.state).color">
|
2024-01-02 13:35:37 +00:00
|
|
|
<font-awesome-icon :icon="stateInfo(item.state).icon"/>
|
2024-01-07 20:30:47 +00:00
|
|
|
</span>
|
2024-01-22 16:21:22 +00:00
|
|
|
<span class="timeline-item-icon faded-icon" v-else-if="item.type === 'assignment'" :class="'bg-secondary'">
|
|
|
|
<font-awesome-icon icon="user"/>
|
|
|
|
</span>
|
2024-06-22 23:42:10 +00:00
|
|
|
<span class="timeline-item-icon faded-icon" v-else-if="item.type === 'item_relation'">
|
|
|
|
<font-awesome-icon icon="object-group"/>
|
|
|
|
</span>
|
|
|
|
<span class="timeline-item-icon faded-icon" v-else-if="item.type === 'shipping_voucher'">
|
|
|
|
<font-awesome-icon icon="truck"/>
|
|
|
|
</span>
|
2024-01-07 20:30:47 +00:00
|
|
|
<span class="timeline-item-icon faded-icon" v-else>
|
|
|
|
<font-awesome-icon icon="pen"/>
|
|
|
|
</span>
|
|
|
|
<TimelineMail v-if="item.type === 'mail'" :item="item"/>
|
|
|
|
<TimelineComment v-else-if="item.type === 'comment'" :item="item"/>
|
|
|
|
<TimelineStateChange v-else-if="item.type === 'state'" :item="item"/>
|
2024-01-22 16:21:22 +00:00
|
|
|
<TimelineAssignment v-else-if="item.type === 'assignment'" :item="item"/>
|
2024-06-22 23:42:10 +00:00
|
|
|
<TimelineRelatedItem v-else-if="item.type === 'item_relation'" :item="item"/>
|
|
|
|
<TimelineShippingVoucher v-else-if="item.type === 'shipping_voucher'" :item="item"/>
|
2024-01-07 20:30:47 +00:00
|
|
|
<p v-else>{{ item }}</p>
|
|
|
|
</li>
|
|
|
|
<li class="timeline-item">
|
|
|
|
<span class="timeline-item-icon | faded-icon">
|
|
|
|
<font-awesome-icon icon="comment"/>
|
|
|
|
</span>
|
2024-01-13 00:40:37 +00:00
|
|
|
<div class="new-comment card bg-dark">
|
|
|
|
<div class="">
|
|
|
|
<textarea placeholder="add comment..." v-model="newComment" class="form-control">
|
2024-01-02 13:35:37 +00:00
|
|
|
</textarea>
|
2024-01-13 00:40:37 +00:00
|
|
|
<button class="btn btn-primary float-right" @click="addCommentAndClear">
|
|
|
|
<font-awesome-icon icon="comment"/>
|
|
|
|
Save Comment
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li class="timeline-item">
|
|
|
|
<span class="timeline-item-icon | faded-icon">
|
|
|
|
<font-awesome-icon icon="envelope"/>
|
|
|
|
</span>
|
|
|
|
<div class="new-mail card bg-dark">
|
|
|
|
<div class="card-header">
|
|
|
|
{{ newestMailSubject }}
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<textarea placeholder="reply mail..." v-model="newMail" class="form-control">
|
|
|
|
</textarea>
|
|
|
|
<button class="btn btn-primary float-right" @click="sendMailAndClear">
|
|
|
|
<font-awesome-icon icon="envelope"/>
|
|
|
|
Send Mail
|
2024-01-07 20:30:47 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import TimelineMail from "@/components/TimelineMail.vue";
|
|
|
|
import TimelineComment from "@/components/TimelineComment.vue";
|
|
|
|
import TimelineStateChange from "@/components/TimelineStateChange.vue";
|
2024-01-02 13:35:37 +00:00
|
|
|
import {mapGetters} from "vuex";
|
2024-01-22 16:21:22 +00:00
|
|
|
import TimelineAssignment from "@/components/TimelineAssignment.vue";
|
2024-06-22 23:42:10 +00:00
|
|
|
import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue";
|
|
|
|
import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue";
|
2024-01-07 20:30:47 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Timeline',
|
2024-06-22 23:42:10 +00:00
|
|
|
components: {
|
|
|
|
TimelineShippingVoucher,
|
|
|
|
TimelineRelatedItem, TimelineAssignment, TimelineStateChange, TimelineComment, TimelineMail
|
|
|
|
},
|
2024-01-07 20:30:47 +00:00
|
|
|
props: {
|
|
|
|
timeline: {
|
|
|
|
type: Array,
|
|
|
|
default: () => []
|
|
|
|
}
|
|
|
|
},
|
2024-01-13 00:40:37 +00:00
|
|
|
emits: ['sendMail', 'addComment'],
|
2024-01-07 20:30:47 +00:00
|
|
|
data: () => ({
|
2024-01-13 00:40:37 +00:00
|
|
|
newMail: "",
|
|
|
|
newComment: ""
|
2024-01-07 20:30:47 +00:00
|
|
|
}),
|
2024-01-02 13:35:37 +00:00
|
|
|
computed: {
|
|
|
|
...mapGetters(['stateInfo']),
|
2024-01-13 00:40:37 +00:00
|
|
|
newestMailSubject() {
|
|
|
|
const mail = this.timeline.filter(item => item.type === 'mail').pop();
|
|
|
|
return mail ? mail.subject : "";
|
|
|
|
},
|
2024-01-02 13:35:37 +00:00
|
|
|
},
|
2024-01-07 20:30:47 +00:00
|
|
|
methods: {
|
2024-01-13 00:40:37 +00:00
|
|
|
sendMailAndClear: function () {
|
2024-01-07 20:30:47 +00:00
|
|
|
this.$emit('sendMail', this.newMail);
|
|
|
|
this.newMail = "";
|
2023-12-29 17:19:42 +00:00
|
|
|
},
|
2024-01-13 00:40:37 +00:00
|
|
|
addCommentAndClear: function () {
|
|
|
|
this.$emit('addComment', this.newComment);
|
|
|
|
this.newComment = "";
|
|
|
|
}
|
2023-12-29 17:19:42 +00:00
|
|
|
},
|
2024-01-07 20:30:47 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
*,
|
|
|
|
*:before,
|
|
|
|
*:after {
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
button,
|
|
|
|
input,
|
|
|
|
select,
|
|
|
|
textarea {
|
|
|
|
font: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
img {
|
|
|
|
display: block;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End basic CSS override */
|
|
|
|
|
|
|
|
.timeline {
|
|
|
|
width: 85%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
padding: 32px 0 32px 32px;
|
|
|
|
border-left: 2px solid var(--gray);
|
|
|
|
font-size: 1.125rem;
|
|
|
|
margin: 0 auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.timeline-item {
|
|
|
|
display: flex;
|
|
|
|
gap: 24px;
|
|
|
|
|
|
|
|
& + * {
|
|
|
|
margin-top: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
& + .extra-space {
|
|
|
|
margin-top: 48px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-13 00:40:37 +00:00
|
|
|
.new-comment, .new-mail {
|
2024-01-07 20:30:47 +00:00
|
|
|
width: 100%;
|
|
|
|
|
2024-01-13 00:40:37 +00:00
|
|
|
textarea, input {
|
2024-01-07 20:30:47 +00:00
|
|
|
border: 1px solid var(--gray);
|
|
|
|
border-radius: 6px;
|
2024-01-13 00:40:37 +00:00
|
|
|
height: 5em;
|
|
|
|
padding: 8px 16px;
|
2024-01-07 20:30:47 +00:00
|
|
|
|
|
|
|
&::placeholder {
|
|
|
|
color: var(--gray-dark);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
border-color: var(--gray-dark);
|
|
|
|
outline: 0; /* Don't actually do this */
|
|
|
|
box-shadow: 0 0 0 4px var(--dark);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.timeline-item-icon {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: 50px;
|
|
|
|
height: 50px;
|
|
|
|
border-radius: 50%;
|
|
|
|
margin-left: -57px;
|
|
|
|
flex-shrink: 0;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
svg {
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.faded-icon {
|
|
|
|
background-color: var(--secondary);
|
|
|
|
color: var(--light);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.filled-icon {
|
|
|
|
background-color: var(--primary);
|
|
|
|
color: var(--light);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.button {
|
|
|
|
border: 0;
|
|
|
|
display: inline-flex;
|
|
|
|
vertical-align: middle;
|
|
|
|
margin-right: 4px;
|
|
|
|
margin-top: 12px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
font-size: 1rem;
|
|
|
|
height: 32px;
|
|
|
|
padding: 0 8px;
|
|
|
|
background-color: var(--dark);
|
|
|
|
flex-shrink: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
border-radius: 99em;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: var(--gray);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|