mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
994ba878fc
@ -48,7 +48,8 @@ export const createFormBlockSettings = new SchemaSettings({
|
||||
Component: SchemaSettingsDataTemplates,
|
||||
useVisible() {
|
||||
const { action } = useFormBlockContext();
|
||||
return !action;
|
||||
const schema = useFieldSchema();
|
||||
return !action && schema?.['x-acl-action'].includes('create');
|
||||
},
|
||||
useComponentProps() {
|
||||
const { name } = useCollection_deprecated();
|
||||
|
@ -0,0 +1,86 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import {
|
||||
SchemaSettings,
|
||||
useBlockTemplateContext,
|
||||
SchemaSettingsLayoutItem,
|
||||
SchemaSettingsDataTemplates,
|
||||
useFormBlockContext,
|
||||
SchemaSettingsFormItemTemplate,
|
||||
useCollection,
|
||||
useCollection_deprecated,
|
||||
SchemaSettingsBlockHeightItem,
|
||||
SchemaSettingsBlockTitleItem,
|
||||
SchemaSettingsLinkageRules,
|
||||
} from '@nocobase/client';
|
||||
|
||||
export const bulkEditFormBlockSettings = new SchemaSettings({
|
||||
name: 'blockSettings:bulkEditForm',
|
||||
items: [
|
||||
{
|
||||
name: 'title',
|
||||
Component: SchemaSettingsBlockTitleItem,
|
||||
},
|
||||
{
|
||||
name: 'setTheBlockHeight',
|
||||
Component: SchemaSettingsBlockHeightItem,
|
||||
},
|
||||
{
|
||||
name: 'linkageRules',
|
||||
Component: SchemaSettingsLinkageRules,
|
||||
useComponentProps() {
|
||||
const { name } = useCollection_deprecated();
|
||||
return {
|
||||
collectionName: name,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: 'divider',
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: 'formItemTemplate',
|
||||
Component: SchemaSettingsFormItemTemplate,
|
||||
useComponentProps() {
|
||||
const { componentNamePrefix } = useBlockTemplateContext();
|
||||
const { name } = useCollection();
|
||||
const fieldSchema = useFieldSchema();
|
||||
const defaultResource =
|
||||
fieldSchema?.['x-decorator-props']?.resource || fieldSchema?.['x-decorator-props']?.association;
|
||||
return {
|
||||
componentName: `${componentNamePrefix}FormItem`,
|
||||
collectionName: name,
|
||||
resourceName: defaultResource,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'setBlockLayout',
|
||||
Component: SchemaSettingsLayoutItem,
|
||||
},
|
||||
{
|
||||
name: 'divider2',
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: 'remove',
|
||||
type: 'remove',
|
||||
componentProps: {
|
||||
removeParentsIfNoChildren: true,
|
||||
breakRemoveOn: {
|
||||
'x-component': 'Grid',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
@ -39,7 +39,7 @@ export function createBulkEditBlockUISchema(options: {
|
||||
association,
|
||||
},
|
||||
'x-toolbar': 'BlockSchemaToolbar',
|
||||
'x-settings': 'blockSettings:createForm',
|
||||
'x-settings': 'blockSettings:bulkEditForm',
|
||||
'x-component': 'CardItem',
|
||||
properties: {
|
||||
[uid()]: {
|
||||
|
@ -26,12 +26,14 @@ import {
|
||||
} from './BulkEditFormActionInitializers';
|
||||
import { BulkEditFormItemInitializers_deprecated, bulkEditFormItemInitializers } from './BulkEditFormItemInitializers';
|
||||
import { bulkEditFormItemSettings } from './bulkEditFormItemSettings';
|
||||
import { bulkEditFormBlockSettings } from './BulkEditFormBlockSettings';
|
||||
import { BulkEditField } from './component/BulkEditField';
|
||||
import { useCustomizeBulkEditActionProps } from './utils';
|
||||
export class PluginActionBulkEditClient extends Plugin {
|
||||
async load() {
|
||||
this.app.addComponents({ BulkEditField, BulkEditActionDecorator });
|
||||
this.app.addScopes({ useCustomizeBulkEditActionProps });
|
||||
this.app.schemaSettingsManager.add(bulkEditFormBlockSettings);
|
||||
this.app.schemaSettingsManager.add(deprecatedBulkEditActionSettings);
|
||||
this.app.schemaSettingsManager.add(bulkEditActionSettings);
|
||||
this.app.schemaSettingsManager.add(bulkEditFormSubmitActionSettings);
|
||||
|
Loading…
x
Reference in New Issue
Block a user