perf: 优化消息窗口

This commit is contained in:
kuaifan 2025-03-30 09:12:38 +08:00
parent a57740e14e
commit 8af33ea66a
4 changed files with 15 additions and 6 deletions

View File

@ -284,7 +284,7 @@ export default {
this.getDialogUser(); this.getDialogUser();
} else { } else {
this.$store.dispatch("forgetDialog", {id: this.dialogId}); this.$store.dispatch("forgetDialog", {id: this.dialogId});
this.goForward({name: 'manage-messenger'}); this.$emit("on-close")
} }
}).catch(({msg}) => { }).catch(({msg}) => {
reject(msg); reject(msg);

View File

@ -2800,7 +2800,6 @@ export default {
}).then(({msg}) => { }).then(({msg}) => {
resolve(msg); resolve(msg);
this.$store.dispatch("forgetDialog", {id: this.dialogId}); this.$store.dispatch("forgetDialog", {id: this.dialogId});
this.goForward({name: 'manage-messenger'});
}).catch(({msg}) => { }).catch(({msg}) => {
reject(msg); reject(msg);
}); });
@ -2823,7 +2822,6 @@ export default {
}).then(({msg}) => { }).then(({msg}) => {
resolve(msg); resolve(msg);
this.$store.dispatch("forgetDialog", {id: this.dialogId}); this.$store.dispatch("forgetDialog", {id: this.dialogId});
this.goForward({name: 'manage-messenger'});
}).catch(({msg}) => { }).catch(({msg}) => {
reject(msg); reject(msg);
}); });

View File

@ -3026,11 +3026,11 @@ export default {
*/ */
openDialog({state, dispatch}, dialog_id) { openDialog({state, dispatch}, dialog_id) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
let single_window = false let single_window = $A.isSubElectron || (state.isModKey && $A.Electron)
let search_msg_id; let search_msg_id;
let dialog_msg_id; let dialog_msg_id;
if ($A.isJson(dialog_id)) { if ($A.isJson(dialog_id)) {
single_window = (dialog_id.single || dialog_id.single_window) && $A.Electron; single_window = single_window || (dialog_id.single && $A.Electron);
search_msg_id = dialog_id.search_msg_id; search_msg_id = dialog_id.search_msg_id;
dialog_msg_id = dialog_id.dialog_msg_id; dialog_msg_id = dialog_id.dialog_msg_id;
dialog_id = dialog_id.dialog_id; dialog_id = dialog_id.dialog_id;
@ -3051,7 +3051,7 @@ export default {
} }
} }
// //
if (single_window || $A.isSubElectron) { if (single_window) {
dispatch('openDialogNewWindow', dialog_id); dispatch('openDialogNewWindow', dialog_id);
resolve() resolve()
return return
@ -3139,6 +3139,9 @@ export default {
// //
const ids = $A.isArray(data.id) ? data.id : [data.id]; const ids = $A.isArray(data.id) ? data.id : [data.id];
ids.some(id => { ids.some(id => {
if ($A.isJson(id)) {
id = id.id
}
const index = state.cacheDialogs.findIndex(dialog => dialog.id == id); const index = state.cacheDialogs.findIndex(dialog => dialog.id == id);
if (index > -1) { if (index > -1) {
dispatch("forgetDialogMsg", {id: state.dialogMsgs.filter(item => item.dialog_id == data.id).map(item => item.id)}) dispatch("forgetDialogMsg", {id: state.dialogMsgs.filter(item => item.dialog_id == data.id).map(item => item.id)})

View File

@ -142,6 +142,11 @@
margin-right: 14px; margin-right: 14px;
opacity: 0.9; opacity: 0.9;
height: 30px; height: 30px;
.ivu-checkbox-wrapper {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ivu-checkbox-focus { .ivu-checkbox-focus {
box-shadow: none; box-shadow: none;
} }
@ -164,6 +169,9 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&.start { &.start {
background-color: rgba($flow-status-start-color, 0.1); background-color: rgba($flow-status-start-color, 0.1);
border-color: rgba($flow-status-start-color, 0.1); border-color: rgba($flow-status-start-color, 0.1);