Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wangqinghua
smart
Commits
b4d98539
Commit
b4d98539
authored
Dec 11, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
cde072ae
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
619 additions
and
79 deletions
+619
-79
select-person.component.html
...bapp/app/modal/select-person/select-person.component.html
+3
-0
select-person.component.ts
...webapp/app/modal/select-person/select-person.component.ts
+15
-0
icon.component.ts
src/main/webapp/app/netTopology/model/icon/icon.component.ts
+52
-50
inspect-plan.component.html
.../webapp/app/work/inspect-plan/inspect-plan.component.html
+12
-7
inspect-plan.component.ts
...in/webapp/app/work/inspect-plan/inspect-plan.component.ts
+88
-22
look-plan.component.html
.../webapp/app/work/modal/look-plan/look-plan.component.html
+108
-0
look-plan.component.ts
...in/webapp/app/work/modal/look-plan/look-plan.component.ts
+30
-0
plan-modal.component.html
...ebapp/app/work/modal/plan-modal/plan-modal.component.html
+152
-0
plan-modal.component.ts
.../webapp/app/work/modal/plan-modal/plan-modal.component.ts
+134
-0
work.service.ts
src/main/webapp/app/work/work.service.ts
+25
-0
No files found.
src/main/webapp/app/modal/select-person/select-person.component.html
0 → 100644
View file @
b4d98539
<p>
select-person works!
</p>
src/main/webapp/app/modal/select-person/select-person.component.ts
0 → 100644
View file @
b4d98539
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'smart-select-person'
,
templateUrl
:
'./select-person.component.html'
,
styles
:
[]
})
export
class
SelectPersonComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
src/main/webapp/app/netTopology/model/icon/icon.component.ts
View file @
b4d98539
...
...
@@ -2,124 +2,126 @@ import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import
{
NzMessageService
,
UploadFile
}
from
'ng-zorro-antd'
;
import
{
TopologyService
}
from
'../../topology.service'
;
import
{
FormBuilder
,
FormGroup
,
Validator
,
Validators
}
from
'@angular/forms'
;
import
{
filter
}
from
'rxjs/operators'
;
import
{
filter
}
from
'rxjs/operators'
;
@
Component
({
selector
:
'smart-icon'
,
templateUrl
:
'./icon.component.html'
,
styles
:
[]
selector
:
'smart-icon'
,
templateUrl
:
'./icon.component.html'
,
styles
:
[]
})
export
class
IconComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
isVisible
=
false
;
fileList
:
UploadFile
[]
=
[];
validateForm
:
FormGroup
;
title
=
"添加图标"
;
options
:
any
;
validateForm
:
FormGroup
;
title
=
'添加图标'
;
options
:
any
;
childrenList
=
[];
constructor
(
private
topologySer
:
TopologyService
,
private
message
:
NzMessageService
,
private
fb
:
FormBuilder
)
{
}
constructor
(
private
topologySer
:
TopologyService
,
private
message
:
NzMessageService
,
private
fb
:
FormBuilder
)
{
}
values
;
ngOnInit
()
{
this
.
initForm
();
this
.
getList
();
}
}
initForm
()
{
initForm
()
{
this
.
validateForm
=
this
.
fb
.
group
({
firstTypeId
:
[
null
,[
Validators
.
required
]]
,
secondTypeId
:[
null
],
iconType
:[
'0'
],
defaultIcon
:
[
"0"
],
name
:
[
""
],
firstTypeId
:
[
null
,
[
Validators
.
required
]]
,
secondTypeId
:
[
null
],
iconType
:
[
'0'
],
defaultIcon
:
[
'0'
],
name
:
[
''
],
});
this
.
fileList
=
[];
}
this
.
fileList
=
[];
}
getList
(){
getList
()
{
this
.
topologySer
.
findTreeWithWeb
().
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
options
=
res
.
data
;
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMSg
);
}
}
)
)
;
}
beforeUpload
=
(
file
:
UploadFile
):
boolean
=>
{
const
isLt2M
=
file
.
size
/
1024
<
300
;
const
isLt2M
=
file
.
size
/
1024
<
300
;
if
(
!
isLt2M
)
{
this
.
message
.
error
(
'图标必须小于300kb!'
);
}
else
{
}
else
{
this
.
fileList
.
push
(
file
);
}
return
false
;
};
showModal
(){
showModal
()
{
this
.
isVisible
=
true
;
}
handleOk
(){
if
(
this
.
fileList
.
length
==
0
)
{
this
.
message
.
error
(
"请选择图标"
);
handleOk
()
{
if
(
this
.
fileList
.
length
==
0
)
{
this
.
message
.
error
(
'请选择图标'
);
return
false
;
}
for
(
let
i
in
this
.
validateForm
.
controls
)
{
for
(
let
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
if
(
this
.
validateForm
.
invalid
)
{
if
(
this
.
validateForm
.
invalid
)
{
return
false
;
}
const
formData
=
new
FormData
();
this
.
fileList
.
forEach
((
file
:
any
)
=>
{
formData
.
append
(
'file'
,
file
);
});
formData
.
append
(
'iconType'
,
this
.
validateForm
.
value
.
iconType
);
formData
.
append
(
'defaultIcon'
,
this
.
validateForm
.
value
.
defaultIcon
);
formData
.
append
(
'firstTypeId'
,
this
.
validateForm
.
value
.
firstTypeId
);
formData
.
append
(
'secondTypeId'
,
this
.
validateForm
.
value
.
secondTypeId
);
formData
.
append
(
'name'
,
this
.
validateForm
.
value
.
name
);
console
.
log
(
this
.
validateForm
.
value
)
formData
.
append
(
'iconType'
,
this
.
validateForm
.
value
.
iconType
);
formData
.
append
(
'defaultIcon'
,
this
.
validateForm
.
value
.
defaultIcon
);
formData
.
append
(
'firstTypeId'
,
this
.
validateForm
.
value
.
firstTypeId
);
formData
.
append
(
'secondTypeId'
,
this
.
validateForm
.
value
.
secondTypeId
);
formData
.
append
(
'name'
,
this
.
validateForm
.
value
.
name
);
console
.
log
(
this
.
validateForm
.
value
)
;
this
.
topologySer
.
iconUpload
(
formData
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
"添加成功"
);
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'添加成功'
);
this
.
isVisible
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
)
;
}
onChanges
(
e
){
onChanges
(
e
)
{
this
.
childrenList
=
[];
console
.
log
(
e
);
if
(
!
isNaN
(
e
))
{
if
(
!
isNaN
(
e
))
{
console
.
log
(
'网站监测'
);
this
.
validateForm
.
get
(
'secondTypeId'
).
clearValidators
();
this
.
validateForm
.
value
.
iconType
=
'1'
;
}
else
{
}
else
{
this
.
validateForm
.
get
(
'secondTypeId'
).
setValidators
(
Validators
.
required
);
console
.
log
(
'主机资源'
);
console
.
log
(
'主机资源'
);
}
this
.
options
.
forEach
(
res
=>
{
if
(
res
.
id
==
e
)
{
this
.
options
.
forEach
(
res
=>
{
if
(
res
.
id
==
e
)
{
this
.
childrenList
=
res
.
childs
;
}
})
})
;
}
handleCancel
(){
handleCancel
()
{
this
.
isVisible
=
false
;
}
...
...
src/main/webapp/app/work/inspect-plan/inspect-plan.component.html
View file @
b4d98539
...
...
@@ -28,8 +28,9 @@
</div>
<div
nz-col
nzSpan=
"3"
>
<nz-select
style=
"width: 100%;"
[(
ngModel
)]="
obj
.
typeId
"
nzPlaceHolder=
"计划类型"
>
<nz-option
nzLabel=
"待处理"
nzValue=
"0"
></nz-option>
<nz-option
nzLabel=
"已结束"
nzValue=
"1"
></nz-option>
<ng-container
*
ngFor=
"let item of planTypeList"
>
<nz-option
[
nzValue
]="
item
.
id
"
[
nzLabel
]="
item
.
name
"
></nz-option>
</ng-container>
</nz-select>
</div>
<div
nz-col
nzSpan=
"8"
>
...
...
@@ -38,7 +39,7 @@
</nz-input-group>
</div>
<div
nz-col
nzSpan=
"3"
>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
新增计划
</button>
<button
(
click
)="
addPlan
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
新增计划
</button>
</div>
</div>
...
...
@@ -75,9 +76,13 @@
<span
*
ngIf=
"data.status == 2"
>
已结束
</span>
</td>
<td
class=
"handle text-center"
>
<span
(
click
)="
showEditModal
(
data
)"
>
查看
</span>
<span
(
click
)="
deleteSend
(
data
)"
>
删除
</span>
<span
(
click
)="
lookPlan
(
data
.
id
)"
>
查看
</span>
<span
(
click
)="
editPlan
(
data
.
id
)"
>
编辑
</span>
<span
(
click
)="
deletePlan
(
data
)"
>
删除
</span>
</td>
</tr>
</tbody>
</nz-table>
\ No newline at end of file
</nz-table>
<smart-plan-modal
#
smartPlanMoadl
></smart-plan-modal>
<smart-look-plan
#
smartLookPlan
></smart-look-plan>
\ No newline at end of file
src/main/webapp/app/work/inspect-plan/inspect-plan.component.ts
View file @
b4d98539
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
WorkService
}
from
'../work.service'
;
import
{
pageSize
}
from
'../../app.constants'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
,
NzModalService
}
from
'ng-zorro-antd'
;
import
{
PlanModalComponent
}
from
'../modal/plan-modal/plan-modal.component'
;
import
{
LookPlanComponent
}
from
'../modal/look-plan/look-plan.component'
;
@
Component
({
selector
:
'smart-inspect-plan'
,
templateUrl
:
'./inspect-plan.component.html'
,
styles
:
[]
selector
:
'smart-inspect-plan'
,
templateUrl
:
'./inspect-plan.component.html'
,
styles
:
[]
})
export
class
InspectPlanComponent
implements
OnInit
{
@
ViewChild
(
'smartPlanMoadl'
)
smartPlanMoadl
:
PlanModalComponent
;
@
ViewChild
(
'smartLookPlan'
)
smartLookPlan
:
LookPlanComponent
;
timeFormat
=
'yyyy-MM-dd'
;
planList
;
planTypeList
;
timeBegin
;
timeEnd
;
pageCount
=
pageSize
;
...
...
@@ -19,41 +24,102 @@ export class InspectPlanComponent implements OnInit {
totalNum
;
obj
=
{
pageNum
:
''
,
pageCount
:
''
,
searchStr
:
""
,
typeId
:
null
,
status
:
null
,
pageNum
:
''
,
pageCount
:
''
,
searchStr
:
''
,
typeId
:
null
,
status
:
null
,
};
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
)
{
}
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
modalSer
:
NzModalService
)
{
}
ngOnInit
()
{
this
.
getList
();
this
.
getPlanType
();
}
//获取计划分类
getPlanType
()
{
const
data
=
{
type
:
1
};
this
.
workSer
.
findByType
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
planTypeList
=
res
.
data
;
}
}
);
}
getList
(){
getList
()
{
const
obj
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
searchStr
:
this
.
obj
.
searchStr
,
typeId
:
this
.
obj
.
typeId
,
status
:
this
.
obj
.
status
,
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
searchStr
:
this
.
obj
.
searchStr
,
typeId
:
this
.
obj
.
typeId
,
status
:
this
.
obj
.
status
,
};
this
.
workSer
.
findPlanList
(
obj
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
planList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
)
;
}
change
(
e
){
change
(
e
)
{
this
.
pageNum
=
e
;
this
.
getList
();
}
//新增计划
addPlan
()
{
this
.
smartPlanMoadl
.
showAddModal
();
}
//编辑计划
editPlan
(
id
)
{
this
.
smartPlanMoadl
.
showEditModal
(
id
);
}
//查看计划
lookPlan
(
id
){
this
.
smartLookPlan
.
showModal
(
id
);
}
//删除计划
deletePlan
(
data
)
{
this
.
modalSer
.
confirm
({
nzTitle
:
'删除'
,
nzContent
:
'<b style="color: red;">确认删除该计划吗?</b>'
,
nzOkText
:
'确定'
,
nzOkType
:
'danger'
,
nzOnOk
:
()
=>
{
const
arr
=
{
ids
:
[]
};
arr
.
ids
.
push
(
data
.
id
);
this
.
workSer
.
deletePlan
(
arr
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
this
.
getList
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
);
},
nzCancelText
:
'取消'
,
nzOnCancel
:
()
=>
console
.
log
(
'Cancel'
)
}
);
}
}
src/main/webapp/app/work/modal/look-plan/look-plan.component.html
0 → 100644
View file @
b4d98539
<!--添加资源-->
<nz-modal
[
nzWidth
]="
1080
"
[(
nzVisible
)]="
isVisiable
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleEditCancel
()"
(
nzOnOk
)="
handEditleOk
()"
>
<form
nz-form
[
formGroup
]="
validateForm
"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"title"
>
计划类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{plan.title}}
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"typeId"
>
计划工作量
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
开始日期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{plan.startTime}}
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialnoA"
>
终止日期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{plan.endTime}}
</nz-form-control>
</nz-form-item>
</div>
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
循环周期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
7
"
>
{{plan.cycleType}}
</nz-form-control>
<nz-form-control
[
nzSpan
]="
6
"
>
{{plan.cycleNum}}
</nz-form-control>
<nz-form-control
[
nzSpan
]="
6
"
>
次
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialnoA"
>
巡检人数
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{plan.number}}
</nz-form-control>
</nz-form-item>
</div>
</div>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
参与人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<span
*
ngFor=
"let item of plan.participants"
>
{{item.username}}
</span>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
负责人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<span
*
ngFor=
"let item of plan.principals"
>
{{item.username}}
</span>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"description"
>
计划描述
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{plan.description}}
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
7
"
nzRequired
nzFor=
"group"
>
附件
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<button
nz-button
>
<i
class=
"anticon anticon-upload"
></i><span>
下载
</span>
</button>
</nz-form-control>
</nz-form-item>
</div>
</form>
</nz-modal>
src/main/webapp/app/work/modal/look-plan/look-plan.component.ts
0 → 100644
View file @
b4d98539
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
WorkService
}
from
'../../work.service'
;
@
Component
({
selector
:
'smart-look-plan'
,
templateUrl
:
'./look-plan.component.html'
,
styles
:
[]
})
export
class
LookPlanComponent
implements
OnInit
{
isVisible
=
false
;
title
;
plan
;
constructor
(
private
workSer
:
WorkService
)
{
}
ngOnInit
()
{
}
showModal
(
id
){
this
.
workSer
.
findPlan
(
id
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
plan
=
res
.
data
;
}
}
)
}
}
src/main/webapp/app/work/modal/plan-modal/plan-modal.component.html
0 → 100644
View file @
b4d98539
<!--添加资源-->
<nz-modal
[
nzWidth
]="
1080
"
[(
nzVisible
)]="
isVisiable
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleEditCancel
()"
(
nzOnOk
)="
handEditleOk
()"
>
<form
nz-form
[
formGroup
]="
validateForm
"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"title"
>
计划标题
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"title"
name=
"title"
nz-input
placeholder=
"计划标题"
formControlName=
"title"
>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"typeId"
>
计划类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
id=
"typeId"
name=
"typeId"
nzPlaceHolder=
"计划类型"
formControlName=
"typeId"
>
<ng-container
*
ngFor=
"let item of planList"
>
<nz-option
[
nzValue
]="
item
.
id
"
[
nzLabel
]="
item
.
name
"
></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
开始日期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-date-picker
nzShowTime
formControlName=
"startTime"
nzPlaceHolder=
"开始时间"
></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialnoA"
>
终止日期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-date-picker
nzShowTime
nzFormat=
"yyyy-MM-dd HH:mm:ss"
formControlName=
"endTime"
nzPlaceHolder=
"结束时间"
></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
循环周期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
7
"
>
<nz-select
name=
"cycleType"
name=
"cycleType"
nzPlaceHolder=
"巡检人数"
formControlName=
"cycleType"
>
<nz-option
nzValue=
"0"
nzLabel=
"每天"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"工作日"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"每周"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"每月"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"每季度"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"每半年"
></nz-option>
<nz-option
nzValue=
"6"
nzLabel=
"无"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-select
name=
"cycleType"
name=
"cycleType"
formControlName=
"cycleType"
>
<nz-option
nzValue=
"1"
nzLabel=
"1"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"2"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"3"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"4"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"5"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
[
nzSpan
]="
6
"
>
次
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialnoA"
>
巡检人数
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"test3"
name=
"test3"
nzPlaceHolder=
"巡检人数"
formControlName=
"number"
>
<nz-option
nzValue=
"1"
nzLabel=
"1"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"2"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"3"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"4"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"5"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
计划工作量
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"host4"
type=
"text"
nz-input
name=
"host1"
[(
ngModel
)]="
validateForm
.
r_longdata
"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
参与人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<label
nz-checkbox
></label>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
负责人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<label
nz-checkbox
></label>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"description"
>
计划描述
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<textarea
nz-input
id=
"description"
name=
"description"
formControlName=
"description"
placeholder=
"发送信息"
[
nzAutosize
]="{
minRows:
2
,
maxRows:
6
}"
></textarea>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
7
"
nzRequired
nzFor=
"group"
>
附件
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<nz-upload
[
nzBeforeUpload
]="
beforeUpload
"
[(
nzFileList
)]="
fileList
"
>
<button
nz-button
>
<i
class=
"anticon anticon-upload"
></i><span>
上传
</span>
</button>
</nz-upload>
</nz-form-control>
</nz-form-item>
</div>
</form>
</nz-modal>
src/main/webapp/app/work/modal/plan-modal/plan-modal.component.ts
0 → 100644
View file @
b4d98539
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormGroup
}
from
'@angular/forms'
;
import
{
WorkService
}
from
'../../work.service'
;
import
{
NzMessageService
,
UploadFile
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-plan-modal'
,
templateUrl
:
'./plan-modal.component.html'
,
styles
:
[]
})
export
class
PlanModalComponent
implements
OnInit
{
planList
;
planId
;
title
;
isVisiable
=
false
;
validateForm
:
FormGroup
;
fileList
:
UploadFile
[]
=
[];
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
fb
:
FormBuilder
)
{
}
ngOnInit
()
{
this
.
initForm
();
this
.
getPlanType
();
}
initForm
()
{
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
null
],
typeId
:
[
null
],
startTime
:
[
null
],
endTime
:
[
null
],
cycleType
:
[
null
],
cycleNum
:
[
null
],
number
:
[
null
],
workload
:
[
null
],
description
:
[
null
],
});
}
getPlanType
(){
const
data
=
{
type
:
1
};
this
.
workSer
.
findByType
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
planList
=
res
.
data
;
}
}
)
}
beforeUpload
=
(
file
:
UploadFile
):
boolean
=>
{
const
isLt5M
=
file
.
size
/
1024
<
5000
;
if
(
!
isLt5M
)
{
this
.
message
.
error
(
' 文件必须小于5M!'
);
}
else
{
this
.
fileList
.
push
(
file
);
}
return
false
;
};
showAddModal
()
{
this
.
title
=
'添加计划'
;
}
showEditModal
(
id
)
{
this
.
title
=
'编辑计划'
;
this
.
planId
=
id
;
}
handEditleOk
()
{
for
(
let
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
if
(
this
.
validateForm
.
invalid
)
{
return
false
;
}
if
(
this
.
title
==
'添加计划'
)
{
this
.
create
();
}
if
(
this
.
title
=
'编辑计划'
)
{
this
.
update
();
}
}
create
()
{
let
formData
=
new
FormData
();
this
.
fileList
.
forEach
((
file
:
any
)
=>
{
formData
.
append
(
'file'
,
file
);
});
formData
.
append
(
'json'
,
JSON
.
stringify
(
this
.
validateForm
.
value
));
this
.
workSer
.
createPlan
(
formData
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
initForm
();
this
.
isVisiable
=
false
;
this
.
message
.
success
(
"新增计划成功"
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
}
update
(){
let
formData
=
new
FormData
();
this
.
fileList
.
forEach
((
file
:
any
)
=>
{
formData
.
append
(
'file'
,
file
);
});
formData
.
append
(
'json'
,
JSON
.
stringify
(
this
.
validateForm
.
value
));
formData
.
append
(
'id'
,
this
.
planId
);
this
.
workSer
.
createPlan
(
formData
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
message
.
success
(
"修改计划成功"
);
this
.
initForm
();
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
}
handleEditCancel
()
{
this
.
isVisiable
=
false
;
}
}
src/main/webapp/app/work/work.service.ts
View file @
b4d98539
...
...
@@ -88,4 +88,29 @@ export class WorkService {
findByParentidCount
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/inventory/findByParentidCount/'
+
params
);
}
//创建资产分类
createType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/inventory/createType'
,
data
);
}
//根据主键id查询资产类型
findType
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/inventory/findType/'
,
params
);
}
//根据资产类型id 查询没有配置主机的资产
selectByInventoryTypeidAndHostidNull
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/inventory/selectByInventoryTypeidAndHostidNull/'
,
params
);
}
//设置资产匹配的主机
updateHostid
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/inventory/updateHostid'
,
data
);
}
//根据type查找
findByType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/syseventType/findByType'
,
data
);
}
}
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