mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-20 07:20:37 +00:00
no message
This commit is contained in:
parent
17dc434350
commit
91c62ee55e
@ -212,8 +212,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
openDialog() {
|
openDialog() {
|
||||||
this.goForward({name: 'manage-messenger'});
|
this.$store.dispatch("openDialogUserid", this.userid).then(({data}) => {
|
||||||
this.$store.dispatch("openDialogUserid", this.userid).catch(() => {})
|
this.goForward({name: 'manage-messenger', params: {id: data.id}});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -485,7 +485,6 @@ export default {
|
|||||||
'taskId',
|
'taskId',
|
||||||
'wsOpenNum',
|
'wsOpenNum',
|
||||||
'columnTemplate',
|
'columnTemplate',
|
||||||
'dialogOpenId',
|
|
||||||
|
|
||||||
'themeMode',
|
'themeMode',
|
||||||
'themeList',
|
'themeList',
|
||||||
@ -713,8 +712,11 @@ export default {
|
|||||||
|
|
||||||
toggleRoute(path) {
|
toggleRoute(path) {
|
||||||
this.show768Menu = false;
|
this.show768Menu = false;
|
||||||
if (path === 'file' && $A.getStorageInt("filePid") > 0) {
|
if (path === 'file' && $A.getStorageInt("file::pid") > 0) {
|
||||||
path += `/${$A.getStorageInt("filePid")}`
|
path += `/${$A.getStorageInt("file::pid")}`
|
||||||
|
}
|
||||||
|
if (path === 'messenger' && $A.getStorageInt("messenger::dialogId") > 0) {
|
||||||
|
path += `/${$A.getStorageInt("messenger::dialogId")}`
|
||||||
}
|
}
|
||||||
this.goForward({path: '/manage/' + path});
|
this.goForward({path: '/manage/' + path});
|
||||||
},
|
},
|
||||||
@ -874,7 +876,7 @@ export default {
|
|||||||
if (!this.natificationReady) {
|
if (!this.natificationReady) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.natificationHidden && this.routePath == "/manage/messenger" && this.dialogOpenId == data.dialog_id) {
|
if (!this.natificationHidden && $A.leftExists(this.routePath, "/manage/messenger") && this.$route.params.id == data.dialog_id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -1003,10 +1005,10 @@ export default {
|
|||||||
if (!$A.isJson(data)) {
|
if (!$A.isJson(data)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.goForward({name: 'manage-messenger'});
|
|
||||||
if (data.dialog_id) {
|
if (data.dialog_id) {
|
||||||
$A.setStorage("messenger::dialogId", data.dialog_id)
|
this.goForward({name: 'manage-messenger', params: {id: data.dialog_id}});
|
||||||
this.$store.state.dialogOpenId = data.dialog_id;
|
} else {
|
||||||
|
this.goForward({name: 'manage-messenger'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -181,9 +181,7 @@ export default {
|
|||||||
if (num <= 1) return
|
if (num <= 1) return
|
||||||
this.wsOpenTimeout && clearTimeout(this.wsOpenTimeout)
|
this.wsOpenTimeout && clearTimeout(this.wsOpenTimeout)
|
||||||
this.wsOpenTimeout = setTimeout(() => {
|
this.wsOpenTimeout = setTimeout(() => {
|
||||||
if (this.$route.name == 'manage-calendar') {
|
this.$route.name == 'manage-calendar' && this.setRenderRange();
|
||||||
this.setRenderRange();
|
|
||||||
}
|
|
||||||
}, 5000)
|
}, 5000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -270,7 +270,7 @@ export default {
|
|||||||
|
|
||||||
wsOpenNum(num) {
|
wsOpenNum(num) {
|
||||||
if (num <= 1) return
|
if (num <= 1) return
|
||||||
this.$store.dispatch("getDialogMsgs", this.dialogId);
|
this.$store.dispatch("getDialogMsgs", this.dialogId).catch(_ => {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1104,9 +1104,7 @@ export default {
|
|||||||
};
|
};
|
||||||
this.msgFile = [];
|
this.msgFile = [];
|
||||||
this.msgText = "";
|
this.msgText = "";
|
||||||
this.goForward({name: 'manage-messenger', query: {_: $A.randomString(6)}});
|
this.goForward({name: 'manage-messenger', params: {id: data.dialog_id}});
|
||||||
$A.setStorage("messenger::dialogId", data.dialog_id)
|
|
||||||
this.$store.state.dialogOpenId = data.dialog_id;
|
|
||||||
this.$store.dispatch('openTask', 0);
|
this.$store.dispatch('openTask', 0);
|
||||||
} else {
|
} else {
|
||||||
this.sendDialogMsg();
|
this.sendDialogMsg();
|
||||||
|
|||||||
@ -513,19 +513,13 @@ export default {
|
|||||||
...mapState(['userId', 'userToken', 'userIsAdmin', 'userInfo', 'files', 'wsOpenNum']),
|
...mapState(['userId', 'userToken', 'userIsAdmin', 'userInfo', 'files', 'wsOpenNum']),
|
||||||
|
|
||||||
pid() {
|
pid() {
|
||||||
let {pid} = this.$route.params;
|
const {pid} = this.$route.params;
|
||||||
if (!/^\d+$/.test(pid)) {
|
return parseInt(this.$route.name === 'manage-file' && /^\d+$/.test(pid) ? pid : 0);
|
||||||
pid = 0
|
|
||||||
}
|
|
||||||
return parseInt(pid);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fid() {
|
fid() {
|
||||||
let {fid} = this.$route.params;
|
const {fid} = this.$route.params;
|
||||||
if (!/^\d+$/.test(fid)) {
|
return parseInt(this.$route.name === 'manage-file' && /^\d+$/.test(fid) ? fid : 0);
|
||||||
fid = 0
|
|
||||||
}
|
|
||||||
return parseInt(fid);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
actionUrl() {
|
actionUrl() {
|
||||||
@ -850,7 +844,7 @@ export default {
|
|||||||
this.$store.dispatch("getFiles", this.pid).then(() => {
|
this.$store.dispatch("getFiles", this.pid).then(() => {
|
||||||
this.loadIng--;
|
this.loadIng--;
|
||||||
this.openFileJudge()
|
this.openFileJudge()
|
||||||
$A.setStorage("filePid", this.pid)
|
$A.setStorage("file::pid", this.pid)
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
this.loadIng--;
|
this.loadIng--;
|
||||||
$A.modalError({
|
$A.modalError({
|
||||||
@ -920,6 +914,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
openFileJudge() {
|
openFileJudge() {
|
||||||
|
if (this.$route.name !== 'manage-file') {
|
||||||
|
this.fileShow = false;
|
||||||
|
this.imageShow = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.fid <= 0) {
|
if (this.fid <= 0) {
|
||||||
this.fileShow = false;
|
this.fileShow = false;
|
||||||
this.imageShow = false;
|
this.imageShow = false;
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
operate: dialog.id == topOperateItem.id && topOperateVisible,
|
operate: dialog.id == topOperateItem.id && topOperateVisible,
|
||||||
completed: $A.dialogCompleted(dialog)
|
completed: $A.dialogCompleted(dialog)
|
||||||
}"
|
}"
|
||||||
@click="openDialog(dialog, true)"
|
@click="openDialog(dialog.id)"
|
||||||
@contextmenu.prevent.stop="handleRightClick($event, dialog)">
|
@contextmenu.prevent.stop="handleRightClick($event, dialog)">
|
||||||
<template v-if="dialog.type=='group'">
|
<template v-if="dialog.type=='group'">
|
||||||
<i v-if="dialog.group_type=='project'" class="taskfont icon-avatar project"></i>
|
<i v-if="dialog.group_type=='project'" class="taskfont icon-avatar project"></i>
|
||||||
@ -113,7 +113,7 @@
|
|||||||
<div class="msg-dialog-bg-text">{{$L('选择一个会话开始聊天')}}</div>
|
<div class="msg-dialog-bg-text">{{$L('选择一个会话开始聊天')}}</div>
|
||||||
</div>
|
</div>
|
||||||
<DialogWrapper v-if="dialogId > 0" :dialogId="dialogId" @on-active="scrollIntoActive">
|
<DialogWrapper v-if="dialogId > 0" :dialogId="dialogId" @on-active="scrollIntoActive">
|
||||||
<div slot="inputBefore" class="dialog-back" @click="closeDialog">
|
<div slot="inputBefore" class="dialog-back" @click="openDialog(0)">
|
||||||
<Icon type="md-arrow-back" />
|
<Icon type="md-arrow-back" />
|
||||||
</div>
|
</div>
|
||||||
</DialogWrapper>
|
</DialogWrapper>
|
||||||
@ -141,7 +141,6 @@ export default {
|
|||||||
],
|
],
|
||||||
dialogActive: '',
|
dialogActive: '',
|
||||||
dialogKey: '',
|
dialogKey: '',
|
||||||
dialogId: 0,
|
|
||||||
|
|
||||||
contactsKey: '',
|
contactsKey: '',
|
||||||
contactsLoad: 0,
|
contactsLoad: 0,
|
||||||
@ -156,12 +155,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
activated() {
|
|
||||||
this.openDialogStorage();
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userId', 'cacheDialogs', 'dialogOpenId']),
|
...mapState(['userId', 'cacheDialogs']),
|
||||||
|
|
||||||
|
dialogId() {
|
||||||
|
const {id} = this.$route.params;
|
||||||
|
return parseInt(this.$route.name == 'manage-messenger' && /^\d+$/.test(id) ? id : 0);
|
||||||
|
},
|
||||||
|
|
||||||
dialogList() {
|
dialogList() {
|
||||||
const {dialogActive, dialogKey} = this;
|
const {dialogActive, dialogKey} = this;
|
||||||
@ -253,11 +253,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
dialogId(id) {
|
dialogId(id) {
|
||||||
$A.setStorage("messenger::dialogId", id);
|
this.$route.name == 'manage-messenger' && $A.setStorage("messenger::dialogId", id);
|
||||||
this.$store.state.dialogOpenId = id;
|
|
||||||
},
|
|
||||||
dialogOpenId(id) {
|
|
||||||
if (id > 0) this.dialogId = id;
|
|
||||||
},
|
},
|
||||||
contactsKey(val) {
|
contactsKey(val) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -299,27 +295,18 @@ export default {
|
|||||||
this.dialogActive = type
|
this.dialogActive = type
|
||||||
},
|
},
|
||||||
|
|
||||||
closeDialog() {
|
openDialog(id) {
|
||||||
this.dialogId = 0;
|
if (id > 0) {
|
||||||
},
|
this.goForward({name: 'manage-messenger', params: {id}});
|
||||||
|
} else {
|
||||||
openDialog(dialog, smooth) {
|
this.goForward({name: 'manage-messenger'});
|
||||||
this.dialogId = dialog.id;
|
|
||||||
this.scrollIntoActive(smooth);
|
|
||||||
},
|
|
||||||
|
|
||||||
openDialogStorage() {
|
|
||||||
this.dialogId = $A.getStorageInt("messenger::dialogId")
|
|
||||||
if (this.dialogId > 0) {
|
|
||||||
const dialog = this.cacheDialogs.find(({id}) => id === this.dialogId);
|
|
||||||
dialog && this.openDialog(dialog, false);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
openContacts(user) {
|
openContacts(user) {
|
||||||
this.tabActive = 'dialog';
|
this.tabActive = 'dialog';
|
||||||
this.$store.dispatch("openDialogUserid", user.userid).then(() => {
|
this.$store.dispatch("openDialogUserid", user.userid).then(({data}) => {
|
||||||
this.scrollIntoActive()
|
this.goForward({name: 'manage-messenger', params: {id: data.id}});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -11,15 +11,6 @@ import ProjectList from "./components/ProjectList";
|
|||||||
import ProjectDialog from "./components/ProjectDialog";
|
import ProjectDialog from "./components/ProjectDialog";
|
||||||
export default {
|
export default {
|
||||||
components: {ProjectDialog, ProjectList},
|
components: {ProjectDialog, ProjectList},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
project_id: 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.project_id = $A.runNum(this.$route.params.id);
|
|
||||||
},
|
|
||||||
|
|
||||||
deactivated() {
|
deactivated() {
|
||||||
this.$store.dispatch("forgetTaskCompleteTemp", true);
|
this.$store.dispatch("forgetTaskCompleteTemp", true);
|
||||||
@ -28,37 +19,38 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState(['cacheProjects', 'wsOpenNum']),
|
...mapState(['cacheProjects', 'wsOpenNum']),
|
||||||
...mapGetters(['projectParameter']),
|
...mapGetters(['projectParameter']),
|
||||||
|
|
||||||
|
projectId() {
|
||||||
|
const {id} = this.$route.params;
|
||||||
|
return parseInt(this.$route.name == 'manage-project' && /^\d+$/.test(id) ? id : 0);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'$route' ({params}) {
|
projectId: {
|
||||||
this.project_id = $A.runNum(params.id);
|
handler() {
|
||||||
},
|
|
||||||
|
|
||||||
project_id() {
|
|
||||||
this.getProjectData();
|
this.getProjectData();
|
||||||
},
|
},
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
|
|
||||||
wsOpenNum(num) {
|
wsOpenNum(num) {
|
||||||
if (num <= 1) return
|
if (num <= 1) return
|
||||||
this.wsOpenTimeout && clearTimeout(this.wsOpenTimeout)
|
this.wsOpenTimeout && clearTimeout(this.wsOpenTimeout)
|
||||||
this.wsOpenTimeout = setTimeout(() => {
|
this.wsOpenTimeout = setTimeout(() => {
|
||||||
if (this.$route.name == 'manage-project') {
|
this.$route.name == 'manage-project' && this.getProjectData();
|
||||||
this.getProjectData();
|
|
||||||
}
|
|
||||||
}, 5000)
|
}, 5000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getProjectData() {
|
getProjectData() {
|
||||||
let id = this.project_id;
|
if (this.projectId <= 0) return;
|
||||||
if (id <= 0) return;
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$store.state.projectId = $A.runNum(id);
|
this.$store.state.projectId = $A.runNum(this.projectId);
|
||||||
this.$store.dispatch("getProjectOne", id).then(() => {
|
this.$store.dispatch("getProjectOne", this.projectId).then(() => {
|
||||||
this.$store.dispatch("getColumns", id).catch(() => {});
|
this.$store.dispatch("getColumns", this.projectId).catch(() => {});
|
||||||
this.$store.dispatch("getTaskForProject", id).catch(() => {})
|
this.$store.dispatch("getTaskForProject", this.projectId).catch(() => {})
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalWarning({
|
$A.modalWarning({
|
||||||
content: msg,
|
content: msg,
|
||||||
|
|||||||
2
resources/assets/js/routes.js
vendored
2
resources/assets/js/routes.js
vendored
@ -24,7 +24,7 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'manage-messenger',
|
name: 'manage-messenger',
|
||||||
path: 'messenger',
|
path: 'messenger/:id?',
|
||||||
component: () => import('./pages/manage/messenger.vue'),
|
component: () => import('./pages/manage/messenger.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
3
resources/assets/js/store/actions.js
vendored
3
resources/assets/js/store/actions.js
vendored
@ -1933,7 +1933,6 @@ export default {
|
|||||||
reject({msg: 'Parameter error'});
|
reject({msg: 'Parameter error'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.dialogOpenId = 0; // 先重置dialogOpenId,否者无法重复打开相同对话
|
|
||||||
dispatch("call", {
|
dispatch("call", {
|
||||||
url: 'dialog/open/user',
|
url: 'dialog/open/user',
|
||||||
data: {
|
data: {
|
||||||
@ -1941,8 +1940,6 @@ export default {
|
|||||||
},
|
},
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
dispatch("saveDialog", result.data);
|
dispatch("saveDialog", result.data);
|
||||||
$A.setStorage("messenger::dialogId", result.data.id);
|
|
||||||
state.dialogOpenId = result.data.id;
|
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
|
|||||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -58,7 +58,6 @@ const stateData = {
|
|||||||
|
|
||||||
// 会话聊天
|
// 会话聊天
|
||||||
dialogMsgs: [],
|
dialogMsgs: [],
|
||||||
dialogOpenId: 0,
|
|
||||||
|
|
||||||
// 文件
|
// 文件
|
||||||
files: [],
|
files: [],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user