mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-27 13:08:13 +00:00
no message
This commit is contained in:
parent
b5041b92d0
commit
e761820df1
@ -225,19 +225,13 @@ export default {
|
||||
},
|
||||
}).then(({data}) => {
|
||||
this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId)
|
||||
this.$store.dispatch("saveDialog", {
|
||||
id: this.dialogId,
|
||||
last_msg: data,
|
||||
last_at: $A.formatDate("Y-m-d H:i:s")
|
||||
});
|
||||
this.$store.dispatch("saveDialogMsg", data);
|
||||
this.sendSuccess(data);
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId)
|
||||
});
|
||||
//
|
||||
this.msgText = '';
|
||||
this.$store.dispatch("dialogMoveTop", this.dialogId);
|
||||
},
|
||||
|
||||
chatKeydown(e) {
|
||||
@ -300,7 +294,6 @@ export default {
|
||||
msg: { },
|
||||
});
|
||||
this.autoBottom = true;
|
||||
this.$store.dispatch("dialogMoveTop", this.dialogId);
|
||||
this.onActive();
|
||||
break;
|
||||
|
||||
@ -310,11 +303,22 @@ export default {
|
||||
|
||||
case 'success':
|
||||
this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId)
|
||||
this.$store.dispatch("saveDialogMsg", file.data);
|
||||
this.sendSuccess(file.data)
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
sendSuccess(data) {
|
||||
this.$store.dispatch("saveDialog", {
|
||||
id: this.dialogId,
|
||||
last_msg: data,
|
||||
last_at: $A.formatDate("Y-m-d H:i:s")
|
||||
});
|
||||
this.$store.dispatch("saveDialogMsg", data);
|
||||
this.$store.dispatch("dialogMoveTop", this.dialogId);
|
||||
this.$store.dispatch("increaseTaskMsgNum", this.dialogId);
|
||||
},
|
||||
|
||||
chatScroll(res) {
|
||||
switch (res.directionreal) {
|
||||
case 'up':
|
||||
|
||||
13
resources/assets/js/store/actions.js
vendored
13
resources/assets/js/store/actions.js
vendored
@ -598,6 +598,16 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 增加任务消息数量
|
||||
* @param state
|
||||
* @param dialog_id
|
||||
*/
|
||||
increaseTaskMsgNum({state}, dialog_id) {
|
||||
const task = state.tasks.find((task) => task.dialog_id === dialog_id);
|
||||
if (task) task.msg_num++;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取任务
|
||||
* @param state
|
||||
@ -1284,8 +1294,7 @@ export default {
|
||||
dispatch("dialogMoveTop", dialog_id);
|
||||
}
|
||||
// 新增任务消息数量
|
||||
const task = state.tasks.find(({dialog_id}) => dialog_id === dialog_id);
|
||||
if (task) task.msg_num++;
|
||||
dispatch("increaseTaskMsgNum", dialog_id);
|
||||
}
|
||||
})(msgDetail);
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user