2020-12-07 22:51:54 +00:00
|
|
|
<template>
|
|
|
|
|
<div class="container py-2">
|
|
|
|
|
<div class="row"></div>
|
|
|
|
|
<div class="comments col-md-12" id="comments">
|
2022-04-14 12:50:58 -04:00
|
|
|
<p class="commentTitle">
|
|
|
|
|
{{ data.title }}
|
2020-12-07 22:51:54 +00:00
|
|
|
</p>
|
|
|
|
|
<div v-for="item in data.items" :key="item.date">
|
2020-12-14 17:10:17 +00:00
|
|
|
<case-comment
|
|
|
|
|
:data="item"
|
|
|
|
|
:onClick="onClick"
|
|
|
|
|
:selected="item == itemSelected"
|
|
|
|
|
@onSelected="onSelected"
|
|
|
|
|
/>
|
2020-12-07 22:51:54 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-12-15 23:56:44 +00:00
|
|
|
<div class="v-comments col-md-12" @dragover="onDragOver">
|
|
|
|
|
<div
|
|
|
|
|
class="mask flex-center rgba-green-strong"
|
|
|
|
|
v-show="showMaskDrop"
|
|
|
|
|
@dragover="onDragOver"
|
|
|
|
|
@dragleave="onDragLeave"
|
|
|
|
|
@drop="onDropFile"
|
|
|
|
|
>
|
|
|
|
|
<p class="white-text">{{ $t("ID_UPLOAD_FILE") }}</p>
|
|
|
|
|
</div>
|
2020-12-07 22:51:54 +00:00
|
|
|
<div class="comment mb-2 row">
|
|
|
|
|
<div class="comment-avatar col-md-1 col-sm-2 text-center pr-1">
|
|
|
|
|
<a href=""
|
|
|
|
|
><img
|
|
|
|
|
class="mx-auto rounded-circle v-img-fluid"
|
2020-12-11 19:36:41 +00:00
|
|
|
:src="pathImgOwner"
|
2020-12-07 22:51:54 +00:00
|
|
|
alt="avatar"
|
|
|
|
|
/></a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="comment-content col-md-11 col-sm-10 v-comment">
|
|
|
|
|
<div class="comment-meta">
|
|
|
|
|
<a href="#">{{ data.user }}</a> {{ data.date }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="comment-body">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<textarea
|
|
|
|
|
class="form-control"
|
|
|
|
|
name="comments"
|
2020-12-08 13:43:33 +00:00
|
|
|
ref="comment"
|
2020-12-07 22:51:54 +00:00
|
|
|
cols="80"
|
|
|
|
|
rows="5"
|
2022-04-14 12:50:58 -04:00
|
|
|
aria-label="comments"
|
2020-12-07 22:51:54 +00:00
|
|
|
></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="comment mb-2 row float-right">
|
|
|
|
|
<div class="form-check v-check-comment">
|
2022-04-14 12:50:58 -04:00
|
|
|
<input id="sendEmail" type="checkbox" class="form-check-input" ref="send" />
|
2020-12-07 22:51:54 +00:00
|
|
|
<label class="form-check-label" for="sendEmail">
|
2020-12-08 13:43:33 +00:00
|
|
|
{{ $t("ID_SEND_EMAIL_CASE_PARTICIPANTS") }}</label
|
2020-12-07 22:51:54 +00:00
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-12-23 20:04:34 +00:00
|
|
|
<button class="btn btn-success btn-sm" @click="onClickComment" :disabled="data.noPerms === 1">
|
2020-12-08 13:43:33 +00:00
|
|
|
{{ $t("ID_SEND") }}
|
2020-12-07 22:51:54 +00:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import CaseComment from "./CaseComment.vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "CaseComments",
|
|
|
|
|
props: {
|
|
|
|
|
data: Object,
|
|
|
|
|
onClick: Function,
|
2020-12-08 13:43:33 +00:00
|
|
|
postComment: Function,
|
2020-12-15 23:56:44 +00:00
|
|
|
dropFiles: Function,
|
2020-12-07 22:51:54 +00:00
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
CaseComment,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
2020-12-14 17:10:17 +00:00
|
|
|
return {
|
2020-12-15 23:56:44 +00:00
|
|
|
showMaskDrop: false,
|
|
|
|
|
files: [],
|
2020-12-14 17:10:17 +00:00
|
|
|
itemSelected: null,
|
|
|
|
|
};
|
2020-12-07 22:51:54 +00:00
|
|
|
},
|
2020-12-11 19:36:41 +00:00
|
|
|
computed: {
|
|
|
|
|
pathImgOwner() {
|
|
|
|
|
return (
|
2021-03-24 14:56:11 +00:00
|
|
|
window.config.SYS_SERVER_AJAX +
|
2020-12-11 19:36:41 +00:00
|
|
|
window.config.SYS_URI +
|
|
|
|
|
`users/users_ViewPhotoGrid?pUID=${window.config.USR_UID}`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
2020-12-07 22:51:54 +00:00
|
|
|
methods: {
|
|
|
|
|
classBtn(cls) {
|
|
|
|
|
return "btn v-btn-request " + cls;
|
|
|
|
|
},
|
|
|
|
|
classIcon(icon) {
|
|
|
|
|
return this.icon[icon];
|
|
|
|
|
},
|
2020-12-08 13:43:33 +00:00
|
|
|
onClickComment() {
|
2020-12-15 23:56:44 +00:00
|
|
|
let fls = this.files;
|
|
|
|
|
this.postComment(
|
|
|
|
|
this.$refs["comment"].value,
|
|
|
|
|
this.$refs["send"].checked,
|
|
|
|
|
fls
|
|
|
|
|
);
|
2020-12-08 13:43:33 +00:00
|
|
|
this.resetComment();
|
|
|
|
|
},
|
|
|
|
|
resetComment() {
|
|
|
|
|
this.$refs["comment"].value = "";
|
|
|
|
|
this.$refs["send"].checked = false;
|
2020-12-15 23:56:44 +00:00
|
|
|
this.files = [];
|
2020-12-08 13:43:33 +00:00
|
|
|
},
|
2020-12-14 17:10:17 +00:00
|
|
|
onSelected(item) {
|
|
|
|
|
this.itemSelected = item;
|
|
|
|
|
},
|
2020-12-15 23:56:44 +00:00
|
|
|
onDropFile(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.stopPropagation();
|
2021-01-13 15:11:21 +00:00
|
|
|
if(this.data.noPerms === 1){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-12-15 23:56:44 +00:00
|
|
|
let that = this,
|
|
|
|
|
fls = [];
|
|
|
|
|
_.each(e.dataTransfer.files, (f) => {
|
|
|
|
|
that.files.push(f);
|
|
|
|
|
});
|
2021-01-13 15:11:21 +00:00
|
|
|
that.files = that.files.slice(0,5);
|
2020-12-15 23:56:44 +00:00
|
|
|
_.each(that.files, (f) => {
|
|
|
|
|
fls.push({
|
|
|
|
|
data: f,
|
|
|
|
|
title: f.name,
|
|
|
|
|
extension: f.name.split(".").pop(),
|
|
|
|
|
onClick: () => {},
|
2021-01-13 15:11:21 +00:00
|
|
|
id: _.random(1000000)
|
2020-12-15 23:56:44 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.dropFiles(fls);
|
|
|
|
|
this.showMaskDrop = false;
|
|
|
|
|
},
|
|
|
|
|
onDragOver(e) {
|
|
|
|
|
e.preventDefault();
|
2021-01-13 15:11:21 +00:00
|
|
|
if(this.data.noPerms === 1){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-12-15 23:56:44 +00:00
|
|
|
if (!this.showMaskDrop) {
|
|
|
|
|
this.showMaskDrop = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onDragLeave(e) {
|
|
|
|
|
if (this.showMaskDrop) {
|
|
|
|
|
this.showMaskDrop = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
removeFile(file) {
|
|
|
|
|
_.remove(this.files, function (n) {
|
|
|
|
|
return file.title == n.name;
|
|
|
|
|
});
|
|
|
|
|
},
|
2020-12-07 22:51:54 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.v-check-comment {
|
|
|
|
|
padding-right: 20px;
|
|
|
|
|
}
|
2020-12-11 19:36:41 +00:00
|
|
|
|
2020-12-15 23:56:44 +00:00
|
|
|
.v-comments {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mask {
|
|
|
|
|
z-index: 100;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background-attachment: fixed;
|
|
|
|
|
outline: 5px dashed #2ba070;
|
|
|
|
|
outline-offset: -20px;
|
|
|
|
|
}
|
|
|
|
|
.flex-center {
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
display: -ms-flexbox;
|
|
|
|
|
display: flex;
|
|
|
|
|
-webkit-box-align: center;
|
|
|
|
|
-ms-flex-align: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
-webkit-box-pack: center;
|
|
|
|
|
-ms-flex-pack: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
.rgba-green-strong,
|
|
|
|
|
.rgba-green-strong:after {
|
|
|
|
|
background-color: rgba(76, 175, 80, 0.7);
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-11 19:36:41 +00:00
|
|
|
.v-img-fluid {
|
|
|
|
|
max-width: 30px;
|
|
|
|
|
height: auto;
|
|
|
|
|
}
|
2020-12-15 23:56:44 +00:00
|
|
|
.white-text {
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
color: antiquewhite;
|
|
|
|
|
}
|
2022-04-14 12:50:58 -04:00
|
|
|
.commentTitle {
|
|
|
|
|
font-weight: bolder;
|
|
|
|
|
}
|
2020-12-07 22:51:54 +00:00
|
|
|
</style>
|