mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: incorrect value display for "Enable index column" (#6724)
This commit is contained in:
parent
31a0189e2e
commit
374c569dc0
@ -37,7 +37,7 @@ const enabledIndexColumn: SchemaSettingsItemType = {
|
|||||||
const { dn } = useDesignable();
|
const { dn } = useDesignable();
|
||||||
return {
|
return {
|
||||||
title: t('Enable index column'),
|
title: t('Enable index column'),
|
||||||
checked: field.decoratorProps.enableSelectColumn !== false,
|
checked: field.decoratorProps.enableIndexÏColumn !== false,
|
||||||
onChange: async (enableIndexÏColumn) => {
|
onChange: async (enableIndexÏColumn) => {
|
||||||
field.decoratorProps = field.decoratorProps || {};
|
field.decoratorProps = field.decoratorProps || {};
|
||||||
field.decoratorProps.enableIndexÏColumn = enableIndexÏColumn;
|
field.decoratorProps.enableIndexÏColumn = enableIndexÏColumn;
|
||||||
|
@ -35,9 +35,34 @@ export const useValues = (options) => {
|
|||||||
const option = (dataIndex && findOption(dataIndex, options)) || {};
|
const option = (dataIndex && findOption(dataIndex, options)) || {};
|
||||||
const operators = option?.operators || [];
|
const operators = option?.operators || [];
|
||||||
field.data.operators = operators?.filter((v) => {
|
field.data.operators = operators?.filter((v) => {
|
||||||
if (dataIndex.length > 1) {
|
const isOptionField = ['select', 'radioGroup', 'multipleSelect', 'checkboxGroup'].includes(
|
||||||
return v.value !== 'value';
|
option?.interface || '',
|
||||||
|
);
|
||||||
|
const isDateField = [
|
||||||
|
'date',
|
||||||
|
'datetime',
|
||||||
|
'dateOnly',
|
||||||
|
'datetimeNoTz',
|
||||||
|
'unixTimestamp',
|
||||||
|
'createdAt',
|
||||||
|
'updatedAt',
|
||||||
|
].includes(option?.interface || '');
|
||||||
|
|
||||||
|
// 如果 多个字段,则排除 Value、DateScope、Options
|
||||||
|
if (dataIndex.length > 1 && [ActionType.Value, ActionType.DateScope, ActionType.Options].includes(v.value)) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 非选项字段,去掉 Options
|
||||||
|
if (!isOptionField && v.value === ActionType.Options) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 非时间字段,去掉 DateScope
|
||||||
|
if (!isDateField && v.value === ActionType.DateScope) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
field.data.schema = option?.schema;
|
field.data.schema = option?.schema;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user