update 系统管理 => 删除
This commit is contained in:
parent
542ebb5e3b
commit
05e1ea5842
@ -75,6 +75,6 @@ export const apiSysMenuConfirm = (data, type) => {
|
||||
}
|
||||
|
||||
// 删除菜单
|
||||
export const apiSysMenuDelete = (params, id) => {
|
||||
return http({ url: `/lz_management/sys/menu/delete/${id}`, method: 'get', params })
|
||||
export const apiSysMenuDelete = (data, id) => {
|
||||
return http({ url: `/lz_management/sys/menu/delete${id}`, method: 'post', data })
|
||||
}
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
import Mock from 'mockjs'
|
||||
import * as common from './modules/common'
|
||||
import * as jobSchedule from './modules/job-schedule'
|
||||
import * as oss from './modules/oss'
|
||||
import * as sysConfig from './modules/sys-config'
|
||||
import * as sysLog from './modules/sys-log'
|
||||
import * as sysMenu from './modules/sys-menu'
|
||||
import * as sysRole from './modules/sys-role'
|
||||
import * as sysUser from './modules/sys-user'
|
||||
|
||||
// tips
|
||||
// 1. 开启/关闭[业务模块]拦截, 通过调用fnCreate方法[isOpen参数]设置.
|
||||
// 2. 开启/关闭[业务模块中某个请求]拦截, 通过函数返回对象中的[isOpen属性]设置.
|
||||
fnCreate(common, false)
|
||||
fnCreate(jobSchedule, false)
|
||||
fnCreate(oss, false)
|
||||
fnCreate(sysConfig, false)
|
||||
fnCreate(sysLog, false)
|
||||
fnCreate(sysMenu, false)
|
||||
fnCreate(sysRole, false)
|
||||
fnCreate(sysUser, false)
|
||||
|
||||
/**
|
||||
* 创建mock模拟数据
|
||||
* @param {*} mod 模块
|
||||
* @param {*} isOpen 是否开启?
|
||||
*/
|
||||
function fnCreate (mod, isOpen = true) {
|
||||
if (isOpen) {
|
||||
for (var key in mod) {
|
||||
((res) => {
|
||||
if (res.isOpen !== false) {
|
||||
Mock.mock(new RegExp(res.url), res.type, (opts) => {
|
||||
opts['data'] = opts.body ? JSON.parse(opts.body) : null
|
||||
delete opts.body
|
||||
console.log('\n')
|
||||
console.log('%cmock拦截, 请求: ', 'color:blue', opts)
|
||||
console.log('%cmock拦截, 响应: ', 'color:blue', res.data)
|
||||
return res.data
|
||||
})
|
||||
}
|
||||
})(mod[key]() || {})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
import Mock from 'mockjs'
|
||||
|
||||
// 生成数据列表
|
||||
var dataList = []
|
||||
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
|
||||
dataList.push(Mock.mock({
|
||||
'id': '@increment',
|
||||
'paramKey': '@first',
|
||||
'paramValue': '@last',
|
||||
'remark': '@csentence'
|
||||
}))
|
||||
}
|
||||
|
||||
// 获取文件列表
|
||||
export function list () {
|
||||
return {
|
||||
url: '/sys/oss/list',
|
||||
type: 'get',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0,
|
||||
'page': {
|
||||
'totalCount': dataList.length,
|
||||
'pageSize': 10,
|
||||
'totalPage': 1,
|
||||
'currPage': 1,
|
||||
'list': dataList
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,628 +0,0 @@
|
||||
// 生成数据列表
|
||||
var dataList = [
|
||||
{
|
||||
'menuId': 1,
|
||||
'parentId': 0,
|
||||
'parentName': null,
|
||||
'name': '系统管理',
|
||||
'url': null,
|
||||
'perms': null,
|
||||
'type': 0,
|
||||
'icon': 'system',
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 2,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '管理员列表',
|
||||
'url': 'sys/user',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'admin',
|
||||
'orderNum': 1,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 3,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '角色管理',
|
||||
'url': 'sys/role',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'role',
|
||||
'orderNum': 2,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 4,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '菜单管理',
|
||||
'url': 'sys/menu',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'menu',
|
||||
'orderNum': 3,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 5,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': 'SQL监控',
|
||||
'url': 'http://localhost:8080/renren-fast/druid/sql.html',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'sql',
|
||||
'orderNum': 4,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 6,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '定时任务',
|
||||
'url': 'job/schedule',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'job',
|
||||
'orderNum': 5,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 7,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '查看',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:list,sys:schedule:info',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 8,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '新增',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:save',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 9,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '修改',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:update',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 10,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '删除',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:delete',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 11,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '暂停',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:pause',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 12,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '恢复',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:resume',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 13,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '立即执行',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:run',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 14,
|
||||
'parentId': 6,
|
||||
'parentName': '定时任务',
|
||||
'name': '日志列表',
|
||||
'url': null,
|
||||
'perms': 'sys:schedule:log',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 15,
|
||||
'parentId': 2,
|
||||
'parentName': '管理员列表',
|
||||
'name': '查看',
|
||||
'url': null,
|
||||
'perms': 'sys:user:list,sys:user:info',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 16,
|
||||
'parentId': 2,
|
||||
'parentName': '管理员列表',
|
||||
'name': '新增',
|
||||
'url': null,
|
||||
'perms': 'sys:user:save,sys:role:select',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 17,
|
||||
'parentId': 2,
|
||||
'parentName': '管理员列表',
|
||||
'name': '修改',
|
||||
'url': null,
|
||||
'perms': 'sys:user:update,sys:role:select',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 18,
|
||||
'parentId': 2,
|
||||
'parentName': '管理员列表',
|
||||
'name': '删除',
|
||||
'url': null,
|
||||
'perms': 'sys:user:delete',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 19,
|
||||
'parentId': 3,
|
||||
'parentName': '角色管理',
|
||||
'name': '查看',
|
||||
'url': null,
|
||||
'perms': 'sys:role:list,sys:role:info',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 20,
|
||||
'parentId': 3,
|
||||
'parentName': '角色管理',
|
||||
'name': '新增',
|
||||
'url': null,
|
||||
'perms': 'sys:role:save,sys:menu:list',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 21,
|
||||
'parentId': 3,
|
||||
'parentName': '角色管理',
|
||||
'name': '修改',
|
||||
'url': null,
|
||||
'perms': 'sys:role:update,sys:menu:list',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 22,
|
||||
'parentId': 3,
|
||||
'parentName': '角色管理',
|
||||
'name': '删除',
|
||||
'url': null,
|
||||
'perms': 'sys:role:delete',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 23,
|
||||
'parentId': 4,
|
||||
'parentName': '菜单管理',
|
||||
'name': '查看',
|
||||
'url': null,
|
||||
'perms': 'sys:menu:list,sys:menu:info',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 24,
|
||||
'parentId': 4,
|
||||
'parentName': '菜单管理',
|
||||
'name': '新增',
|
||||
'url': null,
|
||||
'perms': 'sys:menu:save,sys:menu:select',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 25,
|
||||
'parentId': 4,
|
||||
'parentName': '菜单管理',
|
||||
'name': '修改',
|
||||
'url': null,
|
||||
'perms': 'sys:menu:update,sys:menu:select',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 26,
|
||||
'parentId': 4,
|
||||
'parentName': '菜单管理',
|
||||
'name': '删除',
|
||||
'url': null,
|
||||
'perms': 'sys:menu:delete',
|
||||
'type': 2,
|
||||
'icon': null,
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 27,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '参数管理',
|
||||
'url': 'sys/config',
|
||||
'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
|
||||
'type': 1,
|
||||
'icon': 'config',
|
||||
'orderNum': 6,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 29,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '系统日志',
|
||||
'url': 'sys/log',
|
||||
'perms': 'sys:log:list',
|
||||
'type': 1,
|
||||
'icon': 'log',
|
||||
'orderNum': 7,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 30,
|
||||
'parentId': 1,
|
||||
'parentName': '系统管理',
|
||||
'name': '文件上传',
|
||||
'url': 'oss/oss',
|
||||
'perms': 'sys:oss:all',
|
||||
'type': 1,
|
||||
'icon': 'oss',
|
||||
'orderNum': 6,
|
||||
'open': null,
|
||||
'list': null
|
||||
}
|
||||
]
|
||||
var navDataList = [
|
||||
{
|
||||
'menuId': 1,
|
||||
'parentId': 0,
|
||||
'parentName': null,
|
||||
'name': '系统管理',
|
||||
'url': null,
|
||||
'perms': null,
|
||||
'type': 0,
|
||||
'icon': 'system',
|
||||
'orderNum': 0,
|
||||
'open': null,
|
||||
'list': [
|
||||
{
|
||||
'menuId': 2,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '管理员列表',
|
||||
'url': 'sys/user',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'admin',
|
||||
'orderNum': 1,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 3,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '角色管理',
|
||||
'url': 'sys/role',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'role',
|
||||
'orderNum': 2,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 4,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '菜单管理',
|
||||
'url': 'sys/menu',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'menu',
|
||||
'orderNum': 3,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 5,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': 'SQL监控',
|
||||
'url': 'http://localhost:8080/renren-fast/druid/sql.html',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'sql',
|
||||
'orderNum': 4,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 6,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '定时任务',
|
||||
'url': 'job/schedule',
|
||||
'perms': null,
|
||||
'type': 1,
|
||||
'icon': 'job',
|
||||
'orderNum': 5,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 27,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '参数管理',
|
||||
'url': 'sys/config',
|
||||
'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
|
||||
'type': 1,
|
||||
'icon': 'config',
|
||||
'orderNum': 6,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 30,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '文件上传',
|
||||
'url': 'oss/oss',
|
||||
'perms': 'sys:oss:all',
|
||||
'type': 1,
|
||||
'icon': 'oss',
|
||||
'orderNum': 6,
|
||||
'open': null,
|
||||
'list': null
|
||||
},
|
||||
{
|
||||
'menuId': 29,
|
||||
'parentId': 1,
|
||||
'parentName': null,
|
||||
'name': '系统日志',
|
||||
'url': 'sys/log',
|
||||
'perms': 'sys:log:list',
|
||||
'type': 1,
|
||||
'icon': 'log',
|
||||
'orderNum': 7,
|
||||
'open': null,
|
||||
'list': null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
// 获取导航菜单列表 / 权限
|
||||
export function nav () {
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/nav',
|
||||
type: 'get',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0,
|
||||
'menuList': navDataList,
|
||||
'permissions': [
|
||||
'sys:schedule:info',
|
||||
'sys:menu:update',
|
||||
'sys:menu:delete',
|
||||
'sys:config:info',
|
||||
'sys:menu:list',
|
||||
'sys:config:save',
|
||||
'sys:config:update',
|
||||
'sys:schedule:resume',
|
||||
'sys:user:delete',
|
||||
'sys:config:list',
|
||||
'sys:user:update',
|
||||
'sys:role:list',
|
||||
'sys:menu:info',
|
||||
'sys:menu:select',
|
||||
'sys:schedule:update',
|
||||
'sys:schedule:save',
|
||||
'sys:role:select',
|
||||
'sys:user:list',
|
||||
'sys:menu:save',
|
||||
'sys:role:save',
|
||||
'sys:schedule:log',
|
||||
'sys:role:info',
|
||||
'sys:schedule:delete',
|
||||
'sys:role:update',
|
||||
'sys:schedule:list',
|
||||
'sys:user:info',
|
||||
'sys:schedule:run',
|
||||
'sys:config:delete',
|
||||
'sys:role:delete',
|
||||
'sys:user:save',
|
||||
'sys:schedule:pause',
|
||||
'sys:log:list',
|
||||
'sys:oss:all'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取菜单列表
|
||||
export function list () {
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/list',
|
||||
type: 'get',
|
||||
data: dataList
|
||||
}
|
||||
}
|
||||
|
||||
// 获取上级菜单
|
||||
export function select () {
|
||||
let dataList = JSON.parse(JSON.stringify(navDataList))
|
||||
dataList = dataList.concat(dataList[0].list)
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/select',
|
||||
type: 'get',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0,
|
||||
'menuList': dataList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取菜单信息
|
||||
export function info () {
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/info',
|
||||
type: 'get',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0,
|
||||
'menu': dataList[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export function add () {
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/save',
|
||||
type: 'post',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 修改菜单
|
||||
export function update () {
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/update',
|
||||
type: 'post',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除菜单
|
||||
export function del () {
|
||||
return {
|
||||
// isOpen: false,
|
||||
url: '/sys/menu/delete',
|
||||
type: 'post',
|
||||
data: {
|
||||
'msg': 'success',
|
||||
'code': 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ const http = axios.create({
|
||||
*/
|
||||
http.interceptors.request.use(config => {
|
||||
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
|
||||
config.data = Object.assign({}, config.data, { t: new Date().getTime() })
|
||||
// config.data = Object.assign({}, config.data, { t: new Date().getTime() })
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:title="!dataForm.id ? '新增' : '编辑'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="handleConfirm()" label-width="80px">
|
||||
|
||||
@ -25,12 +25,12 @@
|
||||
<el-table-column prop="perms" header-align="center" align="center" width="150" :show-overflow-tooltip="true" label="授权标识"></el-table-column>
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isAuth('sys:menu:update')" type="text" size="small" @click="handleAddOrUpdate(scope.row.menuId)">修改</el-button>
|
||||
<el-button v-if="isAuth('sys:menu:update')" type="text" size="small" @click="handleAddOrUpdate(scope.row.menuId)">编辑</el-button>
|
||||
<el-button v-if="isAuth('sys:menu:delete')" type="text" size="small" @click="handleDelete(scope.row.menuId)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<!-- 弹窗, 新增 / 编辑 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="handleGetTableList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
@ -63,7 +63,7 @@
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 新增 / 修改
|
||||
// 新增 / 编辑
|
||||
handleAddOrUpdate (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
@ -77,7 +77,7 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
apiSysMenuDelete({}, `/${id}`).then(res => {
|
||||
apiSysMenuDelete('', `/${id}`).then(res => {
|
||||
if (res && res.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@ -91,24 +91,6 @@
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
// this.$http({
|
||||
// url: this.$http.adornUrl(`/sys/menu/delete/${id}`),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData()
|
||||
// }).then(({data}) => {
|
||||
// if (data && data.code === 0) {
|
||||
// this.$message({
|
||||
// message: '操作成功',
|
||||
// type: 'success',
|
||||
// duration: 1500,
|
||||
// onClose: () => {
|
||||
// this.handleGetTableList()
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.$message.error(data.msg)
|
||||
// }
|
||||
// })
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:title="!dataForm.id ? '新增' : '编辑'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="handleConfirm()" label-width="80px">
|
||||
@ -85,7 +85,16 @@
|
||||
if (idx !== -1) {
|
||||
res.role.menuIdList.splice(idx, res.role.menuIdList.length - idx)
|
||||
}
|
||||
this.$refs.menuListTree.setCheckedKeys(res.role.menuIdList)
|
||||
// this.visible = true
|
||||
// let menuIdList = res.role.menuIdList
|
||||
// console.log('res2===', res.role.menuIdList)
|
||||
console.log('refs=1=', this.$refs)
|
||||
this.$nextTick(() => {
|
||||
console.log('refs=2=', this.$refs)
|
||||
console.log('refs=3=', this.$refs[1])
|
||||
console.log('refs=4=', this.$refs.menuListTree.setCheckedKeys)
|
||||
this.$refs.menuListTree.setCheckedKeys([2, 15])
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -6,11 +6,11 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleGetTableList()">查询</el-button>
|
||||
<el-button v-if="isAuth('sys:role:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('sys:role:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
<el-button v-if="isAuth('sys:role:save')" type="primary" @click="handleAddOrUpdate()">新增</el-button>
|
||||
<el-button v-if="isAuth('sys:role:delete')" type="danger" @click="handleDelete()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="handleSelectionChange" style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="roleId" header-align="center" align="center" width="80" label="ID"></el-table-column>
|
||||
<el-table-column prop="roleName" header-align="center" align="center" label="角色名称"></el-table-column>
|
||||
@ -18,21 +18,21 @@
|
||||
<el-table-column prop="createTime" header-align="center" align="center" width="180" label="创建时间"></el-table-column>
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isAuth('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.roleId)">修改</el-button>
|
||||
<el-button v-if="isAuth('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.roleId)">删除</el-button>
|
||||
<el-button v-if="isAuth('sys:role:update')" type="text" size="small" @click="handleAddOrUpdate(scope.row.roleId)">编辑</el-button>
|
||||
<el-button v-if="isAuth('sys:role:delete')" type="text" size="small" @click="handleDelete(scope.row.roleId)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<!-- 弹窗, 新增 / 编辑 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="handleGetTableList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
@ -81,30 +81,30 @@
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
handleSizeChange (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.handleGetTableList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
handleCurrentChange (val) {
|
||||
this.pageIndex = val
|
||||
this.handleGetTableList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
handleSelectionChange (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
// 新增 / 编辑
|
||||
handleAddOrUpdate (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
handleDelete (id) {
|
||||
let ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.roleId
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
@ -112,9 +112,7 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
apiSysRoleDelete({
|
||||
ids
|
||||
}).then(res => {
|
||||
apiSysRoleDelete(ids).then(res => {
|
||||
if (res && res.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@ -128,24 +126,6 @@
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
// this.$http({
|
||||
// url: this.$http.adornUrl('/sys/role/delete'),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData(ids, false)
|
||||
// }).then(({data}) => {
|
||||
// if (data && data.code === 0) {
|
||||
// this.$message({
|
||||
// message: '操作成功',
|
||||
// type: 'success',
|
||||
// duration: 1500,
|
||||
// onClose: () => {
|
||||
// this.handleGetTableList()
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.$message.error(data.msg)
|
||||
// }
|
||||
// })
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:title="!dataForm.id ? '新增' : '编辑'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="handleConfirm()" label-width="80px">
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<el-table-column prop="createTime" header-align="center" align="center" width="180" label="创建时间"></el-table-column>
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isAuth('sys:user:update')" type="text" size="small" @click="handleAddOrUpdate(scope.row.userId)">修改</el-button>
|
||||
<el-button v-if="isAuth('sys:user:update')" type="text" size="small" @click="handleAddOrUpdate(scope.row.userId)">编辑</el-button>
|
||||
<el-button v-if="isAuth('sys:user:delete')" type="text" size="small" @click="handleDelete(scope.row.userId)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -39,7 +39,7 @@
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<!-- 弹窗, 新增 / 编辑 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="handleGetTableList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
@ -102,7 +102,7 @@
|
||||
handleChangeSelection (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
// 新增 / 编辑
|
||||
handleAddOrUpdate (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
@ -111,7 +111,7 @@
|
||||
},
|
||||
// 删除
|
||||
handleDelete (id) {
|
||||
var userIds = id ? [id] : this.dataListSelections.map(item => {
|
||||
let userIds = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.userId
|
||||
})
|
||||
this.$confirm(`确定对[id=${userIds.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
@ -119,9 +119,7 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
apiSysUserDelete({
|
||||
userIds
|
||||
}).then(res => {
|
||||
apiSysUserDelete(userIds).then(res => {
|
||||
if (res && res.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@ -135,24 +133,6 @@
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
// this.$http({
|
||||
// url: this.$http.adornUrl('/sys/user/delete'),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData(userIds, false)
|
||||
// }).then(({data}) => {
|
||||
// if (data && data.code === 0) {
|
||||
// this.$message({
|
||||
// message: '操作成功',
|
||||
// type: 'success',
|
||||
// duration: 1500,
|
||||
// onClose: () => {
|
||||
// this.handleGetTableList()
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.$message.error(data.msg)
|
||||
// }
|
||||
// })
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user