DodoButtonRight:自定义按钮注解
@DodoButtonRight 用于给实体类添加自定义按钮
自定义按钮显示在列表页面,可以按行添加,也可以按模块添加
配置说明
属性名称 | 备注 |
---|---|
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 | 排列顺序,表示按钮出现的先后顺序,升序 |
例子:
//列表页面底部按钮,ajax请求
@DodoButtonRight(name = "底部AJAX", path = "/bottom/ajax",
model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.BOTTOM, event = DodoButtonRightEvent.AJAX)
//列表页面顶部按钮,ajax请求
@DodoButtonRight(name = "顶部AJAX", path = "/top/ajax",
model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.TOP, event = DodoButtonRightEvent.AJAX)
//列表页面底部按钮,点击跳转到站外,新窗口打开
@DodoButtonRight(name = "底部URL", path = "https://www.0yi0.com",
model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.BOTTOM, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
//列表页面顶部按钮,点击跳转到站外,新窗口打开
@DodoButtonRight(name = "顶部URL", path = "https://www.0yi0.com",
model = DodoButtonRightModel.MODEL, location = DodoButtonLocation.TOP, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
//数据行按钮,ajax请求
@DodoButtonRight(name = "行AJAX", path = "/row/ajax",
model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.AJAX)
//数据行按钮,点击新窗口打开一个后台的URL
@DodoButtonRight(name = "后台URL", path = "${rootPath}/special/view.jhtml",
model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
//数据行按钮,点击新窗口打开一个前台的URL
@DodoButtonRight(name = "前台URL", path = "${webHomeUrl}/test.html",
model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
//数据行按钮,点击新窗口打开一个站外的URL
@DodoButtonRight(name = "站外URL", path = "https://www.0yi0.com",
model = DodoButtonRightModel.ROW, event = DodoButtonRightEvent.URL, urlTarget = "_blank")
public class ButtonRightDemo extends BaseEntity {
//......
}
效果图
当前内容版权归 DodoFramework 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 DodoFramework .