Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU03
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
PU03
Commits
2ffa4d7c
Commit
2ffa4d7c
authored
Jun 15, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
2ea4551e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
37 deletions
+50
-37
ng-template-generator_20200615 18-40-45.zip
publish/ng-template-generator_20200615 18-40-45.zip
+0
-0
form.component.html
src/app/form/form.component.html
+6
-8
form.component.ts
src/app/form/form.component.ts
+35
-20
play.component.ts
src/app/play/play.component.ts
+9
-9
6.png
src/assets/play/6.png
+0
-0
7.png
src/assets/play/7.png
+0
-0
No files found.
publish/ng-template-generator_20200615 1
4-02-03
.zip
→
publish/ng-template-generator_20200615 1
8-40-45
.zip
View file @
2ffa4d7c
No preview for this file type
src/app/form/form.component.html
View file @
2ffa4d7c
...
@@ -65,19 +65,17 @@
...
@@ -65,19 +65,17 @@
<div
style=
"flex:3"
>
<div
style=
"flex:3"
>
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
it
.
text
"
(
blur
)="
saveItem
()"
/>
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
it
.
text
"
(
blur
)="
saveItem
()"
/>
</div>
</div>
<div
style=
"flex:8"
style=
"margin-left:
1
0px;"
>
<div
style=
"flex:8"
style=
"margin-left:
2
0px;"
>
<span>
对应下层卡片
</span><span>
:
</span>
<span>
对应下层卡片
</span><span>
:
</span>
<nz-select
nzMode=
"multiple"
nzPlaceHolder=
"Inserted are removed"
[(
ngModel
)]="
it
.
lineTo
"
(
ngModelChange
)="
save
()"
style=
"min-width: 500px;"
>
<nz-checkbox-group
[(
ngModel
)]="
it
.
checkOptions
"
(
ngModelChange
)="
save
()"
></nz-checkbox-group>
<nz-option
*
ngFor=
"let option of options;"
[
nzLabel
]="
option
+
1
"
[
nzValue
]="
option
"
></nz-option>
</nz-select>
</div>
</div>
<div
style=
"flex:4"
>
<div
style=
"flex:4"
>
<div
style=
"float:right; text-align: left; padding-left: 20px;"
>
<div
style=
"float:right; text-align: left; padding-left: 20px;"
>
<button
style=
"vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemUp
(
i
)"
[
disabled
]="
i=
=0"
>
<button
style=
"vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemUp
(
i
tem
.
contentObj
.
textUp
,
i
)"
[
disabled
]="
i=
=0"
>
<i
nz-icon
nzType=
"up"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<i
nz-icon
nzType=
"up"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<span
style=
"float: right;"
>
上移
</span>
<span
style=
"float: right;"
>
上移
</span>
</button>
</button>
<button
style=
"margin-left: 10px; vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemDown
(
i
)"
[
disabled
]="
i=
=item.contentObj.textUp.length-1"
>
<button
style=
"margin-left: 10px; vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemDown
(
i
tem
.
contentObj
.
textUp
,
i
)"
[
disabled
]="
i=
=item.contentObj.textUp.length-1"
>
<i
nz-icon
nzType=
"down"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<i
nz-icon
nzType=
"down"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<span
style=
"float: right;"
>
下移
</span>
<span
style=
"float: right;"
>
下移
</span>
</button>
</button>
...
@@ -118,11 +116,11 @@
...
@@ -118,11 +116,11 @@
</div>
</div>
<div
style=
"flex:4"
>
<div
style=
"flex:4"
>
<div
style=
"float:right; text-align: left; padding-left: 20px;"
>
<div
style=
"float:right; text-align: left; padding-left: 20px;"
>
<button
style=
"vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemUp
(
i
)"
[
disabled
]="
i=
=0"
>
<button
style=
"vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemUp
(
i
tem
.
contentObj
.
textDown
,
i
)"
[
disabled
]="
i=
=0"
>
<i
nz-icon
nzType=
"up"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<i
nz-icon
nzType=
"up"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<span
style=
"float: right;"
>
上移
</span>
<span
style=
"float: right;"
>
上移
</span>
</button>
</button>
<button
style=
"margin-left: 10px; vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemDown
(
i
)"
[
disabled
]="
i=
=item.contentObj.textDown.length-1"
>
<button
style=
"margin-left: 10px; vertical-align:baseline;"
nz-button
nzType=
"default"
(
click
)="
handleMoveItemDown
(
i
tem
.
contentObj
.
textDown
,
i
)"
[
disabled
]="
i=
=item.contentObj.textDown.length-1"
>
<i
nz-icon
nzType=
"down"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<i
nz-icon
nzType=
"down"
nzTheme=
"outline"
style=
"float: left; margin-top: 4px;"
></i>
<span
style=
"float: right;"
>
下移
</span>
<span
style=
"float: right;"
>
下移
</span>
</button>
</button>
...
...
src/app/form/form.component.ts
View file @
2ffa4d7c
...
@@ -12,7 +12,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -12,7 +12,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item
:
any
;
_item
:
any
;
KEY
=
'
DataKey_PU03
'
;
KEY
=
'
DataKey_PU03
'
;
options
=
[]
checkOptionsOne
=
[]
set
item
(
item
)
{
set
item
(
item
)
{
this
.
_item
=
item
;
this
.
_item
=
item
;
...
@@ -75,12 +75,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -75,12 +75,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// console.log("使用默认数据", this.contentObj)
// console.log("使用默认数据", this.contentObj)
this
.
item
.
contentObj
=
this
.
contentObj
;
this
.
item
.
contentObj
=
this
.
contentObj
;
}
}
this
.
updateCheckbox
()
this
.
options
=
[]
this
.
item
.
contentObj
.
textDown
.
forEach
((
item
,
index
)
=>
{
this
.
options
.
push
(
index
)
});
}
}
cardItemData
(){
cardItemData
(){
...
@@ -96,27 +91,27 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -96,27 +91,27 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
handleMoveItemUp
(
items
,
index
){
handleMoveItemUp
(
index
){
if
(
index
!=
0
){
if
(
index
!=
0
){
this
.
item
.
contentObj
.
dataArray
[
index
]
=
this
.
item
.
contentObj
.
dataArray
.
splice
(
index
-
1
,
1
,
this
.
item
.
contentObj
.
dataArray
[
index
])[
0
];
items
[
index
]
=
items
.
splice
(
index
-
1
,
1
,
items
[
index
])[
0
];
}
else
{
}
else
{
this
.
item
.
contentObj
.
dataArray
.
push
(
this
.
item
.
contentObj
.
dataArray
.
shift
());
items
.
push
(
items
.
shift
());
}
}
this
.
save
()
this
.
save
()
}
}
handleMoveItemDown
(
index
){
handleMoveItemDown
(
i
tems
,
i
ndex
){
if
(
index
!=
this
.
item
.
contentObj
.
dataArray
.
length
-
1
){
if
(
index
!=
items
.
length
-
1
){
this
.
item
.
contentObj
.
dataArray
[
index
]
=
this
.
item
.
contentObj
.
dataArray
.
splice
(
index
+
1
,
1
,
this
.
item
.
contentObj
.
dataArray
[
index
])[
0
];
items
[
index
]
=
items
.
splice
(
index
+
1
,
1
,
items
[
index
])[
0
];
}
else
{
}
else
{
this
.
item
.
contentObj
.
dataArray
.
unshift
(
this
.
item
.
contentObj
.
dataArray
.
splice
(
index
,
1
)[
0
]);
items
.
unshift
(
items
.
splice
(
index
,
1
)[
0
]);
}
}
this
.
save
()
this
.
save
()
}
}
deleteItem
(
item
,
index
){
deleteItem
(
item
,
index
){
item
.
splice
(
index
,
1
)
item
.
splice
(
index
,
1
)
this
.
updateCheckbox
()
this
.
save
()
this
.
save
()
}
}
...
@@ -126,12 +121,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -126,12 +121,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
case
"
card
"
:
newItem
=
{
text
:
""
,
lineTo
:
[]}
case
"
card
"
:
newItem
=
{
text
:
""
,
lineTo
:
[]}
default
:
newItem
=
{
text
:
""
,
lineTo
:
[]}
default
:
newItem
=
{
text
:
""
,
lineTo
:
[]}
}
}
this
.
options
=
[]
this
.
item
.
contentObj
.
textDown
.
forEach
((
item
,
index
)
=>
{
this
.
options
.
push
(
index
)
});
item
.
push
(
newItem
);
item
.
push
(
newItem
);
this
.
updateCheckbox
()
this
.
saveItem
();
this
.
saveItem
();
}
}
...
@@ -152,6 +143,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -152,6 +143,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
save
()
{
save
()
{
this
.
item
.
contentObj
.
textUp
.
forEach
((
item
,
index
)
=>
{
let
newLineTo
=
[]
item
.
checkOptions
.
forEach
(
option
=>
{
if
(
option
.
checked
){
newLineTo
.
push
(
option
.
value
)
}
});
item
.
lineTo
=
JSON
.
parse
(
JSON
.
stringify
(
newLineTo
))
});
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
KEY
);
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
KEY
);
this
.
refresh
();
this
.
refresh
();
console
.
log
(
"
保存
"
,
this
.
item
)
console
.
log
(
"
保存
"
,
this
.
item
)
...
@@ -162,5 +163,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -162,5 +163,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
appRef
.
tick
();
this
.
appRef
.
tick
();
},
1
);
},
1
);
}
}
updateCheckbox
(){
let
check
=
[]
this
.
item
.
contentObj
.
textDown
.
forEach
((
item
,
index
)
=>
{
check
.
push
({
label
:
index
+
1
,
value
:
index
,
checked
:
false
})
});
this
.
item
.
contentObj
.
textUp
.
forEach
((
item
,
index
)
=>
{
item
.
lineTo
.
forEach
(
option
=>
{
check
[
Number
(
option
)].
checked
=
true
});
item
.
checkOptions
=
JSON
.
parse
(
JSON
.
stringify
(
check
))
});
}
}
}
src/app/play/play.component.ts
View file @
2ffa4d7c
...
@@ -357,9 +357,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -357,9 +357,9 @@ export class PlayComponent implements OnInit, OnDestroy {
let
enableShortAudio
=
false
;
let
enableShortAudio
=
false
;
switch
(
this
.
g_formData
.
mainQuestion
.
type
){
switch
(
this
.
g_formData
.
mainQuestion
.
type
){
case
"
Image
"
:
enableImage
=
true
;
break
;
case
"
Image
"
:
enableImage
=
true
;
console
.
log
(
"
图片
"
);
break
;
case
"
Text
"
:
enableText
=
true
;
break
;
case
"
Text
"
:
enableText
=
true
;
console
.
log
(
"
文字
"
);
break
;
case
"
LongAudio
"
:
enableLongAudio
=
true
;
break
;
case
"
LongAudio
"
:
enableLongAudio
=
true
;
console
.
log
(
"
长音频
"
);
break
;
default
:
enableText
=
true
;
break
;
default
:
enableText
=
true
;
break
;
}
}
if
(
this
.
g_formData
.
mainQuestion
.
shortAudio_url
){
if
(
this
.
g_formData
.
mainQuestion
.
shortAudio_url
){
...
@@ -368,9 +368,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -368,9 +368,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
enableImage
){
if
(
enableImage
){
// 图片内容
// 图片内容
let
imageContent
=
this
.
g_cartoon
.
createImage
(
"
default_Image
"
,
(
w
,
h
)
=>
{
let
imageContent
=
this
.
g_cartoon
.
createImage
(
this
.
g_formData
.
mainQuestion
.
image_url
,
(
w
,
h
)
=>
{
let
sx
=
645
*
0.9
65
/
w
let
sx
=
645
*
0.9
2
/
w
let
sy
=
323
*
0.9
65
/
h
let
sy
=
323
*
0.9
2
/
h
let
s
=
Math
.
min
(
sx
,
sy
)
let
s
=
Math
.
min
(
sx
,
sy
)
return
{
return
{
sx
:
s
,
sx
:
s
,
...
@@ -628,8 +628,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -628,8 +628,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// 音乐内容
// 音乐内容
let
shortAudio
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
main_window_la_play
"
,
"
btn_laba
"
,
(
w
,
h
)
=>
{
let
shortAudio
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
main_window_la_play
"
,
"
btn_laba
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
77
*
this
.
g_mapScale
/
w
,
sx
:
77
/
w
,
sy
:
260
*
this
.
g_mapScale
/
h
,
sy
:
260
/
h
,
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
return
{
return
{
...
@@ -773,7 +773,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -773,7 +773,7 @@ export class PlayComponent implements OnInit, OnDestroy {
card
.
ref
.
dot
=
dot
;
card
.
ref
.
dot
=
dot
;
// 红色节点
// 红色节点
let
dot_red
=
this
.
g_cartoon
.
createImage
(
"
icon_dian
2
"
,
(
w
,
h
)
=>
{
let
dot_red
=
this
.
g_cartoon
.
createImage
(
"
icon_dian
1
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
37
*
this
.
g_mapScale
/
w
,
sx
:
37
*
this
.
g_mapScale
/
w
,
sy
:
37
*
this
.
g_mapScale
/
h
sy
:
37
*
this
.
g_mapScale
/
h
...
...
src/assets/play/6.png
View replaced file @
2ea4551e
View file @
2ffa4d7c
1.46 KB
|
W:
|
H:
1.74 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/play/7.png
View replaced file @
2ea4551e
View file @
2ffa4d7c
1.6 KB
|
W:
|
H:
1.81 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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