perf: 优化数据结构

This commit is contained in:
kuaifan 2025-04-04 08:08:01 +08:00
parent 38fa72e9da
commit b643fe56d5
14 changed files with 40 additions and 25 deletions

View File

@ -93,15 +93,15 @@ export default {
computed: {
showSSO() {
return this.$isSoftware && ['login'].includes(this.$route.name)
return this.$isSoftware && ['login'].includes(this.routeName)
},
showDown() {
return !this.$isEEUiApp && !this.windowTouch && ['login', 'index', 'manage-dashboard'].includes(this.$route.name)
return !this.$isEEUiApp && !this.windowTouch && ['login', 'index', 'manage-dashboard'].includes(this.routeName)
},
showPrivacy() {
return $A.isDooServer() && this.$isEEUiApp && ['login'].includes(this.$route.name)
return $A.isDooServer() && this.$isEEUiApp && ['login'].includes(this.routeName)
}
},

View File

@ -366,7 +366,7 @@ export default {
},
qrcodeStatus() {
if (this.$route.name !== 'login' || this.loginMode != 'qrcode') {
if (this.routeName !== 'login' || this.loginMode != 'qrcode') {
return;
}
if (this.qrcodeLoad) {

View File

@ -381,7 +381,7 @@ export default {
}
}).then(({msg}) => {
$A.messageSuccess(msg);
if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') {
if (this.routeName == 'manage-approve-details' || this.routeName == 'manage-messenger') {
this.getInfo()
} else {
this.$emit('approve')
@ -411,7 +411,7 @@ export default {
}).then(({msg}) => {
$A.messageSuccess(msg);
resolve();
if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') {
if (this.routeName == 'manage-approve-details' || this.routeName == 'manage-messenger') {
this.getInfo()
} else {
this.$emit('revocation')

View File

@ -188,7 +188,7 @@ export default {
if (num <= 1) return
this.wsTimer && clearTimeout(this.wsTimer)
this.wsTimer = setTimeout(() => {
this.$route.name == 'manage-calendar' && this.setDateRangeText();
this.routeName == 'manage-calendar' && this.setDateRangeText();
}, 5000)
}
},

View File

@ -2648,7 +2648,8 @@ export default {
onDialogMenu(cmd) {
switch (cmd) {
case "single":
this.$store.dispatch('openDialog', {dialog_id: this.dialogData.id});
this.$store.dispatch('openDialog', {dialog_id: this.dialogData.id, single: true});
this.routeName !== 'manage-messenger' && this.$store.dispatch('openDialog', 0);
break;
case "searchMsg":
@ -3000,9 +3001,13 @@ export default {
},
handleBack() {
if ($A.isSubElectron) {
window.close()
return
}
const {name, params} = this.$store.state.routeHistoryLast;
if (name === this.$route.name && /^\d+$/.test(params.dialogId)) {
this.goForward({name: this.$route.name});
if (name === this.routeName && /^\d+$/.test(params.dialogId)) {
this.goForward({name: this.routeName});
} else {
this.goBack();
}

View File

@ -1717,8 +1717,8 @@ export default {
onBack() {
const {name, params} = this.$store.state.routeHistoryLast;
if (name === this.$route.name && /^\d+$/.test(params.projectId)) {
this.goForward({name: this.$route.name, params: {projectId: 'all'}});
if (name === this.routeName && /^\d+$/.test(params.projectId)) {
this.goForward({name: this.routeName, params: {projectId: 'all'}});
} else {
this.goBack();
}

View File

@ -378,6 +378,9 @@ export default {
this.$store.dispatch("updateDialogLastMsg", data.msgs);
$A.messageSuccess(msg);
resolve();
if (data.msgs.length > 0) {
this.$store.dispatch("openDialog", data.msgs[0].dialog_id);
}
}).catch(({msg}) => {
$A.modalError(msg);
reject();

View File

@ -1755,7 +1755,7 @@ export default {
},
openNewWin() {
let config = {
const config = {
title: this.taskDetail.name,
titleFixed: true,
parent: null,

View File

@ -956,7 +956,7 @@ export default {
if (num <= 1) return
this.wsOpenTimeout && clearTimeout(this.wsOpenTimeout)
this.wsOpenTimeout = setTimeout(() => {
this.$route.name == 'manage-file' && this.getFileList();
this.routeName == 'manage-file' && this.getFileList();
}, 5000)
},
@ -975,7 +975,7 @@ export default {
methods: {
getFileList() {
if (this.$route.name !== 'manage-file') {
if (this.routeName !== 'manage-file') {
return;
}
this.loadIng++;
@ -1076,7 +1076,7 @@ export default {
},
openFileJudge() {
if (this.$route.name !== 'manage-file') {
if (this.routeName !== 'manage-file') {
this.fileShow = false;
return;
}

View File

@ -1115,7 +1115,7 @@ export default {
break;
case 'single':
this.$store.dispatch('openDialog', this.operateItem.id);
this.$store.dispatch('openDialog', {dialog_id: this.operateItem.id, single: true});
break;
case 'hide':

View File

@ -37,7 +37,7 @@ export default {
if (num <= 1) return
this.wsOpenTimeout && clearTimeout(this.wsOpenTimeout)
this.wsOpenTimeout = setTimeout(() => {
this.$route.name == 'manage-project' && this.getProjectData();
this.routeName == 'manage-project' && this.getProjectData();
}, 5000)
}
},

View File

@ -3031,15 +3031,16 @@ export default {
*/
openDialog({state, dispatch}, dialogId) {
return new Promise(async (resolve, reject) => {
let singleWindow = state.routeName !== 'manage-messenger',
searchMsgId = 0,
dialogMsgId = 0;
let singleWindow,
searchMsgId,
dialogMsgId;
if ($A.isJson(dialogId)) {
singleWindow = singleWindow || !!dialogId.single;
singleWindow = dialogId.single;
searchMsgId = dialogId.search_msg_id;
dialogMsgId = dialogId.dialog_msg_id;
dialogId = dialogId.dialog_id;
}
singleWindow = typeof singleWindow === "boolean" ? singleWindow : $A.isSubElectron;
searchMsgId = /^\d+$/.test(searchMsgId) ? parseInt(searchMsgId) : 0;
dialogMsgId = /^\d+$/.test(dialogMsgId) ? parseInt(dialogMsgId) : 0;
dialogId = /^\d+$/.test(dialogId) ? parseInt(dialogId) : 0;

View File

@ -38,7 +38,7 @@ body {
.ivu-modal {
.ivu-modal-content {
.ivu-modal-close {
top: 12px;
top: 11px;
z-index: 2;
}
@ -53,6 +53,12 @@ body {
.nav-wrapper {
padding: 0 20px;
&.completed {
&:after {
right: 102px;
}
}
.dialog-menu {
margin-right: 18px;
}

View File

@ -100,7 +100,7 @@
pointer-events: none;
position: absolute;
top: 50%;
right: 52px;
right: 60px;
transform: translateY(-50%);
font-size: 40px;
color: #19be6b;
@ -109,7 +109,7 @@
}
.dialog-title {
padding-right: 52px;
padding-right: 60px;
}
}