Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP46
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
OP46
Commits
c6a05d5c
Commit
c6a05d5c
authored
May 31, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表单修改
parent
4388318f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
36 deletions
+40
-36
form.component.html
form/src/app/form/form.component.html
+37
-35
form.component.ts
form/src/app/form/form.component.ts
+3
-1
No files found.
form/src/app/form/form.component.html
View file @
c6a05d5c
<div
class=
"model-content"
>
<div
style=
"padding: 10px;"
>
<div
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
答对所有题或答题满
<input
style=
"width: 50px;"
type=
"number"
nz-input
[(
ngModel
)]="
item
.
maxWrongNumber
"
(
blur
)="
save
()"
>
次自动结束游戏
答对所有题或答题满
<input
style=
"width: 50px;"
type=
"number"
nz-input
[(
ngModel
)]="
item
.
maxWrongNumber
"
(
blur
)="
save
()"
>
次自动结束游戏
</div>
</div>
<div
style=
"padding: 10px;"
>
<div
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
猫咪开头音频:
<app-audio-recorder
style=
"margin-left: 10px; "
[
audioUrl
]="
item
.
startAudio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
startAudio
',
item
)"
></app-audio-recorder>
猫咪开头音频:
<app-audio-recorder
style=
"margin-left: 10px; "
[
audioUrl
]="
item
.
startAudio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
startAudio
',
item
)"
></app-audio-recorder>
</div>
<div
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
猫咪结束音频:
<app-audio-recorder
style=
"margin-left: 10px; "
[
audioUrl
]="
item
.
endAudio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
endAudio
',
item
)"
></app-audio-recorder>
猫咪结束音频:
<app-audio-recorder
style=
"margin-left: 10px; "
[
audioUrl
]="
item
.
endAudio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
endAudio
',
item
)"
></app-audio-recorder>
</div>
</div>
<div
style=
"padding: 10px;"
>
<div
*
ngFor=
"let q of questionArr; let i = index;"
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
<div
*
ngFor=
"let q of questionArr; let i = index;"
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
<div
style=
" display: flex; align-items: center;"
>
<h3
style=
"margin-top: 5px"
>
question-{{i+1}}:
</h3>
<app-audio-recorder
style=
"margin-left: 10px; "
[
audioUrl
]="
q
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
audio_url
',
q
)"
></app-audio-recorder>
<h3
style=
"margin-top: 5px"
>
question-{{i+1}}:
</h3>
<button
*
ngIf=
"q.option_arr.length < 5"
nz-button
nzType=
"primary"
(
click
)="
addOptionBtnClick
(
q
)"
style=
"margin-left: 15px;"
>
<div>
<div
style=
"margin-top:10px"
>
描述一
</div>
<input
style=
"width: 150px;"
nz-input
[(
ngModel
)]="
q
.
desc1
"
(
blur
)="
save
()"
>
<div
style=
"margin-top:10px"
>
描述二
</div>
<input
style=
"width: 150px;"
nz-input
[(
ngModel
)]="
q
.
desc2
"
(
blur
)="
save
()"
>
</div>
<div
style=
" display: flex; align-items: center;margin-top:10px"
>
<app-audio-recorder
style=
"margin-left: 0px; "
[
audioUrl
]="
q
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
audio_url
',
q
)"
></app-audio-recorder>
<button
*
ngIf=
"q.option_arr.length < 5"
nz-button
nzType=
"primary"
(
click
)="
addOptionBtnClick
(
q
)"
style=
"margin-left: 15px;"
>
+
</button>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteQuestionBtnClick
(
i
)"
style=
"margin-left: 5px;"
>
...
...
@@ -48,29 +53,26 @@
<div
*
ngFor=
"let o of q.option_arr; let oi = index"
style=
"margin-top: 5px; display: flex;"
>
<div
style=
"width: 200px;"
>
<app-upload-image-with-preview
[
picUrl
]="
o
.
pic_url
"
<app-upload-image-with-preview
[
picUrl
]="
o
.
pic_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
pic_url
',
o
)"
>
</app-upload-image-with-preview>
</div>
<div
style=
"margin-left: 10px"
>
<h4>
option-{{oi+1}} :
</h4>
<app-audio-recorder
[
audioUrl
]="
o
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
audio_url
',
o
)"
></app-audio-recorder>
<app-audio-recorder
[
audioUrl
]="
o
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
audio_url
',
o
)"
>
</app-audio-recorder>
<div
style=
"display: flex; align-items: center; margin-top: 10px;"
>
<nz-switch
[(
ngModel
)]="
o
.
is_right
"
(
ngModelChange
)="
save
()"
></nz-switch>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteOptionBtnClick
(
q
.
option_arr
,
oi
)"
style=
"margin-left: 5px;"
>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteOptionBtnClick
(
q
.
option_arr
,
oi
)"
style=
"margin-left: 5px;"
>
delete
</button>
</div>
</div>
</div>
</div>
...
...
@@ -79,7 +81,7 @@
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
Add Question
</button>
<!-- <div style="width: 300px;" align='center'>
<span>图1: </span>
<app-upload-image-with-preview
...
...
@@ -111,4 +113,4 @@
</div>
</div>
</div>
\ No newline at end of file
form/src/app/form/form.component.ts
View file @
c6a05d5c
...
...
@@ -26,7 +26,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
maxWrongNumber
:
4
,
startAudio
:
''
,
endAudio
:
''
,
question_arr
:
[]
question_arr
:
[]
,
};
// 获取存储的数据
...
...
@@ -61,6 +61,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
addQuestionBtnClick
()
{
this
.
questionArr
.
push
({
desc1
:
''
,
desc2
:
''
,
question_audio_url
:
''
,
option_arr
:
[
//选项 (多选)
...
...
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