Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ET_07
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
ET_07
Commits
815c5a5f
Commit
815c5a5f
authored
Feb 25, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 表单页完成
parent
2a162676
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
141 additions
and
58 deletions
+141
-58
form.component.html
form/src/app/form/form.component.html
+131
-29
form.component.ts
form/src/app/form/form.component.ts
+10
-29
No files found.
form/src/app/form/form.component.html
View file @
815c5a5f
This diff is collapsed.
Click to expand it.
form/src/app/form/form.component.ts
View file @
815c5a5f
...
@@ -18,24 +18,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -18,24 +18,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
createShell
()
{
this
.
item
.
wordList
.
push
({
word
:
''
,
audio
:
''
,
backWord
:
''
,
backWordAudio
:
''
,
});
this
.
save
();
}
removeShell
(
idx
)
{
this
.
item
.
wordList
.
splice
(
idx
,
1
);
this
.
save
();
}
ngOnInit
()
{
ngOnInit
()
{
this
.
item
=
{};
this
.
item
=
{
letter
:
'
A
'
};
// 获取存储的数据
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
...
@@ -51,6 +38,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -51,6 +38,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
},
this
.
saveKey
);
},
this
.
saveKey
);
}
}
selectLetter
(
letter
)
{
this
.
item
.
letter
=
letter
;
this
.
save
();
}
ngOnChanges
()
{
ngOnChanges
()
{
}
}
...
@@ -77,18 +69,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -77,18 +69,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存音频数据
* 储存音频数据
* @param e
* @param e
*/
*/
onAudioUploadSuccess
(
e
,
key
)
{
onAudioUploadSuccess
(
e
)
{
this
.
item
[
key
]
=
e
.
url
;
this
.
item
.
audio
=
e
.
url
;
this
.
save
();
}
onWordAudioUploadSuccess
(
e
,
idx
)
{
this
.
item
.
wordList
[
idx
].
audio
=
e
.
url
;
this
.
save
();
}
onBackWordAudioUploadSuccess
(
e
,
idx
)
{
this
.
item
.
wordList
[
idx
].
backWordAudio
=
e
.
url
;
this
.
save
();
this
.
save
();
}
}
...
@@ -97,7 +79,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -97,7 +79,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
*/
*/
save
()
{
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
this
.
refresh
();
this
.
refresh
();
console
.
log
(
'
this.item =
'
+
JSON
.
stringify
(
this
.
item
));
console
.
log
(
'
this.item =
'
+
JSON
.
stringify
(
this
.
item
));
}
}
...
...
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