mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-23 03:58:35 +08:00
管理员列表优化,权限优化
This commit is contained in:
@@ -27,7 +27,7 @@ export function delRole(pram) {
|
|||||||
|
|
||||||
export function getInfo(pram) {
|
export function getInfo(pram) {
|
||||||
const data = {
|
const data = {
|
||||||
id: pram.id
|
ids: pram.id
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: '/admin/system/role/info',
|
url: '/admin/system/role/info',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getRoleById(pram) {
|
export function getRoleById(pram) {
|
||||||
const data = { id: pram.id }
|
const data = { ids: pram.roles }
|
||||||
return request({
|
return request({
|
||||||
url: '/admin/system/role/info',
|
url: '/admin/system/role/info',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|||||||
@@ -66,7 +66,6 @@
|
|||||||
handleSetVisitChart() {
|
handleSetVisitChart() {
|
||||||
this.myChart = echarts.init(document.getElementById(this.echarts))
|
this.myChart = echarts.init(document.getElementById(this.echarts))
|
||||||
let option = null
|
let option = null
|
||||||
console.log(this.echartsTitle)
|
|
||||||
if (this.echartsTitle === 'circle') {
|
if (this.echartsTitle === 'circle') {
|
||||||
option = {
|
option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
|
|||||||
@@ -79,13 +79,12 @@ const actions = {
|
|||||||
reject('getInfo: roles must be a non-null array!')
|
reject('getInfo: roles must be a non-null array!')
|
||||||
}
|
}
|
||||||
|
|
||||||
// commit('SET_ROLES', roles)
|
commit('SET_ROLES', roles)
|
||||||
commit('SET_ROLES', ['admin'])
|
// commit('SET_ROLES', ['admin'])
|
||||||
commit('SET_NAME', account)
|
commit('SET_NAME', account)
|
||||||
// commit('SET_AVATAR', avatar)
|
// commit('SET_AVATAR', avatar)
|
||||||
commit('SET_AVATAR', 'http://kaifa.crmeb.net/system/images/admin_logo.png')
|
commit('SET_AVATAR', 'http://kaifa.crmeb.net/system/images/admin_logo.png')
|
||||||
commit('SET_INTRODUCTION', 'CRMEB admin')
|
commit('SET_INTRODUCTION', 'CRMEB admin')
|
||||||
data.roles = 'admin'
|
|
||||||
resolve(data)
|
resolve(data)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
@@ -12,16 +12,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
|
||||||
<el-select v-model="listPram.isDel" placeholder="删除状态" clearable class="selWidth">
|
|
||||||
<el-option
|
|
||||||
v-for="item in constants.deletedOrNormal"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="listPram.status" placeholder="状态" clearable class="selWidth">
|
<el-select v-model="listPram.status" placeholder="状态" clearable class="selWidth">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -59,7 +49,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">
|
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.updateTime | filterEmpty }}</span>
|
<span>{{ scope.row.lastTime | filterEmpty }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="最后登录IP" prop="lastIp" min-width="150">
|
<el-table-column label="最后登录IP" prop="lastIp" min-width="150">
|
||||||
@@ -129,7 +119,6 @@ export default {
|
|||||||
listPram: {
|
listPram: {
|
||||||
account: null,
|
account: null,
|
||||||
addTime: null,
|
addTime: null,
|
||||||
isDel: null, // false=正常,true=已删除,数据库逻辑删除
|
|
||||||
lastIp: null,
|
lastIp: null,
|
||||||
lastTime: null,
|
lastTime: null,
|
||||||
level: null,
|
level: null,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.zbkj.crmeb.system.controller;
|
|||||||
import com.common.CommonPage;
|
import com.common.CommonPage;
|
||||||
import com.common.CommonResult;
|
import com.common.CommonResult;
|
||||||
import com.common.PageParamRequest;
|
import com.common.PageParamRequest;
|
||||||
|
import com.utils.CrmebUtil;
|
||||||
import com.zbkj.crmeb.category.vo.CategoryTreeVo;
|
import com.zbkj.crmeb.category.vo.CategoryTreeVo;
|
||||||
import com.zbkj.crmeb.system.model.SystemRole;
|
import com.zbkj.crmeb.system.model.SystemRole;
|
||||||
import com.zbkj.crmeb.system.request.SystemRoleRequest;
|
import com.zbkj.crmeb.system.request.SystemRoleRequest;
|
||||||
@@ -112,14 +113,15 @@ public class SystemRoleController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询身份管理表信息
|
* 查询身份管理表信息
|
||||||
* @param id Integer
|
* @param ids String
|
||||||
* @author Mr.Zhang
|
* @author Mr.Zhang
|
||||||
* @since 2020-04-18
|
* @since 2020-04-18
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "详情")
|
@ApiOperation(value = "详情")
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
||||||
public CommonResult<SystemRole> info(@RequestParam(value = "id") Integer id){
|
public CommonResult<List<SystemRole>> info(@RequestParam(value = "ids") String ids){
|
||||||
SystemRole systemRole = systemRoleService.getById(id);
|
// SystemRole systemRole = systemRoleService.getById(CrmebUtil.stringToArray(ids));
|
||||||
|
List<SystemRole> systemRole = systemRoleService.getListInIds(CrmebUtil.stringToArray(ids));
|
||||||
return CommonResult.success(systemRole);
|
return CommonResult.success(systemRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author stivepeim
|
* @author stivepeim
|
||||||
@@ -30,7 +31,7 @@ public class SystemAdminResponse implements Serializable {
|
|||||||
|
|
||||||
private String lastIp;
|
private String lastIp;
|
||||||
|
|
||||||
private Integer lastTime;
|
private Date lastTime;
|
||||||
|
|
||||||
private Integer addTime;
|
private Integer addTime;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ public interface SystemRoleService extends IService<SystemRole> {
|
|||||||
|
|
||||||
List<SystemRole> getList(SystemRoleSearchRequest request, PageParamRequest pageParamRequest);
|
List<SystemRole> getList(SystemRoleSearchRequest request, PageParamRequest pageParamRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id集合获取对应权限列表
|
||||||
|
* @param ids id集合
|
||||||
|
* @return 对应的权限列表
|
||||||
|
*/
|
||||||
|
List<SystemRole> getListInIds(List<Integer> ids);
|
||||||
|
|
||||||
Boolean checkAuth(String uri);
|
Boolean checkAuth(String uri);
|
||||||
|
|
||||||
List<CategoryTreeVo> menu();
|
List<CategoryTreeVo> menu();
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminDao, SystemAd
|
|||||||
for (SystemAdmin admin : systemAdmins) {
|
for (SystemAdmin admin : systemAdmins) {
|
||||||
SystemAdminResponse sar = new SystemAdminResponse();
|
SystemAdminResponse sar = new SystemAdminResponse();
|
||||||
BeanUtils.copyProperties(admin, sar);
|
BeanUtils.copyProperties(admin, sar);
|
||||||
|
sar.setLastTime(admin.getUpdateTime());
|
||||||
if(StringUtils.isBlank(admin.getRoles())) continue;
|
if(StringUtils.isBlank(admin.getRoles())) continue;
|
||||||
List<Integer> roleIds = CrmebUtil.stringToArrayInt(admin.getRoles());
|
List<Integer> roleIds = CrmebUtil.stringToArrayInt(admin.getRoles());
|
||||||
List<String> roleNames = new ArrayList<>();
|
List<String> roleNames = new ArrayList<>();
|
||||||
|
|||||||
@@ -63,6 +63,18 @@ public class SystemRoleServiceImpl extends ServiceImpl<SystemRoleDao, SystemRole
|
|||||||
return dao.selectList(lambdaQueryWrapper);
|
return dao.selectList(lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id集合获取对应权限列表
|
||||||
|
* @param ids id集合
|
||||||
|
* @return 对应的权限列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SystemRole> getListInIds(List<Integer> ids) {
|
||||||
|
// LambdaQueryWrapper<SystemRole> lqw = new LambdaQueryWrapper<>();
|
||||||
|
// lqw.in(SystemRole::getId, ids);
|
||||||
|
return dao.selectBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测是否有访问菜单接口取的权限
|
* 检测是否有访问菜单接口取的权限
|
||||||
* @param uri String 请求参数
|
* @param uri String 请求参数
|
||||||
|
|||||||
Reference in New Issue
Block a user