Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU-17
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
PU-17
Commits
1f09942a
Commit
1f09942a
authored
Jul 03, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整色板处理
parent
b5c84a8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
form.component.html
src/app/form/form.component.html
+22
-1
form.component.ts
src/app/form/form.component.ts
+27
-0
No files found.
src/app/form/form.component.html
View file @
1f09942a
...
@@ -37,6 +37,27 @@
...
@@ -37,6 +37,27 @@
</button>
</button>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzNoColon=
true
>
图片涂色
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<nz-input-group
[
nzSize
]="'
large
'"
>
<div
nz-row
[
nzGutter
]="
8
"
>
<div
nz-col
nzSpan=
"5"
>
<nz-select
[(
ngModel
)]="
curPic
"
style=
"width: 110px;"
id=
"type"
nzPlaceHolder=
"picurte"
(
ngModelChange
)="
onChangeColor
($
event
)"
>
<nz-option
[
nzValue
]="
option
.
picUrl
"
[
nzLabel
]="'图片
-
'
+
(
i
+
1
)
"
*
ngFor=
"let option of item.picArr;let i = index"
>
</nz-option>
</nz-select>
</div>
<div
nz-col
nzSpan=
"5"
>
<input
nz-input
[(
ngModel
)]="
color
"
(
blur
)="
setColor
()"
/>
</div>
<div
nz-col
nzSpan=
"5"
>
<input
nz-input
[(
colorPicker
)]="
color
"
[
style
.
background
]="
color
"
style=
"cursor: pointer; width:50px;margin-left: 10px;"
(
colorPickerClose
)="
setColor
()"
readonly
/>
</div>
</div>
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div
nz-row
>
<div
nz-row
>
<div
*
ngFor=
"let data of item.picArr;let i = index"
nz-col
[
nzXs
]='
24
'
[
nzSm
]='
12
'
[
nzMd
]='
12
'
[
nzLg
]='
7
'
style=
"margin: 1vw;"
>
<div
*
ngFor=
"let data of item.picArr;let i = index"
nz-col
[
nzXs
]='
24
'
[
nzSm
]='
12
'
[
nzMd
]='
12
'
[
nzLg
]='
7
'
style=
"margin: 1vw;"
>
...
@@ -52,7 +73,7 @@
...
@@ -52,7 +73,7 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzNoColon=
true
>
涂色
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzNoColon=
true
>
涂色
</nz-form-label>
<nz-form-control
[
nzSpan
]="
18
"
>
<nz-form-control
[
nzSpan
]="
18
"
>
<div
[(
colorPicker
)]="
data
.
color
"
[
style
.
background
]="
data
.
color
"
style=
"cursor: pointer; width:50px;height:30px;border:1px solid #CCC;float:left;margin-left: 10px;"
(
colorPickerClose
)="
save
()
"
></div>
<div
[
ngStyle
]="{'
background
'
:data
.
color
,'
width
'
:
'
50px
','
height
'
:
'
30px
','
border
'
:
'
1px
solid
#
CCC
'}
"
></div>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</nz-card>
</nz-card>
...
...
src/app/form/form.component.ts
View file @
1f09942a
...
@@ -16,6 +16,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -16,6 +16,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存对象
// 储存对象
item
;
item
;
curPic
;
color
=
"
#f3440d
"
;
colorArr
=
[];
colorArr
=
[];
courseTypeArr
=
[];
courseTypeArr
=
[];
...
@@ -205,5 +209,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -205,5 +209,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
this
.
save
();
}
}
}
}
onChangeColor
(
event
){
this
.
curPic
=
null
;
for
(
let
i
=
0
;
i
<
this
.
item
.
picArr
.
length
;
++
i
){
let
pic
=
this
.
item
.
picArr
[
i
];
let
picUrl
=
pic
.
picUrl
;
if
(
event
===
picUrl
){
this
.
curPic
=
this
.
item
.
picArr
[
i
];
this
.
color
=
pic
.
color
;
break
;
}
}
}
setColor
(){
if
(
this
.
curPic
){
this
.
curPic
.
color
=
this
.
color
;
this
.
save
();
}
}
}
}
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