From bcee37b84bde39072e6e35e642b0911a94f52eef Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 11 Nov 2019 08:59:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=201.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +- ruoyi-ui/package.json | 2 +- ruoyi-ui/src/api/monitor/logininfor.js | 25 + ruoyi-ui/src/api/monitor/operlog.js | 25 + ruoyi-ui/src/api/system/config.js | 9 + ruoyi-ui/src/api/system/dict/data.js | 9 + ruoyi-ui/src/api/system/dict/type.js | 9 + ruoyi-ui/src/api/system/post.js | 9 + ruoyi-ui/src/api/system/role.js | 9 + ruoyi-ui/src/api/system/user.js | 11 +- ruoyi-ui/src/assets/styles/ruoyi.scss | 50 + ruoyi-ui/src/main.js | 3 +- ruoyi-ui/src/utils/ruoyi.js | 7 + .../src/views/monitor/logininfor/index.vue | 100 +- ruoyi-ui/src/views/monitor/online/index.vue | 12 +- ruoyi-ui/src/views/monitor/operlog/index.vue | 102 +- ruoyi-ui/src/views/system/config/index.vue | 103 ++- ruoyi-ui/src/views/system/dict/data.vue | 106 ++- ruoyi-ui/src/views/system/dict/index.vue | 112 ++- ruoyi-ui/src/views/system/notice/index.vue | 82 +- ruoyi-ui/src/views/system/post/index.vue | 104 ++- ruoyi-ui/src/views/system/role/index.vue | 99 +- ruoyi-ui/src/views/system/user/index.vue | 95 +- ruoyi-ui/vue.config.js | 2 +- ruoyi/pom.xml | 10 +- .../sql/{ry_20191008.sql => ry_20191111.sql} | 40 +- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 872 ++++++++++++++++++ .../common/utils/reflect/ReflectUtils.java | 406 ++++++++ .../aspectj/lang/annotation/Excel.java | 113 +++ .../aspectj/lang/annotation/Excels.java | 18 + .../framework/config/SecurityConfig.java | 1 + .../ruoyi/framework/config/SwaggerConfig.java | 51 +- .../web/exception/GlobalExceptionHandler.java | 24 + .../project/common/CommonController.java | 43 + .../controller/SysLogininforController.java | 33 + .../controller/SysOperlogController.java | 32 + .../project/monitor/domain/SysLogininfor.java | 11 + .../project/monitor/domain/SysOperLog.java | 18 + .../monitor/mapper/SysLogininforMapper.java | 4 +- .../monitor/mapper/SysOperLogMapper.java | 4 +- .../service/ISysLogininforService.java | 4 +- .../monitor/service/ISysOperLogService.java | 4 +- .../impl/SysLogininforServiceImpl.java | 7 +- .../service/impl/SysOperLogServiceImpl.java | 10 +- .../controller/SysConfigController.java | 22 +- .../system/controller/SysDeptController.java | 7 +- .../controller/SysDictDataController.java | 24 +- .../controller/SysDictTypeController.java | 24 +- .../system/controller/SysMenuController.java | 6 +- .../controller/SysNoticeController.java | 5 +- .../system/controller/SysPostController.java | 22 +- .../system/controller/SysRoleController.java | 25 +- .../system/controller/SysUserController.java | 23 +- .../project/system/domain/SysConfig.java | 25 + .../ruoyi/project/system/domain/SysDept.java | 33 +- .../project/system/domain/SysDictData.java | 31 + .../project/system/domain/SysDictType.java | 23 + .../ruoyi/project/system/domain/SysMenu.java | 35 +- .../project/system/domain/SysNotice.java | 22 + .../ruoyi/project/system/domain/SysPost.java | 25 + .../ruoyi/project/system/domain/SysRole.java | 36 +- .../ruoyi/project/system/domain/SysUser.java | 51 +- .../system/mapper/SysConfigMapper.java | 10 +- .../system/mapper/SysDictDataMapper.java | 8 + .../system/mapper/SysDictTypeMapper.java | 8 + .../system/mapper/SysNoticeMapper.java | 8 + .../project/system/mapper/SysPostMapper.java | 8 + .../project/system/mapper/SysRoleMapper.java | 7 + .../project/system/mapper/SysUserMapper.java | 8 + .../system/service/ISysConfigService.java | 10 +- .../system/service/ISysDictDataService.java | 8 + .../system/service/ISysDictTypeService.java | 8 + .../system/service/ISysNoticeService.java | 8 + .../system/service/ISysPostService.java | 17 + .../system/service/ISysRoleService.java | 16 + .../system/service/ISysUserService.java | 8 + .../service/impl/SysConfigServiceImpl.java | 14 +- .../service/impl/SysDictDataServiceImpl.java | 11 + .../service/impl/SysDictTypeServiceImpl.java | 11 + .../service/impl/SysNoticeServiceImpl.java | 11 + .../service/impl/SysPostServiceImpl.java | 38 +- .../service/impl/SysRoleServiceImpl.java | 36 + .../service/impl/SysUserServiceImpl.java | 15 + ruoyi/src/main/resources/application.yml | 2 +- .../mybatis/monitor/SysLogininforMapper.xml | 2 +- .../mybatis/monitor/SysOperLogMapper.xml | 2 +- .../mybatis/system/SysConfigMapper.xml | 7 + .../mybatis/system/SysDictDataMapper.xml | 7 + .../mybatis/system/SysDictTypeMapper.xml | 7 + .../mybatis/system/SysNoticeMapper.xml | 7 + .../mybatis/system/SysPostMapper.xml | 7 + .../mybatis/system/SysRoleMapper.xml | 7 + .../mybatis/system/SysUserMapper.xml | 7 + 93 files changed, 3327 insertions(+), 237 deletions(-) rename ruoyi/sql/{ry_20191008.sql => ry_20191111.sql} (95%) create mode 100644 ruoyi/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java create mode 100644 ruoyi/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java create mode 100644 ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java create mode 100644 ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java diff --git a/README.md b/README.md index 3d24601..f171485 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,12 @@ - - + + - - + + @@ -65,8 +65,8 @@ - - + + diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 1122913..ae3a5c3 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi", - "version": "1.0.0", + "version": "1.1.0", "description": "若依管理系统", "author": "若依", "license": "MIT", diff --git a/ruoyi-ui/src/api/monitor/logininfor.js b/ruoyi-ui/src/api/monitor/logininfor.js index 9914aaf..0b89cdc 100644 --- a/ruoyi-ui/src/api/monitor/logininfor.js +++ b/ruoyi-ui/src/api/monitor/logininfor.js @@ -7,4 +7,29 @@ export function list(query) { method: 'get', params: query }) +} + +// 删除登录日志 +export function delLogininfor(infoId) { + return request({ + url: '/monitor/logininfor/' + infoId, + method: 'delete' + }) +} + +// 清空登录日志 +export function cleanLogininfor() { + return request({ + url: '/monitor/logininfor/clean', + method: 'delete' + }) +} + +// 导出登录日志 +export function exportLogininfor(query) { + return request({ + url: '/monitor/logininfor/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/monitor/operlog.js b/ruoyi-ui/src/api/monitor/operlog.js index a6088ad..c519355 100644 --- a/ruoyi-ui/src/api/monitor/operlog.js +++ b/ruoyi-ui/src/api/monitor/operlog.js @@ -7,4 +7,29 @@ export function list(query) { method: 'get', params: query }) +} + +// 删除操作日志 +export function delOperlog(operId) { + return request({ + url: '/monitor/operlog/' + operId, + method: 'delete' + }) +} + +// 清空操作日志 +export function cleanOperlog() { + return request({ + url: '/monitor/operlog/clean', + method: 'delete' + }) +} + +// 导出操作日志 +export function exportOperlog(query) { + return request({ + url: '/monitor/operlog/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/config.js b/ruoyi-ui/src/api/system/config.js index 6ed1050..124c981 100644 --- a/ruoyi-ui/src/api/system/config.js +++ b/ruoyi-ui/src/api/system/config.js @@ -49,4 +49,13 @@ export function delConfig(configId) { url: '/system/config/' + configId, method: 'delete' }) +} + +// 导出参数 +export function exportConfig(query) { + return request({ + url: '/system/config/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/dict/data.js b/ruoyi-ui/src/api/system/dict/data.js index a0fb115..6a3f418 100644 --- a/ruoyi-ui/src/api/system/dict/data.js +++ b/ruoyi-ui/src/api/system/dict/data.js @@ -49,4 +49,13 @@ export function delData(dictCode) { url: '/system/dict/data/' + dictCode, method: 'delete' }) +} + +// 导出字典数据 +export function exportData(query) { + return request({ + url: '/system/dict/data/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/dict/type.js b/ruoyi-ui/src/api/system/dict/type.js index 749bfaa..80a6cfa 100644 --- a/ruoyi-ui/src/api/system/dict/type.js +++ b/ruoyi-ui/src/api/system/dict/type.js @@ -42,3 +42,12 @@ export function delType(dictId) { method: 'delete' }) } + +// 导出字典类型 +export function exportType(query) { + return request({ + url: '/system/dict/type/export', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/api/system/post.js b/ruoyi-ui/src/api/system/post.js index 1bdf069..fb124d9 100644 --- a/ruoyi-ui/src/api/system/post.js +++ b/ruoyi-ui/src/api/system/post.js @@ -41,4 +41,13 @@ export function delPost(postId) { url: '/system/post/' + postId, method: 'delete' }) +} + +// 导出岗位 +export function exportPost(query) { + return request({ + url: '/system/post/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/role.js b/ruoyi-ui/src/api/system/role.js index 95a606d..736708c 100644 --- a/ruoyi-ui/src/api/system/role.js +++ b/ruoyi-ui/src/api/system/role.js @@ -63,4 +63,13 @@ export function delRole(roleId) { url: '/system/role/' + roleId, method: 'delete' }) +} + +// 导出角色 +export function exportRole(query) { + return request({ + url: '/system/role/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/user.js b/ruoyi-ui/src/api/system/user.js index 55766af..3b1170e 100644 --- a/ruoyi-ui/src/api/system/user.js +++ b/ruoyi-ui/src/api/system/user.js @@ -43,6 +43,15 @@ export function delUser(userId) { }) } +// 导出用户 +export function exportUser(query) { + return request({ + url: '/system/user/export', + method: 'get', + params: query + }) +} + // 用户密码重置 export function resetUserPwd(userId, password) { const data = { @@ -106,4 +115,4 @@ export function uploadAvatar(data) { method: 'post', data: data }) -} \ No newline at end of file +} diff --git a/ruoyi-ui/src/assets/styles/ruoyi.scss b/ruoyi-ui/src/assets/styles/ruoyi.scss index 7c3aca1..9e0cdc3 100644 --- a/ruoyi-ui/src/assets/styles/ruoyi.scss +++ b/ruoyi-ui/src/assets/styles/ruoyi.scss @@ -3,6 +3,56 @@ * Copyright (c) 2019 ruoyi */ + /** 基础通用 **/ +.pt5 { + padding-top: 5px; +} +.pr5 { + padding-right: 5px; +} +.pb5 { + padding-bottom: 5px; +} +.mt5 { + margin-top: 5px; +} +.mr5 { + margin-right: 5px; +} +.mb5 { + margin-bottom: 5px; +} +.mb8 { + margin-bottom: 8px; +} +.ml5 { + margin-left: 5px; +} +.mt10 { + margin-top: 10px; +} +.mr10 { + margin-right: 10px; +} +.mb10 { + margin-bottom: 10px; +} +.ml0 { + margin-left: 10px; +} +.mt20 { + margin-top: 20px; +} +.mr20 { + margin-right: 20px; +} +.mb20 { + margin-bottom: 20px; +} +.m20 { + margin-left: 20px; +} + .el-table .el-table__header-wrapper th { word-break: break-word; background-color: #f8f8f9; diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 2b5419d..fbd3d6d 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -18,7 +18,7 @@ import './assets/icons' // icon import './permission' // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel } from "@/utils/ruoyi"; +import { parseTime, resetForm, addDateRange, selectDictLabel, download } from "@/utils/ruoyi"; import Pagination from "@/components/Pagination"; // 全局方法挂载 @@ -28,6 +28,7 @@ Vue.prototype.parseTime = parseTime Vue.prototype.resetForm = resetForm Vue.prototype.addDateRange = addDateRange Vue.prototype.selectDictLabel = selectDictLabel +Vue.prototype.download = download Vue.prototype.msgSuccess = function (msg) { this.$message({ showClose: true, message: msg, type: "success" }); diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 6442ce2..db97dcc 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -3,6 +3,8 @@ * Copyright (c) 2019 ruoyi */ +const baseURL = process.env.VUE_APP_BASE_API + // 日期格式化 export function parseTime(time, pattern) { if (arguments.length === 0) { @@ -73,6 +75,11 @@ export function selectDictLabel(datas, value) { return actions.join(''); } +// 通用下载方法 +export function download(fileName) { + window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; +} + // 字符串格式化(%s ) export function sprintf(str) { var args = arguments, flag = true, i = 1; diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue index 1e3811e..9dee330 100644 --- a/ruoyi-ui/src/views/monitor/logininfor/index.vue +++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue @@ -1,7 +1,7 @@