Commit ea245b32 authored by xiaowenjie's avatar xiaowenjie

修改

parent 003d79fe
...@@ -533,6 +533,37 @@ ...@@ -533,6 +533,37 @@
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >父分类
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select name="secondLevelType" nzPlaceHolder="选择父分类" (ngModelChange)="getTypeByParent($event)">
<ng-container *ngFor="let item of parentTypeList">
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></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 >子分类
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select name="secondLevelType" nzPlaceHolder="选择子分类" [(ngModel)]="validateForm.inventoryExtend.inventoryTypeid">
<ng-container *ngFor="let item of typeList">
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
</div> </div>
<div class="modal-footer-btn"> <div class="modal-footer-btn">
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
} from '@angular/forms'; } from '@angular/forms';
import {OverAllService} from '../../overAll/overAll.service'; import {OverAllService} from '../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {WorkService} from '../../work/work.service';
@Component({ @Component({
selector: 'smart-basic-edit', selector: 'smart-basic-edit',
...@@ -27,7 +28,8 @@ export class BasicEditComponent implements OnInit { ...@@ -27,7 +28,8 @@ export class BasicEditComponent implements OnInit {
tempList = []; //模版列表 tempList = []; //模版列表
hostTypeList = []; //设备类型列表 hostTypeList = []; //设备类型列表
hostTypeChildrenList = []; //设备类型列表 hostTypeChildrenList = []; //设备类型列表
parentTypeList = [];//父级分类
typeList = [];//子级分类
validateForm; validateForm;
groupList = []; groupList = [];
...@@ -48,9 +50,8 @@ export class BasicEditComponent implements OnInit { ...@@ -48,9 +50,8 @@ export class BasicEditComponent implements OnInit {
macroTYpe = 'macro'; //宏tabs macroTYpe = 'macro'; //宏tabs
mainHost = 'hostType1'; //主机tabs mainHost = 'hostType1'; //主机tabs
constructor(private fb: FormBuilder, private overAllSer: OverAllService, constructor(private fb: FormBuilder, private overAllSer: OverAllService,
public message: NzMessageService) { public message: NzMessageService,private workSer:WorkService) {
} }
ngOnInit() { ngOnInit() {
this.tabNum = 0; this.tabNum = 0;
this.initForm(); this.initForm();
...@@ -79,6 +80,25 @@ export class BasicEditComponent implements OnInit { ...@@ -79,6 +80,25 @@ export class BasicEditComponent implements OnInit {
this.modalTitle = '添加资源'; this.modalTitle = '添加资源';
this.hostId = hostId; this.hostId = hostId;
this.getGroup(); this.getGroup();
this.getParentType();
}
//父级分类
getParentType(){
this.workSer.findByParentType().subscribe(
(res)=>{
const data = res.data;
this.parentTypeList = data;
}
)
}
//通过父级分类查询子级分类
getTypeByParent(parentid){
this.workSer.findByParentidCount(parentid).subscribe(
(res)=>{
const data = res.data;
this.typeList = data;
}
)
} }
//编辑 //编辑
......
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