Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mytest_0001
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
mytest_0001
Commits
2f13b8eb
Commit
2f13b8eb
authored
Nov 12, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: select控件测试
parent
8a51c964
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13077 additions
and
56 deletions
+13077
-56
angular.json
angular.json
+5
-2
package-lock.json
package-lock.json
+13046
-0
form.component.html
src/app/form/form.component.html
+12
-24
form.component.ts
src/app/form/form.component.ts
+14
-30
No files found.
angular.json
View file @
2f13b8eb
...
@@ -128,5 +128,8 @@
...
@@ -128,5 +128,8 @@
}
}
}
}
},
},
"defaultProject"
:
"ng-template-generator"
"defaultProject"
:
"ng-template-generator"
,
"cli"
:
{
"analytics"
:
false
}
}
}
\ No newline at end of file
package-lock.json
0 → 100644
View file @
2f13b8eb
This diff is collapsed.
Click to expand it.
src/app/form/form.component.html
View file @
2f13b8eb
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
style=
"margin-left: 100px; margin-top: 100px; border-style: double; border-width: 1px; width:400px"
>
<div
*
ngFor=
"let test of item.testList; let i = index"
>
<div
style=
"position: absolute; left: 200px; top: 100px; width: 800px;"
>
<div
style=
"margin:20px; width: 350px; border-style: double; border-width: 1px;"
>
<nz-select
style=
"width: 200px; margin-top: 10px; margin-left: 10px; margin-bottom: 10px;"
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
text
"
(
blur
)="
save
()"
>
[(
ngModel
)]="
test
.
data
"
(
ngModelChange
)="
save
()"
>
<nz-option
nzValue=
"1"
nzLabel=
"1"
></nz-option>
<app-upload-image-with-preview
<nz-option
nzValue=
"2"
nzLabel=
"2"
></nz-option>
[
picUrl
]="
item
.
pic_url
"
</nz-select>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
pic_url
')"
</div>
></app-upload-image-with-preview>
</div>
<app-audio-recorder
[
audioUrl
]="
item
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
audio_url
')"
></app-audio-recorder>
<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>
</div>
\ No newline at end of file
\ No newline at end of file
src/app/form/form.component.ts
View file @
2f13b8eb
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
'
;
@
Component
({
@
Component
({
selector
:
'
app-form
'
,
selector
:
'
app-form
'
,
...
@@ -10,22 +8,26 @@ import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, Ap
...
@@ -10,22 +8,26 @@ import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, Ap
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
// 储存数据用
saveKey
=
"
test_0011
"
;
saveKey
=
"
test_0
1
011
"
;
// 储存对象
// 储存对象
item
;
item
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
}
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
item
=
{};
this
.
item
=
{
testList
:
[
{
data
:
0
},
{
data
:
1
},
{
data
:
2
},
{
data
:
3
},
{
data
:
4
},
]
};
// 获取存储的数据
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
if
(
data
)
{
if
(
data
)
{
this
.
item
=
data
;
this
.
item
=
data
;
...
@@ -40,47 +42,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -40,47 +42,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
ngOnChanges
()
{
ngOnChanges
()
{
}
}
ngOnDestroy
()
{
ngOnDestroy
()
{
}
}
init
()
{
init
()
{
}
}
/**
/**
* 储存图片数据
* 储存图片数据
* @param e
* @param e
*/
*/
onImageUploadSuccess
(
e
,
key
)
{
onImageUploadSuccess
(
e
,
key
)
{
this
.
item
[
key
]
=
e
.
url
;
this
.
item
[
key
]
=
e
.
url
;
this
.
save
();
this
.
save
();
}
}
/**
* 储存音频数据
* @param e
*/
onAudioUploadSuccess
(
e
,
key
)
{
this
.
item
[
key
]
=
e
.
url
;
this
.
save
();
}
/**
/**
* 储存数据
* 储存数据
*/
*/
save
()
{
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
this
.
refresh
();
this
.
refresh
();
}
}
...
@@ -92,6 +77,5 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -92,6 +77,5 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
appRef
.
tick
();
this
.
appRef
.
tick
();
},
1
);
},
1
);
}
}
}
}
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