处理问题

This commit is contained in:
wanggeng 2022-05-05 17:39:50 +08:00
parent 2c0bef6b8f
commit 315cf78a02
9 changed files with 119 additions and 221 deletions

View File

@ -53,12 +53,13 @@
base: 'assets/layuiadmin/' base: 'assets/layuiadmin/'
}).extend({ }).extend({
index: 'lib/index' index: 'lib/index'
}).use(['index', 'table', 'laydate', 'ztree'], function() { }).use(['index', 'table', 'laydate', 'ztree', 'common'], function() {
var $ = layui.$; var $ = layui.$;
var $win = $(window); var $win = $(window);
var table = layui.table; var table = layui.table;
var admin = layui.admin; var admin = layui.admin;
var laydate = layui.laydate; var laydate = layui.laydate;
var common = layui.common;
var tableUrl = 'api/login-form/listpage'; var tableUrl = 'api/login-form/listpage';
var viewer = new Viewer(document.getElementById('tableBody')); var viewer = new Viewer(document.getElementById('tableBody'));
@ -115,8 +116,11 @@
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-'; return '-';
} }
common.getImgBase64('route/file/download/true/'+ rowData, function(dataUrl) {
$('#'+ row.loginFormId +'Img').attr('src', dataUrl);
});
return '<span class="preview-photos" style="width: 70px;">' + return '<span class="preview-photos" style="width: 70px;">' +
'<img src="route/file/download/true/'+ rowData +'" align="加载失败" style="width: 100%;">' + '<img id="'+ row.loginFormId +'Img" src="" align="加载失败" style="width: 100%;">' +
'</span>'; '</span>';
} }
}, },

View File

@ -3,7 +3,7 @@ package ink.wgink.service.department.controller.route;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.interfaces.dictionary.IDictionaryCheckService; import ink.wgink.interfaces.dictionary.IDictionaryCheckService;
import ink.wgink.util.ResourceUtil; import ink.wgink.util.ResourceUtil;
import ink.wgink.util.request.RequestUtil; import ink.wgink.util.request.StaticResourceRequestUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -12,8 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
/** /**
* When you feel like quitting. Think about why you started * When you feel like quitting. Think about why you started
@ -109,8 +109,8 @@ public class DepartmentRouteController {
@GetMapping("upload/upload-excel-template") @GetMapping("upload/upload-excel-template")
public void excelTemplate(HttpServletResponse response) throws IOException { public void excelTemplate(HttpServletResponse response) throws IOException {
File template = ResourceUtil.getResourceFile("templates/department/upload/upload-excel-template.xls"); InputStream inputStream = ResourceUtil.getJarResourceInputStream("templates/department/upload/upload-excel-template.xls");
RequestUtil.download(response, template, "组织部门导入模板.xls"); StaticResourceRequestUtil.download(response, inputStream, "导入模板.xls");
} }
} }

View File

@ -44,4 +44,10 @@ public class DepartmentUserRouteController {
return modelAndView; return modelAndView;
} }
@GetMapping("select-user-v2")
public ModelAndView selectUserV2() {
ModelAndView modelAndView = new ModelAndView("department/user/select-user-v2");
return modelAndView;
}
} }

View File

@ -36,11 +36,11 @@
var common = layui.common; var common = layui.common;
$('#downloadFile').click(function() { $('#downloadFile').click(function() {
common.download('route/department/upload/upload-excel-template') window.open('route/department/upload/upload-excel-template')
}) })
$(document).on('click', '.error-excel', function() { $(document).on('click', '.error-excel', function() {
common.download('route/file/download/false/'+ this.dataset.errorId); window.open('route/file/download/false/'+ this.dataset.errorId);
}) })
function closeBox() { function closeBox() {

View File

@ -205,7 +205,7 @@
title: '添加部门用户', title: '添加部门用户',
width: '800px', width: '800px',
height: '500px', height: '500px',
closeBtn: 0, closeBtn: 1,
onClose: function() { onClose: function() {
reloadTable(); reloadTable();
} }

View File

@ -1,173 +1,40 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html xmlns:th="http://www.thymeleaf.org">
<head> <head>
<base th:href="${#request.getContextPath() + '/'}">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style> <style>
html,body{margin: 0; padding: 0;} html,body{margin: 0; padding: 0;}
.container { .container {padding: 0px;height: 100%;width: 500px;}
padding: 0px; .container .top {border-top: 1px;border-right: 1px;border-bottom: 0;border-left: 1px;border-style: solid;border-color: silver;padding: 5px;}
height: 100%; .container .top .selected-user {border: 1px dotted silver;line-height: 30px;padding: 5px;overflow: hidden;}
width: 500px; .container .top .selected-user .list {width: 498px;height: 60px;overflow-y: scroll;overflow-x: hidden;}
} .container .center {border: 1px solid silver;height: 40px;overflow: hidden;}
.container .center .list {padding: 5px;line-height: 30px;height: 50px;white-space: nowrap;overflow-x: scroll;overflow-y: hidden;}
.container .top { .container .center .list span::after {content: '>';}
border-top: 1px; .container .center .list span:last-child::after {content: ''}
border-right: 1px; .container .bottom {font-size: 0;}
border-bottom: 0; .container .bottom .left {display: inline-block;width: 198px;border-top: 0;border-right: 1px;border-bottom: 1px;border-left: 1px;border-style: solid;border-color: silver;overflow: hidden;}
border-left: 1px; .container .bottom .left .list {width: 216px;height: 300px;overflow-y: scroll;overflow-x: hidden;}
border-style: solid; .container .bottom .left .list div {font-size: 18px;padding: 5px;line-height: 30px;border-top: 0;border-right: 1px;border-bottom: 1px;border-left: 0;border-style: dotted;border-color: silver;}
border-color: silver; .container .bottom .left .list div:last-child {border-bottom: 0;}
padding: 5px; .container .bottom .right {display: inline-block;width: 299px;border-top: 0;border-right: 1px;border-bottom: 1px;border-left: 0px;border-style: solid;border-color: silver;overflow: hidden;}
} .container .bottom .right .list {width: 316px;height: 300px;overflow-y: scroll;overflow-x: hidden;}
.container .bottom .right .list .user-item {padding: 5px;border-bottom: 1px dotted silver;}
.container .top .selected-user { .container .bottom .right .list .user-item .avatar {display: inline-block;width: 40px;height: 40px;}
border: 1px dotted silver; .container .bottom .right .list .user-item .avatar img {width: 100%;height: 100%;}
line-height: 30px; .container .bottom .right .list .user-item .info {display: inline-block;font-size: 14px;line-height: 20px;vertical-align: top;margin-left: 5px;}
padding: 5px; .container .bottom .right .list .user-item .info div {overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 244px;}
overflow: hidden; .container .bottom .right .list .user-item .checked {display: none;}
} .container .bottom .right .list .active {background: #f1f1f1;position: relative;}
.container .bottom .right .list .active .checked {position: absolute;display: block;top: 12px;right: 12px;width: 25px;height: 25px;background: black;}
.container .top .selected-user .list {
width: 498px;
height: 60px;
overflow-y: scroll;
overflow-x: hidden;
}
.container .center {
border: 1px solid silver;
height: 40px;
overflow: hidden;
}
.container .center .list {
padding: 5px;
line-height: 30px;
height: 50px;
white-space: nowrap;
overflow-x: scroll;
overflow-y: hidden;
}
.container .center .list span::after {
content: '>';
}
.container .center .list span:last-child::after {
content: ''
}
.container .bottom {
font-size: 0;
}
.container .bottom .left {
display: inline-block;
width: 198px;
border-top: 0;
border-right: 1px;
border-bottom: 1px;
border-left: 1px;
border-style: solid;
border-color: silver;
overflow: hidden;
}
.container .bottom .left .list {
width: 216px;
height: 300px;
overflow-y: scroll;
overflow-x: hidden;
}
.container .bottom .left .list div {
font-size: 18px;
padding: 5px;
line-height: 30px;
border-top: 0;
border-right: 1px;
border-bottom: 1px;
border-left: 0;
border-style: dotted;
border-color: silver;
}
.container .bottom .left .list div:last-child {
border-bottom: 0;
}
.container .bottom .right {
display: inline-block;
width: 299px;
border-top: 0;
border-right: 1px;
border-bottom: 1px;
border-left: 0px;
border-style: solid;
border-color: silver;
overflow: hidden;
}
.container .bottom .right .list {
width: 316px;
height: 300px;
overflow-y: scroll;
overflow-x: hidden;
}
.container .bottom .right .list .user-item {
padding: 5px;
border-bottom: 1px dotted silver;
}
.container .bottom .right .list .user-item .avatar {
display: inline-block;
width: 40px;
height: 40px;
}
.container .bottom .right .list .user-item .avatar img {
width: 100%;
height: 100%;
}
.container .bottom .right .list .user-item .info {
display: inline-block;
font-size: 14px;
line-height: 20px;
vertical-align: top;
margin-left: 5px;
}
.container .bottom .right .list .user-item .info div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 244px;
}
.container .bottom .right .list .user-item .checked {
display: none;
}
.container .bottom .right .list .active {
background: #f1f1f1;
position: relative;
}
.container .bottom .right .list .active .checked {
position: absolute;
display: block;
top: 12px;
right: 12px;
width: 25px;
height: 25px;
background: black;
}
</style> </style>
</head> </head>
@ -251,52 +118,67 @@
</div> </div>
</div> </div>
</div> </div>
<script> <script src="assets/layuiadmin/layui/layui.js"></script>
var winWidth = window.innerWidth; <script th:inline="javascript">
var winHeight = window.innerHeight; layui.config({
var containerWidth = winWidth +'px'; base: 'assets/layuiadmin/'
var containerTopSelectedUserListWidth = (winWidth - 2) + 'px'; }).extend({
var containerBottomLeftWidth = (winWidth * (2 / 5) - 2) +'px'; index: 'lib/index'
var containerBottomLeftListWidth = (winWidth * (2 / 5) + 16) +'px'; }).use(['index'], function() {
var containerBottomLeftListHeight = (winHeight - 126) +'px'; var $ = layui.$;
var containerBottomRightWidth = (winWidth * (3 / 5) - 1) +'px'; var $win = $(window);
var containerBottomRightListWidth = (winWidth * (3 / 5) + 16) +'px'; var requestParams = top.restAjax.path(window.location.href);
var containerBottomRightListHeight = (winHeight - 126) +'px'; var departmentRootId = requestParams.departmentRootId;
var containerBottomRightListUserItemInfoDivWidth = (winWidth * (3 / 5) - 56) +'px'; departmentRootId = !departmentRootId ? '0' : departmentRootId;
// 初始化整体样式 var winWidth = window.innerWidth;
function initStyle() { var winHeight = window.innerHeight;
document.querySelectorAll('.container').forEach(function(item) { var containerWidth = winWidth +'px';
item.style.width = containerWidth; var containerTopSelectedUserListWidth = (winWidth - 2) + 'px';
}); var containerBottomLeftWidth = (winWidth * (2 / 5) - 2) +'px';
document.querySelectorAll('.container .top .selected-user .list').forEach(function(item) { var containerBottomLeftListWidth = (winWidth * (2 / 5) + 16) +'px';
item.style.width = containerTopSelectedUserListWidth; var containerBottomLeftListHeight = (winHeight - 126) +'px';
}); var containerBottomRightWidth = (winWidth * (3 / 5) - 1) +'px';
document.querySelectorAll('.container .bottom .left').forEach(function(item) { var containerBottomRightListWidth = (winWidth * (3 / 5) + 16) +'px';
item.style.width = containerBottomLeftWidth; var containerBottomRightListHeight = (winHeight - 126) +'px';
}); var containerBottomRightListUserItemInfoDivWidth = (winWidth * (3 / 5) - 56) +'px';
document.querySelectorAll('.container .bottom .left .list').forEach(function(item) {
item.style.width = containerBottomLeftListWidth;
item.style.height = containerBottomLeftListHeight;
});
document.querySelectorAll('.container .bottom .right').forEach(function(item) {
item.style.width = containerBottomRightWidth;
});
document.querySelectorAll('.container .bottom .right .list').forEach(function(item) {
item.style.width = containerBottomRightListWidth;
item.style.height = containerBottomRightListHeight;
});
}
// 初始化用户列表样式
function initUserListStyle() {
document.querySelectorAll('.container .bottom .right .list .user-item .info div').forEach(function(item) {
item.style.width = containerBottomRightListUserItemInfoDivWidth;
});
}
initStyle(); // 初始化整体样式
initUserListStyle(); function initStyle() {
document.querySelectorAll('.container').forEach(function(item) {
item.style.width = containerWidth;
});
document.querySelectorAll('.container .top .selected-user .list').forEach(function(item) {
item.style.width = containerTopSelectedUserListWidth;
});
document.querySelectorAll('.container .bottom .left').forEach(function(item) {
item.style.width = containerBottomLeftWidth;
});
document.querySelectorAll('.container .bottom .left .list').forEach(function(item) {
item.style.width = containerBottomLeftListWidth;
item.style.height = containerBottomLeftListHeight;
});
document.querySelectorAll('.container .bottom .right').forEach(function(item) {
item.style.width = containerBottomRightWidth;
});
document.querySelectorAll('.container .bottom .right .list').forEach(function(item) {
item.style.width = containerBottomRightListWidth;
item.style.height = containerBottomRightListHeight;
});
}
// 初始化用户列表样式
function initUserListStyle() {
document.querySelectorAll('.container .bottom .right .list .user-item .info div').forEach(function(item) {
item.style.width = containerBottomRightListUserItemInfoDivWidth;
});
}
initStyle();
initUserListStyle();
});
</script> </script>
</body> </body>

View File

@ -94,7 +94,7 @@ public class UserRouteController {
@GetMapping("upload/upload-excel-template") @GetMapping("upload/upload-excel-template")
public void excelTemplate(HttpServletResponse response) throws IOException { public void excelTemplate(HttpServletResponse response) throws IOException {
InputStream inputStream = ResourceUtil.getJarResourceInputStream("templates/user/upload/upload-excel-template.xls"); InputStream inputStream = ResourceUtil.getJarResourceInputStream("templates/user/upload/upload-excel-template.xls");
StaticResourceRequestUtil.download(response, inputStream, "upload-excel-template.xls"); StaticResourceRequestUtil.download(response, inputStream, "导入模板.xls");
} }
} }

View File

@ -78,6 +78,12 @@
</if> </if>
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
AND ( AND (
user_name LIKE CONCAT('%', #{keywords}, '%')
OR
creator_name LIKE CONCAT('%', #{keywords}, '%')
OR
update_reason LIKE CONCAT('%', #{keywords}, '%')
OR
old_value LIKE CONCAT('%', #{keywords}, '%') old_value LIKE CONCAT('%', #{keywords}, '%')
OR OR
new_value LIKE CONCAT('%', #{keywords}, '%') new_value LIKE CONCAT('%', #{keywords}, '%')

View File

@ -37,11 +37,11 @@
var common = layui.common; var common = layui.common;
$('#downloadFile').click(function() { $('#downloadFile').click(function() {
common.download('route/user/upload/upload-excel-template') window.open('route/user/upload/upload-excel-template');
}) })
$(document).on('click', '.error-excel', function() { $(document).on('click', '.error-excel', function() {
common.download('route/file/download/false/'+ this.dataset.errorId); window.open('route/file/download/false/'+ this.dataset.errorId);
}) })
function closeBox() { function closeBox() {