erupt
erupt copied to clipboard
@RowOperation与@ChoiceType组合使用时,ifExpr 表达式不生效
版本情况
JDK版本: openjdk_17
erupt版本: 1.12.7
问题描述(包括截图)
- 复现代码
@Data
@Erupt(name = "XXX管理", rowOperation = {
@RowOperation(title = "XXX", mode = RowOperation.Mode.SINGLE, ifExpr = "item.status == 0", operationHandler = XXX.class)
})
@EruptField(views = @View(title = "XXX"), edit = @Edit(title = "XXX", type = EditType.CHOICE, choiceType = @ChoiceType(vl = {@VL(label = "X1", value = "0"), @VL(label = "X2", value = "1")})))
private Integer status;
status
字段数据库中为integer类型,使用@ChoiceType注解在前端展示成vl中的label,此时 ifExpr 失效。
当我修改以下代码,将 ifExpr 表达式改成 item.status == @ChoiceType中vl的label值时,ifExpr生效
@Data
@Erupt(name = "XXX管理", rowOperation = {
@RowOperation(title = "XXX", mode = RowOperation.Mode.SINGLE, ifExpr = "item.status == 'XXX1'", operationHandler = XXX.class)
})
请问这是特地设计成这样还是本身是个bug,因为我在使用 ifExpr 时直觉是他应该与数据库的字段类型相同