mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: issue with select linkage value type (#5180)
* fix: issue with filterItem remove * fix: issue with select-linkage-value-type * fix: bug * fix: bug
This commit is contained in:
parent
c4a3b96330
commit
2459991fbb
@ -95,6 +95,9 @@ export const FilterGroup = connect((props) => {
|
|||||||
field.value = {
|
field.value = {
|
||||||
[logic]: items,
|
[logic]: items,
|
||||||
};
|
};
|
||||||
|
field.initialValue = {
|
||||||
|
[logic]: items,
|
||||||
|
};
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('Add condition')}
|
{t('Add condition')}
|
||||||
|
@ -68,6 +68,7 @@ export const LinkageRuleActionGroup = withDynamicSchemaProps(
|
|||||||
const items = f.value || [];
|
const items = f.value || [];
|
||||||
items.push({});
|
items.push({});
|
||||||
f.value = items;
|
f.value = items;
|
||||||
|
f.initialValue = items;
|
||||||
}, [field]);
|
}, [field]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import { Input, Select } from 'antd';
|
import { Input, Select } from 'antd';
|
||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import React, { useCallback, useMemo, useState } from 'react';
|
import React, { useCallback, useMemo, useState, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useFormBlockContext } from '../../block-provider/FormBlockProvider';
|
import { useFormBlockContext } from '../../block-provider/FormBlockProvider';
|
||||||
import { useRecord } from '../../record-provider';
|
import { useRecord } from '../../record-provider';
|
||||||
@ -50,6 +50,11 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => {
|
|||||||
const constantStyle = useMemo(() => {
|
const constantStyle = useMemo(() => {
|
||||||
return { minWidth: 150, maxWidth: 430 };
|
return { minWidth: 150, maxWidth: 430 };
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setMode(fieldValue?.mode || 'constant');
|
||||||
|
}, [fieldValue?.mode]);
|
||||||
|
|
||||||
const handleChangeOfConstant = useCallback(
|
const handleChangeOfConstant = useCallback(
|
||||||
(value) => {
|
(value) => {
|
||||||
setValue({
|
setValue({
|
||||||
@ -160,7 +165,7 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => {
|
|||||||
</Option>
|
</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
{modeMap[fieldValue?.mode || mode]}
|
{modeMap[mode]}
|
||||||
</Input.Group>
|
</Input.Group>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user