Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
ww_vocabulary
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
ww_vocabulary
Commits
503effd0
Commit
503effd0
authored
May 10, 2021
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 表单保存问题
parent
0a8f1cc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
form.component.ts
src/app/form/form.component.ts
+5
-15
No files found.
src/app/form/form.component.ts
View file @
503effd0
...
...
@@ -13,7 +13,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
saveKey
=
'
ww_vocabulary
'
;
// 储存对象
item
;
originContent
;
constructor
(
private
appRef
:
ApplicationRef
,
...
...
@@ -33,12 +32,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
pic_id
:
""
,
vocabulary_audio
:
""
}
};
};
// 获取存储的数据
(
window
as
any
).
courseware
.
getData
((
data
)
=>
{
if
(
data
)
{
this
.
item
=
data
;
this
.
item
=
data
;
}
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
detectChanges
();
...
...
@@ -65,30 +64,21 @@ 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
();
}
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
();
}
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
();
}
this
.
save
();
}
onVocabularyAudioUploadSuccess
(
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment