no message

This commit is contained in:
kuaifan 2022-06-27 13:31:17 +08:00
parent 5bb80b5f50
commit 17ce620abf
5 changed files with 32 additions and 19 deletions

View File

@ -781,14 +781,11 @@ class ProjectTask extends AbstractModel
// 更新任务时间也要更新重复周期
$this->refreshLoop();
}
$oldLoop = Carbon::parse($loopAt);
$newLoop = Carbon::parse($this->loop_at);
if ($oldLoop->ne($newLoop)) {
$this->addLog("修改{任务}下一个周期", [
'change' => [
$loopAt ? $oldLoop->toDateTimeString() : null,
$this->loop_at ? $newLoop->toDateTimeString() : null,
]
$oldLoop = $loopAt ? Carbon::parse($loopAt)->toDateTimeString() : null;
$newLoop = $this->loop_at ? Carbon::parse($this->loop_at)->toDateTimeString() : null;
if ($oldLoop != $newLoop) {
$this->addLog("修改{任务}下个周期", [
'change' => [$oldLoop, $newLoop]
]);
}
if ($loopDesc != $this->loopDesc()) {

View File

@ -61,7 +61,7 @@ class LoopTask extends AbstractTask
if ($task->start_at) {
$diffSecond = Carbon::parse($task->start_at)->diffInSeconds(Carbon::parse($task->end_at), true);
$task->start_at = Carbon::parse($task->loop_at);
$task->end_at = $task->start_at->addSeconds($diffSecond);
$task->end_at = $task->start_at->clone()->addSeconds($diffSecond);
}
$task->refreshLoop(true);
$task->addLog("创建任务来自周期任务ID" . $item->id, [], $task->userid);

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
ad35f0f8f397a654
f252c016b432380a

View File

@ -1114,8 +1114,10 @@ export default {
increaseTaskMsgNum({state}, dialog_id) {
$A.execMainDispatch("increaseTaskMsgNum", dialog_id)
//
const task = state.cacheTasks.find(task => task.dialog_id === dialog_id);
if (task) task.msg_num++;
if (dialog_id) {
const task = state.cacheTasks.find(task => task.dialog_id === dialog_id);
if (task) task.msg_num++;
}
},
/**
@ -1129,10 +1131,22 @@ export default {
//
if (reply_id > 0) {
const msg = state.dialogMsgs.find(({id}) => id == reply_id)
if (msg) {
msg.reply_num++
dispatch("saveDialogMsg", msg)
}
if (msg) msg.reply_num++;
}
},
/**
* 减少回复数量
* @param state
* @param dispatch
* @param reply_id
*/
decrementMsgReplyNum({state, dispatch}, reply_id) {
$A.execMainDispatch("decrementMsgReplyNum", reply_id)
//
if (reply_id > 0) {
const msg = state.dialogMsgs.find(({id}) => id == reply_id)
if (msg) msg.reply_num--;
}
},
@ -2146,15 +2160,17 @@ export default {
/**
* 忘记消息数据
* @param state
* @param dispatch
* @param msg_id
*/
forgetDialogMsg({state}, msg_id) {
forgetDialogMsg({state, dispatch}, msg_id) {
$A.execMainDispatch("forgetDialogMsg", msg_id)
//
let ids = $A.isArray(msg_id) ? msg_id : [msg_id];
const ids = $A.isArray(msg_id) ? msg_id : [msg_id];
ids.some(id => {
const index = state.dialogMsgs.findIndex(item => item.id == id);
if (index > -1) {
dispatch("decrementMsgReplyNum", state.dialogMsgs[index].reply_id);
Store.set('audioSubscribe', id);
state.dialogMsgs.splice(index, 1);
}