Commit 503effd0 authored by liujiangnan's avatar liujiangnan

fix: 表单保存问题

parent 0a8f1cc1
......@@ -13,7 +13,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
saveKey = 'ww_vocabulary';
// 储存对象
item;
originContent;
constructor(private appRef: ApplicationRef,
......@@ -65,31 +64,22 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (temp) {
this.item.contentObj.vocabulary = this.item.contentObj.vocabulary.trim();
}
if (temp !== this.originContent.vocabulary) {
this.originContent.vocabulary = temp;
this.save();
}
}
updatePartOfSpeech() {
const temp = this.item.contentObj.vocabularyType ? this.item.contentObj.vocabularyType.trim() : '';
if (temp) {
this.item.contentObj.vocabularyType = this.item.contentObj.vocabularyType.trim();
}
if (temp !== this.originContent.vocabularyType) {
this.originContent.vocabularyType = temp;
this.save();
}
}
updateDefinition() {
const temp = this.item.contentObj.definition ? this.item.contentObj.definition.trim() : '';
if (temp) {
this.item.contentObj.definition = this.item.contentObj.definition.trim();
}
if (temp !== this.originContent.definition) {
this.originContent.definition = temp;
this.save();
}
}
onVocabularyAudioUploadSuccess(e) {
this.item.contentObj.vocabulary_audio = e.url;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment