添加动态拖拉角色名称 列

添加角色底排序底部汇总伪代码
pull/50/head
zoulifu 2022-10-18 20:40:22 +08:00 committed by 小诺
parent a06b36482c
commit 2404e96e5d
5 changed files with 64 additions and 2 deletions

View File

@ -73,5 +73,9 @@ export default {
// 获取权限授权树 // 获取权限授权树
rolePermissionTreeSelector(data) { rolePermissionTreeSelector(data) {
return request('permissionTreeSelector', data, 'get') return request('permissionTreeSelector', data, 'get')
},
// 获取汇总数据
roleSummary(data) {
return request('summary', data, 'get')
} }
} }

View File

@ -45,6 +45,7 @@
bordered bordered
:row-key="(record) => record.id" :row-key="(record) => record.id"
:row-selection="options.rowSelection" :row-selection="options.rowSelection"
@resizeColumn="handleResizeColumn"
> >
<template #operator class="table-operator"> <template #operator class="table-operator">
<a-space> <a-space>
@ -87,6 +88,16 @@
</a-dropdown> </a-dropdown>
</template> </template>
</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> </s-table>
</a-card> </a-card>
</a-col> </a-col>
@ -114,7 +125,9 @@
const columns = [ const columns = [
{ {
title: '角色名称', title: '角色名称',
dataIndex: 'name' dataIndex: 'name',
resizable: true,
width: 150
}, },
{ {
title: '分类', title: '分类',
@ -165,10 +178,22 @@
// Promise // Promise
const loadDate = (parameter) => { 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 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) => { orgApi.orgTree().then((res) => {
cardLoading.value = false cardLoading.value = false
@ -213,6 +238,10 @@
} }
table.value.refresh(true) table.value.refresh(true)
} }
//
const handleResizeColumn = (w, col) => {
col.width = w;
}
// //
const removeOrg = (record) => { const removeOrg = (record) => {
let params = [ let params = [

View File

@ -276,4 +276,17 @@ public class SysRoleController {
public CommonResult<List<SysUser>> userSelector(SysRoleSelectorUserParam sysRoleSelectorUserParam) { public CommonResult<List<SysUser>> userSelector(SysRoleSelectorUserParam sysRoleSelectorUserParam) {
return CommonResult.data(sysRoleService.userSelector(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));
}
} }

View File

@ -169,4 +169,12 @@ public interface SysRoleService extends IService<SysRole> {
* @date 2022/8/22 13:39 * @date 2022/8/22 13:39
**/ **/
List<SysUser> userSelector(SysRoleSelectorUserParam sysRoleSelectorUserParam); List<SysUser> userSelector(SysRoleSelectorUserParam sysRoleSelectorUserParam);
/**
*
*
* @author jax
* @date 2022/8/22 13:39
**/
SysRole summary(SysRolePageParam sysRolePageParam);
} }

View File

@ -403,6 +403,14 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
return sysUserService.list(lambdaQueryWrapper); 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) { public JSONObject getParentNode(List<Tree<String>> treeList, SysMenu sysMenu) {