From 66961197f6865622e341cd520c40d51db345becb Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 9 Jun 2022 11:44:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E6=98=AF=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=B4=9F=E8=B4=A3=E4=BA=BA=E4=B8=8D=E8=83=BD=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E5=B0=8F=E7=AA=97=E5=8F=A3=E5=8F=91=E9=80=81=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/ProjectController.php | 4 +- .../js/pages/manage/components/TaskDetail.vue | 68 +++++++++---------- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php index b8de12324..1399edd93 100755 --- a/app/Http/Controllers/Api/ProjectController.php +++ b/app/Http/Controllers/Api/ProjectController.php @@ -1504,7 +1504,7 @@ class ProjectController extends AbstractController */ public function task__dialog() { - User::auth(); + $user = User::auth(); // $task_id = intval(Request::input('task_id')); // @@ -1529,9 +1529,11 @@ class ProjectController extends AbstractController }); // $task->pushMsg('dialog'); + $dialogData = WebSocketDialog::find($task->dialog_id)?->formatData($user->userid); return Base::retSuccess('success', [ 'id' => $task->id, 'dialog_id' => $task->dialog_id, + 'dialog_data' => $dialogData, ]); } diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index 2417d141b..82016c905 100644 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -1103,43 +1103,43 @@ export default { task_id: this.taskDetail.id, }, }).then(({data}) => { - this.$store.dispatch("saveTask", data); - this.$store.dispatch("getDialogOne", data.dialog_id).then(() => { - if ($A.isSubElectron) { - this.resizeDialog().then(() => { - this.sendDialogMsg(); - }); - } else { - this.$nextTick(() => { - if (this.windowSmall) { - $A.onBlur(); - this.$store.state.dialogMsgTransfer = { - time: $A.Time() + 10, - msgRecord: this.msgRecord, - msgFile: this.msgFile, - msgText: typeof msgText === 'string' && msgText ? msgText : this.msgText, - }; - this.msgRecord = {}; - this.msgFile = []; - this.msgText = ""; - if (this.dialogId > 0) { - // 如果当前打开着对话窗口则关闭任务窗口 - this.$store.dispatch("openTask", 0); - } - this.$store.dispatch('openDialog', data.dialog_id) - } else { - this.sendDialogMsg(); - } - }); - } - }).catch(({msg}) => { - $A.modalError(msg); - }).finally(_ => { - this.sendLoad--; + this.$store.dispatch("saveTask", { + id: data.id, + dialog_id: data.dialog_id, }); + this.$store.dispatch("saveDialog", data.dialog_data); + // + if ($A.isSubElectron) { + this.resizeDialog().then(() => { + this.sendDialogMsg(); + }); + } else { + this.$nextTick(() => { + if (this.windowSmall) { + $A.onBlur(); + this.$store.state.dialogMsgTransfer = { + time: $A.Time() + 10, + msgRecord: this.msgRecord, + msgFile: this.msgFile, + msgText: typeof msgText === 'string' && msgText ? msgText : this.msgText, + }; + this.msgRecord = {}; + this.msgFile = []; + this.msgText = ""; + if (this.dialogId > 0) { + // 如果当前打开着对话窗口则关闭任务窗口 + this.$store.dispatch("openTask", 0); + } + this.$store.dispatch('openDialog', data.dialog_id) + } else { + this.sendDialogMsg(); + } + }); + } }).catch(({msg}) => { - this.sendLoad--; $A.modalError(msg); + }).finally(_ => { + this.sendLoad--; }); },