Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
test_01_gt
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
test_01_gt
Commits
c3a447fa
Commit
c3a447fa
authored
Jun 04, 2020
by
luhongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入门教程练习
parent
3695f7ce
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9340 additions
and
665 deletions
+9340
-665
form.component.css
src/app/form/form.component.css
+0
-1
form.component.html
src/app/form/form.component.html
+5
-5
form.component.ts
src/app/form/form.component.ts
+16
-47
play.component.ts
src/app/play/play.component.ts
+26
-612
yarn.lock
yarn.lock
+9293
-0
No files found.
src/app/form/form.component.css
View file @
c3a447fa
...
...
@@ -4,5 +4,4 @@
.model-content
{
width
:
100%
;
height
:
100%
;
}
src/app/form/form.component.html
View file @
c3a447fa
<div
class=
"model-content"
>
<input
nz-input
placeholder=
"Basic usage"
[(
ngModel
)]="
msg
"
(
blur
)="
saveItem
()"
/>
<div
style=
"position: absolute; left: 200px; top: 100px; width: 800px;"
>
<
!-- <
div style="position: absolute; left: 200px; top: 100px; width: 800px;">
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
...
...
@@ -18,8 +19,7 @@
<app-custom-hot-zone></app-custom-hot-zone>
<app-upload-video></app-upload-video>
<app-lesson-title-config></app-lesson-title-config>
</div>
</div>
-->
</div>
\ No newline at end of file
src/app/form/form.component.ts
View file @
c3a447fa
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
'
;
import
{
NzInputModule
}
from
'
ng-zorro-antd/input
'
;
...
...
@@ -9,89 +10,57 @@ import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, Ap
})
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
msg
=
"
gt
"
;
// 储存数据用
saveKey
=
"
test_001
1
"
;
KEY
=
"
test_01_gt
1
"
;
// 储存对象
item
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
}
ngOnInit
()
{
this
.
item
=
{};
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
getData
(
data
=>
{
if
(
data
)
{
this
.
item
=
data
;
this
.
msg
=
data
.
msg
;
}
else
{
this
.
msg
=
""
;
}
this
.
init
();
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
detectChanges
();
this
.
refresh
();
},
this
.
saveKey
);
},
this
.
KEY
)
}
ngOnChanges
()
{
}
ngOnDestroy
()
{
}
init
()
{
}
/**
* 储存图片数据
* @param e
*/
onImageUploadSuccess
(
e
,
key
)
{
this
.
item
[
key
]
=
e
.
url
;
this
.
save
();
}
/**
* 储存音频数据
* @param e
*/
onAudioUploadSuccess
(
e
,
key
)
{
this
.
item
[
key
]
=
e
.
url
;
saveItem
()
{
console
.
log
(
"
save:
"
+
this
.
msg
);
this
.
save
();
}
/**
* 储存数据
*/
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
(
<
any
>
window
).
courseware
.
setData
({
msg
:
this
.
msg
},
null
,
this
.
KEY
);
this
.
refresh
();
}
/**
* 刷新 渲染页面
* 立即执行
*/
refresh
()
{
setTimeout
(()
=>
{
this
.
appRef
.
tick
();
},
1
);
}
}
src/app/play/play.component.ts
View file @
c3a447fa
This diff is collapsed.
Click to expand it.
yarn.lock
0 → 100644
View file @
c3a447fa
This diff is collapsed.
Click to expand it.
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