Commit b75f4d57 authored by wangqinghua's avatar wangqinghua

update

parent 207405ee
...@@ -63,16 +63,6 @@ ...@@ -63,16 +63,6 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="4" nzFor="serviceid">关联业务</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-select name="serviceid" [(ngModel)]="validateForm.hostExtend.serviceid"-->
<!--nzPlaceHolder="无关联业务">-->
<!--<nz-option nzValue="" nzLabel="无"></nz-option>-->
<!--</nz-select>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">添加接口</nz-form-label> <nz-form-label [nzSpan]="4">添加接口</nz-form-label>
<nz-form-control [nzSpan]="20"> <nz-form-control [nzSpan]="20">
...@@ -362,12 +352,18 @@ ...@@ -362,12 +352,18 @@
<!--</nz-tab>--> <!--</nz-tab>-->
<nz-tab nzTitle="资产登记"> <nz-tab nzTitle="资产登记">
<div nz-form class="ant-advanced-search-form form-select"> <div nz-form class="ant-advanced-search-form form-select">
<nz-form-item> <div nz-row [nzGutter]="24">
<nz-form-control [nzSm]="14" [nzXs]="24"> <div nz-col [nzSpan]="12">
<nz-tag nzMode="checkable" [nzChecked]="!isInVentory" (nzCheckedChange)="checkChange('no')">不需要登记资产</nz-tag> <nz-form-item nzFlex>
<nz-tag nzMode="checkable" [nzChecked]="isInVentory" (nzCheckedChange)="checkChange('yes')">需要登记资产</nz-tag> <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="equipmentTypeid">登记资产
</nz-form-label>
<nz-form-control [nzSpan]="14">
<button nz-button nzSize="small" [nzType]="isYesInVentory" (click)="checkChange('no')">不需要</button>
<button nz-button nzSize="small" [nzType]="isNOInVentory" (click)="checkChange('yes')">需要</button>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div>
</div>
<ng-container *ngIf="isInVentory"> <ng-container *ngIf="isInVentory">
<div nz-row [nzGutter]="24"> <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
......
...@@ -51,6 +51,8 @@ export class BasicEditComponent implements OnInit { ...@@ -51,6 +51,8 @@ export class BasicEditComponent implements OnInit {
mainHost = 'hostType1'; //主机tabs mainHost = 'hostType1'; //主机tabs
isInVentory = false; isInVentory = false;
isYesInVentory = 'primary';
isNOInVentory = 'default';
inventoryParentId; inventoryParentId;
constructor(private fb: FormBuilder, private overAllSer: OverAllService, constructor(private fb: FormBuilder, private overAllSer: OverAllService,
public message: NzMessageService,private workSer:WorkService) { public message: NzMessageService,private workSer:WorkService) {
...@@ -126,7 +128,7 @@ export class BasicEditComponent implements OnInit { ...@@ -126,7 +128,7 @@ export class BasicEditComponent implements OnInit {
this.validateForm.inventoryExtend = data.inventory; this.validateForm.inventoryExtend = data.inventory;
this.validateForm.hostExtend = data.hostExtend; this.validateForm.hostExtend = data.hostExtend;
this.validateForm.groups = data.groups; this.validateForm.groups = data.groups;
if (data.parentTemplates) { if (data.parentTemplates) { //模版对象
let tempArr = []; let tempArr = [];
tempArr = data.parentTemplates.map(res => { tempArr = data.parentTemplates.map(res => {
return res.templateid; return res.templateid;
...@@ -135,23 +137,27 @@ export class BasicEditComponent implements OnInit { ...@@ -135,23 +137,27 @@ export class BasicEditComponent implements OnInit {
this.templatesResoure = tempArr; this.templatesResoure = tempArr;
} }
this.interfaceslist = data.interfaces; this.interfaceslist = data.interfaces;
this.interfaceslist.forEach(res => { this.interfaceslist.forEach(res => { //接口对象
res.main = res.main + ''; res.main = res.main + '';
res.type = res.type + ''; res.type = res.type + '';
}); });
this.hostTypeChildrenList = []; this.hostTypeChildrenList = [];
this.hostTypeList.forEach(res => { this.hostTypeList.forEach(res => { //主机对象
if (this.validateForm.hostExtend.equipmentTypeid == res.id) { if (this.validateForm.hostExtend.equipmentTypeid == res.id) {
this.hostTypeChildrenList = res.childs; this.hostTypeChildrenList = res.childs;
} }
}); });
if (data.macros) { if (data.macros) { //红对象
this.macroList1 = data.macros; this.macroList1 = data.macros;
} }
if(data.inventory){ //资产对象
for (let i = 0; i < this.validateForm.groups.length; i++) { this.isInVentory = false;
this.isYesInVentory = 'default';
this.isNOInVentory = 'primary';
}
for (let i = 0; i < this.validateForm.groups.length; i++) { //分组对象
for (let j = 0; j < this.groupList.length; j++) { for (let j = 0; j < this.groupList.length; j++) {
if (this.validateForm.groups[i].groupid == this.groupList[j].value) { if (this.validateForm.groups[i].groupid == this.groupList[j].value) {
this.groupList[j].checked = true; this.groupList[j].checked = true;
...@@ -403,15 +409,21 @@ export class BasicEditComponent implements OnInit { ...@@ -403,15 +409,21 @@ export class BasicEditComponent implements OnInit {
checkChange(e){ checkChange(e){
if(e == "yes"){ if(e == "yes"){
this.isInVentory = true; this.isInVentory = true;
this.isYesInVentory = 'default';
this.isNOInVentory = 'primary';
} }
if(e == "no"){ if(e == "no"){
this.isInVentory = false; this.isInVentory = false;
this.isYesInVentory = 'primary';
this.isNOInVentory = 'default'
} }
} }
//初始化Form信息 //初始化Form信息
initForm() { initForm() {
this.isInVentory = false; this.isInVentory = false;
this.isYesInVentory = 'primary';
this.isNOInVentory = 'default';
this.templatesResoure = []; this.templatesResoure = [];
this.macroList1 = [ //配置宏数组 this.macroList1 = [ //配置宏数组
{ {
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
nzShowTime nzShowTime
formControlName="startTime" formControlName="startTime"
nzPlaceHolder="开始时间" nzPlaceHolder="开始时间"
[nzDisabled]="isDisabled"
></nz-date-picker> ></nz-date-picker>
<nz-form-explain *ngIf="validateForm.get('startTime').dirty && validateForm.get('startTime').errors">请选择开始时间</nz-form-explain> <nz-form-explain *ngIf="validateForm.get('startTime').dirty && validateForm.get('startTime').errors">请选择开始时间</nz-form-explain>
......
...@@ -3,6 +3,7 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms'; ...@@ -3,6 +3,7 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {WorkService} from '../../work.service'; import {WorkService} from '../../work.service';
import {NzMessageService, UploadFile} from 'ng-zorro-antd'; import {NzMessageService, UploadFile} from 'ng-zorro-antd';
import {SelectPersonComponent} from '../../../modal/select-person/select-person.component'; import {SelectPersonComponent} from '../../../modal/select-person/select-person.component';
import {DatePipe} from '@angular/common';
@Component({ @Component({
selector: 'smart-plan-modal', selector: 'smart-plan-modal',
...@@ -17,6 +18,7 @@ export class PlanModalComponent implements OnInit { ...@@ -17,6 +18,7 @@ export class PlanModalComponent implements OnInit {
planId; planId;
title; title;
isVisiable = false; isVisiable = false;
isDisabled = false;
validateForm: FormGroup; validateForm: FormGroup;
fileList = []; fileList = [];
...@@ -26,7 +28,7 @@ export class PlanModalComponent implements OnInit { ...@@ -26,7 +28,7 @@ export class PlanModalComponent implements OnInit {
principalsList = []; //负责人 principalsList = []; //负责人
constructor(private workSer: WorkService, private message: NzMessageService, constructor(private workSer: WorkService, private message: NzMessageService,
private fb: FormBuilder) { private fb: FormBuilder,private datePipe:DatePipe) {
} }
ngOnInit() { ngOnInit() {
...@@ -36,6 +38,7 @@ export class PlanModalComponent implements OnInit { ...@@ -36,6 +38,7 @@ export class PlanModalComponent implements OnInit {
initForm() { initForm() {
this.fileList = []; this.fileList = [];
this.isDisabled = false;
this.participantsList = []; this.participantsList = [];
this.principalsList = []; this.principalsList = [];
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
...@@ -102,8 +105,10 @@ export class PlanModalComponent implements OnInit { ...@@ -102,8 +105,10 @@ export class PlanModalComponent implements OnInit {
this.validateForm.patchValue({ this.validateForm.patchValue({
startTime:new Date( res.data.startTime ), startTime:new Date( res.data.startTime ),
endTime:new Date( res.data.endTime ), endTime:new Date( res.data.endTime ),
}); });
if(res.data.status == 1){
this.isDisabled = true;
}
} }
) )
} }
...@@ -129,6 +134,10 @@ export class PlanModalComponent implements OnInit { ...@@ -129,6 +134,10 @@ export class PlanModalComponent implements OnInit {
this.validateForm.value.principals = this.principalsList; this.validateForm.value.principals = this.principalsList;
this.validateForm.value.participants = this.participantsList; this.validateForm.value.participants = this.participantsList;
this.validateForm.patchValue({
startTime:this.datePipe.transform( this.validateForm.value.startTime,'yyyy-MM-dd HH:mm:ss' ),
endTime:this.datePipe.transform( this.validateForm.value.endTime ,'yyyy-MM-dd HH:mm:ss' ),
});
if (this.title == '添加计划') { if (this.title == '添加计划') {
this.create(); this.create();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment