mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
perf: 优化数据结构
This commit is contained in:
parent
b643fe56d5
commit
7b5867e2c0
@ -60,7 +60,7 @@
|
|||||||
"stylus-loader": "^7.1.0",
|
"stylus-loader": "^7.1.0",
|
||||||
"tinymce": "^5.10.3",
|
"tinymce": "^5.10.3",
|
||||||
"tui-calendar-hi": "^2.1.3-3",
|
"tui-calendar-hi": "^2.1.3-3",
|
||||||
"view-design-hi": "^4.7.0-71",
|
"view-design-hi": "^4.7.0-72",
|
||||||
"vite": "^2.9.15",
|
"vite": "^2.9.15",
|
||||||
"vite-plugin-file-copy": "^1.0.0",
|
"vite-plugin-file-copy": "^1.0.0",
|
||||||
"vite-plugin-require": "^1.1.10",
|
"vite-plugin-require": "^1.1.10",
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
|
ref="modal"
|
||||||
:value="show"
|
:value="show"
|
||||||
:styles="modalStyles"
|
:styles="modalStyles"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
import DialogWrapper from "./DialogWrapper";
|
import DialogWrapper from "./DialogWrapper";
|
||||||
|
import emitter from "../../../store/events";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DialogModal",
|
name: "DialogModal",
|
||||||
@ -35,6 +37,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
emitter.on('dialogModalMoveTop', this.handleMoveTop);
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
emitter.off('dialogModalMoveTop', this.handleMoveTop);
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['dialogId', 'windowOrientation']),
|
...mapState(['dialogId', 'windowOrientation']),
|
||||||
|
|
||||||
@ -95,6 +105,9 @@ export default {
|
|||||||
this.closIng--
|
this.closIng--
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleMoveTop() {
|
||||||
|
this.$refs.modal?.handleMoveTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -882,7 +882,7 @@ export default {
|
|||||||
'cacheTranslationLanguage'
|
'cacheTranslationLanguage'
|
||||||
]),
|
]),
|
||||||
|
|
||||||
...mapGetters(['isLoad', 'getDialogQuote']),
|
...mapGetters(['isLoad', 'isMessengerPage', 'getDialogQuote']),
|
||||||
|
|
||||||
isReady() {
|
isReady() {
|
||||||
return this.dialogId > 0 && this.dialogData.id > 0
|
return this.dialogId > 0 && this.dialogData.id > 0
|
||||||
@ -2567,8 +2567,8 @@ export default {
|
|||||||
if (!this.dialogData.group_info) {
|
if (!this.dialogData.group_info) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.windowPortrait) {
|
if (!this.isMessengerPage || this.windowPortrait) {
|
||||||
// 如果是竖屏则关闭对话窗口
|
// 如果 当前不是消息页面 或 是竖屏 则关闭对话窗口
|
||||||
this.$store.dispatch("openDialog", 0);
|
this.$store.dispatch("openDialog", 0);
|
||||||
}
|
}
|
||||||
this.goForward({name: 'manage-project', params: {projectId:this.dialogData.group_info.id}});
|
this.goForward({name: 'manage-project', params: {projectId:this.dialogData.group_info.id}});
|
||||||
@ -2578,10 +2578,6 @@ export default {
|
|||||||
if (!this.dialogData.group_info) {
|
if (!this.dialogData.group_info) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.taskId > 0) {
|
|
||||||
// 如果当前打开着任务窗口则关闭对话窗口
|
|
||||||
this.$store.dispatch("openDialog", 0);
|
|
||||||
}
|
|
||||||
this.$store.dispatch("openTask", {
|
this.$store.dispatch("openTask", {
|
||||||
id: this.dialogData.group_info.id,
|
id: this.dialogData.group_info.id,
|
||||||
deleted_at: this.dialogData.group_info.deleted_at,
|
deleted_at: this.dialogData.group_info.deleted_at,
|
||||||
@ -2649,7 +2645,7 @@ export default {
|
|||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case "single":
|
case "single":
|
||||||
this.$store.dispatch('openDialog', {dialog_id: this.dialogData.id, single: true});
|
this.$store.dispatch('openDialog', {dialog_id: this.dialogData.id, single: true});
|
||||||
this.routeName !== 'manage-messenger' && this.$store.dispatch('openDialog', 0);
|
!this.isMessengerPage && this.$store.dispatch('openDialog', 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "searchMsg":
|
case "searchMsg":
|
||||||
|
|||||||
@ -1637,9 +1637,6 @@ export default {
|
|||||||
this.msgFile = [];
|
this.msgFile = [];
|
||||||
this.msgText = "";
|
this.msgText = "";
|
||||||
this.$nextTick(_ => {
|
this.$nextTick(_ => {
|
||||||
if (this.dialogId > 0) {
|
|
||||||
this.$store.dispatch("openTask", 0) // 如果当前打开着对话窗口则关闭任务窗口
|
|
||||||
}
|
|
||||||
this.$store.dispatch('openDialog', data.dialog_id).then(_ => {
|
this.$store.dispatch('openDialog', data.dialog_id).then(_ => {
|
||||||
this.$store.state.dialogMsgTransfer = transferData
|
this.$store.state.dialogMsgTransfer = transferData
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
|
ref="modal"
|
||||||
:value="show"
|
:value="show"
|
||||||
:styles="styles"
|
:styles="styles"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
@ -26,6 +27,7 @@ body {
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapState} from "vuex";
|
import {mapGetters, mapState} from "vuex";
|
||||||
import TaskDetail from "./TaskDetail";
|
import TaskDetail from "./TaskDetail";
|
||||||
|
import emitter from "../../../store/events";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TaskModal",
|
name: "TaskModal",
|
||||||
@ -47,6 +49,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
emitter.on('taskModalMoveTop', this.handleMoveTop);
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
emitter.off('taskModalMoveTop', this.handleMoveTop);
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onBeforeClose() {
|
onBeforeClose() {
|
||||||
return new Promise(_ => {
|
return new Promise(_ => {
|
||||||
@ -58,6 +68,9 @@ export default {
|
|||||||
this.$refs.taskDetail.checkUpdate(true);
|
this.$refs.taskDetail.checkUpdate(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleMoveTop() {
|
||||||
|
this.$refs.modal?.handleMoveTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<div v-else class="invite-warp">
|
<div v-else class="invite-warp">
|
||||||
<Card v-if="project.id > 0">
|
<Card v-if="project.id > 0">
|
||||||
<p slot="title">{{project.name}}</p>
|
<p slot="title">{{project.name}}</p>
|
||||||
<div v-if="project.desc" class="invite-desc">{{project.desc}}</div>
|
<div v-if="project.desc" class="invite-desc" :title="$L('项目介绍')">{{project.desc}}</div>
|
||||||
<div v-else>{{$L('暂无介绍')}}</div>
|
<div v-else>{{$L('暂无介绍')}}</div>
|
||||||
<div class="invite-footer">
|
<div class="invite-footer">
|
||||||
<Button v-if="already" type="success" icon="ios-checkmark-circle-outline" @click="goProject">{{$L('已加入')}}</Button>
|
<Button v-if="already" type="success" icon="ios-checkmark-circle-outline" @click="goProject">{{$L('已加入')}}</Button>
|
||||||
@ -47,6 +47,7 @@
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -58,37 +59,24 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['dialogId','windowPortrait']),
|
...mapState(['dialogId', 'windowPortrait']),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route': {
|
'$route': {
|
||||||
handler(route) {
|
handler(route) {
|
||||||
if(route.name == 'manage-project-invite'){
|
if (route.name == 'manage-project-invite') {
|
||||||
// 唤醒app
|
|
||||||
if (!$A.Electron && !$A.isEEUiApp && navigator.userAgent.indexOf("MicroMessenger") === -1){
|
|
||||||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
|
||||||
try {
|
|
||||||
if(/Android/i.test(navigator.userAgent)){
|
|
||||||
window.open("dootask://" + route.fullPath)
|
|
||||||
}else{
|
|
||||||
window.location.href = "dootask://" + route.fullPath
|
|
||||||
}
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 关闭聊天
|
|
||||||
if (this.windowPortrait){
|
|
||||||
this.$store.dispatch("openDialog", 0)
|
|
||||||
}
|
|
||||||
//
|
|
||||||
this.code = route.query ? route.query.code : '';
|
this.code = route.query ? route.query.code : '';
|
||||||
this.getData();
|
this.getData();
|
||||||
|
this.wakeApp();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获取邀请信息
|
||||||
|
*/
|
||||||
getData() {
|
getData() {
|
||||||
this.loadIng++;
|
this.loadIng++;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
@ -106,6 +94,9 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加入项目
|
||||||
|
*/
|
||||||
joinProject() {
|
joinProject() {
|
||||||
this.joinLoad++;
|
this.joinLoad++;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
@ -124,11 +115,33 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转到项目
|
||||||
|
*/
|
||||||
goProject() {
|
goProject() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
$A.goForward({name: 'manage-project', params: {projectId: this.project.id}});
|
$A.goForward({name: 'manage-project', params: {projectId: this.project.id}});
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 唤醒APP
|
||||||
|
*/
|
||||||
|
wakeApp() {
|
||||||
|
if (!$A.Electron && !$A.isEEUiApp && navigator.userAgent.indexOf("MicroMessenger") === -1) {
|
||||||
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||||
|
try {
|
||||||
|
if (/Android/i.test(navigator.userAgent)) {
|
||||||
|
window.open("dootask://" + route.fullPath)
|
||||||
|
} else {
|
||||||
|
window.location.href = "dootask://" + route.fullPath
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
14
resources/assets/js/store/actions.js
vendored
14
resources/assets/js/store/actions.js
vendored
@ -460,18 +460,19 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 显示文件(打开文件所在位置)
|
* 显示文件(打开文件所在位置)
|
||||||
* @param state
|
* @param state
|
||||||
|
* @param getters
|
||||||
* @param dispatch
|
* @param dispatch
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
filePos({state, dispatch}, data) {
|
filePos({state, getters, dispatch}, data) {
|
||||||
if ($A.isSubElectron) {
|
if ($A.isSubElectron) {
|
||||||
$A.syncDispatch("filePos", data)
|
$A.syncDispatch("filePos", data)
|
||||||
$A.Electron.sendMessage('mainWindowActive');
|
$A.Electron.sendMessage('mainWindowActive');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dispatch('openTask', 0)
|
dispatch('openTask', 0)
|
||||||
if (state.windowPortrait) {
|
if (!getters.isMessengerPage || state.windowPortrait) {
|
||||||
// 如果是宽屏则关闭对话窗口
|
// 如果 当前不是消息页面 或 是竖屏 则关闭对话窗口
|
||||||
dispatch("openDialog", 0);
|
dispatch("openDialog", 0);
|
||||||
}
|
}
|
||||||
$A.goForward({name: 'manage-file', params: data});
|
$A.goForward({name: 'manage-file', params: data});
|
||||||
@ -2294,6 +2295,9 @@ export default {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (state.taskId > 0) {
|
||||||
|
emitter.emit('taskModalMoveTop'); // 已打开任务时将任务窗口置顶
|
||||||
|
}
|
||||||
state.taskArchiveView = task_id;
|
state.taskArchiveView = task_id;
|
||||||
state.taskId = task_id;
|
state.taskId = task_id;
|
||||||
if (task_id > 0) {
|
if (task_id > 0) {
|
||||||
@ -3063,6 +3067,10 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
if (state.dialogId) {
|
||||||
|
emitter.emit('dialogModalMoveTop'); // 已打开对话时将对话窗口置顶
|
||||||
|
}
|
||||||
|
//
|
||||||
requestAnimationFrame(_ => {
|
requestAnimationFrame(_ => {
|
||||||
state.dialogSearchMsgId = searchMsgId;
|
state.dialogSearchMsgId = searchMsgId;
|
||||||
state.dialogMsgId = dialogMsgId;
|
state.dialogMsgId = dialogMsgId;
|
||||||
|
|||||||
9
resources/assets/js/store/getters.js
vendored
9
resources/assets/js/store/getters.js
vendored
@ -11,6 +11,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否在消息页面
|
||||||
|
* @param state
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isMessengerPage(state) {
|
||||||
|
return state.routeName === 'manage-messenger'
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前打开的项目
|
* 当前打开的项目
|
||||||
* @param state
|
* @param state
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user