Commit 21fdc4c7 authored by 前端-李俊鑫's avatar 前端-李俊鑫

fix: 修复选择所有物料的重置问题以及品类名称显示问题

parent b453026e
......@@ -20,7 +20,7 @@ const CategoryDrawer = (props: PropsType, ref) => {
const handleOk = useCallback(() => {
isValuesChangeRef.current = false
onOk?.(checkedKeys.map(item => ({ id: item.id, value: item[fieldCode] })))
onOk?.(checkedKeys.map(item => ({ id: item.id, value: item.value || item[fieldCode] })))
}, [checkedKeys])
const getCategoryTree = async () => {
......
......@@ -136,13 +136,15 @@ const ProcessRules: React.FC<PropsType> = ({ form, filedTypeOptions, onFormField
onFormFieldsChange?.(_, _all)
let ruleEngineConfigFieldRelations = form.getFieldValue('ruleEngineConfigFieldRelations')
// 当字段类型改变的时候,需要重置一下对应的code/value/condition
// 当字段类型改变的时候,需要重置一下对应的code/value/condition/isQueryAll
if (_[0]?.name?.[4] === 'code') {
const filedTypeItem = getFiledTypeItem(_[0].value)
ruleEngineConfigFieldRelations[_[0].name[1]].ruleEngineConfigFields[_[0].name[3]].type = filedTypeItem?.type
// 日期格式给予'今天'的默认值
ruleEngineConfigFieldRelations[_[0].name[1]].ruleEngineConfigFields[_[0].name[3]].value = filedTypeItem?.type === Filed_Type.DATE ? moment().format('YYYY-MM-DD') : undefined
ruleEngineConfigFieldRelations[_[0].name[1]].ruleEngineConfigFields[_[0].name[3]].condition = conditionOptions[filedTypeItem?.type][0].value
// 是否勾选所有物料也需要重置
ruleEngineConfigFieldRelations[_[0].name[1]].ruleEngineConfigFields[_[0].name[3]].isQueryAll = 0
form.setFieldsValue({ ruleEngineConfigFieldRelations })
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment