完善导出权限
This commit is contained in:
@ -15,6 +15,9 @@ public class PermissionConstants
|
||||
|
||||
/** 删除权限 */
|
||||
public static final String REMOVE_PERMISSION = "remove";
|
||||
|
||||
/** 导出权限 */
|
||||
public static final String EXPORT_PERMISSION = "export";
|
||||
|
||||
/** 显示权限 */
|
||||
public static final String VIEW_PERMISSION = "view";
|
||||
|
@ -33,6 +33,10 @@ public class PermissionUtils
|
||||
{
|
||||
msg = MessageUtils.message("no.delete.permission", permission);
|
||||
}
|
||||
else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.EXPORT_PERMISSION))
|
||||
{
|
||||
msg = MessageUtils.message("no.export.permission", permission);
|
||||
}
|
||||
else if (StringUtils.endsWithAny(permission, new String[] { PermissionConstants.VIEW_PERMISSION, PermissionConstants.LIST_PERMISSION }))
|
||||
{
|
||||
msg = MessageUtils.message("no.view.permission", permission);
|
||||
|
@ -56,6 +56,7 @@ public class BaseController
|
||||
protected TableDataInfo getDataTable(List<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(0);
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
|
@ -15,6 +15,8 @@ public class TableDataInfo implements Serializable
|
||||
private long total;
|
||||
/** 列表数据 */
|
||||
private List<?> rows;
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 表格数据对象
|
||||
@ -55,4 +57,13 @@ public class TableDataInfo implements Serializable
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ public class JobController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "定时任务", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:job:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(Job job) throws Exception
|
||||
|
@ -49,6 +49,7 @@ public class JobLogController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "调度日志", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:job:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(JobLog jobLog) throws Exception
|
||||
|
@ -49,6 +49,7 @@ public class LogininforController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "登陆日志", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:logininfor:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(Logininfor logininfor) throws Exception
|
||||
|
@ -51,6 +51,7 @@ public class OperlogController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:operlog:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(OperLog operLog) throws Exception
|
||||
|
@ -54,6 +54,7 @@ public class ConfigController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "参数管理", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:config:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(Config config) throws Exception
|
||||
|
@ -51,6 +51,7 @@ public class DictDataController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "字典数据", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:dict:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(DictData dictData) throws Exception
|
||||
|
@ -51,6 +51,7 @@ public class DictTypeController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "字典类型", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:dict:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(DictType dictType) throws Exception
|
||||
|
@ -51,6 +51,7 @@ public class PostController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "岗位管理", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:post:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(Post post) throws Exception
|
||||
|
@ -53,6 +53,7 @@ public class RoleController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "角色管理", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:role:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(Role role) throws Exception
|
||||
|
@ -61,6 +61,7 @@ public class UserController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", action = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(User user) throws Exception
|
||||
|
@ -33,4 +33,5 @@ no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
||||
|
@ -36,7 +36,8 @@
|
||||
showToggle: $.common.visible(options.showToggle), // 是否显示详细视图和列表视图的切换按钮
|
||||
showExport: $.common.visible(options.showExport), // 是否支持导出文件
|
||||
queryParams: $.table._params, // 传递参数(*)
|
||||
columns: options.columns // 显示列信息(*)
|
||||
columns: options.columns, // 显示列信息(*)
|
||||
responseHandler: $.table.responseHandler // 回调函数
|
||||
});
|
||||
},
|
||||
// 查询条件
|
||||
@ -50,6 +51,15 @@
|
||||
isAsc: params.order
|
||||
};
|
||||
},
|
||||
// 请求获取数据后处理回调函数
|
||||
responseHandler: function(res) {
|
||||
if (res.code == 0) {
|
||||
return { rows: res.rows, total: res.total };
|
||||
} else {
|
||||
$.modal.alertWarning(res.msg);
|
||||
return { rows: [], total: 0 };
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
search: function(formId) {
|
||||
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
|
||||
|
File diff suppressed because one or more lines are too long
@ -25,7 +25,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:logininfor:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:logininfor:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -30,7 +30,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:config:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -27,7 +27,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:dict:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:dict:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -56,7 +56,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 下载</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user