Commit 075b388e authored by 李家智's avatar 李家智
Browse files

filesytem

parent fea41b40
......@@ -278,9 +278,10 @@ public class UserConsoleController {
}
@GetMapping(MODEL + "/excel/export.json")
@PostMapping(MODEL + "/excel/export.json")
@Function("user.export")
public JsonResult export(HttpServletResponse response,UserQuery condtion) {
@ResponseBody
public JsonResult<String> export(HttpServletResponse response,UserQuery condtion) {
String excelTemplate ="excelTemplates/admin/user/user_collection_template.xls";
PageQuery<CoreUser> page = condtion.getPageQuery();
//取出全部符合条件的
......@@ -297,6 +298,7 @@ public class UserConsoleController {
Context context = new Context();
context.putVar("users", users);
JxlsHelper.getInstance().processTemplate(is, os, context);
//下载参考FileSystemContorller
return JsonResult.success(item.getId());
} catch (IOException e) {
throw new PlatformException(e.getMessage());
......
......@@ -126,8 +126,8 @@ layui.define([ 'form', 'laydate', 'table','userApi' ], function(exports) {
},
exportUsers:function(){
Common.openConfirm("确认要导出这些用户?",function(){
userApi.exportUsers($("#searchForm"),function(){
Common.info("导出成功")
userApi.exportUsers($("#searchForm"),function(fileId){
Lib.download(fileId);
})
})
......
......@@ -30,8 +30,8 @@ layui.define([], function(exports) {
},
exportUsers:function(form,callback){
var formPara = form.serializeJson();
Common.post("/admin/user/excel/export.json", formPara, function() {
callback();
Common.post("/admin/user/excel/export.json", formPara, function(fileId) {
callback(fileId);
})
}
......
......@@ -9,8 +9,8 @@
<layui:accessButton function="user.role" action="userRole">操作角色</layui:accessButton>
<layui:accessButton function="user.role" action="userRole">流程角色</layui:accessButton>
<layui:accessButton function="user.password" action="changePassword">修改密码</layui:accessButton>
<layui:accessButton function="user.export" action="export">导出</layui:accessButton>
<layui:accessButton function="user.import" action="import">导入</layui:accessButton>
<layui:accessButton function="user.export" action="exportUsers">导出Excel</layui:accessButton>
<layui:accessButton function="user.import" action="importUsers">导入</layui:accessButton>
</div>
<table id="userTable" lay-filter="userTable"></table>
......
......@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
......@@ -17,6 +18,7 @@ import com.ibeetl.admin.core.file.FileService;
public class FileSystemContorller {
private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/core/file";
@Autowired
FileService fileService;
@GetMapping(MODEL + "/get.do")
public ModelAndView index(HttpServletResponse response,String id) throws IOException {
......
......@@ -228,6 +228,10 @@ var Lib = {
+ "</option>");
}
},
download:function(fileId){
window.location.href = Common.ctxPath+"/core/file/get.do?id="+fileId
},
/* 搜索 */
doSearchForm : function(form, tableIns, page) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment