Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/component/search/src/component/ |
Upload File : |
import {EventEmitter} from 'main.core.events'; import {ChatTypes, EventType, AvatarSize} from 'im.v2.const'; import {Avatar, ChatTitle} from 'im.v2.component.elements'; import '../css/search.css'; // @vue/component export const SearchResultItem = { name: 'SearchResultItem', components: {Avatar, ChatTitle}, props: { dialogId: { type: String, required: true }, child: { type: Boolean, default: false, required: false }, }, computed: { user() { return this.$store.getters['users/get'](this.dialogId, true); }, dialog() { return this.$store.getters['dialogues/get'](this.dialogId, true); }, isChat() { return !this.isUser; }, isUser() { return this.dialog.type === ChatTypes.user; }, userOnlineStatus() { return this.$store.getters['users/getLastOnline'](this.dialogId); }, workPosition() { return this.$store.getters['users/getPosition'](this.dialogId); }, AvatarSize: () => AvatarSize, }, methods: { onClick() { console.warn('onClick', this.dialog); EventEmitter.emit(EventType.dialog.open, {dialogId: this.dialogId}); EventEmitter.emit(EventType.search.selectItem, this.dialogId); }, onRightClick() { console.warn('onRightClick'); } }, // language=Vue template: ` <div @click="onClick" @click.right.prevent="onRightClick" class="bx-im-search-item" :class="[this.child ? 'bx-im-search-sub-item' : '']"> <div class="bx-im-search-avatar-wrap"> <Avatar :dialogId="dialogId" :size="AvatarSize.L" /> </div> <div v-if="isUser" class="bx-im-search-result-item-content"> <div class="bx-im-search-result-item-content-header"> <ChatTitle :dialogId="dialogId" /> </div> <div class="bx-im-recent-item-content-bottom"> <div class="bx-im-search-result-item-text-wrap"> <div class="bx-im-search-result-item-message-text">{{ workPosition }}</div> <div class="bx-im-search-result-item-message-text">{{ userOnlineStatus }}</div> </div> </div> </div> <div v-else class="bx-im-search-result-item-title-content"> <ChatTitle :dialogId="dialogId" /> </div> </div> ` };