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
bd59ce3a
Commit
bd59ce3a
authored
Jun 24, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
5557a5b8
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
155 additions
and
95 deletions
+155
-95
ng-template-generator_20200624 17-43-55.zip
publish/ng-template-generator_20200624 17-43-55.zip
+0
-0
form.component.html
src/app/form/form.component.html
+19
-23
form.component.ts
src/app/form/form.component.ts
+29
-6
play.component.ts
src/app/play/play.component.ts
+103
-66
resources.js
src/app/play/resources.js
+4
-0
bg_change2-2.png
src/assets/play/bg_change2-2.png
+0
-0
bg_face.png
src/assets/play/bg_face.png
+0
-0
No files found.
publish/ng-template-generator_20200624 17-43-55.zip
0 → 100644
View file @
bd59ce3a
File added
src/app/form/form.component.html
View file @
bd59ce3a
...
...
@@ -40,7 +40,7 @@
<span>
卡片类型
</span><span>
:
</span>
</div>
<div
style=
"float: left; width: 300px;"
>
<nz-radio-group
[(
ngModel
)]="
contentObj
.
answerType
"
(
ngModelChange
)="
saveItem
()"
>
<nz-radio-group
[(
ngModel
)]="
contentObj
.
answerType
"
(
ngModelChange
)="
handleAnswerTypeChange
()"
>
<label
nz-radio
[
nzValue
]="'
Text
'"
>
文字
</label>
<label
nz-radio
[
nzDisabled
]="
contentObj
.
question
.
type
!=
'
LongAudio
'"
[
nzValue
]="'
Image
'"
>
图片
</label>
</nz-radio-group>
...
...
@@ -71,12 +71,6 @@
<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"
>
...
...
@@ -86,25 +80,27 @@
<div
class=
"section"
>
<div
class=
"section-content"
>
<div
*
ngIf=
"contentObj.answerType=='Text'"
style=
"flex:1"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"flex:1"
>
文字
<div
[
ngSwitch
]="
contentObj
.
answerType
"
>
<div
*
ngSwitchCase=
"Text"
style=
"flex:1"
>
<div
style=
"display: flex; margin-bottom: 10px;"
>
<div
style=
"flex:1"
>
文字
</div>
<div
style=
"flex:5"
>
<!-- <input type="text" nz-input placeholder="" [(ngModel)]="contentObj.dataArray[i]" (blur)="saveItem()" style="width: 250px;" /> -->
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
contentObj
.
dataArray
[
i
]"
(
blur
)="
handleTextChange
($
event
,
i
)"
style=
"width: 250px;"
/>
</div>
</div>
<div
style=
"flex:5"
>
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
item
.
text
"
(
blur
)="
saveItem
()"
style=
"width: 250px;"
/>
</div>
</div>
</div>
<div
*
ngIf=
"contentObj.answerType=='Image'"
style=
"flex:1"
>
<div
style=
"display: flex; "
>
<div
style=
"flex:1"
>
图片
<div
*
ngSwitchCase=
"Image"
style=
"flex:1"
>
<div
style=
"display: flex; "
>
<div
style=
"flex:1"
>
图片
</div>
<div
style=
"flex:5"
>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
item
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
contentObj
.
dataArray
,
i
)"
></app-upload-image-with-preview>
</div>
</div>
<div
style=
"flex:5"
>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
item
.
image_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
contentObj
.
dataArray
,
i
)"
></app-upload-image-with-preview>
</div>
</div>
</div>
</div>
...
...
src/app/form/form.component.ts
View file @
bd59ce3a
...
...
@@ -13,6 +13,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item
:
any
;
KEY
=
'
DataKey_PU01
'
;
checkOptionsOne
=
[]
Text
=
"
Text
"
Image
=
"
Image
"
set
item
(
item
)
{
this
.
_item
=
item
;
...
...
@@ -24,7 +28,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
"
version
"
:
"
1.0
"
,
key
:
"
DataKey_PU01
"
,
question
:
{
type
:
"
Image
"
type
:
"
Image
"
,
text
:
""
,
image_url
:
""
,
shortAudio_url
:
""
,
longAudio_url
:
""
},
answerType
:
"
Text
"
,
dataArray
:
[]
...
...
@@ -45,14 +53,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
handleQuestionTypeChange
(){
if
(
this
.
contentObj
.
question
.
type
!=
'
LongAudio
'
){
this
.
contentObj
.
answerType
=
'
Text
'
if
(
this
.
contentObj
.
answerType
!=
"
Text
"
){
this
.
contentObj
.
answerType
=
'
Text
'
let
len
=
this
.
contentObj
.
dataArray
.
length
this
.
contentObj
.
dataArray
=
Array
(
len
).
fill
(
""
)
}
}
this
.
saveItem
()
}
handleAnswerTypeChange
(){
// console.log("Change")
let
len
=
this
.
contentObj
.
dataArray
.
length
this
.
contentObj
.
dataArray
=
Array
(
len
).
fill
(
""
)
this
.
saveItem
()
}
handleTextChange
(
e
,
index
){
// console.log(e.target.value, index)
this
.
contentObj
.
dataArray
[
index
]
=
e
.
target
.
value
this
.
saveItem
()
this
.
refresh
();
}
...
...
@@ -132,12 +154,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
addItem
(
item
?,
type
?)
{
item
.
push
(
{
text
:
""
,
image_url
:
""
}
)
item
.
push
(
""
)
this
.
saveItem
();
}
onImageUploadSuccessByItem
(
e
,
item
,
key
)
{
item
[
key
]
=
e
.
url
this
.
contentObj
.
dataArray
[
key
]
=
e
.
url
this
,
this
.
refresh
()
this
.
save
();
}
...
...
src/app/play/play.component.ts
View file @
bd59ce3a
This diff is collapsed.
Click to expand it.
src/app/play/resources.js
View file @
bd59ce3a
...
...
@@ -31,6 +31,7 @@ const localImages = {
'
bg_bottom
'
:
'
assets/play/bg_bottom.png
'
,
'
bg_change
'
:
'
assets/play/bg_change_1.png
'
,
'
bg_change2
'
:
'
assets/play/bg_change2-1.png
'
,
'
bg_change3
'
:
'
assets/play/bg_change2-2.png
'
,
'
bg_kuang1
'
:
'
assets/play/bg_kuang1.png
'
,
'
bg_kuang2
'
:
'
assets/play/bg_kuang2.png
'
,
'
bg_laba
'
:
'
assets/play/bg_laba.png
'
,
...
...
@@ -60,6 +61,9 @@ const localImages = {
'
border_right
'
:
'
assets/play/border_right.png
'
,
'
border_center
'
:
'
assets/play/border_center.png
'
,
'
lego-building
'
:
'
assets/play/lego-building.jpg
'
,
'
bg_face
'
:
'
assets/play/bg_face.png
'
,
'
btn_laba (1)
'
:
'
assets/play/frame/btn_laba (1).png
'
,
'
btn_laba (2)
'
:
'
assets/play/frame/btn_laba (2).png
'
,
...
...
src/assets/play/bg_change2-2.png
0 → 100644
View file @
bd59ce3a
2.34 KB
src/assets/play/bg_face.png
0 → 100644
View file @
bd59ce3a
981 KB
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