Commit 33db69e4 by yangzhengze Committed by 若依

!11 增加通过Excel文件批量添加用户功能

Merge pull request !11 from yangzhengze/master
parents c5b2b8d5 dbb2d6a8
......@@ -40,6 +40,7 @@
<kaptcha.version>2.3.2</kaptcha.version>
<swagger.version>2.7.0</swagger.version>
<jsoup.version>1.11.3</jsoup.version>
<poi.version>3.17</poi.version>
</properties>
<dependencies>
......@@ -246,6 +247,19 @@
<version>${jsoup.version}</version>
</dependency>
<!-- POI-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
</dependencies>
<build>
......
package com.ruoyi.common.utils;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.Cell;
import java.text.DecimalFormat;
import java.util.Date;
/**
* 导入Excel工具类
*/
public class ExcelImportUtils {
/** 是否是2003的excel,返回true是2003Excel文件**/
public static boolean isExcel2003(String filePath){
return filePath.matches("^.+\\.(?i)(xls)$");
}
/** 是否是2007以上的excel,返回true是2007Excel文件**/
public static boolean isExcel2007(String filePath){
return filePath.matches("^.+\\.(?i)(xlsx)$");
}
/**
* 验证EXCEL文件
*
* @param filePath
* @return
*/
public static boolean validateExcel(String filePath) {
if (filePath == null || !(isExcel2003(filePath) || isExcel2007(filePath))) {
return false;
}
return true;
}
/**
* 获取单元格的值
* @param cell
* @return
*/
public static String getCellValue(Cell cell) {
String value = "";
if (cell != null) {
switch(cell.getCellTypeEnum()){
case NUMERIC:// 数字
value = cell.getNumericCellValue()+ " ";
if(HSSFDateUtil.isCellDateFormatted(cell)){
Date date = cell.getDateCellValue();
if(date != null){
value = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,date); // 日期格式化
}else{
value = "";
}
}else {
// 解析cell时候 数字类型默认是double类型的 但是想要获取整数类型 需要格式化
value = new DecimalFormat("0").format(cell.getNumericCellValue());
}
break;
case STRING: // 字符串
value = cell.getStringCellValue();
break;
case BOOLEAN: // Boolean类型
value = cell.getBooleanCellValue()+"";
break;
case BLANK: // 空值
value = "";
break;
case ERROR: // 错误类型
value ="非法字符";
break;
default:
value = "未知类型";
break;
}
}
return value.trim();
}
}
package com.ruoyi.project.system.user.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.web.controller.BaseController;
......@@ -25,6 +12,17 @@ import com.ruoyi.project.system.role.service.IRoleService;
import com.ruoyi.project.system.user.domain.User;
import com.ruoyi.project.system.user.domain.UserStatus;
import com.ruoyi.project.system.user.service.IUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 用户信息
......@@ -35,7 +33,7 @@ import com.ruoyi.project.system.user.service.IUserService;
@RequestMapping("/system/user")
public class UserController extends BaseController
{
private static final Logger log = LoggerFactory.getLogger(UserController.class);
private String prefix = "system/user";
@Autowired
......@@ -173,6 +171,28 @@ public class UserController extends BaseController
}
/**
* 批量新增用户
*/
@RequiresPermissions("system:user:batchAdd")
@Log(title = "系统管理", action = "用户管理-批量新增用户")
@PostMapping("/batchAdd")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
public Message batchAdd( @RequestParam("uploadfile") MultipartFile file)
{
try {
if(!file.isEmpty()){
int rows=userService.batchImportUsers(file);
return Message.success(String.valueOf(rows));
}
return Message.error();
}catch (Exception e){
log.error("批量添加用户失败 !", e);
return Message.error(e.getMessage());
}
}
/**
* 校验用户名
*/
@PostMapping("/checkLoginNameUnique")
......
package com.ruoyi.project.system.user.mapper;
import java.util.List;
import com.ruoyi.project.system.user.domain.User;
import java.util.List;
/**
* 用户表 数据层
*
......@@ -108,4 +109,12 @@ public interface UserMapper
* @return 结果
*/
public User checkEmailUnique(String email);
/**
* 批量添加用户
* @param userList
* @return
*/
public int batchAddUser(List<User> userList);
}
package com.ruoyi.project.system.user.service;
import java.util.List;
import com.ruoyi.project.system.user.domain.User;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 用户 业务层
......@@ -133,4 +135,11 @@ public interface IUserService
*/
public String selectUserPostGroup(Long userId);
/**
* Excel批量导入用户
* @param myFile
* @return
*/
public int batchImportUsers(MultipartFile myFile);
}
# 项目名称、版本、版权年份
ruoyi:
name: RuoYi
version: 1.1.5
version: 1.1.6
copyrightYear: 2018
profile: D:/profile/
......
......@@ -160,4 +160,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</insert>
<insert id="batchAddUser" useGeneratedKeys="true" keyProperty="userId" >
insert into sys_user(
dept_id,
login_name,
user_name,
email,
phonenumber,
sex,
password,
salt,
status,
create_by,
remark,
create_time
)values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.deptId},
#{item.loginName},
#{item.userName},
#{item.email},
#{item.phonenumber},
#{item.sex},
#{item.password},
#{item.salt},
#{item.status},
#{item.createBy},
#{item.remark},
sysdate()
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
/*!
* bootstrap-fileinput v4.4.9
* http://plugins.krajee.com/file-input
*
* Krajee default styling for bootstrap-fileinput.
*
* Author: Kartik Visweswaran
* Copyright: 2014 - 2018, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD 3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/.btn-file input[type=file],.file-caption-icon,.file-no-browse,.file-preview .fileinput-remove,.file-zoom-dialog .btn-navigate,.file-zoom-dialog .floating-buttons,.krajee-default .file-thumb-progress{position:absolute}.file-loading input[type=file],input[type=file].file-loading{width:0;height:0}.file-no-browse{left:50%;bottom:20%;width:1px;height:1px;font-size:0;opacity:0;border:none;background:0 0;outline:0;box-shadow:none}.file-caption-icon,.file-input-ajax-new .fileinput-remove-button,.file-input-ajax-new .fileinput-upload-button,.file-input-ajax-new .no-browse .input-group-btn,.file-input-new .close,.file-input-new .file-preview,.file-input-new .fileinput-remove-button,.file-input-new .fileinput-upload-button,.file-input-new .glyphicon-file,.file-input-new .no-browse .input-group-btn,.file-zoom-dialog .modal-header:after,.file-zoom-dialog .modal-header:before,.hide-content .kv-file-content,.kv-hidden{display:none}.btn-file,.file-caption,.file-input,.file-loading:before,.file-preview,.file-zoom-dialog .modal-dialog,.krajee-default .file-thumbnail-footer,.krajee-default.file-preview-frame{position:relative}.file-error-message pre,.file-error-message ul,.krajee-default .file-actions,.krajee-default .file-other-error{text-align:left}.file-error-message pre,.file-error-message ul{margin:0}.krajee-default .file-drag-handle,.krajee-default .file-upload-indicator{float:left;margin:5px 0 -5px;width:16px;height:16px}.krajee-default .file-thumb-progress .progress,.krajee-default .file-thumb-progress .progress-bar{height:11px;font-size:9px;line-height:10px}.krajee-default .file-caption-info,.krajee-default .file-size-info{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:160px;height:15px;margin:auto}.file-zoom-content>.file-object.type-flash,.file-zoom-content>.file-object.type-image,.file-zoom-content>.file-object.type-video{max-width:100%;max-height:100%;width:auto}.file-zoom-content>.file-object.type-flash,.file-zoom-content>.file-object.type-video{height:100%}.file-zoom-content>.file-object.type-default,.file-zoom-content>.file-object.type-html,.file-zoom-content>.file-object.type-pdf,.file-zoom-content>.file-object.type-text{width:100%}.rotate-2{transform:rotateY(180deg)}.rotate-3{transform:rotate(180deg)}.rotate-4{transform:rotate(180deg) rotateY(180deg)}.rotate-5{transform:rotate(270deg) rotateY(180deg)}.rotate-6{transform:rotate(90deg)}.rotate-7{transform:rotate(90deg) rotateY(180deg)}.rotate-8{transform:rotate(270deg)}.file-loading:before{content:" Loading...";display:inline-block;padding-left:20px;line-height:16px;font-size:13px;font-variant:small-caps;color:#999;background:url(../img/loading.gif) top left no-repeat}.file-object{margin:0 0 -5px;padding:0}.btn-file{overflow:hidden}.btn-file input[type=file]{top:0;left:0;min-width:100%;min-height:100%;text-align:right;opacity:0;background:none;cursor:inherit;display:block}.btn-file ::-ms-browse{font-size:10000px;width:100%;height:100%}.file-caption .file-caption-name{width:100%;margin:0;padding:0;box-shadow:none;border:none;background:0 0;outline:0}.file-caption.icon-visible .file-caption-icon{display:inline-block}.file-caption.icon-visible .file-caption-name{padding-left:15px}.file-caption-icon{left:8px}.file-error-message{color:#a94442;background-color:#f2dede;margin:5px;border:1px solid #ebccd1;border-radius:4px;padding:15px}.file-error-message pre{margin:5px 0}.file-caption-disabled{background-color:#eee;cursor:not-allowed;opacity:1}.file-preview{border-radius:5px;border:1px solid #ddd;padding:8px;width:100%;margin-bottom:5px}.file-preview .btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.file-preview .fileinput-remove{top:1px;right:1px;line-height:10px}.file-preview .clickable{cursor:pointer}.file-preview-image{font:40px Impact,Charcoal,sans-serif;color:green}.krajee-default.file-preview-frame{margin:8px;border:1px solid #ddd;box-shadow:1px 1px 5px 0 #a2958a;padding:6px;float:left;text-align:center}.krajee-default.file-preview-frame .kv-file-content{width:213px;height:160px}.krajee-default.file-preview-frame .file-thumbnail-footer{height:70px}.krajee-default.file-preview-frame:not(.file-preview-error):hover{box-shadow:3px 3px 5px 0 #333}.krajee-default .file-preview-text{display:block;color:#428bca;border:1px solid #ddd;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;outline:0;padding:8px;resize:none}.krajee-default .file-preview-html{border:1px solid #ddd;padding:8px;overflow:auto}.krajee-default .file-other-icon{font-size:6em}.krajee-default .file-footer-buttons{float:right}.krajee-default .file-footer-caption{display:block;text-align:center;padding-top:4px;font-size:11px;color:#777;margin-bottom:15px}.krajee-default .file-preview-error{opacity:.65;box-shadow:none}.krajee-default .file-thumb-progress{height:11px;top:37px;left:0;right:0}.krajee-default.kvsortable-ghost{background:#e1edf7;border:2px solid #a1abff}.krajee-default .file-preview-other:hover{opacity:.8}.krajee-default .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover{color:#000}.kv-upload-progress .progress{height:20px;line-height:20px;margin:10px 0;overflow:hidden}.kv-upload-progress .progress-bar{height:20px;line-height:20px}.file-zoom-dialog .file-other-icon{font-size:22em;font-size:50vmin}.file-zoom-dialog .modal-dialog{width:auto}.file-zoom-dialog .modal-header{display:flex;align-items:center;justify-content:space-between}.file-zoom-dialog .btn-navigate{padding:0;margin:0;background:0 0;text-decoration:none;outline:0;opacity:.7;top:45%;font-size:4em;color:#1c94c4}.file-zoom-dialog .btn-navigate:not([disabled]):hover{outline:0;box-shadow:none;opacity:.6}.file-zoom-dialog .floating-buttons{top:5px;right:10px}.file-zoom-dialog .btn-navigate[disabled]{opacity:.3}.file-zoom-dialog .btn-prev{left:1px}.file-zoom-dialog .btn-next{right:1px}.file-zoom-dialog .kv-zoom-title{font-weight:300;color:#999;max-width:50%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.file-input-ajax-new .no-browse .form-control,.file-input-new .no-browse .form-control{border-top-right-radius:4px;border-bottom-right-radius:4px}.file-caption-main{width:100%}.file-thumb-loading{background:url(../img/loading.gif) center center no-repeat content-box!important}.file-drop-zone{border:1px dashed #aaa;border-radius:4px;height:100%;text-align:center;vertical-align:middle;margin:12px 15px 12px 12px;padding:5px}.file-drop-zone.clickable:hover{border:2px dashed #999}.file-drop-zone.clickable:focus{border:2px solid #5acde2}.file-drop-zone .file-preview-thumbnails{cursor:default}.file-drop-zone-title{color:#aaa;font-size:1.6em;padding:85px 10px;cursor:default}.file-highlighted{border:2px dashed #999!important;background-color:#eee}.file-uploading{background:url(../img/loading-sm.gif) center bottom 10px no-repeat;opacity:.65}@media (min-width:576px){.file-zoom-dialog .modal-dialog{max-width:500px}}@media (min-width:992px){.file-zoom-dialog .modal-lg{max-width:800px}}.file-zoom-fullscreen.modal{position:fixed;top:0;right:0;bottom:0;left:0}.file-zoom-fullscreen .modal-dialog{position:fixed;margin:0;padding:0;width:100%;height:100%;max-width:100%;max-height:100%}.file-zoom-fullscreen .modal-content{border-radius:0;box-shadow:none}.file-zoom-fullscreen .modal-body{overflow-y:auto}.floating-buttons{z-index:3000}.floating-buttons .btn-kv{margin-left:3px;z-index:3000}.file-zoom-content{height:480px;text-align:center}.file-zoom-content .file-preview-image,.file-zoom-content .file-preview-video{max-height:100%}.file-zoom-content .is-portrait-gt4{margin-top:60px}.file-zoom-content>.file-object.type-image{height:auto;min-height:inherit}.file-zoom-content>.file-object.type-audio{width:auto;height:30px}@media screen and (max-width:767px){.file-preview-thumbnails{display:flex;justify-content:center;align-items:center;flex-direction:column}.file-zoom-dialog .modal-header{flex-direction:column}}@media screen and (max-width:350px){.krajee-default.file-preview-frame .kv-file-content{width:160px}}.file-loading[dir=rtl]:before{background:url(../img/loading.gif) top right no-repeat;padding-left:0;padding-right:20px}.file-sortable .file-drag-handle{cursor:move;opacity:1}.file-sortable .file-drag-handle:hover{opacity:.7}.clickable .file-drop-zone-title{cursor:pointer}.kv-zoom-actions .btn-kv{margin-left:3px}.file-preview-initial.sortable-chosen{background-color:#d9edf7}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* FileInput Chinese Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinput
* @author kangqf <kangqingfei@gmail.com>
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
(function ($) {
"use strict";
$.fn.fileinputLocales['zh'] = {
fileSingle: '文件',
filePlural: '个文件',
browseLabel: '选择 &hellip;',
removeLabel: '移除',
removeTitle: '清除选中文件',
cancelLabel: '取消',
cancelTitle: '取消进行中的上传',
uploadLabel: '上传',
uploadTitle: '上传选中文件',
msgNo: '没有',
msgNoFilesSelected: '未选择文件',
msgCancelled: '取消',
msgPlaceholder: '选择 {files}...',
msgZoomModalHeading: '详细预览',
msgFileRequired: '必须选择一个文件上传.',
msgSizeTooSmall: '文件 "{name}" (<b>{size} KB</b>) 必须大于限定大小 <b>{minSize} KB</b>.',
msgSizeTooLarge: '文件 "{name}" (<b>{size} KB</b>) 超过了允许大小 <b>{maxSize} KB</b>.',
msgFilesTooLess: '你必须选择最少 <b>{n}</b> {files} 来上传. ',
msgFilesTooMany: '选择的上传文件个数 <b>({n})</b> 超出最大文件的限制个数 <b>{m}</b>.',
msgFileNotFound: '文件 "{name}" 未找到!',
msgFileSecured: '安全限制,为了防止读取文件 "{name}".',
msgFileNotReadable: '文件 "{name}" 不可读.',
msgFilePreviewAborted: '取消 "{name}" 的预览.',
msgFilePreviewError: '读取 "{name}" 时出现了一个错误.',
msgInvalidFileName: '文件名 "{name}" 包含非法字符.',
msgInvalidFileType: '不正确的类型 "{name}". 只支持 "{types}" 类型的文件.',
msgInvalidFileExtension: '不正确的文件扩展名 "{name}". 只支持 "{extensions}" 的文件扩展名.',
msgFileTypes: {
'image': 'image',
'html': 'HTML',
'text': 'text',
'video': 'video',
'audio': 'audio',
'flash': 'flash',
'pdf': 'PDF',
'object': 'object'
},
msgUploadAborted: '该文件上传被中止',
msgUploadThreshold: '处理中...',
msgUploadBegin: '正在初始化...',
msgUploadEnd: '完成',
msgUploadEmpty: '无效的文件上传.',
msgUploadError: '上传出错',
msgValidationError: '验证错误',
msgLoading: '加载第 {index} 文件 共 {files} &hellip;',
msgProgress: '加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.',
msgSelected: '{n} {files} 选中',
msgFoldersNotAllowed: '只支持拖拽文件! 跳过 {n} 拖拽的文件夹.',
msgImageWidthSmall: '图像文件的"{name}"的宽度必须是至少{size}像素.',
msgImageHeightSmall: '图像文件的"{name}"的高度必须至少为{size}像素.',
msgImageWidthLarge: '图像文件"{name}"的宽度不能超过{size}像素.',
msgImageHeightLarge: '图像文件"{name}"的高度不能超过{size}像素.',
msgImageResizeError: '无法获取的图像尺寸调整。',
msgImageResizeException: '调整图像大小时发生错误。<pre>{errors}</pre>',
msgAjaxError: '{operation} 发生错误. 请重试!',
msgAjaxProgressError: '{operation} 失败',
ajaxOperations: {
deleteThumb: '删除文件',
uploadThumb: '上传文件',
uploadBatch: '批量上传',
uploadExtra: '表单数据上传'
},
dropZoneTitle: '拖拽文件到这里 &hellip;<br>支持多文件同时上传',
dropZoneClickTitle: '<br>(或点击{files}按钮选择文件)',
fileActionSettings: {
removeTitle: '删除文件',
uploadTitle: '上传文件',
uploadRetryTitle: '重试',
zoomTitle: '查看详情',
dragTitle: '移动 / 重置',
indicatorNewTitle: '没有上传',
indicatorSuccessTitle: '上传',
indicatorErrorTitle: '上传错误',
indicatorLoadingTitle: '上传 ...'
},
previewZoomButtonTitles: {
prev: '预览上一个文件',
next: '预览下一个文件',
toggleheader: '缩放',
fullscreen: '全屏',
borderless: '无边界模式',
close: '关闭当前预览'
}
};
})(window.jQuery);
......@@ -5,8 +5,11 @@ $(document).ready(function(){
$('body').layout({ west__size: 185 });
queryUserList();
queryDeptTreeDaTa();
//加载文件输入框
fileinputlist();
});
function queryUserList() {
var columns = [{
checkbox: true
......@@ -119,7 +122,25 @@ function queryDeptTreeDaTa()
loadTree();
});
}
/** 初始化文件框*/
function fileinputlist(){
$('#uploadfile').fileinput({
language: 'zh', //设置语言
showPreview: false,//是否显示预览,不写默认为true
showUpload: false, //是否显示上传按钮,跟随文本框的那个
showRemove : true, //显示移除按钮,跟随文本框的那个
showCaption: true,//是否显示标题,就是那个文本框
uploadAsync : false, //默认异步上传
elErrorContainer: '#upload-file-errors',
maxFileCount: 1, //表示允许同时上传的最大文件个数
maxFileSize: 102400, //单位为kb,如果为0表示不限制文件大小
enctype: 'multipart/form-data',
dropZoneTitle: '拖拽文件到这里 &hellip;<br>仅仅支持单个文件同时上传',//重新定义提示
msgFilesTooMany: '选择上传的文件数量({n}) 超过允许的最大数值{m}!',
allowedFileExtensions: ["xls", "xlsx"],
uploadUrl: prefix+'/batchAdd'
});
}
/*用户管理-部门*/
function dept() {
var url = ctx + "system/dept";
......@@ -144,6 +165,42 @@ function add() {
var url = prefix + '/add';
layer_showAuto("新增用户", url);
}
/*用户管理-批量新增*/
function batchAdd() {
//文件默认上传方法,传ID:uploadfile
$('#uploadfile').fileinput("upload");
//同步上传错误处理
$('#uploadfile').on('filebatchuploaderror', function(event, data, msg) {
// get message
$.modalAlert(msg, "error");
//重置
$('#uploadfile').fileinput("clear");
$('#uploadfile').fileinput("reset");
$('#uploadfile').fileinput('refresh');
$('#uploadfile').fileinput('enable');
});
//同步上传后从后台返回结果
$('#uploadfile').on('filebatchuploadsuccess', function(event, data, previewId, index) {
var result = data.response;
if (result.code == 0) {
//刷新数据表格
$('.bootstrap-table').bootstrapTable('refresh');
var count = result.msg;
$.modalAlert("成功导入" +count+ "条数据","success");
$('#uploadfile').fileinput('reset');
$('#exampleModal').modal('hide');
} else {
$.modalAlert(result.msg, "error");
//重置
$('#uploadfile').fileinput("clear");
$('#uploadfile').fileinput("reset");
$('#uploadfile').fileinput('refresh');
$('#uploadfile').fileinput('enable');
}
});
}
/*用户管理-重置密码*/
function resetPwd(userId) {
......
......@@ -39,7 +39,7 @@ $(window).load(function() {
options.imgSrc = e.target.result;
//根据MIME判断上传的文件是不是图片类型
if((options.imgSrc).indexOf("image/")==-1){
alert("错误提示\n" + " 请上传图片类型!");
parent.layer.alert("文件格式错误,请上传图片类型,如:JPG,JEPG,PNG后缀的文件。", {icon: 2,title:"系统提示"});
} else {
cropper = $('.imageBox').cropbox(options);
}
......
......@@ -6,6 +6,9 @@
<link href="/ruoyi/css/RuoYi.css" th:href="@{/ruoyi/css/RuoYi.css}" rel="stylesheet"/>
<link href="/ajax/libs/jquery-layout/jquery.layout-latest.css" th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link href="/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css" th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<!-- 文件输入框-->
<link href="/css/plugins/fileinput/fileinput.min.css" th:href="@{/css/plugins/fileinput/fileinput.min.css}" rel="stylesheet"/>
<body class="white-bg">
<div class="ui-layout-west">
<div class="main-content">
......@@ -33,6 +36,10 @@
<button class="btn btn-outline btn-default" onclick="javascript:add()" shiro:hasPermission="system:user:add">
<i class="fa fa-plus"></i> 新增
</button>
<button class="btn btn-outline btn-default" data-toggle="modal" data-target="#exampleModal" shiro:hasPermission="system:user:batchAdd">
<i class="fa fa-plus-square"></i> 批量新增
</button>
<button class="btn btn-outline btn-default" onclick="javascript:batchRemove()" shiro:hasPermission="system:user:batchRemove">
<i class="fa fa-trash-o"></i> 删除
</button>
......@@ -43,10 +50,46 @@
data-sort-name="create_time" data-sort-order="desc">
</table>
</div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="exampleModalLabel">导入Execl表</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<a class="btn" style="font-size:15px" href="../static/template/用户导入模板.xlsx" th:href="@{/template/用户导入模板.xlsx}">
用户导入模板.xlsx
</a>
</div>
<div class="modal-body">
<div class="file-loading">
<input id="uploadfile" name="uploadfile" multiple type="file" accept=".xls,.xlsx">
</div>
<div id="upload-file-errors"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="javascript:batchAdd()">保存</button>
</div>
</div>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script src="/ruoyi/system/user/user.js" th:src="@{/ruoyi/system/user/user.js}"></script>
<script src="/ajax/libs/jquery-layout/jquery.layout-latest.js" th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
<script src="/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js" th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<!-- 文件输入框-->
<script src="/js/plugins/fileinput/fileinput.min.js" th:src="@{/js/plugins/fileinput/fileinput.min.js}"></script>
<script src="/js/plugins/fileinput/locales/zh.js" th:src="@{/js/plugins/fileinput/locales/zh.js}"></script>
<script src="/js/plugins/fileinput/plugins/piexif.js" th:src="@{/js/plugins/fileinput/plugins/piexif.js}"></script>
<script src="/js/plugins/fileinput/plugins/purify.js" th:src="@{/js/plugins/fileinput/plugins/purify.js}"></script>
<script src="/js/plugins/fileinput/plugins/sortable.js" th:src="@{/js/plugins/fileinput/plugins/sortable.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('system:user:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:user:remove')}]];
......
Markdown is supported
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