Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
多鱼的夏天
RuoYi-Cloud-Docker
提交
173c0e38
R
RuoYi-Cloud-Docker
项目概览
多鱼的夏天
/
RuoYi-Cloud-Docker
通知
210
Star
7
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RuoYi-Cloud-Docker
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
173c0e38
编写于
11月 17, 2021
作者:
R
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化导出数据操作
上级
360ccc7a
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
31 addition
and
46 deletion
+31
-46
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
.../main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
+8
-10
ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/controller.java.vm
...s/ruoyi-gen/src/main/resources/vm/java/controller.java.vm
+1
-1
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
...-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
+1
-1
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobController.java
.../main/java/com/ruoyi/job/controller/SysJobController.java
+1
-2
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobLogController.java
...in/java/com/ruoyi/job/controller/SysJobLogController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java
...java/com/ruoyi/system/controller/SysConfigController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java
...va/com/ruoyi/system/controller/SysDictDataController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java
...va/com/ruoyi/system/controller/SysDictTypeController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java
.../com/ruoyi/system/controller/SysLogininforController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java
...ava/com/ruoyi/system/controller/SysOperlogController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysPostController.java
...n/java/com/ruoyi/system/controller/SysPostController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
...n/java/com/ruoyi/system/controller/SysRoleController.java
+1
-2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
...n/java/com/ruoyi/system/controller/SysUserController.java
+1
-1
ruoyi-ui/src/utils/request.js
ruoyi-ui/src/utils/request.js
+10
-7
ruoyi-ui/src/utils/ruoyi.js
ruoyi-ui/src/utils/ruoyi.js
+0
-7
ruoyi-ui/src/views/system/user/index.vue
ruoyi-ui/src/views/system/user/index.vue
+1
-1
未找到文件。
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
浏览文件 @
173c0e38
...
...
@@ -2,7 +2,6 @@ package com.ruoyi.common.core.utils.poi;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
...
...
@@ -357,7 +356,7 @@ public class ExcelUtil<T>
* @return 结果
* @throws IOException
*/
public
void
exportExcel
(
HttpServletResponse
response
,
List
<
T
>
list
,
String
sheetName
)
throws
IOException
public
void
exportExcel
(
HttpServletResponse
response
,
List
<
T
>
list
,
String
sheetName
)
{
exportExcel
(
response
,
list
,
sheetName
,
StringUtils
.
EMPTY
);
}
...
...
@@ -372,12 +371,12 @@ public class ExcelUtil<T>
* @return 结果
* @throws IOException
*/
public
void
exportExcel
(
HttpServletResponse
response
,
List
<
T
>
list
,
String
sheetName
,
String
title
)
throws
IOException
public
void
exportExcel
(
HttpServletResponse
response
,
List
<
T
>
list
,
String
sheetName
,
String
title
)
{
response
.
setContentType
(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
);
response
.
setCharacterEncoding
(
"utf-8"
);
this
.
init
(
list
,
sheetName
,
title
,
Type
.
EXPORT
);
exportExcel
(
response
.
getOutputStream
()
);
exportExcel
(
response
);
}
/**
...
...
@@ -392,7 +391,7 @@ public class ExcelUtil<T>
* @param sheetName 工作表的名称
* @return 结果
*/
public
void
importTemplateExcel
(
HttpServletResponse
response
,
String
sheetName
)
throws
IOException
public
void
importTemplateExcel
(
HttpServletResponse
response
,
String
sheetName
)
{
importTemplateExcel
(
response
,
sheetName
,
StringUtils
.
EMPTY
);
}
...
...
@@ -404,12 +403,12 @@ public class ExcelUtil<T>
* @param title 标题
* @return 结果
*/
public
void
importTemplateExcel
(
HttpServletResponse
response
,
String
sheetName
,
String
title
)
throws
IOException
public
void
importTemplateExcel
(
HttpServletResponse
response
,
String
sheetName
,
String
title
)
{
response
.
setContentType
(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
);
response
.
setCharacterEncoding
(
"utf-8"
);
this
.
init
(
null
,
sheetName
,
title
,
Type
.
IMPORT
);
exportExcel
(
response
.
getOutputStream
()
);
exportExcel
(
response
);
}
/**
...
...
@@ -417,12 +416,12 @@ public class ExcelUtil<T>
*
* @return 结果
*/
public
void
exportExcel
(
OutputStream
out
)
public
void
exportExcel
(
HttpServletResponse
response
)
{
try
{
writeSheet
();
wb
.
write
(
out
);
wb
.
write
(
response
.
getOutputStream
()
);
}
catch
(
Exception
e
)
{
...
...
@@ -431,7 +430,6 @@ public class ExcelUtil<T>
finally
{
IOUtils
.
closeQuietly
(
wb
);
IOUtils
.
closeQuietly
(
out
);
}
}
...
...
ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/controller.java.vm
浏览文件 @
173c0e38
...
...
@@ -64,7 +64,7 @@ public class ${ClassName}Controller extends BaseController
@RequiresPermissions("
${
permissionPrefix
}
:export")
@Log(title = "
${
functionName
}
", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,
${
ClassName
}
${
className
}
)
throws IOException
public void export(HttpServletResponse response,
${
ClassName
}
${
className
}
)
{
List
<
${
ClassName
}
>
list =
${
className
}
Service.select
${
ClassName
}
List(
${
className
}
);
ExcelUtil
<
${
ClassName
}
>
util = new ExcelUtil
<
${
ClassName
}
>
(
${
ClassName
}
.class);
...
...
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
浏览文件 @
173c0e38
...
...
@@ -561,7 +561,7 @@ export default {
handleExport
()
{
this
.
download
(
'
${
moduleName
}
/
${
businessName
}
/export
'
,
{
...
this
.
queryParams
},
`
${
moduleName
}
_
${
businessName
}
.xlsx`
)
},
`
${
businessName
}
_
#
[[
${
new
Date().getTime()}]]
#
.xlsx`
)
}
}
};
...
...
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobController.java
浏览文件 @
173c0e38
package
com.ruoyi.job.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.quartz.SchedulerException
;
...
...
@@ -58,7 +57,7 @@ public class SysJobController extends BaseController
@RequiresPermissions
(
"monitor:job:export"
)
@Log
(
title
=
"定时任务"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysJob
sysJob
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysJob
sysJob
)
{
List
<
SysJob
>
list
=
jobService
.
selectJobList
(
sysJob
);
ExcelUtil
<
SysJob
>
util
=
new
ExcelUtil
<
SysJob
>(
SysJob
.
class
);
...
...
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobLogController.java
浏览文件 @
173c0e38
package
com.ruoyi.job.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -50,7 +49,7 @@ public class SysJobLogController extends BaseController
@RequiresPermissions
(
"monitor:job:export"
)
@Log
(
title
=
"任务调度日志"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysJobLog
sysJobLog
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysJobLog
sysJobLog
)
{
List
<
SysJobLog
>
list
=
jobLogService
.
selectJobLogList
(
sysJobLog
);
ExcelUtil
<
SysJobLog
>
util
=
new
ExcelUtil
<
SysJobLog
>(
SysJobLog
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -52,7 +51,7 @@ public class SysConfigController extends BaseController
@Log
(
title
=
"参数管理"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:config:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysConfig
config
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysConfig
config
)
{
List
<
SysConfig
>
list
=
configService
.
selectConfigList
(
config
);
ExcelUtil
<
SysConfig
>
util
=
new
ExcelUtil
<
SysConfig
>(
SysConfig
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -54,7 +53,7 @@ public class SysDictDataController extends BaseController
@Log
(
title
=
"字典数据"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:dict:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysDictData
dictData
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysDictData
dictData
)
{
List
<
SysDictData
>
list
=
dictDataService
.
selectDictDataList
(
dictData
);
ExcelUtil
<
SysDictData
>
util
=
new
ExcelUtil
<
SysDictData
>(
SysDictData
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -49,7 +48,7 @@ public class SysDictTypeController extends BaseController
@Log
(
title
=
"字典类型"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:dict:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysDictType
dictType
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysDictType
dictType
)
{
List
<
SysDictType
>
list
=
dictTypeService
.
selectDictTypeList
(
dictType
);
ExcelUtil
<
SysDictType
>
util
=
new
ExcelUtil
<
SysDictType
>(
SysDictType
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -46,7 +45,7 @@ public class SysLogininforController extends BaseController
@Log
(
title
=
"登录日志"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:logininfor:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysLogininfor
logininfor
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysLogininfor
logininfor
)
{
List
<
SysLogininfor
>
list
=
logininforService
.
selectLogininforList
(
logininfor
);
ExcelUtil
<
SysLogininfor
>
util
=
new
ExcelUtil
<
SysLogininfor
>(
SysLogininfor
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -46,7 +45,7 @@ public class SysOperlogController extends BaseController
@Log
(
title
=
"操作日志"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:operlog:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysOperLog
operLog
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysOperLog
operLog
)
{
List
<
SysOperLog
>
list
=
operLogService
.
selectOperLogList
(
operLog
);
ExcelUtil
<
SysOperLog
>
util
=
new
ExcelUtil
<
SysOperLog
>(
SysOperLog
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysPostController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -52,7 +51,7 @@ public class SysPostController extends BaseController
@Log
(
title
=
"岗位管理"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:post:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysPost
post
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysPost
post
)
{
List
<
SysPost
>
list
=
postService
.
selectPostList
(
post
);
ExcelUtil
<
SysPost
>
util
=
new
ExcelUtil
<
SysPost
>(
SysPost
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
浏览文件 @
173c0e38
package
com.ruoyi.system.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -55,7 +54,7 @@ public class SysRoleController extends BaseController
@Log
(
title
=
"角色管理"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:role:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysRole
role
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysRole
role
)
{
List
<
SysRole
>
list
=
roleService
.
selectRoleList
(
role
);
ExcelUtil
<
SysRole
>
util
=
new
ExcelUtil
<
SysRole
>(
SysRole
.
class
);
...
...
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
浏览文件 @
173c0e38
...
...
@@ -77,7 +77,7 @@ public class SysUserController extends BaseController
@Log
(
title
=
"用户管理"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"system:user:export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SysUser
user
)
throws
IOException
public
void
export
(
HttpServletResponse
response
,
SysUser
user
)
{
List
<
SysUser
>
list
=
userService
.
selectUserList
(
user
);
ExcelUtil
<
SysUser
>
util
=
new
ExcelUtil
<
SysUser
>(
SysUser
.
class
);
...
...
ruoyi-ui/src/utils/request.js
浏览文件 @
173c0e38
...
...
@@ -8,7 +8,7 @@ import { saveAs } from 'file-saver'
let
downloadLoadingInstance
;
axios
.
defaults
.
headers
[
'
Con
n
tent-Type
'
]
=
'
application/json;charset=utf-8
'
axios
.
defaults
.
headers
[
'
Content-Type
'
]
=
'
application/json;charset=utf-8
'
// 创建axios实例
const
service
=
axios
.
create
({
// axios中请求配置有baseURL选项,表示请求URL公共部分
...
...
@@ -48,16 +48,19 @@ service.interceptors.response.use(res => {
return
res
.
data
}
if
(
code
===
401
)
{
MessageBox
.
confirm
(
'
登录状态已过期,您可以继续留在该页面,或者重新登录
'
,
'
系统提示
'
,
{
let
doms
=
document
.
getElementsByClassName
(
'
el-message-box
'
)[
0
]
if
(
doms
===
undefined
){
MessageBox
.
confirm
(
'
登录状态已过期,您可以继续留在该页面,或者重新登录
'
,
'
系统提示
'
,
{
confirmButtonText
:
'
重新登录
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}
).
then
(()
=>
{
store
.
dispatch
(
'
LogOut
'
).
then
(()
=>
{
location
.
href
=
'
/index
'
;
})
}).
catch
(()
=>
{});
).
then
(()
=>
{
store
.
dispatch
(
'
LogOut
'
).
then
(()
=>
{
location
.
href
=
'
/index
'
;
})
}).
catch
(()
=>
{});
}
return
Promise
.
reject
(
'
无效的会话,或者会话已过期,请重新登录。
'
)
}
else
if
(
code
===
500
)
{
Message
({
...
...
ruoyi-ui/src/utils/ruoyi.js
浏览文件 @
173c0e38
...
...
@@ -3,8 +3,6 @@
* Copyright (c) 2019 ruoyi
*/
const
baseURL
=
process
.
env
.
VUE_APP_BASE_API
// 日期格式化
export
function
parseTime
(
time
,
pattern
)
{
if
(
arguments
.
length
===
0
||
!
time
)
{
...
...
@@ -95,11 +93,6 @@ export function selectDictLabels(datas, value, separator) {
return
actions
.
join
(
''
).
substring
(
0
,
actions
.
join
(
''
).
length
-
1
);
}
// 通用下载方法
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
;
...
...
ruoyi-ui/src/views/system/user/index.vue
浏览文件 @
173c0e38
...
...
@@ -653,7 +653,7 @@ export default {
importTemplate
()
{
this
.
download
(
'
system/user/importTemplate
'
,
{
...
this
.
queryParams
},
`user_
${
new
Date
().
getTime
()}
.xlsx`
)
},
`user_
template_
${
new
Date
().
getTime
()}
.xlsx`
)
},
// 文件上传中处理
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录