Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU01
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
PU01
Commits
40281eec
Commit
40281eec
authored
Jun 23, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
13070a82
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
378 additions
and
130 deletions
+378
-130
form.component.html
src/app/form/form.component.html
+79
-2
form.component.scss
src/app/form/form.component.scss
+6
-0
form.component.ts
src/app/form/form.component.ts
+29
-5
Cartoon.ts
src/app/play/Cartoon.ts
+2
-1
play.component.ts
src/app/play/play.component.ts
+261
-121
defaultData.js
src/assets/play/default/formData/defaultData.js
+1
-1
No files found.
src/app/form/form.component.html
View file @
40281eec
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
class=
"card-config"
>
<div
class=
"card-config"
>
<div
class=
"card-item clearfix"
style=
"padding: 0.5vw; width: 100%;"
>
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content"
>
<div
class=
"title"
>
题目素材
</div>
<div
class=
"section"
>
<div
class=
"section-content"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"float: left; text-align: right; margin-right: 10px; margin-left: 10px;"
>
<span>
显示选项
</span><span>
:
</span>
</div>
<div
style=
"float: left; width: 300px;"
>
<nz-radio-group
[(
ngModel
)]="
contentObj
.
question
.
type
"
(
ngModelChange
)="
handleQuestionTypeChange
()"
>
<label
nz-radio
[
nzValue
]="'
Text
'"
>
文字
</label>
<label
nz-radio
[
nzValue
]="'
Image
'"
>
图片
</label>
<label
nz-radio
[
nzValue
]="'
LongAudio
'"
>
长音频
</label>
</nz-radio-group>
</div>
<div
style=
"float: left; width: 300px;"
>
<div
*
ngIf=
"contentObj.question.type=='Image'"
>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
contentObj
.
question
.
image_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
contentObj
.
question
,
'
image_url
')"
></app-upload-image-with-preview>
</div>
<div
*
ngIf=
"contentObj.question.type=='Text'"
>
<textarea
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
contentObj
.
question
.
text
"
(
blur
)="
saveItem
()"
></textarea>
</div>
<div
*
ngIf=
"contentObj.question.type=='LongAudio'"
>
<app-audio-recorder
[
audioUrl
]="
contentObj
.
question
.
longAudio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
contentObj
.
question
,
'
longAudio_url
')"
></app-audio-recorder>
</div>
</div>
</div>
</div>
</div>
<div
class=
"section"
>
<div
class=
"section-content"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"float: left; text-align: right; margin-right: 10px; margin-left: 10px;"
>
<span>
卡片类型
</span><span>
:
</span>
</div>
<div
style=
"float: left; width: 300px;"
>
<nz-radio-group
[(
ngModel
)]="
contentObj
.
answerType
"
(
ngModelChange
)="
saveItem
()"
>
<label
nz-radio
[
nzValue
]="'
Text
'"
>
文字
</label>
<label
nz-radio
[
nzDisabled
]="
contentObj
.
question
.
type
!=
'
LongAudio
'"
[
nzValue
]="'
Image
'"
>
图片
</label>
</nz-radio-group>
</div>
<div
style=
"float: left; width: 300px;"
>
</div>
</div>
</div>
</div>
<div
class=
"section"
>
<div
class=
"section-content"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"flex:1; text-align: right; margin-right: 10px;"
>
<span>
短音频
</span><span>
:
</span>
</div>
<div
style=
"flex:3"
>
<app-audio-recorder
[
audioUrl
]="
contentObj
.
question
.
shortAudio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
contentObj
.
question
,
'
shortAudio_url
')"
></app-audio-recorder>
</div>
<div
style=
"flex:8"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
*
ngFor=
"let item of contentObj.dataArray; let i = index"
class=
"card-item"
style=
"padding: 0.5vw; "
>
<div
*
ngFor=
"let item of contentObj.dataArray; let i = index"
class=
"card-item"
style=
"padding: 0.5vw; "
>
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content"
>
<div
class=
"card-item-content"
>
...
@@ -9,7 +86,7 @@
...
@@ -9,7 +86,7 @@
<div
class=
"section"
>
<div
class=
"section"
>
<div
class=
"section-content"
>
<div
class=
"section-content"
>
<div
style=
"flex:1"
>
<div
*
ngIf=
"contentObj.answerType=='Text'"
style=
"flex:1"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"flex:1"
>
<div
style=
"flex:1"
>
文字
文字
...
@@ -20,7 +97,7 @@
...
@@ -20,7 +97,7 @@
</div>
</div>
</div>
</div>
<div
style=
"flex:1"
>
<div
*
ngIf=
"contentObj.answerType=='Image'"
style=
"flex:1"
>
<div
style=
"display: flex; "
>
<div
style=
"display: flex; "
>
<div
style=
"flex:1"
>
<div
style=
"flex:1"
>
图片
图片
...
...
src/app/form/form.component.scss
View file @
40281eec
...
@@ -53,3 +53,9 @@
...
@@ -53,3 +53,9 @@
}
}
}
}
}
}
.clearfix
:before
,
.clearfix
:after
{
content
:
""
;
display
:
block
;
clear
:
both
;
}
\ No newline at end of file
src/app/form/form.component.ts
View file @
40281eec
...
@@ -11,7 +11,7 @@ import defauleFormData from '../../assets/play/default/formData/defaultData.js'
...
@@ -11,7 +11,7 @@ import defauleFormData from '../../assets/play/default/formData/defaultData.js'
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
_item
:
any
;
_item
:
any
;
KEY
=
'
DataKey_PU0
8
'
;
KEY
=
'
DataKey_PU0
1
'
;
checkOptionsOne
=
[]
checkOptionsOne
=
[]
set
item
(
item
)
{
set
item
(
item
)
{
...
@@ -23,9 +23,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -23,9 +23,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
contentObj
=
{
contentObj
=
{
"
version
"
:
"
1.0
"
,
"
version
"
:
"
1.0
"
,
key
:
"
DataKey_PU01
"
,
key
:
"
DataKey_PU01
"
,
dataArray
:
[
question
:
{
{
text
:
""
,
image_url
:
""
}
type
:
"
Image
"
]
},
answerType
:
"
Text
"
,
dataArray
:
[]
}
}
@
Output
()
@
Output
()
...
@@ -34,6 +36,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -34,6 +36,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
handleQuestionTypeChange
(){
if
(
this
.
contentObj
.
question
.
type
!=
'
LongAudio
'
){
this
.
contentObj
.
answerType
=
'
Text
'
}
this
.
saveItem
()
}
ngOnInit
()
{
ngOnInit
()
{
this
.
item
=
{};
this
.
item
=
{};
this
.
item
.
contentObj
=
{};
this
.
item
.
contentObj
=
{};
...
@@ -113,7 +137,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -113,7 +137,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
onImageUploadSuccessByItem
(
e
,
item
,
key
)
{
onImageUploadSuccessByItem
(
e
,
item
,
key
)
{
item
[
key
]
.
image_url
=
e
.
url
item
[
key
]
=
e
.
url
this
.
save
();
this
.
save
();
}
}
...
...
src/app/play/Cartoon.ts
View file @
40281eec
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
ShapeCircle
,
ShapeCircle
,
MyAnimation
MyAnimation
}
from
"
./Unit
"
;
}
from
"
./Unit
"
;
import
{
matchesElement
}
from
'
@angular/animations/browser/src/render/shared
'
;
export
class
Cartoon
{
export
class
Cartoon
{
...
@@ -410,7 +411,7 @@ export class Cartoon {
...
@@ -410,7 +411,7 @@ export class Cartoon {
createAnimation
(
imageKey
,
length
,
runTime
,
endCallback
?,
order
?:
boolean
)
{
createAnimation
(
imageKey
,
length
,
runTime
,
endCallback
?,
order
?:
boolean
)
{
let
element
=
new
MyAnimation
()
let
element
=
new
MyAnimation
()
element
.
id
=
"
ANI-
"
+
imageKey
element
.
id
=
"
ANI-
"
+
imageKey
+
"
-
"
+
Math
.
floor
(
Math
.
random
()
*
10000
)
if
(
order
){
if
(
order
){
for
(
let
index
=
length
;
index
>
0
;
index
--
)
{
for
(
let
index
=
length
;
index
>
0
;
index
--
)
{
element
.
addFrameByImg
(
this
.
images
.
get
(
`
${
imageKey
}
(
${
index
}
)`
))
element
.
addFrameByImg
(
this
.
images
.
get
(
`
${
imageKey
}
(
${
index
}
)`
))
...
...
src/app/play/play.component.ts
View file @
40281eec
This diff is collapsed.
Click to expand it.
src/assets/play/default/formData/defaultData.js
View file @
40281eec
...
@@ -5,5 +5,5 @@ export default {
...
@@ -5,5 +5,5 @@ export default {
type
:
"
Image
"
type
:
"
Image
"
},
},
answerType
:
"
Text
"
,
answerType
:
"
Text
"
,
dataArray
:
[
"
This is for test
"
,
"
Apple
"
,
"
Building
"
,
"
Lovely Puppy
"
]
dataArray
:
[
"
One
"
,
"
Two
"
,
"
Three
"
,
"
Four
"
]
}
}
\ No newline at end of file
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