perf: 优化客户端任务详情按command+s保存
This commit is contained in:
parent
0a9f9eea90
commit
1759572b2e
@ -181,11 +181,7 @@
|
||||
newValue = "";
|
||||
}
|
||||
if (!this.isTyping) {
|
||||
if (this.getEditor() !== null) {
|
||||
this.getEditor().setContent(newValue);
|
||||
} else{
|
||||
this.content = newValue;
|
||||
}
|
||||
this.setContent(newValue);
|
||||
}
|
||||
},
|
||||
readOnly(value) {
|
||||
@ -459,6 +455,14 @@
|
||||
return this.getEditor().getContent();
|
||||
},
|
||||
|
||||
setContent(content) {
|
||||
if (this.getEditor() === null) {
|
||||
this.content = content;
|
||||
} else if (content != this.getEditor().getContent()){
|
||||
this.getEditor().setContent(content);
|
||||
}
|
||||
},
|
||||
|
||||
insertImage(src) {
|
||||
this.insertContent('<img src="' + src + '">');
|
||||
},
|
||||
|
@ -153,7 +153,6 @@
|
||||
:option-full="taskOptionFull"
|
||||
:placeholder="$L('详细描述...')"
|
||||
@on-blur="updateData('content')"
|
||||
@editorSave="updateData('content')"
|
||||
inline/>
|
||||
</div>
|
||||
<Form class="items" label-position="left" label-width="auto" @submit.native.prevent>
|
||||
@ -310,7 +309,13 @@
|
||||
<i class="taskfont"></i>{{$L('子任务')}}
|
||||
</div>
|
||||
<ul class="item-content subtask">
|
||||
<TaskDetail v-for="(task, key) in subList" :key="key" :task-id="task.id" :open-task="task" :main-end-at="taskDetail.end_at"/>
|
||||
<TaskDetail
|
||||
v-for="(task, key) in subList"
|
||||
:ref="`subTask_${task.id}`"
|
||||
:key="key"
|
||||
:task-id="task.id"
|
||||
:open-task="task"
|
||||
:main-end-at="taskDetail.end_at"/>
|
||||
</ul>
|
||||
<ul :class="['item-content', subList.length === 0 ? 'nosub' : '']">
|
||||
<li>
|
||||
@ -748,12 +753,7 @@ export default {
|
||||
},
|
||||
|
||||
onNameKeydown(e) {
|
||||
if (e.keyCode === 83) {
|
||||
if (e.metaKey || e.ctrlKey) {
|
||||
e.preventDefault();
|
||||
this.updateData('name');
|
||||
}
|
||||
} else if (e.keyCode === 13) {
|
||||
if (e.keyCode === 13) {
|
||||
if (!e.shiftKey) {
|
||||
e.preventDefault();
|
||||
this.updateData('name');
|
||||
@ -761,6 +761,40 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
checkUpdate(update) {
|
||||
let isModify = false;
|
||||
if (this.openTask.name != this.taskDetail.name) {
|
||||
isModify = true;
|
||||
if (update) {
|
||||
this.updateData('name');
|
||||
} else if (isModify) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (this.$refs.desc && this.$refs.desc.getContent() != this.taskContent) {
|
||||
isModify = true;
|
||||
if (update) {
|
||||
this.updateData('content');
|
||||
} else if (isModify) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (this.addsubShow && this.addsubName) {
|
||||
isModify = true;
|
||||
if (update) {
|
||||
this.onAddsub();
|
||||
} else if (isModify) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
this.subList.some(({id}) => {
|
||||
if (this.$refs[`subTask_${id}`][0].checkUpdate(update)) {
|
||||
isModify = true;
|
||||
}
|
||||
})
|
||||
return isModify;
|
||||
},
|
||||
|
||||
updateData(action, params) {
|
||||
switch (action) {
|
||||
case 'priority':
|
||||
|
Loading…
x
Reference in New Issue
Block a user