|
@@ -101,7 +101,8 @@ export default {
|
|
|
this.CacheDraft = new MemoryCache();
|
|
|
return {
|
|
|
drawerVisible: !this.hideDrawer,
|
|
|
- currentContactId: null,
|
|
|
+ currentContactId: null, // 消息菜单下当前联系人
|
|
|
+ currentContactIdSidebarContact: null, // 联系人菜单下当前联系人
|
|
|
currentMessages: [],
|
|
|
activeSidebar: DEFAULT_MENU_LASTMESSAGES,
|
|
|
contacts: [],
|
|
@@ -133,6 +134,9 @@ export default {
|
|
|
currentContact() {
|
|
|
return this.contacts.find(item => item.id == this.currentContactId) || {};
|
|
|
},
|
|
|
+ currentContactSidebarContact() {
|
|
|
+ return this.contacts.find(item => item.id == this.currentContactIdSidebarContact) || {};
|
|
|
+ },
|
|
|
currentMenu() {
|
|
|
return this.menus.find(item => item.name == this.activeSidebar) || {};
|
|
|
},
|
|
@@ -397,7 +401,7 @@ export default {
|
|
|
return (
|
|
|
<lemon-contact
|
|
|
class={{
|
|
|
- "lemon-contact--active": this.currentContactId == props.contact.id,
|
|
|
+ "lemon-contact--active": this.activeSidebar == DEFAULT_MENU_CONTACTS ? this.currentContactIdSidebarContact == props.contact.id : this.currentContactId == props.contact.id
|
|
|
}}
|
|
|
v-lemon-contextmenu_contact={this.contactContextmenu}
|
|
|
props={props}
|
|
@@ -469,7 +473,7 @@ export default {
|
|
|
_renderContainer() {
|
|
|
const nodes = [];
|
|
|
const cls = "lemon-container";
|
|
|
- const curact = this.currentContact;
|
|
|
+ const curact = this.activeSidebar == DEFAULT_MENU_CONTACTS ? this.currentContactSidebarContact : this.currentContact;
|
|
|
let defIsShow = true;
|
|
|
for (const name in this.CacheContactContainer.get()) {
|
|
|
const show = curact.id == name && this.currentIsDefSidebar;
|
|
@@ -682,7 +686,10 @@ export default {
|
|
|
if (menuName) {
|
|
|
this.changeMenu(menuName);
|
|
|
} else {
|
|
|
- if (this._changeContactLock || this.currentContactId == contactId)
|
|
|
+ if (this._changeContactLock ||
|
|
|
+ (this.activeSidebar == DEFAULT_MENU_LASTMESSAGES && this.currentContactId == contactId) ||
|
|
|
+ (this.activeSidebar == DEFAULT_MENU_CONTACTS && this.currentContactIdSidebarContact == contactId)
|
|
|
+ )
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -697,7 +704,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- this.currentContactId = contactId;
|
|
|
+
|
|
|
+ if (this.activeSidebar == DEFAULT_MENU_CONTACTS) {
|
|
|
+ this.currentContactIdSidebarContact = contactId
|
|
|
+ } else {
|
|
|
+ this.currentContactId = contactId;
|
|
|
+ }
|
|
|
if (!this.currentContactId) return false;
|
|
|
|
|
|
this.$emit("change-contact", this.currentContact, this);
|