From a634aa4f9307b3f77018af296d7947ff5797dd9c Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Fri, 27 Dec 2019 17:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B3=BB=E7=BB=9F=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/catch-admin/src/api/database.js | 37 ++++ view/catch-admin/src/api/permission.js | 44 +++++ view/catch-admin/src/config/router.config.js | 44 +++++ .../src/core/lazy_lib/components_use.js | 6 +- .../views/permissions/roles/form/create.vue | 75 +++++++- .../src/views/permissions/roles/roles.vue | 2 +- .../views/permissions/rules/form/create.vue | 98 ++++++++--- .../src/views/permissions/rules/rules.vue | 156 +++++++++++++++++ .../views/permissions/users/form/create.vue | 93 ++++++++-- .../src/views/permissions/users/users.vue | 14 +- .../src/views/system/database/index.vue | 162 +++++++++++++++++- .../src/views/system/database/table.vue | 86 +++++++++- .../src/views/system/log/login.vue | 13 -- .../src/views/system/log/operate.vue | 13 -- 14 files changed, 746 insertions(+), 97 deletions(-) create mode 100644 view/catch-admin/src/api/permission.js diff --git a/view/catch-admin/src/api/database.js b/view/catch-admin/src/api/database.js index e69de29..78aa3bb 100644 --- a/view/catch-admin/src/api/database.js +++ b/view/catch-admin/src/api/database.js @@ -0,0 +1,37 @@ +/** + * 用户管理模块 + * + */ + +import { axios } from '@/utils/request' + +export function getTables (parameter) { + return axios({ + url: '/tables', + method: 'get', + params: parameter + }) +} + +export function optimize (parameter) { + return axios({ + url: '/table/optimize', + method: 'post', + data: parameter + }) +} + +export function backup (parameter) { + return axios({ + url: '/table/backup', + method: 'post', + data: parameter + }) +} + +export function read (table) { + return axios({ + url: '/table/view/' + table, + method: 'get' + }) +} diff --git a/view/catch-admin/src/api/permission.js b/view/catch-admin/src/api/permission.js new file mode 100644 index 0000000..aa4bde5 --- /dev/null +++ b/view/catch-admin/src/api/permission.js @@ -0,0 +1,44 @@ +/** + * 用户管理模块 + * + */ + +import { axios } from '@/utils/request' + +export function getPermissionList (parameter) { + return axios({ + url: '/permissions', + method: 'get', + params: parameter + }) +} + +export function store (parameter) { + return axios({ + url: '/permissions', + method: 'post', + data: parameter + }) +} + +export function read (id) { + return axios({ + url: '/permissions/' + id, + method: 'get' + }) +} + +export function update (id, parameter) { + return axios({ + url: '/permissions/' + id, + method: 'put', + data: parameter + }) +} + +export function del (id) { + return axios({ + url: '/permissions/' + id, + method: 'delete' + }) +} diff --git a/view/catch-admin/src/config/router.config.js b/view/catch-admin/src/config/router.config.js index ac48c99..33eba8e 100644 --- a/view/catch-admin/src/config/router.config.js +++ b/view/catch-admin/src/config/router.config.js @@ -94,6 +94,50 @@ export const asyncRouterMap = [ hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu component: () => import('@/views/permissions/roles/roles'), meta: { title: '角色管理', keepAlive: true, permission: [ 'permission' ] } + }, + { + path: '/permissions/rules', + name: 'rules', + hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu + component: () => import('@/views/permissions/rules/rules'), + meta: { title: '菜单管理', keepAlive: true, permission: [ 'permission' ] } + } + ] + }, + { + path: '/system', + name: 'system', + component: PageView, + redirect: '/system', + meta: { title: '系统管理', icon: 'table', system: [ 'system' ] }, + children: [ + { + path: '/system/database', + name: 'database', + hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu + component: () => import('@/views/system/database/index'), + meta: { title: '数据字典', keepAlive: true, system: [ 'system' ] } + }, + { + path: '/system/log', + name: 'log', + meta: { title: '日志管理', keepAlive: true, permission: [ 'permission' ] }, + children: [ + { + path: '/system/log/login', + name: 'loginLog', + hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu + component: () => import('@/views/system/log/login'), + meta: { title: '登录日志', keepAlive: true, system: [ 'system' ] } + }, + { + path: '/system/log/operate', + name: 'operateLog', + hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu + component: () => import('@/views/system/log/operate'), + meta: { title: '操作日志', keepAlive: true, system: [ 'system' ] } + } + ] } ] }, diff --git a/view/catch-admin/src/core/lazy_lib/components_use.js b/view/catch-admin/src/core/lazy_lib/components_use.js index c7c28c3..011ddf3 100644 --- a/view/catch-admin/src/core/lazy_lib/components_use.js +++ b/view/catch-admin/src/core/lazy_lib/components_use.js @@ -46,7 +46,9 @@ import { Skeleton, Popconfirm, message, - notification + notification, + TreeSelect, + Tree } from 'ant-design-vue' // import VueCropper from 'vue-cropper' @@ -89,6 +91,8 @@ Vue.use(Skeleton) Vue.use(Popconfirm) // Vue.use(VueCropper) Vue.use(notification) +Vue.use(TreeSelect) +Vue.use(Tree) Vue.prototype.$confirm = Modal.confirm Vue.prototype.$message = message diff --git a/view/catch-admin/src/views/permissions/roles/form/create.vue b/view/catch-admin/src/views/permissions/roles/form/create.vue index bbd3e06..4a0ad8e 100644 --- a/view/catch-admin/src/views/permissions/roles/form/create.vue +++ b/view/catch-admin/src/views/permissions/roles/form/create.vue @@ -25,14 +25,28 @@ > + + + + diff --git a/view/catch-admin/src/views/permissions/users/form/create.vue b/view/catch-admin/src/views/permissions/users/form/create.vue index 061107d..a436c0b 100644 --- a/view/catch-admin/src/views/permissions/users/form/create.vue +++ b/view/catch-admin/src/views/permissions/users/form/create.vue @@ -15,28 +15,47 @@ :labelCol="labelCol" :wrapperCol="wrapperCol" > - + - + - + - + + + + + @@ -45,9 +64,11 @@ - - \ No newline at end of file diff --git a/view/catch-admin/src/views/system/database/table.vue b/view/catch-admin/src/views/system/database/table.vue index 12425fc..c30c55e 100644 --- a/view/catch-admin/src/views/system/database/table.vue +++ b/view/catch-admin/src/views/system/database/table.vue @@ -1,13 +1,83 @@ - - - \ No newline at end of file diff --git a/view/catch-admin/src/views/system/log/login.vue b/view/catch-admin/src/views/system/log/login.vue index c9e4d7e..e69de29 100644 --- a/view/catch-admin/src/views/system/log/login.vue +++ b/view/catch-admin/src/views/system/log/login.vue @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/view/catch-admin/src/views/system/log/operate.vue b/view/catch-admin/src/views/system/log/operate.vue index 2589ff3..e69de29 100644 --- a/view/catch-admin/src/views/system/log/operate.vue +++ b/view/catch-admin/src/views/system/log/operate.vue @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file