解决冲突

This commit is contained in:
wangshiming
2022-03-01 13:59:37 +08:00
parent c20220da1d
commit c56013d9ea
2 changed files with 14 additions and 9 deletions

View File

@ -147,10 +147,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
console.log(q) console.log(q === ' ')
if (q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -158,8 +159,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
if (q) { let str =q.replace(/^\s+|\s+$/g,"");
this.getRegionCode(q); if (str) {
this.getRegionCode(str);
} }
} }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema

View File

@ -135,9 +135,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
if (q) { console.log(q === ' ')
let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -145,8 +147,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
if (q) { let str =q.replace(/^\s+|\s+$/g,"");
this.getRegionCode(q); if (str) {
this.getRegionCode(str);
} }
}, },
} as SFSelectWidgetSchema } as SFSelectWidgetSchema