Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cocosTest
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
cocosTest
Commits
49118022
Commit
49118022
authored
Jul 21, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 初始项目
parent
8a51c964
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12937 additions
and
10 deletions
+12937
-10
package-lock.json
package-lock.json
+12868
-0
form.component.css
src/app/form/form.component.css
+20
-0
form.component.html
src/app/form/form.component.html
+32
-3
form.component.ts
src/app/form/form.component.ts
+17
-7
No files found.
package-lock.json
0 → 100644
View file @
49118022
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/app/form/form.component.css
View file @
49118022
...
@@ -6,3 +6,23 @@
...
@@ -6,3 +6,23 @@
height
:
100%
;
height
:
100%
;
}
}
.border
{
border-radius
:
20px
;
border-style
:
dashed
;
padding
:
20px
;
margin
:
20px
;
/*width: 500px; */
/*//border-radius: 20px;*/
/*//border-width: 2px;*/
/*//border-color: #000000;*/
}
.border-lite
{
border
:
2px
dashed
#ddd
;
border-radius
:
0.5rem
;
padding
:
10px
;
margin
:
10px
;
}
\ No newline at end of file
src/app/form/form.component.html
View file @
49118022
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
class=
"border"
style=
"position: absolute; left: 200px; top: 100px; width: 800px;"
>
<span
style=
"float: left; height: 30px; font-size: 18px;"
>
正确字母:
</span>
<input
style=
"float: left; width: 50px;"
type=
"text"
nz-input
[(
ngModel
)]="
item
.
rightWord
"
(
blur
)="
save
()"
>
<br>
<br>
<span
style=
"float: left; height: 30px; font-size: 18px;"
>
正确字母个数:
</span>
<input
style=
"float: left; width: 50px;"
type=
"text"
nz-input
[(
ngModel
)]="
item
.
rightNum
"
(
blur
)="
save
()"
>
<br>
<br>
<span
style=
"float: left; height: 30px; font-size: 18px;"
>
总字母个数:
</span>
<input
style=
"float: left; width: 50px;"
type=
"text"
nz-input
[(
ngModel
)]="
item
.
optionNum
"
(
blur
)="
save
()"
>
<br>
<br>
<div
*
ngFor=
"let wordItem of item.wordItem; let i = index"
style=
"float: left;"
>
<div
class=
"border"
style=
"float: left; width: 230px;"
>
<span
style=
"float: left; height: 30px; font-size: 18px;"
>
字母:
</span>
<input
style=
"float: left; width: 50px;"
type=
"text"
nz-input
[(
ngModel
)]="
wordItem
.
word
"
(
blur
)="
save
()"
>
<app-upload-image-with-preview
style=
"float: left; width:200px;"
[
picUrl
]="
wordItem
.
img
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
pic_url
')"
></app-upload-image-with-preview>
<div
style=
"position: absolute; left: 200px; top: 100px; width: 800px;"
>
<app-audio-recorder
style=
"float: left;"
[
audioUrl
]="
wordItem
.
audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
audio_url
')"
></app-audio-recorder>
</div>
</div>
</div>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
text
"
(
blur
)="
save
()"
>
<!--
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
<app-upload-image-with-preview
<app-upload-image-with-preview
[picUrl]="item.pic_url"
[picUrl]="item.pic_url"
...
@@ -18,7 +47,7 @@
...
@@ -18,7 +47,7 @@
<app-custom-hot-zone></app-custom-hot-zone>
<app-custom-hot-zone></app-custom-hot-zone>
<app-upload-video></app-upload-video>
<app-upload-video></app-upload-video>
<app-lesson-title-config></app-lesson-title-config>
<app-lesson-title-config></app-lesson-title-config>
</div>
</div>
-->
</div>
</div>
src/app/form/form.component.ts
View file @
49118022
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
'
;
...
@@ -15,17 +15,26 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -15,17 +15,26 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
item
;
item
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
item
=
{};
this
.
item
=
{
wordItem
:
[{
word
:
'
p
'
,
audio
:
'
p.mp3
'
,
img
:
'
p.png
'
}],
rightWord
:
'
a
'
,
rightNum
:
6
,
optionNum
:
11
,
};
// 获取存储的数据
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
if
(
data
)
{
if
(
data
)
{
this
.
item
=
data
;
this
.
item
=
data
;
...
@@ -60,8 +69,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -60,8 +69,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
*/
*/
onImageUploadSuccess
(
e
,
key
)
{
onImageUploadSuccess
(
e
,
key
)
{
this
.
item
[
key
]
=
e
.
url
;
this
.
item
[
key
]
=
e
.
url
;
this
.
save
();
this
.
save
();
}
}
/**
/**
...
@@ -80,7 +89,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -80,7 +89,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存数据
* 储存数据
*/
*/
save
()
{
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
console
.
log
(
'
this.item =
'
+
JSON
.
stringify
(
this
.
item
))
this
.
refresh
();
this
.
refresh
();
}
}
...
...
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