fix(web): filter type operator
This commit is contained in:
@@ -91,7 +91,8 @@ const FilterConditions: FC<FilterConditionsProps> = ({
|
|||||||
const keyFieldValue = currentCondition.key;
|
const keyFieldValue = currentCondition.key;
|
||||||
const keyFieldOption = fileSubVariable.find(option => option.filed === keyFieldValue);
|
const keyFieldOption = fileSubVariable.find(option => option.filed === keyFieldValue);
|
||||||
const keyFieldType = keyFieldOption?.dataType;
|
const keyFieldType = keyFieldOption?.dataType;
|
||||||
const operatorList = operatorsObj[keyFieldValue === 'type' ? 'type' : keyFieldType || 'default'] || operatorsObj.default || [];
|
const innerType = variableType?.match(/^array\[(.+)\]$/)?.[1];
|
||||||
|
const operatorList = operatorsObj[innerType !== 'file' ? (innerType || 'default') : keyFieldValue === 'type' ? 'type' : keyFieldType || 'default'] || operatorsObj.default || [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
@@ -111,7 +112,7 @@ const FilterConditions: FC<FilterConditionsProps> = ({
|
|||||||
fieldNames={{ value: 'filed', label: 'label' }}
|
fieldNames={{ value: 'filed', label: 'label' }}
|
||||||
onChange={(value) => handleKeyFieldChange(index, value)}
|
onChange={(value) => handleKeyFieldChange(index, value)}
|
||||||
variant="borderless"
|
variant="borderless"
|
||||||
className="rb:w-full!"
|
className="rb:w-full! rb:h-7!"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
@@ -129,15 +130,15 @@ const FilterConditions: FC<FilterConditionsProps> = ({
|
|||||||
popupMatchSelectWidth={false}
|
popupMatchSelectWidth={false}
|
||||||
placeholder={t('common.pleaseSelect')}
|
placeholder={t('common.pleaseSelect')}
|
||||||
variant="borderless"
|
variant="borderless"
|
||||||
className="rb:w-full!"
|
className="rb:w-full! rb:h-7!"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
{!hideValueField && (
|
{!hideValueField && (
|
||||||
<Col flex="1">
|
<Col flex="1">
|
||||||
<Form.Item name={[field.name, 'value']} className="rb:pt-0.5! rb:mb-0! rb:pl-2!">
|
<Form.Item name={[field.name, 'value']} className="rb:pt-0.5! rb:mb-0! rb:pl-2!">
|
||||||
{variableType?.includes('boolean')
|
{innerType === 'boolean'
|
||||||
? <RadioGroupBtn options={[{ value: true, label: 'True' }, { value: false, label: 'False' }]} />
|
? <RadioGroupBtn options={[{ value: true, label: 'True' }, { value: false, label: 'False' }]} type="inner" />
|
||||||
: keyFieldValue === 'type'
|
: keyFieldValue === 'type'
|
||||||
? <Select
|
? <Select
|
||||||
placeholder={t('common.pleaseSelect')}
|
placeholder={t('common.pleaseSelect')}
|
||||||
|
|||||||
Reference in New Issue
Block a user