mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 优化数据结构
This commit is contained in:
parent
82fddefc94
commit
38fa72e9da
@ -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,
|
||||
},
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -57,10 +57,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
},
|
||||
|
||||
fileFolderId() {
|
||||
const {folderId} = this.$route.params;
|
||||
return parseInt(/^\d+$/.test(folderId) ? folderId : 0);
|
||||
|
||||
@ -45,10 +45,6 @@ export default {
|
||||
...mapState(['cacheDialogs', 'reportUnreadNumber', 'approveUnreadNumber']),
|
||||
...mapGetters(['dashboardTask']),
|
||||
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
},
|
||||
|
||||
/**
|
||||
* 综合数(未读、提及、待办)
|
||||
* @returns {string|string}
|
||||
|
||||
@ -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;
|
||||
|
||||
3
resources/assets/js/mixins/state.js
vendored
3
resources/assets/js/mixins/state.js
vendored
@ -17,6 +17,9 @@ export default {
|
||||
|
||||
'userId',
|
||||
'userToken',
|
||||
|
||||
'routeName',
|
||||
'routePath',
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@ -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}`,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['dialogId', 'routeName', 'windowOrientation']),
|
||||
...mapState(['dialogId', 'windowOrientation']),
|
||||
|
||||
modalStyles() {
|
||||
if (this.windowPortrait) {
|
||||
|
||||
@ -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 => {
|
||||
|
||||
@ -371,10 +371,6 @@ export default {
|
||||
|
||||
...mapGetters(['getDialogDraft', 'tagDialogDraft']),
|
||||
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
},
|
||||
|
||||
contactAvatarSize() {
|
||||
return this.windowPortrait ? 36 : 30
|
||||
},
|
||||
|
||||
@ -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+$/)
|
||||
},
|
||||
|
||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -50,6 +50,7 @@ export default {
|
||||
|
||||
// 路由记录
|
||||
routeName: null,
|
||||
routePath: null,
|
||||
routeHistorys: [],
|
||||
routeHistoryLast: {},
|
||||
routeLoading: 0,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user