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