DodoButtonRight:自定义按钮注解

  1. @DodoButtonRight 用于给实体类添加自定义按钮
  2. 自定义按钮显示在列表页面,可以按行添加,也可以按模块添加

配置说明

属性名称备注
name按钮的显示文本名称,该配置和nameKey属性只能二选一
nameKey国际化使用:按钮的显示文本名称,标识Spring国际化资源文件中的一个key 优先级高于 name
event访问模式 打开URL方式 或者 ajax方式
path按钮访问路径,具体说明请查看源码中的注释
model按钮模式:ROW=数据行按钮,MODEL=模块按钮
location按钮显示的位置,默认是在下方;取值:TOP=顶部,BOTTOM=底部;model=DodoButtonRightModel.MODEL时启用
urlTarget_self=当前页打开,_blank=新窗口打开,event=DodoButtonRightEvent.URL下启用
sortSeq排列顺序,表示按钮出现的先后顺序,升序

例子:

  1. //列表页面底部按钮,ajax请求
  2. @DodoButtonRight(name = "底部AJAX", path = "/bottom/ajax",
  3. model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.BOTTOM, event = DodoButtonRightEvent.AJAX)
  4. //列表页面顶部按钮,ajax请求
  5. @DodoButtonRight(name = "顶部AJAX", path = "/top/ajax",
  6. model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.TOP, event = DodoButtonRightEvent.AJAX)
  7. //列表页面底部按钮,点击跳转到站外,新窗口打开
  8. @DodoButtonRight(name = "底部URL", path = "https://www.0yi0.com",
  9. model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.BOTTOM, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
  10. //列表页面顶部按钮,点击跳转到站外,新窗口打开
  11. @DodoButtonRight(name = "顶部URL", path = "https://www.0yi0.com",
  12. model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.TOP, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
  13. //数据行按钮,ajax请求
  14. @DodoButtonRight(name = "行AJAX", path = "/row/ajax",
  15. model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.AJAX)
  16. //数据行按钮,点击新窗口打开一个后台的URL
  17. @DodoButtonRight(name = "后台URL", path = "${rootPath}/special/view.jhtml",
  18. model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
  19. //数据行按钮,点击新窗口打开一个前台的URL
  20. @DodoButtonRight(name = "前台URL", path = "${webHomeUrl}/test.html",
  21. model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
  22. //数据行按钮,点击新窗口打开一个站外的URL
  23. @DodoButtonRight(name = "站外URL", path = "https://www.0yi0.com",
  24. model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
  25. public class ButtonRightDemo extends BaseEntity {
  26. //......
  27. }

效果图

登录图片