Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_23
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
hw_23
Commits
b5012225
Commit
b5012225
authored
May 25, 2020
by
hw_023_test
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confirm
parent
6968ff34
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
217 additions
and
72 deletions
+217
-72
form.component.html
src/app/form/form.component.html
+1
-0
form.component.scss
src/app/form/form.component.scss
+3
-0
form.component.ts
src/app/form/form.component.ts
+27
-0
play.component.ts
src/app/play/play.component.ts
+186
-72
No files found.
src/app/form/form.component.html
View file @
b5012225
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
(
audioUploaded
)
=
"
onAudioUploadSuccessByItem
($
event
,
word
)"
(
audioUploaded
)
=
"
onAudioUploadSuccessByItem
($
event
,
word
)"
class=
"item"
class=
"item"
></app-audio-recorder>
></app-audio-recorder>
<button
style=
"margin-bottom: 10px;"
nz-button
nzType=
"danger"
(
click
)="
deleteItemWord
(
it
,
word
)"
>
删除单词和音频
</button>
</div>
</div>
<button
nz-button
nzType=
"primary"
class=
"add-word-btn"
(
click
)="
addWord
(
it
)"
>
添加单词
</button>
<button
nz-button
nzType=
"primary"
class=
"add-word-btn"
(
click
)="
addWord
(
it
)"
>
添加单词
</button>
</div>
</div>
...
...
src/app/form/form.component.scss
View file @
b5012225
...
@@ -65,6 +65,9 @@
...
@@ -65,6 +65,9 @@
margin-right
:
10px
;
margin-right
:
10px
;
}
}
}
}
button
{
margin-left
:
10px
;
}
.add-word-btn
{
.add-word-btn
{
width
:
100%
;
width
:
100%
;
}
}
...
...
src/app/form/form.component.ts
View file @
b5012225
...
@@ -18,6 +18,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -18,6 +18,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存对象
// 储存对象
_item
:
any
;
_item
:
any
;
KEY
=
'
test_0011
'
;
KEY
=
'
test_0011
'
;
wordArr
=
[];
...
@@ -143,6 +144,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -143,6 +144,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
deleteItem
(
data
)
{
deleteItem
(
data
)
{
const
index
=
this
.
picArr
.
indexOf
(
data
);
const
index
=
this
.
picArr
.
indexOf
(
data
);
console
.
log
(
this
.
picArr
);
console
.
log
(
index
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
this
.
picArr
.
splice
(
index
,
1
);
this
.
picArr
.
splice
(
index
,
1
);
}
}
...
@@ -151,6 +154,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -151,6 +154,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
this
.
save
();
}
}
deleteItemWord
(
picdata
,
wordData
)
{
const
pindex
=
this
.
picArr
.
indexOf
(
picdata
);
// console.log('data',picdata,index);
const
wordList
=
this
.
picArr
[
pindex
].
wordArr
;
// console.log('s',wordList);
const
windex
=
wordList
.
indexOf
(
wordData
);
console
.
log
(
'
id
'
,
windex
);
if
(
pindex
!==
-
1
)
{
// const this.picArr[pindex].wordArr[windex].splice(windex,1);
this
.
picArr
[
pindex
].
wordArr
.
splice
(
windex
,
1
);
// const pic = this.picArr[pindex].wordArr;
// const word = pic[windex];
// console.log('word',word);
}
// const a = this.item.contentObj
// console.log(this.picArr);
// console.log(index);
// if (index !== -1) {
// this.wordArr.splice(index, 1);
// }
console
.
log
(
'
a
'
);
// this.update.emit(this.item);
this
.
save
();
}
...
...
src/app/play/play.component.ts
View file @
b5012225
This diff is collapsed.
Click to expand it.
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