Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FT_12
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
FT_12
Commits
4e5e6ae1
Commit
4e5e6ae1
authored
Dec 22, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form done
parent
b31a2b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
81 deletions
+79
-81
form.component.html
form/src/app/form/form.component.html
+36
-38
form.component.ts
form/src/app/form/form.component.ts
+43
-43
No files found.
form/src/app/form/form.component.html
View file @
4e5e6ae1
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<span
style=
"margin-left: 5%;height: 30px; font-size: 18px;"
>
标题音频:
</span>
<div
style=
"margin-left: 5%;"
>
<app-audio-recorder
[
audioUrl
]="
item
.
questionAudio
"
(
audioUploaded
)="
onQuestionAudioUploadSuccess
($
event
)"
>
</app-audio-recorder>
</div>
<br>
<span
style=
"margin-left: 5%;height: 30px; font-size: 18px;"
>
标题文本:
</span>
<br>
<input
style=
"margin-left: 5%;width: 150px; "
type=
"text"
maxlength=
""
nz-input
[(
ngModel
)]="
item
.
questionText
"
(
blur
)="
save
()"
>
<br>
<div
*
ngFor=
"let question of item.questionList; let i = index"
>
<div
*
ngFor=
"let question of item.questionList; let i = index"
>
<div
style=
"border-style: dotted; border-width: 1px;"
>
<div
style=
"border-style: dotted; border-width: 1px;"
>
<div
style=
"margin-left: 5%; margin-bottom: 50px; padding-top: 20px; "
>
<div
style=
"margin-left: 5%; margin-bottom: 50px; padding-top: 20px; "
>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页标题音频:
</span>
<app-audio-recorder
[
audioUrl
]="
question
.
questionAudio
"
(
audioUploaded
)="
onQuestionAudioUploadSuccess
($
event
,
i
)"
>
</app-audio-recorder>
<br>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页标题文本:
</span>
<br>
<input
style=
"width: 150px; "
type=
"text"
maxlength=
""
nz-input
[(
ngModel
)]="
question
.
questionText
"
(
blur
)="
save
()"
>
<br>
<br>
<div
style=
"height: 330px;width:100%"
>
<div
style=
"height: 330px;width:100%"
>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页题干:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页题干:
</span>
<div
*
ngFor=
"let option of question.optionList; let j = index"
>
<div
*
ngFor=
"let option of question.optionList; let j = index"
>
...
@@ -32,9 +32,22 @@
...
@@ -32,9 +32,22 @@
(
refreshEmitter
)="
refresh
()"
>
(
refreshEmitter
)="
refresh
()"
>
</app-upload-dragon-bone>
</app-upload-dragon-bone>
<br>
<br>
<div>
<nz-radio-group
[(
ngModel
)]="
question
.
rightOptionIdx
"
>
<div
[
nzValue
]="
j
"
nz-radio
(
click
)="
radioClick
(
i
,
j
)"
>
<span
style=
"height: 30px; font-size: 18px;"
>
正确选项
</span>
</div>
</nz-radio-group>
</div>
<button
style=
"margin-top: 20px; width: 100%; height: 32px; color: red;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
removeOption
(
i
,
j
)"
>
删除选项
</button>
</div>
</div>
</div>
</div>
<div
*
ngIf=
"(question.optionList.length <
4
)"
>
<div
*
ngIf=
"(question.optionList.length <
7
)"
>
<button
style=
"margin-top: 20px; float: left; border-width: 1px;
<button
style=
"margin-top: 20px; float: left; border-width: 1px;
border-style: dotted; padding: 20px; margin-right: 20px;
border-style: dotted; padding: 20px; margin-right: 20px;
width: 230px; height: 263px;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
addOption
(
i
)"
>
width: 230px; height: 263px;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
addOption
(
i
)"
>
...
@@ -43,33 +56,18 @@
...
@@ -43,33 +56,18 @@
</div>
</div>
</div>
</div>
<div
style=
"height: 130px;width:100%"
>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页选项:
</span>
<div
*
ngFor=
"let option of question.optionList; let j = index"
>
<div
style=
"margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
padding: 20px; margin-right: 20px; width: 230px;"
>
<span
style=
"height: 30px; font-size: 18px;"
>
选项骨骼动画:
</span>
<app-upload-dragon-bone
[
btnName
]="[['配置骨骼动画']]"
[
animaNames
]="[[['
normal
']]]"
[
skeJsonData
]=
option
.
optionDragonBone
.
skeJsonData2
[
texJsonData
]=
option
.
optionDragonBone
.
texJsonData2
[
texPngData
]=
option
.
optionDragonBone
.
texPngData2
(
save
)="
saveAnima2
($
event
,
option
.
optionDragonBone
)"
(
refreshEmitter
)="
refresh
()"
>
</app-upload-dragon-bone>
<br>
<div
*
ngIf=
"(question.optionList.length >= 4)"
>
<button
style=
"margin-top: 20px; width: 100%; height: 32px; color: red;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
removeOption
(
i
,
j
)"
>
删除选项
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<button
style=
"margin-left: 5%; margin-top: 50px;margin-bottom: 8px; width: 90%; height: 32px; color: red;"
<button
style=
"margin-left: 5%; margin-top: 50px;margin-bottom: 8px; width: 100px; height: 32px;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
removeQuestion
(
i
)"
>
nz-button
nzType=
"danger"
(
click
)="
removeQuestion
(
i
)"
>
删除问题{{i+1}}
删除问题
</button>
<button
style=
"margin-left: 5px; margin-top: 50px;margin-bottom: 8px; width: 100px; height: 32px; "
nz-button
nzType=
"dashed"
nzDanger
class=
"add-btn"
(
click
)="
copyQuestion
(
i
)"
>
复制问题
</button>
<button
style=
"margin-left: 5px; margin-top: 50px;margin-bottom: 8px; width: 120px; height: 32px;"
nz-button
nzType=
"dashed"
nzDanger
class=
"add-btn"
(
click
)="
pasteQuestion
(
i
)"
>
粘贴到下一页
</button>
</button>
</div>
</div>
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
4e5e6ae1
...
@@ -19,44 +19,39 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -19,44 +19,39 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
addQuestion
()
{
addQuestion
()
{
this
.
item
.
questionList
.
push
(
{
this
.
item
.
questionList
.
push
(
"
questionAudio
"
:
""
,
{
"
questionText
"
:
""
,
"
rightOptionIdx
"
:
0
,
"
optionList
"
:
[{
"
rightOptionIndex
"
:
""
,
"
text
"
:
""
,
"
optionList
"
:
[{
"
optionDragonBone
"
:
{
"
text
"
:
""
,
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
optionDragonBone
"
:
{
"
tex
JsonData
"
:
{
"
url
"
:
""
},
"
ske
JsonData
"
:
{
"
url
"
:
""
},
"
texPng
Data
"
:
{
"
url
"
:
""
},
"
texJson
Data
"
:
{
"
url
"
:
""
},
"
skeJsonData2
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
"
texJsonData2
"
:
{
"
url
"
:
""
},
},
"
texPngData2
"
:
{
"
url
"
:
""
}
"
optionAudio
"
:
""
},
},
"
optionAudio
"
:
""
{
},
{
"
text
"
:
""
,
"
text
"
:
""
,
"
optionDragonBone
"
:
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
},
"
skeJsonData2
"
:
{
"
url
"
:
""
},
"
optionAudio
"
:
""
"
texJsonData2
"
:
{
"
url
"
:
""
},
"
texPngData2
"
:
{
"
url
"
:
""
}
},
},
"
optionAudio
"
:
""
{
},
{
"
text
"
:
""
,
"
text
"
:
""
,
"
optionDragonBone
"
:
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
},
"
skeJsonData2
"
:
{
"
url
"
:
""
},
"
optionAudio
"
:
""
"
texJsonData2
"
:
{
"
url
"
:
""
},
}]
"
texPngData2
"
:
{
"
url
"
:
""
}
}
},
);
"
optionAudio
"
:
""
}]
});
this
.
save
();
this
.
save
();
}
}
...
@@ -64,17 +59,20 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -64,17 +59,20 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
item
.
questionList
.
splice
(
idx
,
1
);
this
.
item
.
questionList
.
splice
(
idx
,
1
);
this
.
save
();
this
.
save
();
}
}
copyQuestion
(
idx
){
this
.
copyQuestion
=
this
.
item
.
questionList
[
idx
];
}
pasteQuestion
(
idx
){
this
.
item
.
questionList
.
splice
(
idx
+
1
,
0
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
copyQuestion
)));
}
addOption
(
questionIdx
)
{
addOption
(
questionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
optionList
.
push
({
this
.
item
.
questionList
[
questionIdx
].
optionList
.
push
({
"
text
"
:
""
,
"
text
"
:
""
,
"
optionDragonBone
"
:
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
},
"
skeJsonData2
"
:
{
"
url
"
:
""
},
"
texJsonData2
"
:
{
"
url
"
:
""
},
"
texPngData2
"
:
{
"
url
"
:
""
}
},
},
"
optionAudio
"
:
""
"
optionAudio
"
:
""
});
});
...
@@ -88,6 +86,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -88,6 +86,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
ngOnInit
()
{
ngOnInit
()
{
this
.
item
=
{
this
.
item
=
{
questionAudio
:
""
,
questionText
:
""
,
questionList
:
[]
questionList
:
[]
};
};
...
@@ -121,8 +121,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -121,8 +121,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
this
.
save
();
}
}
onQuestionAudioUploadSuccess
(
e
,
questionIdx
)
{
onQuestionAudioUploadSuccess
(
e
)
{
this
.
item
.
question
List
[
questionIdx
].
question
Audio
=
e
.
url
;
this
.
item
.
questionAudio
=
e
.
url
;
this
.
save
();
this
.
save
();
// questionText
// questionText
}
}
...
...
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