Commit b75f4d57 authored by wangqinghua's avatar wangqinghua

update

parent 207405ee
......@@ -63,16 +63,6 @@
</nz-form-control>
</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-label [nzSpan]="4">添加接口</nz-form-label>
<nz-form-control [nzSpan]="20">
......@@ -362,12 +352,18 @@
<!--</nz-tab>-->
<nz-tab nzTitle="资产登记">
<div nz-form class="ant-advanced-search-form form-select">
<nz-form-item>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-tag nzMode="checkable" [nzChecked]="!isInVentory" (nzCheckedChange)="checkChange('no')">不需要登记资产</nz-tag>
<nz-tag nzMode="checkable" [nzChecked]="isInVentory" (nzCheckedChange)="checkChange('yes')">需要登记资产</nz-tag>
</nz-form-control>
</nz-form-item>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<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-item>
</div>
</div>
<ng-container *ngIf="isInVentory">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
......
......@@ -51,6 +51,8 @@ export class BasicEditComponent implements OnInit {
mainHost = 'hostType1'; //主机tabs
isInVentory = false;
isYesInVentory = 'primary';
isNOInVentory = 'default';
inventoryParentId;
constructor(private fb: FormBuilder, private overAllSer: OverAllService,
public message: NzMessageService,private workSer:WorkService) {
......@@ -126,7 +128,7 @@ export class BasicEditComponent implements OnInit {
this.validateForm.inventoryExtend = data.inventory;
this.validateForm.hostExtend = data.hostExtend;
this.validateForm.groups = data.groups;
if (data.parentTemplates) {
if (data.parentTemplates) { //模版对象
let tempArr = [];
tempArr = data.parentTemplates.map(res => {
return res.templateid;
......@@ -135,23 +137,27 @@ export class BasicEditComponent implements OnInit {
this.templatesResoure = tempArr;
}
this.interfaceslist = data.interfaces;
this.interfaceslist.forEach(res => {
this.interfaceslist.forEach(res => { //接口对象
res.main = res.main + '';
res.type = res.type + '';
});
this.hostTypeChildrenList = [];
this.hostTypeList.forEach(res => {
this.hostTypeList.forEach(res => { //主机对象
if (this.validateForm.hostExtend.equipmentTypeid == res.id) {
this.hostTypeChildrenList = res.childs;
}
});
if (data.macros) {
if (data.macros) { //红对象
this.macroList1 = data.macros;
}
for (let i = 0; i < this.validateForm.groups.length; i++) {
if(data.inventory){ //资产对象
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++) {
if (this.validateForm.groups[i].groupid == this.groupList[j].value) {
this.groupList[j].checked = true;
......@@ -403,15 +409,21 @@ export class BasicEditComponent implements OnInit {
checkChange(e){
if(e == "yes"){
this.isInVentory = true;
this.isYesInVentory = 'default';
this.isNOInVentory = 'primary';
}
if(e == "no"){
this.isInVentory = false;
this.isYesInVentory = 'primary';
this.isNOInVentory = 'default'
}
}
//初始化Form信息
initForm() {
this.isInVentory = false;
this.isYesInVentory = 'primary';
this.isNOInVentory = 'default';
this.templatesResoure = [];
this.macroList1 = [ //配置宏数组
{
......
......@@ -41,6 +41,7 @@
nzShowTime
formControlName="startTime"
nzPlaceHolder="开始时间"
[nzDisabled]="isDisabled"
></nz-date-picker>
<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';
import {WorkService} from '../../work.service';
import {NzMessageService, UploadFile} from 'ng-zorro-antd';
import {SelectPersonComponent} from '../../../modal/select-person/select-person.component';
import {DatePipe} from '@angular/common';
@Component({
selector: 'smart-plan-modal',
......@@ -17,6 +18,7 @@ export class PlanModalComponent implements OnInit {
planId;
title;
isVisiable = false;
isDisabled = false;
validateForm: FormGroup;
fileList = [];
......@@ -26,7 +28,7 @@ export class PlanModalComponent implements OnInit {
principalsList = []; //负责人
constructor(private workSer: WorkService, private message: NzMessageService,
private fb: FormBuilder) {
private fb: FormBuilder,private datePipe:DatePipe) {
}
ngOnInit() {
......@@ -36,6 +38,7 @@ export class PlanModalComponent implements OnInit {
initForm() {
this.fileList = [];
this.isDisabled = false;
this.participantsList = [];
this.principalsList = [];
this.validateForm = this.fb.group({
......@@ -102,8 +105,10 @@ export class PlanModalComponent implements OnInit {
this.validateForm.patchValue({
startTime:new Date( res.data.startTime ),
endTime:new Date( res.data.endTime ),
});
if(res.data.status == 1){
this.isDisabled = true;
}
}
)
}
......@@ -129,6 +134,10 @@ export class PlanModalComponent implements OnInit {
this.validateForm.value.principals = this.principalsList;
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 == '添加计划') {
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