mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 13:22:49 +00:00
perf: 优化关闭任务独立窗口点击取消后没有自动获取焦点
This commit is contained in:
parent
e754ceace8
commit
22704b32d6
@ -15,6 +15,7 @@
|
||||
<div class="subtask-name">
|
||||
<Input
|
||||
v-model="taskDetail.name"
|
||||
ref="name"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
@ -137,6 +138,7 @@
|
||||
<div class="title">
|
||||
<Input
|
||||
v-model="taskDetail.name"
|
||||
ref="name"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
@ -767,34 +769,37 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
checkUpdate(update) {
|
||||
checkUpdate(action) {
|
||||
let isModify = false;
|
||||
if (this.openTask.name != this.taskDetail.name) {
|
||||
isModify = true;
|
||||
if (update) {
|
||||
if (action === true) {
|
||||
this.updateData('name');
|
||||
} else if (isModify) {
|
||||
} else {
|
||||
action === false && this.$refs.name.focus();
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (this.$refs.desc && this.$refs.desc.getContent() != this.taskContent) {
|
||||
isModify = true;
|
||||
if (update) {
|
||||
if (action === true) {
|
||||
this.updateData('content');
|
||||
} else if (isModify) {
|
||||
} else {
|
||||
action === false && this.$refs.desc.focus();
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (this.addsubShow && this.addsubName) {
|
||||
isModify = true;
|
||||
if (update) {
|
||||
if (action === true) {
|
||||
this.onAddsub();
|
||||
} else if (isModify) {
|
||||
} else {
|
||||
action === false && this.$refs.addsub.focus();
|
||||
return true
|
||||
}
|
||||
}
|
||||
this.subList.some(({id}) => {
|
||||
if (this.$refs[`subTask_${id}`][0].checkUpdate(update)) {
|
||||
if (this.$refs[`subTask_${id}`][0].checkUpdate(action)) {
|
||||
isModify = true;
|
||||
}
|
||||
})
|
||||
|
||||
@ -65,6 +65,7 @@ export default {
|
||||
this.$Electron.sendMessage('windowDestroy');
|
||||
},
|
||||
onCancel: () => {
|
||||
this.$refs.taskDetail.checkUpdate(false);
|
||||
this.canUpdateBlur = true;
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user