新增获取动态表单中的字典字段

This commit is contained in:
WenG 2020-09-23 21:21:13 +08:00
parent 0e90165e9f
commit 02df595c0d
2 changed files with 22 additions and 0 deletions

View File

@ -112,4 +112,13 @@ public interface IDynamicFormService {
* @param dynamicFormFormShowFieldDTOs * @param dynamicFormFormShowFieldDTOs
*/ */
void setDynamicFieldData(ModelAndView mv, List<DynamicFormFormShowFieldDTO> dynamicFormFormShowFieldDTOs); void setDynamicFieldData(ModelAndView mv, List<DynamicFormFormShowFieldDTO> dynamicFormFormShowFieldDTOs);
/**
* 从字段列表中获取字典字段
*
* @param dynamicFormDTOs
* @return
* @throws SearchException
*/
List<String> listDataDictionaryField(List<DynamicFormDTO> dynamicFormDTOs) throws SearchException;
} }

View File

@ -242,6 +242,19 @@ public class DynamicFormServiceImpl extends AbstractService implements IDynamicF
mv.addObject("radioMapList", radioMapList); mv.addObject("radioMapList", radioMapList);
} }
@Override
public List<String> listDataDictionaryField(List<DynamicFormDTO> dynamicFormDTOs) throws SearchException {
List<String> dataDictionaryFields = new ArrayList<>();
for (DynamicFormDTO dynamicFormDTO : dynamicFormDTOs) {
if (StringUtils.equals(dynamicFormDTO.getFieldType(), FieldTypeEnum.SELECT.getValue())
|| StringUtils.equals(dynamicFormDTO.getFieldType(), FieldTypeEnum.RADIO.getValue())
|| StringUtils.equals(dynamicFormDTO.getFieldType(), FieldTypeEnum.CHECKBOX.getValue())) {
dataDictionaryFields.add(dynamicFormDTO.getFieldName());
}
}
return dataDictionaryFields;
}
/** /**
* 判断是否是动态字段 * 判断是否是动态字段
* *