mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-18 13:28:12 +00:00
perf: 任务详情点任务聊天时不要发送消息
This commit is contained in:
parent
841ed4e682
commit
52faf7884b
@ -1644,7 +1644,7 @@ export default {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (this.taskDetail.dialog_id) {
|
if (this.taskDetail.dialog_id) {
|
||||||
this.openDialogBefore(this.taskDetail.dialog_id, msgText)
|
this.openDialogBefore(this.taskDetail.dialog_id, msgText, onlyOpen)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -1662,7 +1662,7 @@ export default {
|
|||||||
}).then(async ({data}) => {
|
}).then(async ({data}) => {
|
||||||
await this.$store.dispatch("saveTask", {id: data.id, dialog_id: data.dialog_id});
|
await this.$store.dispatch("saveTask", {id: data.id, dialog_id: data.dialog_id});
|
||||||
await this.$store.dispatch("saveDialog", data.dialog_data);
|
await this.$store.dispatch("saveDialog", data.dialog_data);
|
||||||
await this.openDialogBefore(data.dialog_id, msgText)
|
await this.openDialogBefore(data.dialog_id, msgText, onlyOpen)
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
@ -1674,7 +1674,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async openDialogBefore(dialogId, msgText) {
|
async openDialogBefore(dialogId, msgText, onlyOpen) {
|
||||||
if ($A.isSubElectron) {
|
if ($A.isSubElectron) {
|
||||||
await this.resizeDialog()
|
await this.resizeDialog()
|
||||||
this.sendDialogMsg(msgText);
|
this.sendDialogMsg(msgText);
|
||||||
@ -1683,19 +1683,22 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.windowPortrait) {
|
if (this.windowPortrait) {
|
||||||
$A.onBlur();
|
$A.onBlur();
|
||||||
const transferData = {
|
const openSuccess = () => {
|
||||||
time: $A.dayjs().unix() + 10,
|
const transferData = {
|
||||||
msgRecord: this.msgRecord,
|
time: $A.dayjs().unix() + 10,
|
||||||
msgFile: this.msgFile,
|
msgRecord: this.msgRecord,
|
||||||
msgText: typeof msgText === 'string' && msgText ? msgText : this.msgText,
|
msgFile: this.msgFile,
|
||||||
dialogId,
|
msgText: typeof msgText === 'string' && msgText ? msgText : this.msgText,
|
||||||
};
|
dialogId,
|
||||||
this.msgRecord = {};
|
};
|
||||||
this.msgFile = [];
|
this.msgRecord = {};
|
||||||
this.msgText = "";
|
this.msgFile = [];
|
||||||
|
this.msgText = "";
|
||||||
|
this.$store.state.dialogMsgTransfer = transferData
|
||||||
|
}
|
||||||
this.$nextTick(_ => {
|
this.$nextTick(_ => {
|
||||||
this.$store.dispatch('openDialog', dialogId).then(_ => {
|
this.$store.dispatch('openDialog', dialogId).then(_ => {
|
||||||
this.$store.state.dialogMsgTransfer = transferData
|
!onlyOpen && openSuccess()
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user