Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM-42
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
YM-42
Commits
3c9bbfda
Commit
3c9bbfda
authored
Nov 18, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bugs
parent
ebc5514e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13073 additions
and
25 deletions
+13073
-25
package-lock.json
package-lock.json
+13045
-0
form.component.ts
src/app/form/form.component.ts
+28
-25
No files found.
package-lock.json
0 → 100644
View file @
3c9bbfda
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/app/form/form.component.ts
View file @
3c9bbfda
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
,
ApplicationRef
,
ChangeDetectorRef
}
from
'
@angular/core
'
;
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
,
ApplicationRef
,
ChangeDetectorRef
}
from
'
@angular/core
'
;
...
...
@@ -14,7 +14,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存对象
item
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
}
...
...
@@ -34,17 +34,20 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
console
.
log
(
'
item:
'
,
this
.
item
);
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
if
(
data
)
{
this
.
item
=
data
;
if
(
data
.
contentObj
&&
data
.
contentObj
.
data
)
{
this
.
item
=
data
.
contentObj
.
data
;
}
}
if
(
!
this
.
item
.
skinB
)
{
if
(
!
this
.
item
.
skinB
)
{
this
.
item
.
skinB
=
{};
}
if
(
!
this
.
item
.
skinA
)
{
if
(
!
this
.
item
.
skinA
)
{
this
.
item
.
skinA
=
{};
}
...
...
@@ -67,20 +70,20 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
init
()
{
if
(
!
this
.
item
.
title
)
{
if
(
!
this
.
item
.
title
)
{
this
.
item
.
title
=
this
.
getDefaultTile
();
}
//设置默认皮肤
if
(
!
this
.
item
.
skin
)
{
if
(
!
this
.
item
.
skin
)
{
this
.
item
.
skin
=
"
A
"
;
}
if
(
!
this
.
item
.
exercisesArr
||
this
.
item
.
exercisesArr
.
length
==
0
)
{
if
(
!
this
.
item
.
exercisesArr
||
this
.
item
.
exercisesArr
.
length
==
0
)
{
this
.
item
.
exercisesArr
=
[];
for
(
let
i
=
0
;
i
<
6
;
++
i
)
{
for
(
let
i
=
0
;
i
<
6
;
++
i
)
{
let
exercises
=
this
.
getDefaultExercisesItem
();
...
...
@@ -117,7 +120,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存数据
*/
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
this
.
changeDetectorRef
.
detectChanges
();
this
.
refresh
();
}
...
...
@@ -135,22 +138,22 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
/**
* 获取缺省的练习题内容
*/
getDefaultExercisesItem
(){
getDefaultExercisesItem
()
{
const
exercises
=
{
text
:
''
,
pic_url
:
''
,
audio_url
:
''
,
letters
:[]
text
:
''
,
pic_url
:
''
,
audio_url
:
''
,
letters
:
[]
};
return
exercises
;
}
getDefaultTile
(){
getDefaultTile
()
{
const
title
=
{
part1
:
''
,
part2
:
''
,
audio_url
:
''
part1
:
''
,
part2
:
''
,
audio_url
:
''
};
return
title
;
...
...
@@ -159,10 +162,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
/**
* 获取默认的字母
*/
getDefaultLetter
(){
getDefaultLetter
()
{
let
letter
=
{
val
:
''
,
isColor
:
'
0
'
val
:
''
,
isColor
:
'
0
'
};
return
letter
;
...
...
@@ -185,11 +188,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
clearBg
(){
if
(
this
.
item
.
skin
===
'
A
'
)
{
clearBg
()
{
if
(
this
.
item
.
skin
===
'
A
'
)
{
this
.
item
.
skinA
=
{};
}
else
{
else
{
this
.
item
.
skinB
=
{};
}
...
...
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