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

View File

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

View File

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

View File

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

View File

@ -216,15 +216,22 @@ export default {
break; break;
case 'message': 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 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}) => { }).catch(({msg}) => {
$A.modalError(msg || this.$L('打开会话失败')) $A.modalError(msg || this.$L('打开会话失败'))
}) })
break; break;
case 'contact': 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('打开会话失败')) $A.modalError(msg || this.$L('打开会话失败'))
}); });
break; break;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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