Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2025-04-18 11:21:08 +00:00
commit 3a084e436e
2 changed files with 7 additions and 6 deletions

View File

@ -135,11 +135,10 @@ export const useChartFilter = () => {
'x-decorator': 'ChartFilterFormItem', 'x-decorator': 'ChartFilterFormItem',
'x-data-source': dataSource, 'x-data-source': dataSource,
'x-collection-field': `${fieldName}.${field.name}`, 'x-collection-field': `${fieldName}.${field.name}`,
...defaultOperator?.schema,
'x-component-props': { 'x-component-props': {
utc: false, utc: false,
underFilter: true, underFilter: true,
...field.uiSchema?.['x-component-props'], component: defaultOperator?.schema?.['x-component'],
'filter-operator': defaultOperator, 'filter-operator': defaultOperator,
'data-source': dataSource, 'data-source': dataSource,
'collection-field': `${fieldName}.${field.name}`, 'collection-field': `${fieldName}.${field.name}`,
@ -195,14 +194,15 @@ export const useChartFilter = () => {
'x-settings': 'chart:filterForm:item', 'x-settings': 'chart:filterForm:item',
'x-toolbar': 'ChartFilterItemToolbar', 'x-toolbar': 'ChartFilterItemToolbar',
'x-decorator': 'ChartFilterFormItem', 'x-decorator': 'ChartFilterFormItem',
'x-component': 'CollectionField',
'x-data-source': dataSource, 'x-data-source': dataSource,
'x-collection-field': `${fieldName}.${child.name}`, 'x-collection-field': `${fieldName}.${child.name}`,
...child.schema, ...child.schema,
title, title,
...defaultOperator?.schema,
'x-component-props': { 'x-component-props': {
utc: false, utc: false,
underFilter: true, underFilter: true,
component: defaultOperator?.schema?.['x-component'],
'filter-operator': defaultOperator, 'filter-operator': defaultOperator,
'data-source': dataSource, 'data-source': dataSource,
'collection-field': `${fieldName}.${child.name}`, 'collection-field': `${fieldName}.${child.name}`,

View File

@ -56,6 +56,7 @@ function useFieldComponentName(): string {
const map = { const map = {
// AssociationField 的 mode 默认值是 Select // AssociationField 的 mode 默认值是 Select
AssociationField: 'Select', AssociationField: 'Select',
'DatePicker.FilterWithPicker': 'DatePicker',
}; };
const fieldComponentName = const fieldComponentName =
fieldSchema?.['x-component-props']?.['mode'] || fieldSchema?.['x-component-props']?.['mode'] ||
@ -163,15 +164,15 @@ const EditOperator = () => {
const setOperatorComponent = (operator: any, component: any, props = {}) => { const setOperatorComponent = (operator: any, component: any, props = {}) => {
const componentProps = field.componentProps || {}; const componentProps = field.componentProps || {};
field.component = component;
field.componentProps = { field.componentProps = {
...componentProps, ...componentProps,
component,
'filter-operator': operator, 'filter-operator': operator,
...props, ...props,
}; };
fieldSchema['x-component'] = component;
fieldSchema['x-component-props'] = { fieldSchema['x-component-props'] = {
...fieldSchema['x-component-props'], ...fieldSchema['x-component-props'],
component,
'filter-operator': operator, 'filter-operator': operator,
...props, ...props,
}; };
@ -179,9 +180,9 @@ const EditOperator = () => {
dn.emit('patch', { dn.emit('patch', {
schema: { schema: {
'x-uid': fieldSchema['x-uid'], 'x-uid': fieldSchema['x-uid'],
'x-component': component,
'x-component-props': { 'x-component-props': {
...fieldSchema['x-component-props'], ...fieldSchema['x-component-props'],
component,
'filter-operator': operator, 'filter-operator': operator,
...props, ...props,
}, },