Skip to content

Commit f110664

Browse files
authored
feat(form:tree-select): add change of schema (#1827)
1 parent f8d383a commit f110664

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/form/widgets/tree-select/schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
33

44
import type { SFSchemaEnum, SFSchemaEnumType, SFUISchemaItem } from '@delon/form';
55
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/core/tree';
6-
import { NgStyleInterface, NzSizeLDSType } from 'ng-zorro-antd/core/types';
6+
import type { NgStyleInterface, NzSafeAny, NzSizeLDSType } from 'ng-zorro-antd/core/types';
77

88
export interface SFTreeSelectWidgetSchema extends SFUISchemaItem {
99
/**
@@ -129,4 +129,6 @@ export interface SFTreeSelectWidgetSchema extends SFUISchemaItem {
129129
* 点击展开树节点图标调用
130130
*/
131131
expandChange?: (e: NzFormatEmitEvent) => Observable<SFSchemaEnum[]>;
132+
133+
change?: (value: NzSafeAny[] | NzSafeAny) => void;
132134
}

packages/form/widgets/tree-select/widget.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FormsModule } from '@angular/forms';
33

44
import { ControlUIWidget, DelonFormModule, SFSchemaEnum, SFValue, getData, toBool } from '@delon/form';
55
import { NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/core/tree';
6+
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
67
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
78

89
import type { SFTreeSelectWidgetSchema } from './schema';
@@ -90,7 +91,8 @@ export class TreeSelectWidget extends ControlUIWidget<SFTreeSelectWidgetSchema>
9091
});
9192
}
9293

93-
change(value: string[] | string): void {
94+
change(value: NzSafeAny[] | NzSafeAny): void {
95+
console.log(value);
9496
if (this.ui.change) this.ui.change(value);
9597
this.setValue(value);
9698
}

0 commit comments

Comments
 (0)