Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy17_hds
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
hy17_hds
Commits
1ef70890
Commit
1ef70890
authored
Jun 22, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置调整
parent
18b2060d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
146 deletions
+21
-146
form.component.html
form/src/app/form/form.component.html
+16
-115
form.component.ts
form/src/app/form/form.component.ts
+5
-31
No files found.
form/src/app/form/form.component.html
View file @
1ef70890
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
</div> -->
</div> -->
</div>
</div>
<div
class=
"border-dashed"
style=
"margin: 20px;width: 1000px;"
>
<
!-- <
div class="border-dashed" style="margin: 20px;width: 1000px;">
<div style="font-size: 20px;">游戏模式: </div>
<div style="font-size: 20px;">游戏模式: </div>
<nz-radio-group [(ngModel)]="item.recordFlag" (ngModelChange)="save()">
<nz-radio-group [(ngModel)]="item.recordFlag" (ngModelChange)="save()">
<label nz-radio [nzValue]="true">
<label nz-radio [nzValue]="true">
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
</label>
</label>
</nz-radio-group>
</nz-radio-group>
</div>
</div>
-->
<!-- <div class="border-dashed" style="margin: 20px;width: 1000px;">
<!-- <div class="border-dashed" style="margin: 20px;width: 1000px;">
<div class="word-input-title">
<div class="word-input-title">
...
@@ -135,132 +135,33 @@
...
@@ -135,132 +135,33 @@
<div
*
ngFor=
"let question of item.questions; let i = index"
>
<div
*
ngFor=
"let question of item.questions; let i = index"
>
<div
style=
"display: flex;margin-top: 20px;"
>
<div
style=
"display: flex;margin-top: 20px;"
>
<div
class=
"border-solid"
style=
"min-width: 1000px;"
>
<div
class=
"border-solid"
style=
"min-width: 1000px;"
>
<!-- <div class="word-type-title">
题目{{i+1}}
</div> -->
<!-- <div>
<div class="word-type-option-title" style="margin-top:10px;">题目音频:</div>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="question.questionAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionAudio',question,'audioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ question.audioName}}</span>
</div>
</div>
</div> -->
<!-- <div style="margin-top:20px">
<div class="word-type-option-title">倒计时: </div>
<input type="number" nz-input [(ngModel)]="question.duration" (blur)="save()">
</div> -->
<div
class=
"option-title"
>
题目{{i+1}}
<div
class=
"word-type-option-title"
style=
"margin-top:20px;"
>
题目内容:
</div>
</div>
<div
class=
"option-content"
style=
"padding: 15px 30px;"
>
<div
style=
"width: 200px"
>
<span
style=
"font-size: 20px;"
>
文本
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
question
.
text
"
(
blur
)="
save
()"
>
</div>
<div
*
ngFor=
"let option of question.options; let j = index"
>
<div
style=
"width: 200px"
>
<div
style=
"display: flex;margin-top:20px"
>
<span
style=
"font-size: 20px;"
>
录音时长
</span>
<div
class=
"option-title"
>
<input
type=
"number"
nz-input
[(
ngModel
)]="
question
.
time
"
(
blur
)="
save
()"
>
题目{{j+1}}
</div>
<div
class=
"option-content"
style=
"padding: 15px 30px;"
>
<!-- <div style="margin:-15px -30px;width: calc(100%+60px);height: 40px;padding:10px 20px;" [style]="{
backgroundColor: option.right ?'#169BD5':'#eee'}">
<label nz-checkbox [(ngModel)]="option.right" (ngModelChange)="save()"
[style]="{color: option.right ?'#fff':'#000'}">正确答案</label>
</div> -->
<div
style=
"margin-top: 20px;"
>
<div
class=
"word-type-option-title"
>
类型:
</div>
<div
style=
"margin-top: 5px;"
>
<nz-radio-group
[(
ngModel
)]="
option
.
type
"
(
ngModelChange
)="
ngChange
(
i
,
j
)"
>
<label
nz-radio
nzValue=
"img"
>
<span
[
style
]="{
color:option
.
type=
='img'
?
'#
169BD5
'
:
'#
000
'}"
>
图片
</span>
</label>
<label
nz-radio
nzValue=
"img_txt"
>
<span
[
style
]="{
color:option
.
type=
='img_txt'
?
'#
169BD5
'
:
'#
000
'}"
>
图片+文本
</span>
</label>
<label
nz-radio
nzValue=
"img_audio"
>
<span
[
style
]="{
color:option
.
type=
='img_audio'
?
'#
169BD5
'
:
'#
000
'}"
>
图片+音频
</span>
</label>
<label
nz-radio
nzValue=
"img_txt_audio"
>
<span
[
style
]="{
color:option
.
type=
='img_txt_audio'
?
'#
169BD5
'
:
'#
000
'}"
>
图片+文本+音频
</span>
</label>
</nz-radio-group>
</div>
</div>
<div
style=
"margin-top: 25px;"
>
<div
class=
"option-img"
>
<div
style=
"width: 200px;"
>
<span
style=
"font-size: 20px;"
>
图片:
</span>
<app-upload-image-with-preview
[
picUrl
]="
option
.
image
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
image
',
option
)"
>
</app-upload-image-with-preview>
</div>
</div>
<div
class=
"option-text"
>
<div
*
ngIf=
"option.type=='img_txt'|| option.type=='img_txt_audio' "
style=
"width: 200px"
>
<span
style=
"font-size: 20px;"
>
文本
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
option
.
text
"
(
blur
)="
save
()"
>
</div>
</div>
<div
class=
"option-audio"
*
ngIf=
"option.type=='img_audio' || option.type=='img_txt_audio'"
>
<span
style=
"font-size: 20px;"
>
选项音频:
</span>
<div
style=
"display: flex"
>
<div>
<app-audio-recorder
[
audioUrl
]="
option
.
audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,'
audio
',
option
,'
audioName
')"
>
</app-audio-recorder>
</div>
<div
style=
"margin: 5px"
>
<span>
{{ option.audioName}}
</span>
</div>
</div>
</div>
<div
class=
"option-time"
*
ngIf=
"item.recordFlag==true"
>
<div
class=
"word-type-option-title"
>
录音倒计时:
</div>
<input
type=
"number"
nz-input
[(
ngModel
)]="
option
.
duration
"
(
blur
)="
save
()"
>
<span
style=
"font-size: 20px;"
>
录音文本
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
option
.
content
"
(
blur
)="
save
()"
>
</div>
</div>
</div>
<div
class=
"option-btns"
>
<button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removeoption
(
i
,
j
)"
>
删除题目
</button>
<button
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
nzType=
"default"
nzDanger
(
click
)="
copyOption
(
i
,
j
)"
>
复制题目
</button>
</div>
</div>
</div>
</div>
</div>
<div
style=
"margin-left: 69px;margin-top: 15px;"
>
<button
class=
"btn-blue"
nz-button
nzType=
"default"
nzDanger
(
click
)="
addoption
(
i
)"
>
+增加题目
</button>
</div>
</div>
</div>
<div
style=
"margin:0 20px"
>
<div
style=
"margin:0 20px"
>
<
!-- <button class="btn-red" nz-button nzType="default" nzDanger (click)="removequestion(i)">删除题目</button> --
>
<
button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removequestion
(
i
)"
>
删除题目
</button
>
</div>
</div>
</div>
</div>
</div>
</div>
<
!-- <
button class="btn-blue" style="margin-top:10px;width: 1000px; height: 50px;" nz-button nzType="default" nzDanger
<button
class=
"btn-blue"
style=
"margin-top:10px;width: 1000px; height: 50px;"
nz-button
nzType=
"default"
nzDanger
(click)="addquestion()">+增加题目</button>
-->
(
click
)="
addquestion
()"
>
+增加题目
</button>
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
1ef70890
...
@@ -9,7 +9,7 @@ import { MetaFormCreator } from './mataFormCreator';
...
@@ -9,7 +9,7 @@ import { MetaFormCreator } from './mataFormCreator';
})
})
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
// 储存数据用
saveKey
=
"
hy
01_danci
"
;
saveKey
=
"
hy
17_hds
"
;
item
=
{
item
=
{
recordFlag
:
false
,
recordFlag
:
false
,
...
@@ -17,9 +17,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -17,9 +17,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
questionText
:
""
,
questionText
:
""
,
questionTextAudio
:
""
,
questionTextAudio
:
""
,
questions
:
[{
questions
:
[{
questionAudio
:
""
,
text
:
""
,
duration
:
120
,
time
:
10
options
:
[]
}],
}],
bgAudio
:
""
,
bgAudio
:
""
,
bgAudioName
:
""
,
bgAudioName
:
""
,
...
@@ -47,30 +46,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -47,30 +46,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
console
.
log
(
new
MetaFormCreator
().
create
());
console
.
log
(
new
MetaFormCreator
().
create
());
}
}
removeoption
(
i
,
j
)
{
this
.
openDelete
(
"
确定删除选项?
"
,
()
=>
{
this
.
item
.
questions
[
i
].
options
.
splice
(
j
,
1
);
this
.
save
();
})
}
copyOption
(
i
,
j
)
{
let
data
=
this
.
item
.
questions
[
i
].
options
[
j
];
this
.
item
.
questions
[
i
].
options
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
data
)));
this
.
save
();
}
addoption
(
i
)
{
this
.
item
.
questions
[
i
].
options
.
push
({
type
:
""
,
image
:
""
,
audio
:
""
,
text
:
""
,
duration
:
''
,
content
:
''
,
right
:
false
});
this
.
save
();
}
removequestion
(
i
)
{
removequestion
(
i
)
{
this
.
openDelete
(
"
确定删除题目?
"
,
()
=>
{
this
.
openDelete
(
"
确定删除题目?
"
,
()
=>
{
...
@@ -81,9 +56,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -81,9 +56,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion
()
{
addquestion
()
{
this
.
item
.
questions
.
push
({
this
.
item
.
questions
.
push
({
questionAudio
:
""
,
text
:
""
,
duration
:
120
,
time
:
10
,
options
:
[]
});
});
this
.
save
();
this
.
save
();
}
}
...
...
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