mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 04:32:49 +00:00
perf: 优化数据结构
This commit is contained in:
parent
82fddefc94
commit
38fa72e9da
@ -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,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -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}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
3
resources/assets/js/mixins/state.js
vendored
3
resources/assets/js/mixins/state.js
vendored
@ -17,6 +17,9 @@ export default {
|
|||||||
|
|
||||||
'userId',
|
'userId',
|
||||||
'userToken',
|
'userToken',
|
||||||
|
|
||||||
|
'routeName',
|
||||||
|
'routePath',
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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}`,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['dialogId', 'routeName', 'windowOrientation']),
|
...mapState(['dialogId', 'windowOrientation']),
|
||||||
|
|
||||||
modalStyles() {
|
modalStyles() {
|
||||||
if (this.windowPortrait) {
|
if (this.windowPortrait) {
|
||||||
|
|||||||
@ -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 => {
|
||||||
|
|||||||
@ -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
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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+$/)
|
||||||
},
|
},
|
||||||
|
|||||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -50,6 +50,7 @@ export default {
|
|||||||
|
|
||||||
// 路由记录
|
// 路由记录
|
||||||
routeName: null,
|
routeName: null,
|
||||||
|
routePath: null,
|
||||||
routeHistorys: [],
|
routeHistorys: [],
|
||||||
routeHistoryLast: {},
|
routeHistoryLast: {},
|
||||||
routeLoading: 0,
|
routeLoading: 0,
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user