diff --git a/packages/form/widgets/tree-select/schema.ts b/packages/form/widgets/tree-select/schema.ts index fc0d483738..8cff7e6289 100644 --- a/packages/form/widgets/tree-select/schema.ts +++ b/packages/form/widgets/tree-select/schema.ts @@ -3,7 +3,7 @@ import { Observable } from 'rxjs'; import type { SFSchemaEnum, SFSchemaEnumType, SFUISchemaItem } from '@delon/form'; import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/core/tree'; -import { NgStyleInterface, NzSizeLDSType } from 'ng-zorro-antd/core/types'; +import type { NgStyleInterface, NzSafeAny, NzSizeLDSType } from 'ng-zorro-antd/core/types'; export interface SFTreeSelectWidgetSchema extends SFUISchemaItem { /** @@ -129,4 +129,6 @@ export interface SFTreeSelectWidgetSchema extends SFUISchemaItem { * 点击展开树节点图标调用 */ expandChange?: (e: NzFormatEmitEvent) => Observable; + + change?: (value: NzSafeAny[] | NzSafeAny) => void; } diff --git a/packages/form/widgets/tree-select/widget.ts b/packages/form/widgets/tree-select/widget.ts index 831ff43347..10e6215f15 100644 --- a/packages/form/widgets/tree-select/widget.ts +++ b/packages/form/widgets/tree-select/widget.ts @@ -3,6 +3,7 @@ import { FormsModule } from '@angular/forms'; import { ControlUIWidget, DelonFormModule, SFSchemaEnum, SFValue, getData, toBool } from '@delon/form'; import { NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/core/tree'; +import type { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; import type { SFTreeSelectWidgetSchema } from './schema'; @@ -90,7 +91,8 @@ export class TreeSelectWidget extends ControlUIWidget }); } - change(value: string[] | string): void { + change(value: NzSafeAny[] | NzSafeAny): void { + console.log(value); if (this.ui.change) this.ui.change(value); this.setValue(value); }