Merge pull request #5530 from sqzhou/fix-transfer

fix:修复时间类、Transfer的事件动作
This commit is contained in:
hsm-lv 2022-10-11 20:32:44 +08:00 committed by GitHub
commit 2391bd5849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View File

@ -851,6 +851,7 @@ icon:
| 事件名称 | 事件参数 | 说明 |
| -------- | --------------------------------- | ---------------- |
| change | `event.data.value: string` 选中值 | 选中值变化时触发 |
| selectAll | `event.data.options: Array<Options>` | 全选时触发 |
## 动作表

View File

@ -423,8 +423,8 @@ export default class DateControl extends React.PureComponent<
// 派发有event的事件
@autobind
dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {
const {dispatchEvent, data} = this.props;
dispatchEvent(e, data);
const {dispatchEvent, data, value} = this.props;
dispatchEvent(e, createObject(data, {value}));
}
// 动作

View File

@ -386,8 +386,8 @@ export class BaseTransferRenderer<
@autobind
onSelectAll(options: Option[]) {
const {dispatchEvent} = this.props;
dispatchEvent('selectAll', options);
const {dispatchEvent, data} = this.props;
dispatchEvent('selectAll', createObject(data, {options}));
}
// 动作

View File

@ -3,7 +3,7 @@ import React from 'react';
import {Spinner} from 'amis-ui';
import {BaseTransferRenderer, TransferControlSchema} from './Transfer';
import {TransferPicker} from 'amis-ui';
import {autobind} from 'amis-core';
import {autobind, createObject} from 'amis-core';
import {ActionObject} from 'amis-core';
/**
@ -41,8 +41,8 @@ export interface TabsTransferProps
export class TransferPickerRenderer extends BaseTransferRenderer<TabsTransferProps> {
@autobind
dispatchEvent(name: string) {
const {dispatchEvent, data} = this.props;
dispatchEvent(name, data);
const {dispatchEvent, data, value} = this.props;
dispatchEvent(name, createObject(data, {value}));
}
// 动作