Merge pull request #10253 from 2betop/fix-crud-synclocation

chore: crud 即便不同步地址栏也回显地址栏参数 Close: #9788
This commit is contained in:
hsm-lv 2024-05-17 10:54:35 +08:00 committed by GitHub
commit 7e0f3fdfa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 4 deletions

View File

@ -2666,6 +2666,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
footerToolbarRender,
testIdBuilder,
id,
filterCanAccessSuperData = true,
...rest
} = this.props;
@ -2702,7 +2703,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
onSubmit: this.handleFilterSubmit,
onInit: this.handleFilterInit,
formStore: undefined,
canAccessSuperData: false
canAccessSuperData: filterCanAccessSuperData
}
)
: null}
@ -2726,6 +2727,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
className: cx('Crud-body', bodyClassName),
ref: this.controlRef,
autoGenerateFilter: !filter && autoGenerateFilter,
filterCanAccessSuperData,
autoFillHeight: autoFillHeight,
selectable: !!(
(this.hasBulkActionsToolbar() && this.hasBulkActions()) ||

View File

@ -268,6 +268,7 @@ export default class PickerControl extends React.PureComponent<
type: 'crud',
pickerMode: true,
syncLocation: false,
filterCanAccessSuperData: false,
api: isScopeData ? null : props.source,
source: isScopeData ? props.source : null,
keepItemSelectionOnPageChange: true,

View File

@ -19,6 +19,8 @@ export interface AutoFilterFormProps extends RendererProps {
onToggleExpanded?: () => void;
query?: any;
canAccessSuperData?: boolean;
popOverContainer?: any;
onSearchableFromReset?: any;
onSearchableFromSubmit?: any;
@ -40,7 +42,8 @@ export function AutoFilterForm({
onSearchableFromSubmit,
onSearchableFromInit,
popOverContainer,
testIdBuilder
testIdBuilder,
canAccessSuperData
}: AutoFilterFormProps) {
const schema = React.useMemo(() => {
const {columnsNum, showBtnToolbar} =
@ -194,13 +197,14 @@ export function AutoFilterForm({
submitText: __('search'),
body: body,
actions: [],
canAccessSuperData: false
canAccessSuperData: canAccessSuperData
};
}, [
autoGenerateFilter,
activedSearchableColumns,
searchableColumns,
searchFormExpanded,
canAccessSuperData,
__ // 保证语言更新后能重新渲染
]);

View File

@ -1693,7 +1693,8 @@ export default class Table extends React.Component<TableProps, object> {
query,
data,
autoGenerateFilter,
testIdBuilder
testIdBuilder,
filterCanAccessSuperData = true
} = this.props;
const searchableColumns = store.searchableColumns;
@ -1708,6 +1709,7 @@ export default class Table extends React.Component<TableProps, object> {
translate={__}
classnames={cx}
render={render}
canAccessSuperData={filterCanAccessSuperData}
autoGenerateFilter={autoGenerateFilter}
onSearchableFromReset={onSearchableFromReset}
onSearchableFromSubmit={onSearchableFromSubmit}