From f2782a1fcc743ca31be220756de640cb92196bee Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 10 Oct 2022 10:23:08 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E6=96=B0=E5=A2=9E=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=90=8D=E7=A7=B0=E4=B8=8D=E5=85=81=E8=AE=B8=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/home/basic-info/add-unit/add-unit.component.html | 5 ++++- src/app/home/basic-info/add-unit/add-unit.component.scss | 4 ++++ src/app/home/basic-info/add-unit/add-unit.component.ts | 6 ++++-- .../home/basic-info/unit-details/unit-details.component.ts | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app/home/basic-info/add-unit/add-unit.component.html b/src/app/home/basic-info/add-unit/add-unit.component.html index 3da3448..6c9d049 100644 --- a/src/app/home/basic-info/add-unit/add-unit.component.html +++ b/src/app/home/basic-info/add-unit/add-unit.component.html @@ -4,8 +4,11 @@ 单位名称 - + +
+ (单位名称不能使用空格)
diff --git a/src/app/home/basic-info/add-unit/add-unit.component.scss b/src/app/home/basic-info/add-unit/add-unit.component.scss index e69de29..371695b 100644 --- a/src/app/home/basic-info/add-unit/add-unit.component.scss +++ b/src/app/home/basic-info/add-unit/add-unit.component.scss @@ -0,0 +1,4 @@ +.error-message{ + color: red; + font-size: 14px; +} \ No newline at end of file diff --git a/src/app/home/basic-info/add-unit/add-unit.component.ts b/src/app/home/basic-info/add-unit/add-unit.component.ts index 49d28ee..b8f27f5 100644 --- a/src/app/home/basic-info/add-unit/add-unit.component.ts +++ b/src/app/home/basic-info/add-unit/add-unit.component.ts @@ -17,7 +17,7 @@ export class AddUnitComponent implements OnInit { constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } ngOnInit(): void { this.validateForm = this.fb.group({ - unitname: [null, [Validators.required]], + unitname: [null, [Validators.required, Validators.pattern("[^\\s\\r\\n]{1,100}")]], person: [null], phone: [null], addr: [null], @@ -31,5 +31,7 @@ export class AddUnitComponent implements OnInit { this.modal.destroy({ data: 'this the result data' }); } - + xxx(){ + console.log(this.validateForm.controls['unitname']) + } } diff --git a/src/app/home/basic-info/unit-details/unit-details.component.ts b/src/app/home/basic-info/unit-details/unit-details.component.ts index 9292c8d..d9fff6d 100644 --- a/src/app/home/basic-info/unit-details/unit-details.component.ts +++ b/src/app/home/basic-info/unit-details/unit-details.component.ts @@ -1483,7 +1483,6 @@ export class UnitDetailsComponent implements OnInit { getAllOrganization() { let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId let params = { - // OrganizationId: organizationId || '', ContainsChildren: "true", PageNumber: 1, PageSize: 9999 @@ -1491,6 +1490,7 @@ export class UnitDetailsComponent implements OnInit { this.http.get('/api/Organizations', { params: params }).subscribe((data: any) => { + console.log('组织机构', data.items) data.items.forEach(element => { if (element.id == organizationId) { element.parentId = null