no message

This commit is contained in:
kuaifan 2021-06-24 16:04:03 +08:00
parent 6db6528be1
commit 3aa90f7006
3 changed files with 12 additions and 13 deletions

View File

@ -162,24 +162,19 @@ export default {
}, },
dialogId: { dialogId: {
handler() { handler(id) {
this.autoBottom = true; if (id) {
this.msgNew = 0; this.autoBottom = true;
this.topId = -1; this.msgNew = 0;
this.getMsg(); this.topId = -1;
this.$store.dispatch("getDialogMsgs", id);
}
}, },
immediate: true immediate: true
} }
}, },
methods: { methods: {
getMsg() {
if (!this.dialogId) {
return;
}
this.$store.dispatch("getDialogMsgs", this.dialogId);
},
sendMsg(text) { sendMsg(text) {
if (typeof text === "string" && text) { if (typeof text === "string" && text) {
this.msgText = text; this.msgText = text;

View File

@ -345,7 +345,7 @@
</div> </div>
<div class="task-dialog" :style="dialogStyle"> <div class="task-dialog" :style="dialogStyle">
<template v-if="taskDetail.dialog_id > 0"> <template v-if="taskDetail.dialog_id > 0">
<DialogWrapper ref="dialog" :dialog-id="taskDetail.dialog_id"> <DialogWrapper v-if="taskId > 0" ref="dialog" :dialog-id="taskDetail.dialog_id">
<div slot="head" class="head"> <div slot="head" class="head">
<Icon class="icon" type="ios-chatbubbles-outline" /> <Icon class="icon" type="ios-chatbubbles-outline" />
<div class="nav"> <div class="nav">
@ -1083,6 +1083,7 @@ export default {
}, },
}).then(({data}) => { }).then(({data}) => {
this.$store.dispatch("saveTask", data); this.$store.dispatch("saveTask", data);
this.$store.dispatch("getDialogOne", data.dialog_id);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dialog.sendMsg(this.msgText); this.$refs.dialog.sendMsg(this.msgText);
this.msgText = ""; this.msgText = "";

View File

@ -1454,8 +1454,11 @@ export default {
dispatch("addTaskSuccess", data) dispatch("addTaskSuccess", data)
break; break;
case 'update': case 'update':
dispatch("saveTask", data)
break;
case 'dialog': case 'dialog':
dispatch("saveTask", data) dispatch("saveTask", data)
dispatch("getDialogOne", data.dialog_id)
break; break;
case 'upload': case 'upload':
dispatch("getTaskFiles", data.task_id) dispatch("getTaskFiles", data.task_id)