perf: 优化数据结构

This commit is contained in:
kuaifan 2025-04-03 22:35:46 +08:00
parent 82fddefc94
commit 38fa72e9da
13 changed files with 34 additions and 53 deletions

View File

@ -73,7 +73,6 @@ export default {
data() {
return {
routePath: null,
appInter: null,
countDown: Math.min(30, 60 - $A.daytz().second()),
lastCheckUpgradeYmd: $A.daytz().format('YYYY-MM-DD')
@ -102,8 +101,8 @@ export default {
watch: {
'$route': {
handler(to) {
this.routePath = to.path
this.$store.state.routeName = to.name
this.$store.state.routePath = to.path
},
immediate: true,
},

View File

@ -28,12 +28,6 @@ import {mapState} from "vuex";
export default {
name: 'AuthException',
data() {
return {
routePath: null,
}
},
computed: {
...mapState(['ajaxAuthException']),
@ -42,15 +36,6 @@ export default {
}
},
watch: {
'$route': {
handler(to) {
this.routePath = to.path
},
immediate: true,
},
},
methods: {
onClose() {
window.close();

View File

@ -57,10 +57,6 @@ export default {
}
},
routeName() {
return this.$route.name
},
fileFolderId() {
const {folderId} = this.$route.params;
return parseInt(/^\d+$/.test(folderId) ? folderId : 0);

View File

@ -45,10 +45,6 @@ export default {
...mapState(['cacheDialogs', 'reportUnreadNumber', 'approveUnreadNumber']),
...mapGetters(['dashboardTask']),
routeName() {
return this.$route.name
},
/**
* 综合数未读提及待办
* @returns {string|string}

View File

@ -216,15 +216,22 @@ export default {
break;
case 'message':
this.$store.dispatch("openDialog", item.id).then(() => {
this.$store.dispatch("openDialog", item.id).then(_ => {
this.$store.state.dialogSearchMsgId = /^\d+$/.test(item.rawData.search_msg_id) ? item.rawData.search_msg_id : 0
if (this.routeName === 'manage-messenger') {
this.onHide()
}
}).catch(({msg}) => {
$A.modalError(msg || this.$L('打开会话失败'))
})
break;
case 'contact':
this.$store.dispatch("openDialogUserid", item.id).catch(({msg}) => {
this.$store.dispatch("openDialogUserid", item.id).then(_ => {
if (this.routeName === 'manage-messenger') {
this.onHide()
}
}).catch(({msg}) => {
$A.modalError(msg || this.$L('打开会话失败'))
});
break;

View File

@ -17,6 +17,9 @@ export default {
'userId',
'userToken',
'routeName',
'routePath',
])
}
}

View File

@ -523,10 +523,6 @@ export default {
...mapGetters(['dashboardTask']),
routeName() {
return this.$route.name
},
// okr
okrUrl() {
return import.meta.env.VITE_OKR_WEB_URL || $A.mainUrl("apps/okr")
@ -872,12 +868,12 @@ export default {
},
classNameRoute(path) {
let routeName = this.routeName
if(routeName == 'manage-approve' || routeName == 'manage-apps'){
routeName = `manage-application`
let name = this.routeName
if (name == 'manage-approve' || name == 'manage-apps') {
name = `manage-application`
}
return {
"active": routeName === `manage-${path}`,
"active": name === `manage-${path}`,
};
},

View File

@ -36,7 +36,7 @@ export default {
},
computed: {
...mapState(['dialogId', 'routeName', 'windowOrientation']),
...mapState(['dialogId', 'windowOrientation']),
modalStyles() {
if (this.windowPortrait) {

View File

@ -149,13 +149,8 @@ export default {
computed: {
...mapState(['systemConfig', 'userInfo', 'userIsAdmin', 'cacheTasks', 'taskCompleteTemps', 'loadDashboardTasks']),
...mapGetters(['dashboardTask', 'assistTask', 'transforTasks']),
routeName() {
return this.$route.name
},
columns({hiddenColumns, dashboardTask, assistTask}) {
const list = [];
['today', 'overdue', 'todo'].some(type => {

View File

@ -371,10 +371,6 @@ export default {
...mapGetters(['getDialogDraft', 'tagDialogDraft']),
routeName() {
return this.$route.name
},
contactAvatarSize() {
return this.windowPortrait ? 36 : 30
},

View File

@ -64,10 +64,6 @@ export default {
computed: {
...mapState(['userInfo', 'userIsAdmin', 'clientNewVersion', 'systemConfig']),
routeName() {
return this.$route.name
},
showContent() {
return this.$route.path.match(/^\/manage\/setting\/\w+$/)
},

View File

@ -50,6 +50,7 @@ export default {
// 路由记录
routeName: null,
routePath: null,
routeHistorys: [],
routeHistoryLast: {},
routeLoading: 0,

View File

@ -8,10 +8,6 @@ body {
.ivu-modal-content {
background: transparent;
.ivu-modal-close {
display: none;
}
.ivu-modal-body {
padding: 0;
display: flex;
@ -29,12 +25,23 @@ body {
.ivu-modal {
margin: 0;
padding: 0;
.ivu-modal-content {
.ivu-modal-close {
display: none;
}
}
}
}
&.dialog-landscape {
.ivu-modal {
.ivu-modal-content {
.ivu-modal-close {
top: 12px;
z-index: 2;
}
.ivu-modal-body {
.dialog-wrapper {
position: relative;
@ -45,6 +52,10 @@ body {
.dialog-nav {
.nav-wrapper {
padding: 0 20px;
.dialog-menu {
margin-right: 18px;
}
}
}