feat: implement AddPolicyEngine component with dynamic rule and action configuration logic
This commit is contained in:
@@ -598,13 +598,13 @@ export default function AddPolicyEngine() {
|
||||
valObj.booleanValue = !!val;
|
||||
} else if (fieldType === 'number' || fieldType === 'decimal' || fieldType === 'percentage') {
|
||||
valObj.numberValue = parseFloat(val) || 0;
|
||||
} else if (Array.isArray(val)) {
|
||||
valObj.textValue = JSON.stringify(val);
|
||||
} else if (fieldType === 'dropdown' || fieldType === 'select' || fieldDef?.lookupSource) {
|
||||
valObj.selectedValueId = String(val ?? '');
|
||||
const lookupOpts = fieldLookupOptionsMap[fieldDef?.lookupSource || ''] || [];
|
||||
const matchedOpt = lookupOpts.find((o) => o.value === val || o.id === val || o.code === val);
|
||||
valObj.textValue = matchedOpt ? matchedOpt.label : String(val ?? '');
|
||||
} else if (Array.isArray(val)) {
|
||||
valObj.textValue = JSON.stringify(val);
|
||||
} else {
|
||||
valObj.textValue = String(val ?? '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user