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: {
handler() {
this.autoBottom = true;
this.msgNew = 0;
this.topId = -1;
this.getMsg();
handler(id) {
if (id) {
this.autoBottom = true;
this.msgNew = 0;
this.topId = -1;
this.$store.dispatch("getDialogMsgs", id);
}
},
immediate: true
}
},
methods: {
getMsg() {
if (!this.dialogId) {
return;
}
this.$store.dispatch("getDialogMsgs", this.dialogId);
},
sendMsg(text) {
if (typeof text === "string" && text) {
this.msgText = text;

View File

@ -345,7 +345,7 @@
</div>
<div class="task-dialog" :style="dialogStyle">
<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">
<Icon class="icon" type="ios-chatbubbles-outline" />
<div class="nav">
@ -1083,6 +1083,7 @@ export default {
},
}).then(({data}) => {
this.$store.dispatch("saveTask", data);
this.$store.dispatch("getDialogOne", data.dialog_id);
this.$nextTick(() => {
this.$refs.dialog.sendMsg(this.msgText);
this.msgText = "";

View File

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