8000 chore: 调整 crud2 配置面板加载更多部分 by 2betop · Pull Request #12030 · baidu/amis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: 调整 crud2 配置面板加载更多部分 #12030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions packages/amis-editor/src/plugin/CRUD2/BaseCRUD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,8 @@ export class BaseCRUDPlugin extends BasePlugin {
layout: ['total', 'perPage', 'pager'],
perPageAvailable: [10, 20, 50, 100]
}
: schema.pullRefresh.disabled
? null
: {
type: 'button',
behavior: 'loadMore',
Expand All @@ -799,7 +801,8 @@ export class BaseCRUDPlugin extends BasePlugin {
}
};

this.addFeatToToolbar(schema, newCompSchema, 'footer', 'right');
newCompSchema &&
this.addFeatToToolbar(schema, newCompSchema, 'footer', 'right');
}
form.setValues({
perPage: value !== 'more' ? undefined : schema.perPage,
Expand All @@ -817,7 +820,47 @@ export class BaseCRUDPlugin extends BasePlugin {
name: 'pullRefresh.disabled',
label: '禁用加载更多',
pipeIn: (value: any) => !!value,
pipeOut: (value: boolean) => value
pipeOut: (value: boolean) => value,
onChange: (
value: string,
oldValue: any,
model: any,
form: any
) => {
const schema = cloneDeep(form.data);
if (value) {
deepRemove(schema, item => {
return item.behavior === 'loadMore';
});
} else {
this.addFeatToToolbar(
schema,
{
type: 'button',
behavior: 'loadMore',
label: '加载更多',
onEvent: {
click: {
actions: [
{
componentId: schema.id,
groupType: 'component',
actionType: 'loadMore'
}
],
weight: 0
}
}
},
'footer',
'right'
);
}

form.setValues({
footerToolbar: schema.footerToolbar
});
}
},
{
type: 'switch',
Expand Down Expand Up @@ -881,7 +924,8 @@ export class BaseCRUDPlugin extends BasePlugin {
},
{
type: 'fieldset',
title: '文本配置',
title: '移动端下拉刷新文案配置',
size: 'base',
visibleOn:
'!data.pullRefresh?.disabled && data.pullRefresh?.showText',
body: [
Expand Down
Loading
0