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