Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@RowOperation与@ChoiceType组合使用时,ifExpr 表达式不生效 #220

Open
tzxyz opened this issue Nov 24, 2023 · 0 comments
Open

Comments

@tzxyz
Copy link

tzxyz commented Nov 24, 2023

版本情况

JDK版本: openjdk_17
erupt版本: 1.12.7

问题描述(包括截图)

  1. 复现代码
@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 时直觉是他应该与数据库的字段类型相同

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant