Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM04-3
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
JM04-3
Commits
b59c9ccd
Commit
b59c9ccd
authored
Jul 30, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
082f5165
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
29 deletions
+70
-29
form.component.ts
src/app/form/form.component.ts
+5
-5
play.component.ts
src/app/play/play.component.ts
+65
-24
No files found.
src/app/form/form.component.ts
View file @
b59c9ccd
...
...
@@ -108,15 +108,15 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
for
(
let
i
=
0
;
i
<
this
.
grid
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
grid
[
i
].
length
;
j
++
)
{
if
(
this
.
checkIndex
(
this
.
grid
[
i
][
j
].
index
,
index
))
{
this
.
grid
[
i
][
j
].
index
=
[]
;
this
.
grid
[
i
][
j
].
index
.
length
=
0
;
this
.
grid
[
i
][
j
].
text
=
""
;
}
if
(
del
)
{
this
.
grid
[
i
][
j
].
index
.
forEach
(
temIndex
=>
{
if
(
t
emIndex
>
index
)
{
t
emIndex
--
;
for
(
let
key
=
0
;
key
<
this
.
grid
[
i
][
j
].
index
.
length
;
key
++
)
{
if
(
t
his
.
grid
[
i
][
j
].
index
[
key
]
>
index
)
{
t
his
.
grid
[
i
][
j
].
index
[
key
]
--
;
}
}
);
}
}
}
}
...
...
src/app/play/play.component.ts
View file @
b59c9ccd
...
...
@@ -1257,34 +1257,40 @@ export class PlayComponent implements OnInit, OnDestroy {
}
showCheckPannel
(
checkResult
)
{
const
creatItem
=
(
height
,
withSplit
,
data
)
=>
{
let
padding
=
30
;
const
creatItem
=
(
withSplit
,
data
)
=>
{
let
heightData
=
{
text
:
0
,
textLineNum
:
0
,
word
:
0
,
right
:
0
,
line
:
0
,
textRef
:
null
,
wordRef
:
null
,
rightRef
:
null
,
lineRef
:
null
}
let
scrollContent
=
this
.
g_cartoon
.
getCartoonElement
(
"
check_scroll_pannel
"
)
let
totalHeight
=
height
let
text
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text
"
,
data
.
text
,
"
Aileron-Bold
"
,
"
#FFFFFF
"
,
48
)
text
.
ref
.
textAlign
=
"
left
"
;
text
.
ref
.
warpLineHeight
=
64
;
text
.
ref
.
maxSingalLineWidth
=
800
;
text
.
ref
.
refreshSize
();
text
.
ref
.
x
=
0
if
(
text
.
ref
.
lineNum
==
0
)
{
text
.
ref
.
warpLineHeight
=
0
;
text
.
ref
.
maxSingalLineWidth
=
0
;
text
.
ref
.
refreshSize
();
text
.
ref
.
y
=
totalHeight
text
.
ref
.
y
+=
62
}
else
{
text
.
ref
.
baseY
=
totalHeight
}
totalHeight
+=
(
text
.
ref
.
lineNum
+
1
)
*
64
;
heightData
.
textRef
=
text
.
ref
;
heightData
.
textLineNum
=
text
.
ref
.
lineNum
heightData
.
text
=
(
text
.
ref
.
lineNum
+
1
)
*
64
scrollContent
.
ref
.
addChild
(
text
.
ref
)
let
wordColorBG
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
"
wordColorBG
"
,
360
,
64
,
data
.
right
?
"
#007b3e
"
:
"
#d71818
"
);
wordColorBG
.
ref
.
radius
=
16
wordColorBG
.
ref
.
y
=
totalHeight
+
padding
+
64
/
2
totalHeight
+=
padding
+
64
;
heightData
.
wordRef
=
wordColorBG
.
ref
heightData
.
word
=
64
;
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
word
,
"
Aileron-Bold
"
,
"
#FFFFFF
"
,
48
)
word
.
ref
.
x
=
360
/
2
...
...
@@ -1301,16 +1307,17 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
scrollContent
.
ref
.
width
/
2
,
y
:
totalHeight
+
50
+
6
0
y
:
0
}
})
totalHeight
+=
120
+
padding
;
heightData
.
rightRef
=
ele
.
ref
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
rightWord
,
"
Aileron-Bold
"
,
"
#ffe9b1
"
,
52
)
word
.
ref
.
x
=
0
word
.
ref
.
x
=
-
797
/
2
+
15
0
word
.
ref
.
y
=
0
ele
.
ref
.
addChild
(
word
.
ref
)
heightData
.
right
=
120
;
scrollContent
.
ref
.
addChild
(
ele
.
ref
)
}
...
...
@@ -1323,26 +1330,60 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
880
/
2
,
y
:
totalHeight
+
5
0
y
:
0
}
})
totalHeight
+=
padding
+
10
;
heightData
.
line
=
10
;
heightData
.
lineRef
=
splitLine
.
ref
scrollContent
.
ref
.
addChild
(
splitLine
.
ref
);
}
return
totalHeight
return
heightData
}
let
scrollContent
=
this
.
g_cartoon
.
getCartoonElement
(
"
check_scroll_pannel
"
)
let
sliderBG
=
this
.
g_cartoon
.
getCartoonElement
(
"
slider-background
"
)
let
totalHeight
=
0
;
let
heigthData
=
[]
;
let
totalNum
=
checkResult
.
length
;
checkResult
.
forEach
((
element
,
index
)
=>
{
totalHeight
=
creatItem
(
totalHeight
,
!
(
index
==
(
totalNum
-
1
)),
element
)
heigthData
.
push
(
creatItem
(
!
(
index
==
(
totalNum
-
1
)),
element
)
)
});
this
.
m_totalScrollHeight
=
totalHeight
+
100
;
let
totalHeight
=
0
let
padding
=
30
;
heigthData
.
forEach
(
item
=>
{
totalHeight
+=
item
.
text
totalHeight
+=
item
.
word
totalHeight
+=
item
.
right
totalHeight
+=
item
.
line
})
let
countY
=
0
;
heigthData
.
forEach
(
item
=>
{
if
(
item
.
textLineNum
>
0
)
{
item
.
textRef
.
baseY
=
countY
-
item
.
text
+
64
*
1.5
;
}
else
{
item
.
textRef
.
y
=
countY
+
64
/
2
;
}
countY
+=
item
.
text
+
padding
if
(
item
.
wordRef
)
{
item
.
wordRef
.
y
=
countY
;
countY
+=
item
.
word
+
padding
}
if
(
item
.
rightRef
)
{
item
.
rightRef
.
y
=
countY
+
item
.
right
/
2
;
countY
+=
item
.
right
+
padding
}
if
(
item
.
lineRef
)
{
item
.
lineRef
.
y
=
countY
;
countY
+=
item
.
line
+
padding
}
})
this
.
m_totalScrollHeight
=
totalHeight
+
200
;
sliderBG
.
initSlider
(
scrollContent
.
windowHeight
,
this
.
m_totalScrollHeight
,
0
)
let
scroll
=
this
.
g_cartoon
.
getCartoonElement
(
"
check_scroll_pannel
"
)
scroll
.
ref
.
setSize
(
880
,
this
.
m_totalScrollHeight
)
...
...
@@ -1532,8 +1573,8 @@ export class PlayComponent implements OnInit, OnDestroy {
let
questionText
=
this
.
g_cartoon
.
getCartoonElement
(
"
question_text
"
);
questionText
.
ref
.
text
=
this
.
g_formData
.
dataArray
[
toIndex
].
text
questionText
.
ref
.
refreshSize
();
if
(
questionText
.
ref
.
width
>
1
92
0
)
{
questionText
.
ref
.
setScaleXY
(
1
92
0
/
questionText
.
ref
.
width
);
if
(
questionText
.
ref
.
width
>
1
80
0
)
{
questionText
.
ref
.
setScaleXY
(
1
80
0
/
questionText
.
ref
.
width
);
}
let
nextButton
=
this
.
g_cartoon
.
getCartoonElement
(
"
question_next
"
)
...
...
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