mirror of https://gitee.com/xiaonuobase/snowy
parent
a06b36482c
commit
2404e96e5d
|
@ -73,5 +73,9 @@ export default {
|
|||
// 获取权限授权树
|
||||
rolePermissionTreeSelector(data) {
|
||||
return request('permissionTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取汇总数据
|
||||
roleSummary(data) {
|
||||
return request('summary', data, 'get')
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
bordered
|
||||
:row-key="(record) => record.id"
|
||||
:row-selection="options.rowSelection"
|
||||
@resizeColumn="handleResizeColumn"
|
||||
>
|
||||
<template #operator class="table-operator">
|
||||
<a-space>
|
||||
|
@ -87,6 +88,16 @@
|
|||
</a-dropdown>
|
||||
</template>
|
||||
</template>
|
||||
<template #summary>
|
||||
<a-table-summary-row>
|
||||
<a-table-summary-cell :index="0">汇 总</a-table-summary-cell>
|
||||
<a-table-summary-cell :index="1"></a-table-summary-cell>
|
||||
<a-table-summary-cell :index="2">
|
||||
<a-typography-text type="danger">{{ summaryData.sortCode }}</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell :index="3"></a-table-summary-cell>
|
||||
</a-table-summary-row>
|
||||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
</a-col>
|
||||
|
@ -114,7 +125,9 @@
|
|||
const columns = [
|
||||
{
|
||||
title: '角色名称',
|
||||
dataIndex: 'name'
|
||||
dataIndex: 'name',
|
||||
resizable: true,
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '分类',
|
||||
|
@ -165,10 +178,22 @@
|
|||
|
||||
// 表格查询 返回 Promise 对象
|
||||
const loadDate = (parameter) => {
|
||||
return roleApi.rolePage(Object.assign(parameter, searchFormState)).then((res) => {
|
||||
let param = Object.assign(parameter, searchFormState)
|
||||
summaryDataReq(param)
|
||||
return roleApi.rolePage(param).then((res) => {
|
||||
return res
|
||||
})
|
||||
}
|
||||
// 计算汇总数据
|
||||
const summaryData = {}
|
||||
const summaryDataReq = (param) => {
|
||||
summaryData.sortCode = ref(0)
|
||||
roleApi.roleSummary(param).then((summary) => {
|
||||
if(summary != null){
|
||||
return summaryData.sortCode = summary.sortCode
|
||||
}
|
||||
})
|
||||
}
|
||||
// 加载左侧的树
|
||||
orgApi.orgTree().then((res) => {
|
||||
cardLoading.value = false
|
||||
|
@ -213,6 +238,10 @@
|
|||
}
|
||||
table.value.refresh(true)
|
||||
}
|
||||
// 可伸缩列
|
||||
const handleResizeColumn = (w, col) => {
|
||||
col.width = w;
|
||||
}
|
||||
// 删除
|
||||
const removeOrg = (record) => {
|
||||
let params = [
|
||||
|
|
|
@ -276,4 +276,17 @@ public class SysRoleController {
|
|||
public CommonResult<List<SysUser>> userSelector(SysRoleSelectorUserParam sysRoleSelectorUserParam) {
|
||||
return CommonResult.data(sysRoleService.userSelector(sysRoleSelectorUserParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户选择器
|
||||
*
|
||||
* @author jax
|
||||
* @date 2022/10/18 20:00
|
||||
*/
|
||||
@ApiOperationSupport(order = 17)
|
||||
@ApiOperation("获取页面统计数据")
|
||||
@GetMapping("/sys/role/summary")
|
||||
public CommonResult<SysRole> summary(SysRolePageParam sysRolePageParam) {
|
||||
return CommonResult.data(sysRoleService.summary(sysRolePageParam));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,4 +169,12 @@ public interface SysRoleService extends IService<SysRole> {
|
|||
* @date 2022/8/22 13:39
|
||||
**/
|
||||
List<SysUser> userSelector(SysRoleSelectorUserParam sysRoleSelectorUserParam);
|
||||
|
||||
/**
|
||||
* 获取页面统计数据
|
||||
*
|
||||
* @author jax
|
||||
* @date 2022/8/22 13:39
|
||||
**/
|
||||
SysRole summary(SysRolePageParam sysRolePageParam);
|
||||
}
|
||||
|
|
|
@ -403,6 +403,14 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|||
return sysUserService.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysRole summary(SysRolePageParam sysRolePageParam) {
|
||||
// 实现自己业务逻辑计算 以下是伪代码
|
||||
SysRole sysRole = new SysRole();
|
||||
sysRole.setSortCode(2000);
|
||||
return sysRole;
|
||||
}
|
||||
|
||||
/* ====以下为各种递归方法==== */
|
||||
|
||||
public JSONObject getParentNode(List<Tree<String>> treeList, SysMenu sysMenu) {
|
||||
|
|
Loading…
Reference in New Issue