Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
forms_for_developers
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
forms_for_developers
Commits
53bfe6b5
Commit
53bfe6b5
authored
Feb 28, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
c3c69987
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
form.component.html
form_angular/src/app/form/form.component.html
+20
-1
form.component.ts
form_angular/src/app/form/form.component.ts
+18
-0
No files found.
form_angular/src/app/form/form.component.html
View file @
53bfe6b5
<div
class=
"model-content"
>
<div
class=
"border"
style=
"width: 800px;"
>
<textarea
style=
"width: 755px; height: 300px;"
#
itemTextarea
>
{{itemStr}}
</textarea>
<button
(
click
)="
copyData
();"
>
Copy
</button>
</div>
<div
class=
"border"
style=
"width: 800px;"
>
<div
class=
"border"
style=
"width: 700px;"
>
<span
style=
"font-size: 20px;"
>
标题:
</span>
<input
type=
"text"
style=
"width: 200px;"
nz-input
[(
ngModel
)]="
item
.
title
"
(
blur
)="
save
()"
>
<br>
<span
style=
"font-size: 20px;"
>
语音评测引导音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
guideAudio
"
(
audioUploaded
)="
onGuideAudioUploadSuccess
($
event
)"
>
</app-audio-recorder>
</div>
<div
*
ngFor=
"let question of item.questions; let i = index"
>
<div
class=
"border"
style=
"width: 700px;"
>
<span
style=
"font-size: 20px;"
>
第{{i + 1}}题:
</span>
...
...
@@ -13,7 +26,13 @@
[
texPngData
]=
question
.
dragonBoneData
.
texPngData
(
save
)="
saveAnima
($
event
,
question
.
dragonBoneData
)"
(
refreshEmitter
)="
refresh
()"
>
</app-upload-dragon-bone>
<span
style=
"font-size: 20px;"
>
蛋糕等待时间:
</span>
<input
type=
"number"
style=
"width: 100px;"
nz-input
[(
ngModel
)]="
question
.
choosewaitTime
"
(
blur
)="
save
()"
>
<br>
<span
style=
"font-size: 20px;"
>
评测等待时间:
</span>
<input
type=
"number"
style=
"width: 100px;"
nz-input
[(
ngModel
)]="
question
.
testWaitTime
"
(
blur
)="
save
()"
>
<br><br>
<button
(
click
)="
deleteQuestion
(
i
);"
>
delete question
</button>
</div>
</div>
...
...
form_angular/src/app/form/form.component.ts
View file @
53bfe6b5
...
...
@@ -4,7 +4,9 @@ import {
Input
,
OnDestroy
,
OnChanges
,
ElementRef
,
OnInit
,
ViewChild
,
Output
,
ApplicationRef
,
ChangeDetectorRef
,
...
...
@@ -35,6 +37,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
if
(
data
)
{
this
.
item
=
data
;
this
.
itemStr
=
JSON
.
stringify
(
this
.
item
);
}
this
.
init
();
...
...
@@ -68,10 +71,17 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
onGuideAudioUploadSuccess
(
e
)
{
this
.
item
.
guideAudio
=
e
.
url
;
this
.
save
();
}
addQuestion
()
{
this
.
item
.
questions
.
push
({
text
:
""
,
audio
:
""
,
choosewaitTime
:
5
,
testWaitTime
:
3
,
dragonBoneData
:
{
skeJsonData
:
{},
texJsonData
:
{},
...
...
@@ -93,14 +103,22 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
@
ViewChild
(
"
itemTextarea
"
,
{
static
:
true
})
itemTextarea
:
ElementRef
;
copyData
()
{
this
.
itemTextarea
.
nativeElement
.
select
();
document
.
execCommand
(
"
copy
"
);
}
/**
* 储存数据
*/
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
console
.
log
(
JSON
.
stringify
(
this
.
item
));
this
.
itemStr
=
JSON
.
stringify
(
this
.
item
);
this
.
refresh
();
}
itemStr
=
""
;
/**
* 刷新 渲染页面
...
...
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