处理问题

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/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'ztree'], function() {
}).use(['index', 'table', 'laydate', 'ztree', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var tableUrl = 'api/login-form/listpage';
var viewer = new Viewer(document.getElementById('tableBody'));
@ -115,8 +116,11 @@
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
common.getImgBase64('route/file/download/true/'+ rowData, function(dataUrl) {
$('#'+ row.loginFormId +'Img').attr('src', dataUrl);
});
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>';
}
},

View File

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

View File

@ -44,4 +44,10 @@ public class DepartmentUserRouteController {
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;
$('#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() {
common.download('route/file/download/false/'+ this.dataset.errorId);
window.open('route/file/download/false/'+ this.dataset.errorId);
})
function closeBox() {

View File

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

View File

@ -1,173 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#request.getContextPath() + '/'}">
<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">
<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>
html,body{margin: 0; padding: 0;}
.container {
padding: 0px;
height: 100%;
width: 500px;
}
.container .top {
border-top: 1px;
border-right: 1px;
border-bottom: 0;
border-left: 1px;
border-style: solid;
border-color: silver;
padding: 5px;
}
.container .top .selected-user {
border: 1px dotted silver;
line-height: 30px;
padding: 5px;
overflow: hidden;
}
.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;
}
.container {padding: 0px;height: 100%;width: 500px;}
.container .top {border-top: 1px;border-right: 1px;border-bottom: 0;border-left: 1px;border-style: solid;border-color: silver;padding: 5px;}
.container .top .selected-user {border: 1px dotted silver;line-height: 30px;padding: 5px;overflow: hidden;}
.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>
</head>
@ -251,52 +118,67 @@
</div>
</div>
</div>
<script>
var winWidth = window.innerWidth;
var winHeight = window.innerHeight;
var containerWidth = winWidth +'px';
var containerTopSelectedUserListWidth = (winWidth - 2) + 'px';
var containerBottomLeftWidth = (winWidth * (2 / 5) - 2) +'px';
var containerBottomLeftListWidth = (winWidth * (2 / 5) + 16) +'px';
var containerBottomLeftListHeight = (winHeight - 126) +'px';
var containerBottomRightWidth = (winWidth * (3 / 5) - 1) +'px';
var containerBottomRightListWidth = (winWidth * (3 / 5) + 16) +'px';
var containerBottomRightListHeight = (winHeight - 126) +'px';
var containerBottomRightListUserItemInfoDivWidth = (winWidth * (3 / 5) - 56) +'px';
<script src="assets/layuiadmin/layui/layui.js"></script>
<script th:inline="javascript">
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index'], function() {
var $ = layui.$;
var $win = $(window);
var requestParams = top.restAjax.path(window.location.href);
var departmentRootId = requestParams.departmentRootId;
departmentRootId = !departmentRootId ? '0' : departmentRootId;
// 初始化整体样式
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;
});
}
var winWidth = window.innerWidth;
var winHeight = window.innerHeight;
var containerWidth = winWidth +'px';
var containerTopSelectedUserListWidth = (winWidth - 2) + 'px';
var containerBottomLeftWidth = (winWidth * (2 / 5) - 2) +'px';
var containerBottomLeftListWidth = (winWidth * (2 / 5) + 16) +'px';
var containerBottomLeftListHeight = (winHeight - 126) +'px';
var containerBottomRightWidth = (winWidth * (3 / 5) - 1) +'px';
var containerBottomRightListWidth = (winWidth * (3 / 5) + 16) +'px';
var containerBottomRightListHeight = (winHeight - 126) +'px';
var containerBottomRightListUserItemInfoDivWidth = (winWidth * (3 / 5) - 56) +'px';
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>
</body>

View File

@ -94,7 +94,7 @@ public class UserRouteController {
@GetMapping("upload/upload-excel-template")
public void excelTemplate(HttpServletResponse response) throws IOException {
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 test="keywords != null and keywords != ''">
AND (
user_name LIKE CONCAT('%', #{keywords}, '%')
OR
creator_name LIKE CONCAT('%', #{keywords}, '%')
OR
update_reason LIKE CONCAT('%', #{keywords}, '%')
OR
old_value LIKE CONCAT('%', #{keywords}, '%')
OR
new_value LIKE CONCAT('%', #{keywords}, '%')

View File

@ -37,11 +37,11 @@
var common = layui.common;
$('#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() {
common.download('route/file/download/false/'+ this.dataset.errorId);
window.open('route/file/download/false/'+ this.dataset.errorId);
})
function closeBox() {