File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/im/view/list/item/sidebar/src/sidebar.js
Back
import { Vue } from "ui.vue"; import { Utils } from "im.lib.utils"; import "./sidebar.css"; Vue.cloneComponent('bx-im-view-list-item-sidebar', 'bx-list-element', { props: [ 'rawListItem', 'itemTypes' ], methods: { }, computed: { listItem() { return { id: this.rawListItem.id, template: this.rawListItem.template, type: this.rawListItem.chatType, sectionCode: this.rawListItem.sectionCode, title: { leftIcon: this.titleLeftIcon, value: this.titleValue }, avatar: { url: this.avatarUrl, topRightIcon: this.rawListItem.counter, bottomRightIcon: this.avatarBottomRightIcon }, notification: false, } }, listItemStyle() { if (this.rawListItem.sectionCode === 'pinned') { return { backgroundColor: '#f7f7f7' }; } return {}; }, imageStyle() { let backgroundColor = ''; if (!this.listItem.avatar.url) { backgroundColor = this.imageColor; } return { backgroundColor }; }, imageClass() { let classes = 'bx-vue-list-item-image '; if (this.isGeneralChat) { classes += 'bx-vue-list-item-image-general'; } return classes; }, imageColor() { if (this.isUser && this.userData) { return this.userData.color; } if (this.isChat && this.dialogData) { return this.dialogData.color; } if (this.isNotificationChat) { return this.rawListItem.color; } }, avatarUrl() { if (this.isGeneralChat) { return '/bitrix/js/im/images/blank.gif'; } if (this.isUser && this.userData) { return this.userData.avatar; } if (this.isChat && this.dialogData) { return this.dialogData.avatar; } }, avatarBottomRightIcon() { if (this.isUser) { if (this.userData.isAbsent) { return 'absent'; } else if (this.userData.isBirthday) { return 'birthday'; } else if (this.userData.isMobileOnline) { return 'mobile-online'; } else if (this.userData.isOnline && (this.userData.status === 'away' || this.userData.status === 'dnd')) { return this.userData.status; } else if (this.userData.isOnline) { return 'online'; } else { return 'offline'; } } if (this.isChat) { return this.rawListItem.chatType; } }, titleValue() { if (this.isUser && this.userData) { return this.userData.name; } if (this.isChat && this.dialogData) { return this.dialogData.name; } if (this.isNotificationChat) { return this.rawListItem.title; } }, userData() { return this.$root.$store.getters['users/get'](this.rawListItem.userId); }, dialogData() { return this.$root.$store.getters['dialogues/getByChatId'](this.rawListItem.chatId); }, isChat() { return ['chat', 'open'].includes(this.rawListItem.chatType) }, isUser() { return this.rawListItem.chatType === 'user'; }, isNotificationChat() { return this.rawListItem.id === 'notify'; }, isGeneralChat() { return this.rawListItem.id === 'chat1'; } }, template: ` <div class="bx-vue-list-item" :style="listItemStyle"> <template v-if="listItem.template !== itemTypes.placeholder"> <div v-if="listItem.avatar" class="bx-vue-list-item-image-wrap"> <img v-if="listItem.avatar.url" :src="listItem.avatar.url" :style="imageStyle" :class="imageClass" alt=""> <div v-else-if="!listItem.avatar.url" :style="imageStyle" class="bx-vue-list-item-image-text">{{ avatarText }}</div> <div v-if="listItem.avatar.topLeftIcon" :class="'bx-vue-list-icon-avatar-top-left bx-vue-list-icon-avatar-top-left-' + listItem.avatar.topLeftIcon"></div> <div v-if="listItem.avatar.topRightIcon" class="bx-vue-list-icon-avatar-top-right">{{ listItem.avatar.topRightIcon }}</div> <div v-if="listItem.avatar.bottomRightIcon" :class="'bx-vue-list-icon-avatar-bottom-right bx-vue-list-avatar-bottom-right-' + listItem.avatar.bottomRightIcon"></div> </div> </template> <template v-else-if="listItem.template === itemTypes.placeholder"> <div class="bx-vue-list-item-image-wrap"><img src="https://www.ischool.berkeley.edu/sites/default/files/default_images/avatar.jpeg" alt="" class="bx-vue-list-item-image"></div> </template> </div> ` });
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings