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