mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix(data-vi): enum field options are empty in the filter block (#6706)
* fix(data-vi): enum field options are empty in the filter block * fix: specific props
This commit is contained in:
parent
5931e2914e
commit
97f4a6ccff
@ -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}`,
|
||||||
|
@ -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,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user