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
10f09abe
Commit
10f09abe
authored
Sep 19, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建运维项目
parent
9448ef44
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
145 deletions
+142
-145
create-project.component.html
...anager/modal/create-project/create-project.component.html
+22
-34
create-project.component.ts
...-manager/modal/create-project/create-project.component.ts
+110
-109
opr-project.component.html
...pp/project-manager/opr-project/opr-project.component.html
+3
-1
opr-project.component.ts
.../app/project-manager/opr-project/opr-project.component.ts
+7
-1
No files found.
src/main/webapp/app/project-manager/modal/create-project/create-project.component.html
View file @
10f09abe
...
@@ -26,60 +26,48 @@
...
@@ -26,60 +26,48 @@
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"principal"
>
甲方名称
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"principal"
>
甲方名称
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"principal"
id=
"principal"
>
<input
nz-input
formControlName=
"principal"
id=
"principal"
>
<nz-form-explain
*
ngIf=
"validateForm.get('principal').dirty && validateForm.get('principal').errors"
>
用户登录名为2到16个字符!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="phone">乙方名称</nz-form-label>-->
<!-- <nz-form-control [nzSm]="14" [nzXs]="24">-->
<!-- <input nz-input formControlName="phone" id="phone">-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
phone"
>
乙方名称
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
startDate"
>
开始时间
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"phone"
id=
"phone"
>
<nz-date-picker
<nz-form-explain
*
ngIf=
"validateForm.get('phone').dirty && validateForm.get('phone').errors"
>
手机号码错误!
[
nzFormat
]="
timeFormat
"
</nz-form-explain>
formControlName=
"startDate"
id=
"startDate"
</nz-form-control>
nzPlaceHolder=
"终止时间"
></nz-date-picker>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"phone"
>
开始时间
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"phone"
id=
"phone"
>
<nz-form-explain
*
ngIf=
"validateForm.get('phone').dirty && validateForm.get('phone').errors"
>
手机号码错误!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
phon
e"
>
终止时间
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
endDat
e"
>
终止时间
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"phone"
id=
"phone"
>
<nz-date-picker
<nz-form-explain
*
ngIf=
"validateForm.get('phone').dirty && validateForm.get('phone').errors"
>
手机号码错误!
[
nzFormat
]="
timeFormat
"
</nz-form-explain>
formControlName=
"endDate"
id=
"endDate"
nzPlaceHolder=
"终止时间"
></nz-date-picker>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
principal
"
>
项目金额
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
amount
"
>
项目金额
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"principal"
id=
"principal"
>
<input
nz-input
formControlName=
"amount"
id=
"amount"
>
<nz-form-explain
*
ngIf=
"validateForm.get('principal').dirty && validateForm.get('principal').errors"
>
用户登录名为2到16个字符!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
p
rincipal"
>
单位负责人
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
officeP
rincipal"
>
单位负责人
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"principal"
id=
"principal"
>
<input
nz-input
formControlName=
"officePrincipal"
id=
"officePrincipal"
>
<nz-form-explain
*
ngIf=
"validateForm.get('principal').dirty && validateForm.get('principal').errors"
>
用户登录名为2到16个字符!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
p
rincipal"
>
乙方维护组长
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
aP
rincipal"
>
乙方维护组长
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"principal"
id=
"principal"
>
<input
nz-input
formControlName=
"principal"
id=
"aPrincipal"
>
<nz-form-explain
*
ngIf=
"validateForm.get('principal').dirty && validateForm.get('principal').errors"
>
用户登录名为2到16个字符!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
...
...
src/main/webapp/app/project-manager/modal/create-project/create-project.component.ts
View file @
10f09abe
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormControl
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
FormBuilder
,
FormControl
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
NzMessageService
,
UploadFile
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
,
UploadFile
}
from
'ng-zorro-antd'
;
import
{
opr_company_type
}
from
'../../project.constants'
;
import
{
opr_company_type
,
project_type
}
from
'../../project.constants'
;
import
{
SystemService
}
from
'../../../system/system.service'
;
import
{
SystemService
}
from
'../../../system/system.service'
;
import
{
ProjectService
}
from
'../../project.service'
;
import
{
ProjectService
}
from
'../../project.service'
;
@
Component
({
@
Component
({
selector
:
'smart-create-project'
,
selector
:
'smart-create-project'
,
templateUrl
:
'./create-project.component.html'
,
templateUrl
:
'./create-project.component.html'
,
styles
:
[]
styles
:
[]
})
})
export
class
CreateProjectComponent
implements
OnInit
{
export
class
CreateProjectComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
@
Output
()
done
=
new
EventEmitter
<
any
>
();
tabNum
=
0
;
//tabs面板的序列号
tabNum
=
0
;
//tabs面板的序列号
timeFormat
=
'yyyy-MM-dd'
;
title
;
title
;
isVisible
=
false
;
isVisible
=
false
;
isOkLoading
=
false
;
isOkLoading
=
false
;
validateForm
:
FormGroup
;
validateForm
:
FormGroup
;
fileList
:
UploadFile
[]
=
[];
fileList
:
UploadFile
[]
=
[];
opr_company_type
=
opr_company
_type
;
opr_company_type
=
project
_type
;
cID
;
cID
;
constructor
(
private
fb
:
FormBuilder
,
private
systemSer
:
SystemService
,
constructor
(
private
fb
:
FormBuilder
,
private
systemSer
:
SystemService
,
private
message
:
NzMessageService
,
private
projectSer
:
ProjectService
)
{
private
message
:
NzMessageService
,
private
projectSer
:
ProjectService
)
{
}
}
ngOnInit
():
void
{
this
.
initForm
();
}
initForm
()
{
this
.
validateForm
=
this
.
fb
.
group
({
name
:
[
null
,
[
Validators
.
required
,
Validators
.
minLength
(
2
),
Validators
.
maxLength
(
50
)]],
officeName
:
[
null
],
officePrincipal
:
[
null
],
aPrincipal
:
[
null
],
amount
:
[
null
],
type
:
[
null
],
planWorkNum
:
[
null
],
workNum
:
[
null
],
status
:
[
null
],
companyId
:
[
null
],
teamId
:
[
null
],
startDate
:
[
null
],
endDate
:
[
null
],
});
}
showAddModal
(
title
)
{
this
.
isVisible
=
true
;
this
.
title
=
title
;
}
showEditModal
(
data
,
title
)
{
this
.
isVisible
=
true
;
this
.
title
=
title
;
this
.
cID
=
data
.
id
;
console
.
log
(
data
);
this
.
validateForm
.
patchValue
(
data
);
}
handleCancel
()
{
this
.
isVisible
=
false
;
this
.
initForm
();
}
beforeUpload
=
(
file
:
UploadFile
):
boolean
=>
{
ngOnInit
():
void
{
const
isExcel
=
file
.
type
===
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
||
'application/octet-stream'
;
this
.
initForm
();
if
(
!
isExcel
)
{
this
.
message
.
error
(
'请上传正确的文件!'
);
}
else
{
this
.
fileList
[
0
]
=
file
;
}
}
return
false
;
};
handleOk
()
{
initForm
()
{
for
(
let
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
=
this
.
fb
.
group
({
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
name
:
[
null
,
[
Validators
.
required
,
Validators
.
minLength
(
2
),
Validators
.
maxLength
(
50
)]],
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
officeName
:
[
null
],
officePrincipal
:
[
null
],
aPrincipal
:
[
null
],
amount
:
[
null
],
type
:
[
null
],
principal
:
[
null
],
startDate
:
[
null
],
endDate
:
[
null
],
});
}
}
if
(
this
.
validateForm
.
invalid
)
{
return
false
;
showAddModal
(
title
)
{
this
.
isVisible
=
true
;
this
.
title
=
title
;
}
}
this
.
isOkLoading
=
true
;
if
(
this
.
title
==
'新增运维公司'
)
{
showEditModal
(
data
,
title
)
{
this
.
create
();
this
.
isVisible
=
true
;
this
.
title
=
title
;
this
.
cID
=
data
.
id
;
this
.
validateForm
.
patchValue
(
data
);
}
}
if
(
this
.
title
==
'编辑运维公司'
)
{
this
.
update
();
handleCancel
()
{
this
.
isVisible
=
false
;
this
.
initForm
();
}
}
}
create
()
{
beforeUpload
=
(
file
:
UploadFile
):
boolean
=>
{
this
.
projectSer
.
addMaintainCompany
(
this
.
validateForm
.
value
).
subscribe
(
const
isExcel
=
file
.
type
===
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
||
'application/octet-stream'
;
(
res
)
=>
{
if
(
!
isExcel
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
error
(
'请上传正确的文件!'
);
this
.
isVisible
=
false
;
}
else
{
this
.
initForm
();
this
.
fileList
[
0
]
=
file
;
this
.
done
.
emit
();
this
.
message
.
success
(
'新增运维公司成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isOkLoading
=
false
;
}
}
)
;
return
false
;
}
};
update
()
{
handleOk
()
{
this
.
validateForm
.
addControl
(
'id'
,
new
FormControl
(
this
.
cID
));
for
(
let
i
in
this
.
validateForm
.
controls
)
{
this
.
systemSer
.
updateUser
(
this
.
validateForm
.
value
).
subscribe
(
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
(
res
)
=>
{
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
if
(
res
.
errCode
==
10000
)
{
this
.
isVisible
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
this
.
message
.
success
(
'更新信息成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isOkLoading
=
false
;
}
}
);
if
(
this
.
validateForm
.
invalid
)
{
}
return
false
;
}
this
.
isOkLoading
=
true
;
if
(
this
.
title
==
'新增运维项目'
)
{
this
.
create
();
}
if
(
this
.
title
==
'编辑运维项目'
)
{
this
.
update
();
}
}
//tabs切换
create
()
{
tabsChange
(
num
)
{
this
.
validateForm
.
patchValue
({
this
.
tabNum
=
num
;
startDate
:
new
Date
(
this
.
validateForm
.
value
.
startDate
).
getTime
(),
}
endDate
:
new
Date
(
this
.
validateForm
.
value
.
endDate
).
getTime
(),
});
this
.
projectSer
.
addMaintainProject
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isVisible
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
this
.
message
.
success
(
'新增运维项目成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isOkLoading
=
false
;
}
);
}
update
()
{
this
.
validateForm
.
addControl
(
'id'
,
new
FormControl
(
this
.
cID
));
this
.
projectSer
.
updateMaintainProject
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isVisible
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
this
.
message
.
success
(
'更新项目成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isOkLoading
=
false
;
}
);
}
//tabs切换
tabsChange
(
num
)
{
this
.
tabNum
=
num
;
}
}
}
src/main/webapp/app/project-manager/opr-project/opr-project.component.html
View file @
10f09abe
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
</nz-radio-group>
</nz-radio-group>
</div>
</div>
<div
nz-col
nzSpan=
"3"
>
<div
nz-col
nzSpan=
"3"
>
<button
(
click
)="
search
()"
<button
(
click
)="
handleOpenModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
style=
"color: #6097b7"
></i>
新增运维项目
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
style=
"color: #6097b7"
></i>
新增运维项目
</button>
</button>
</div>
</div>
...
@@ -107,3 +107,5 @@
...
@@ -107,3 +107,5 @@
</tr>
</tr>
</tbody>
</tbody>
</nz-table>
</nz-table>
<smart-create-project
#
smartCreateProject
(
done
)="
getList
()"
></smart-create-project>
src/main/webapp/app/project-manager/opr-project/opr-project.component.ts
View file @
10f09abe
...
@@ -10,6 +10,7 @@ import {CommonService} from '../../shared/common/common.service';
...
@@ -10,6 +10,7 @@ import {CommonService} from '../../shared/common/common.service';
import
{
DatePipe
}
from
'@angular/common'
;
import
{
DatePipe
}
from
'@angular/common'
;
import
{
ProjectService
}
from
'../project.service'
;
import
{
ProjectService
}
from
'../project.service'
;
import
{
project_status
}
from
'../project.constants'
;
import
{
project_status
}
from
'../project.constants'
;
import
{
CreateProjectComponent
}
from
'../modal/create-project/create-project.component'
;
@
Component
({
@
Component
({
selector
:
'app-opr-project'
,
selector
:
'app-opr-project'
,
...
@@ -17,6 +18,7 @@ import {project_status} from '../project.constants';
...
@@ -17,6 +18,7 @@ import {project_status} from '../project.constants';
styleUrls
:
[
'./opr-project.component.css'
]
styleUrls
:
[
'./opr-project.component.css'
]
})
})
export
class
OprProjectComponent
implements
OnInit
{
export
class
OprProjectComponent
implements
OnInit
{
@
ViewChild
(
'smartCreateProject'
)
smartCreateProject
:
CreateProjectComponent
;
timeFormat
=
'yyyy'
;
timeFormat
=
'yyyy'
;
...
@@ -38,7 +40,7 @@ export class OprProjectComponent implements OnInit {
...
@@ -38,7 +40,7 @@ export class OprProjectComponent implements OnInit {
keyword
:
''
keyword
:
''
};
};
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
projectSer
:
ProjectService
,
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
projectSer
:
ProjectService
,
private
router
:
Router
,
private
commonSer
:
CommonService
,
private
datePipe
:
DatePipe
)
{
private
router
:
Router
,
private
commonSer
:
CommonService
,
private
datePipe
:
DatePipe
)
{
}
}
...
@@ -79,4 +81,8 @@ export class OprProjectComponent implements OnInit {
...
@@ -79,4 +81,8 @@ export class OprProjectComponent implements OnInit {
this
.
getList
();
this
.
getList
();
}
}
handleOpenModal
()
{
this
.
smartCreateProject
.
showAddModal
(
'新增运维项目'
);
}
}
}
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