|
|
|
@ -7,31 +7,31 @@ |
|
|
|
<q-item> |
|
|
|
<q-item> |
|
|
|
<q-item-section side> |
|
|
|
<q-item-section side> |
|
|
|
<q-avatar> |
|
|
|
<q-avatar> |
|
|
|
<q-img :alt="message.sender.username" :src="message.sender.illustrationUrl" /> |
|
|
|
<q-img :alt="post.sender.username" :src="post.sender.illustrationUrl" /> |
|
|
|
</q-avatar> |
|
|
|
</q-avatar> |
|
|
|
</q-item-section> |
|
|
|
</q-item-section> |
|
|
|
|
|
|
|
|
|
|
|
<q-item-section> |
|
|
|
<q-item-section> |
|
|
|
<q-item-label |
|
|
|
<q-item-label |
|
|
|
v-if="!message.firstReceiver || (message.firstReceiver && message.sender['@id'] === message.firstReceiver.receiver['@id'])" |
|
|
|
v-if="null === post.userReceiver || post.sender['@id'] === post.userReceiver['@id']" |
|
|
|
> |
|
|
|
> |
|
|
|
<router-link :to="{ name: 'SocialkWall', query: { id: message.sender['@id']} }"> |
|
|
|
<router-link :to="{ name: 'SocialWall', query: { id: post.sender['@id']} }"> |
|
|
|
{{ message.sender.username }} |
|
|
|
{{ post.sender.username }} |
|
|
|
</router-link> |
|
|
|
</router-link> |
|
|
|
</q-item-label> |
|
|
|
</q-item-label> |
|
|
|
|
|
|
|
|
|
|
|
<q-item-label v-else> |
|
|
|
<q-item-label v-else> |
|
|
|
<router-link :to="{ name: 'SocialWall', query: { id: message.sender['@id']} }"> |
|
|
|
<router-link :to="{ name: 'SocialWall', query: { id: post.sender['@id']} }"> |
|
|
|
{{ message.sender.username }} |
|
|
|
{{ post.sender.username }} |
|
|
|
</router-link> |
|
|
|
</router-link> |
|
|
|
» |
|
|
|
» |
|
|
|
<router-link :to="{ name: 'SocialkWall', query: { id: message.firstReceiver.receiver['@id']} }"> |
|
|
|
<router-link :to="{ name: 'SocialWall', query: { id: post.userReceiver['@id']} }"> |
|
|
|
{{ message.firstReceiver.receiver.username }} |
|
|
|
{{ post.userReceiver.username }} |
|
|
|
</router-link> |
|
|
|
</router-link> |
|
|
|
</q-item-label> |
|
|
|
</q-item-label> |
|
|
|
|
|
|
|
|
|
|
|
<q-item-label caption> |
|
|
|
<q-item-label caption> |
|
|
|
{{ $filters.abbreviatedDatetime(message.sendDate) }} |
|
|
|
{{ $filters.abbreviatedDatetime(post.sendDate) }} |
|
|
|
</q-item-label> |
|
|
|
</q-item-label> |
|
|
|
</q-item-section> |
|
|
|
</q-item-section> |
|
|
|
</q-item> |
|
|
|
</q-item> |
|
|
|
@ -47,7 +47,7 @@ |
|
|
|
:alt="attachment.comment" |
|
|
|
:alt="attachment.comment" |
|
|
|
:src="attachment.contentUrl" |
|
|
|
:src="attachment.contentUrl" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<q-card-section v-html="message.content" /> |
|
|
|
<q-card-section v-html="post.content" /> |
|
|
|
|
|
|
|
|
|
|
|
<q-separator /> |
|
|
|
<q-separator /> |
|
|
|
|
|
|
|
|
|
|
|
@ -64,7 +64,7 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</q-list> |
|
|
|
</q-list> |
|
|
|
|
|
|
|
|
|
|
|
<WallCommentForm :post="message" /> |
|
|
|
<WallCommentForm :post="post" /> |
|
|
|
</q-card> |
|
|
|
</q-card> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
@ -72,35 +72,36 @@ |
|
|
|
import WallCommentForm from "./CommentForm"; |
|
|
|
import WallCommentForm from "./CommentForm"; |
|
|
|
import {onMounted, reactive} from "vue"; |
|
|
|
import {onMounted, reactive} from "vue"; |
|
|
|
import WallComment from "./WallComment"; |
|
|
|
import WallComment from "./WallComment"; |
|
|
|
import {MESSAGE_TYPE_WALL} from "../message/constants"; |
|
|
|
import {SOCIAL_TYPE_WALL_COMMENT} from "./constants"; |
|
|
|
import {useStore} from "vuex"; |
|
|
|
import {useStore} from "vuex"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "WallPost", |
|
|
|
name: "WallPost", |
|
|
|
components: {WallComment, WallCommentForm}, |
|
|
|
components: {WallComment, WallCommentForm}, |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
message: { |
|
|
|
post: { |
|
|
|
type: Object, |
|
|
|
type: Object, |
|
|
|
required: true |
|
|
|
required: true |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
setup(props) { |
|
|
|
setup(props) { |
|
|
|
const attachment = props.message.attachments.length ? props.message.attachments[0] : null; |
|
|
|
const attachment = null;//props.post.attachments.length ? props.post.attachments[0] : null; |
|
|
|
let comments = reactive([]); |
|
|
|
let comments = reactive([]); |
|
|
|
|
|
|
|
|
|
|
|
const containsImage = attachment && attachment.resourceNode.resourceFile.mimeType.includes('image/'); |
|
|
|
const containsImage = false; //attachment && attachment.resourceNode.resourceFile.mimeType.includes('image/'); |
|
|
|
const containsVideo = attachment && attachment.resourceNode.resourceFile.mimeType.includes('video/'); |
|
|
|
const containsVideo = false; //attachment && attachment.resourceNode.resourceFile.mimeType.includes('video/'); |
|
|
|
|
|
|
|
|
|
|
|
function loadComments() { |
|
|
|
function loadComments() { |
|
|
|
const store = useStore(); |
|
|
|
const store = useStore(); |
|
|
|
|
|
|
|
|
|
|
|
store |
|
|
|
store |
|
|
|
.dispatch( |
|
|
|
.dispatch( |
|
|
|
'message/findAll', |
|
|
|
'socialpost/findAll', |
|
|
|
{ |
|
|
|
{ |
|
|
|
parent: props.message['@id'], |
|
|
|
parent: props.post['@id'], |
|
|
|
msgType: MESSAGE_TYPE_WALL, |
|
|
|
type: SOCIAL_TYPE_WALL_COMMENT, |
|
|
|
'order[sendDate]': 'desc', |
|
|
|
'order[sendDate]': 'desc', |
|
|
|
|
|
|
|
itemsPerPage: 3 |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
.then(response => comments.push(...response)); |
|
|
|
.then(response => comments.push(...response)); |
|
|
|
|