若依 3.0
This commit is contained in:
237
ruoyi-admin/src/main/resources/templates/system/user/add.html
Normal file
237
ruoyi-admin/src/main/resources/templates/system/user/add.html
Normal file
@@ -0,0 +1,237 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-user-add">
|
||||
<input name="deptId" type="hidden" id="treeId"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">登录名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" id="loginName" name="loginName"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="deptName" onclick="selectDeptTree()" readonly="true" id="treeName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="userName" id="userName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="password" name="password" id="password" th:value="${@config.getKey('sys.user.initPassword')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email" id="email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phonenumber" id="phonenumber">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select id="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="onoffswitch">
|
||||
<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="status" name="status">
|
||||
<label class="onoffswitch-label" for="status">
|
||||
<span class="onoffswitch-inner"></span>
|
||||
<span class="onoffswitch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">岗位:</label>
|
||||
<div class="col-sm-8">
|
||||
<select id="post" name="post" class="form-control select2-hidden-accessible" multiple="">
|
||||
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">角色:</label>
|
||||
<div class="col-sm-8">
|
||||
<label th:each="role:${roles}" class="check-box">
|
||||
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:disabled="${role.status == '1'}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ajax/libs/select/select2.js}"></script>
|
||||
<script>
|
||||
$("#form-user-add").validate({
|
||||
rules:{
|
||||
loginName:{
|
||||
required:true,
|
||||
minlength: 2,
|
||||
maxlength: 20,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkLoginNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
name : function() {
|
||||
return $.common.trim($("#loginName").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
userName:{
|
||||
required:true,
|
||||
},
|
||||
deptName:{
|
||||
required:true,
|
||||
},
|
||||
password:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
maxlength: 20
|
||||
},
|
||||
email:{
|
||||
required:true,
|
||||
email:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkEmailUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
name: function () {
|
||||
return $.common.trim($("#email").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function (data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
phonenumber:{
|
||||
required:true,
|
||||
isPhone:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkPhoneUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
name: function () {
|
||||
return $.common.trim($("#phonenumber").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function (data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"loginName": {
|
||||
remote: "用户已经存在"
|
||||
},
|
||||
"email": {
|
||||
remote: "Email已经存在"
|
||||
},
|
||||
"phonenumber":{
|
||||
remote: "手机号码已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
add();
|
||||
}
|
||||
}
|
||||
|
||||
function add() {
|
||||
var userId = $("input[name='userId']").val();
|
||||
var deptId = $("input[name='deptId']").val();
|
||||
var loginName = $("input[name='loginName']").val();
|
||||
var userName = $("input[name='userName']").val();
|
||||
var password = $("input[name='password']").val();
|
||||
var email = $("input[name='email']").val();
|
||||
var phonenumber = $("input[name='phonenumber']").val();
|
||||
var sex = $("#sex option:selected").val();
|
||||
var status = $("input[name='status']").is(':checked') == true ? 0 : 1;
|
||||
var roleIds = $.form.selectCheckeds("role");
|
||||
var postIds = $.form.selectSelects("post");
|
||||
$.ajax({
|
||||
cache : true,
|
||||
type : "POST",
|
||||
url : ctx + "system/user/add",
|
||||
data : {
|
||||
"userId": userId,
|
||||
"deptId": deptId,
|
||||
"loginName": loginName,
|
||||
"userName": userName,
|
||||
"password": password,
|
||||
"email": email,
|
||||
"phonenumber": phonenumber,
|
||||
"sex": sex,
|
||||
"status": status,
|
||||
"roleIds": roleIds,
|
||||
"postIds": postIds
|
||||
},
|
||||
async : false,
|
||||
error : function(request) {
|
||||
$.modal.alertError("系统错误");
|
||||
},
|
||||
success : function(data) {
|
||||
$.operate.saveSuccess(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*用户管理-新增-选择部门树*/
|
||||
function selectDeptTree() {
|
||||
var treeId = $("#treeId").val();
|
||||
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||
var options = {
|
||||
title: '选择部门',
|
||||
width: "380",
|
||||
height: "380",
|
||||
url: ctx + "system/dept/selectDeptTree/" + deptId,
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||
if ($.tree.notAllowParents(tree)) {
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
210
ruoyi-admin/src/main/resources/templates/system/user/edit.html
Normal file
210
ruoyi-admin/src/main/resources/templates/system/user/edit.html
Normal file
@@ -0,0 +1,210 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-user-edit" th:object="${user}">
|
||||
<input name="userId" type="hidden" th:field="*{userId}" />
|
||||
<input name="deptId" type="hidden" th:field="*{deptId}" id="treeId"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">登录名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" th:field="*{loginName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="deptName" onclick="selectDeptTree()" readonly="true" id="treeName" th:field="*{dept.deptName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="userName" id="userName" th:field="*{userName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email" id="email" th:field="*{email}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phonenumber" id="phonenumber" th:field="*{phonenumber}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select id="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="onoffswitch">
|
||||
<input type="checkbox" th:checked="${user.status == '0' ? true : false}" class="onoffswitch-checkbox" id="status" name="status">
|
||||
<label class="onoffswitch-label" for="status">
|
||||
<span class="onoffswitch-inner"></span>
|
||||
<span class="onoffswitch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">岗位:</label>
|
||||
<div class="col-sm-8">
|
||||
<select id="post" name="post" class="form-control select2-hidden-accessible" multiple="">
|
||||
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">角色:</label>
|
||||
<div class="col-sm-8">
|
||||
<label th:each="role:${roles}" class="check-box">
|
||||
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ajax/libs/select/select2.js}"></script>
|
||||
<script>
|
||||
$("#form-user-edit").validate({
|
||||
rules:{
|
||||
userName:{
|
||||
required:true,
|
||||
},
|
||||
deptName:{
|
||||
required:true,
|
||||
},
|
||||
email:{
|
||||
required:true,
|
||||
email:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkEmailUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"userId": function() {
|
||||
return $("#userId").val();
|
||||
},
|
||||
"email": function() {
|
||||
return $.common.trim($("#email").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function (data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
phonenumber:{
|
||||
required:true,
|
||||
isPhone:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkPhoneUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"userId": function() {
|
||||
return $("#userId").val();
|
||||
},
|
||||
"phonenumber": function() {
|
||||
return $.common.trim($("#phonenumber").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function (data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"email": {
|
||||
remote: "Email已经存在"
|
||||
},
|
||||
"phonenumber":{
|
||||
remote: "手机号码已经存在"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
edit();
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
edit();
|
||||
}
|
||||
}
|
||||
|
||||
function edit() {
|
||||
var userId = $("input[name='userId']").val();
|
||||
var deptId = $("input[name='deptId']").val();
|
||||
var userName = $("input[name='userName']").val();
|
||||
var email = $("input[name='email']").val();
|
||||
var phonenumber = $("input[name='phonenumber']").val();
|
||||
var sex = $("#sex option:selected").val();
|
||||
var status = $("input[name='status']").is(':checked') == true ? 0 : 1;
|
||||
var roleIds = $.form.selectCheckeds("role");
|
||||
var postIds = $.form.selectSelects("post");
|
||||
$.ajax({
|
||||
cache : true,
|
||||
type : "POST",
|
||||
url : ctx + "system/user/edit",
|
||||
data : {
|
||||
"userId": userId,
|
||||
"deptId": deptId,
|
||||
"userName": userName,
|
||||
"email": email,
|
||||
"phonenumber": phonenumber,
|
||||
"sex": sex,
|
||||
"status": status,
|
||||
"roleIds": roleIds,
|
||||
"postIds": postIds
|
||||
},
|
||||
async : false,
|
||||
error : function(request) {
|
||||
$.modal.alertError("系统错误");
|
||||
},
|
||||
success : function(data) {
|
||||
$.operate.saveSuccess(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*用户管理-修改-选择部门树*/
|
||||
function selectDeptTree() {
|
||||
var deptId = $("#treeId").val();
|
||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||
var options = {
|
||||
title: '选择部门',
|
||||
width: "380",
|
||||
height: "380",
|
||||
url: url,
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||
if ($.tree.notAllowParents(tree)) {
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<title>用户头像修改</title>
|
||||
<link th:href="@{/ajax/libs/cropbox/cropbox.css}" rel="stylesheet"/>
|
||||
<body class="white-bg">
|
||||
<input name="userId" id="userId" type="hidden" th:value="${user.userId}" />
|
||||
<div class="container">
|
||||
<div class="imageBox">
|
||||
<div class="thumbBox"></div>
|
||||
<div class="spinner" style="display: none">Loading...</div>
|
||||
</div>
|
||||
<div class="action">
|
||||
<div class="new-contentarea tc">
|
||||
<a href="javascript:void(0)" class="upload-img"> <label for="avatar">上传图像</label> </a>
|
||||
<input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
|
||||
</div>
|
||||
<input type="button" id="btnCrop" class="Btnsty_peyton" value="裁切" />
|
||||
<input type="button" id="btnZoomIn" class="Btnsty_peyton" value="+" />
|
||||
<input type="button" id="btnZoomOut" class="Btnsty_peyton" value="-" />
|
||||
<input type="button" id="blobSubmit" class="Btnsty_peyton" value="提交" />
|
||||
</div>
|
||||
<div class="cropped"></div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ajax/libs/cropbox/cropbox.js}"></script>
|
||||
<script type="text/javascript">
|
||||
$(window).load(function() {
|
||||
var avatar = '[[${user.avatar}]]';
|
||||
var options = {
|
||||
thumbBox: '.thumbBox',
|
||||
spinner: '.spinner',
|
||||
imgSrc: $.common.isEmpty(avatar) ? ctx + 'img/profile.jpg' : ctx + 'profile/avatar/' + avatar
|
||||
}
|
||||
var cropper = $('.imageBox').cropbox(options);
|
||||
$('#avatar').on('change',
|
||||
function() {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
options.imgSrc = e.target.result;
|
||||
//根据MIME判断上传的文件是不是图片类型
|
||||
if((options.imgSrc).indexOf("image/")==-1){
|
||||
parent.layer.alert("文件格式错误,请上传图片类型,如:JPG,JEPG,PNG后缀的文件。", {icon: 2,title:"系统提示"});
|
||||
} else {
|
||||
cropper = $('.imageBox').cropbox(options);
|
||||
}
|
||||
}
|
||||
reader.readAsDataURL(this.files[0]);
|
||||
})
|
||||
$('#blobSubmit').on('click', function(){
|
||||
var img = cropper.getBlob();
|
||||
var formdata = new FormData();
|
||||
formdata.append("avatarfile", img);
|
||||
formdata.append("userId", $("#userId").val());
|
||||
$.ajax({
|
||||
url: ctx + "system/user/profile/updateAvatar",
|
||||
data: formdata,
|
||||
type: "post",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(result) {
|
||||
$.operate.saveSuccess(result);
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#btnCrop').on('click', function(){
|
||||
var img = cropper.getDataURL();
|
||||
$('.cropped').html('');
|
||||
$('.cropped').append('<img src="'+img+'" align="absmiddle" style="width:64px;margin-top:4px;border-radius:64px;box-shadow:0px 0px 12px #7E7E7E;" ><p>64px*64px</p>');
|
||||
$('.cropped').append('<img src="'+img+'" align="absmiddle" style="width:128px;margin-top:4px;border-radius:128px;box-shadow:0px 0px 12px #7E7E7E;"><p>128px*128px</p>');
|
||||
$('.cropped').append('<img src="'+img+'" align="absmiddle" style="width:180px;margin-top:4px;border-radius:180px;box-shadow:0px 0px 12px #7E7E7E;"><p>180px*180px</p>');
|
||||
})
|
||||
$('#btnZoomIn').on('click', function(){
|
||||
cropper.zoomIn();
|
||||
})
|
||||
$('#btnZoomOut').on('click', function(){
|
||||
cropper.zoomOut();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-user-edit" th:object="${user}">
|
||||
<input name="userId" type="hidden" th:field="*{userId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">登录名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" th:field="*{loginName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" th:field="*{dept.deptName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="userName" id="userName" th:field="*{userName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email" th:field="*{email}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phonenumber" id="phonenumber" th:field="*{phonenumber}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" id="radio1" th:field="*{sex}" name="sex" value="0">
|
||||
<label for="radio1">男</label>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
<input type="radio" id="radio2" th:field="*{sex}" name="sex" value="1">
|
||||
<label for="radio2">女</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script>
|
||||
$("#form-user-edit").validate({
|
||||
rules:{
|
||||
userName:{
|
||||
required:true,
|
||||
},
|
||||
email:{
|
||||
required:true,
|
||||
email:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkEmailUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"userId": function() {
|
||||
return $("#userId").val();
|
||||
},
|
||||
"email": function() {
|
||||
return $.common.trim($("#email").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function (data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
phonenumber:{
|
||||
required:true,
|
||||
isPhone:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/checkPhoneUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"userId": function() {
|
||||
return $("#userId").val();
|
||||
},
|
||||
"phonenumber": function() {
|
||||
return $.common.trim($("#phonenumber").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function (data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"email": {
|
||||
remote: "Email已经存在"
|
||||
},
|
||||
"phonenumber":{
|
||||
remote: "手机号码已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(ctx + "system/user/profile/update", $('#form-user-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!--360浏览器优先以webkit内核解析-->
|
||||
<title>个人信息</title>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
|
||||
</head>
|
||||
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row animated fadeInRight">
|
||||
<div class="col-sm-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>个人信息</h5>
|
||||
<div class="ibox-tools">
|
||||
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="profile.html#">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="javascript:edit()">修改信息</a></li>
|
||||
<li><a href="javascript:resetPwd()">修改密码</a></li>
|
||||
<li><a href="javascript:avatar()">修改头像</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="contact-box">
|
||||
<div class="col-sm-4">
|
||||
<div class="text-center">
|
||||
<img alt="image" class="img-circle m-t-xs img-responsive" th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{/profile/avatar/} + ${user.avatar}">
|
||||
<div class="m-t-xs font-bold">[[${user.loginIp}]]</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<h3><strong>[[${user.loginName}]]</strong></h3>
|
||||
<p><i class="fa fa-user"></i> [[${user.userName}]] / [[${#strings.defaultString(roleGroup,'无角色')}]]
|
||||
<p><i class="fa fa-phone"></i> [[${user.phonenumber}]]</p>
|
||||
<p><i class="fa fa-group"></i> [[${user.dept?.deptName}]] / [[${#strings.defaultString(postGroup,'无岗位')}]]</p>
|
||||
<p><i class="fa fa-transgender"></i> 性别:[[${user.sex}]]</p>
|
||||
<p><i class="fa fa-envelope-o"></i> [[${user.email}]]</p>
|
||||
<p><i class="fa fa-calendar"></i> [[${#dates.format(user.createTime, 'yyyy-MM-dd HH:mm:ss')}]]</p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div th:include="include::footer"></div>
|
||||
<script>
|
||||
var userId = [[${user.userId}]];
|
||||
/*用户信息-修改*/
|
||||
function edit() {
|
||||
var url = ctx + "system/user/profile/edit/" + userId;
|
||||
$.modal.open("修改用户", url);
|
||||
}
|
||||
/*用户管理-重置密码*/
|
||||
function resetPwd() {
|
||||
var url = ctx + 'system/user/profile/resetPwd/' + userId;
|
||||
$.modal.open("重置密码", url, '800', '500');
|
||||
}
|
||||
/*用户管理-头像*/
|
||||
function avatar() {
|
||||
var url = ctx + 'system/user/profile/avatar/' + userId;
|
||||
$.modal.open("修改头像", url);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-user-resetPwd">
|
||||
<input name="userId" type="hidden" th:value="${user.userId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">登录名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" name="loginName" th:value="${user.loginName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">旧密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="password" name="oldPassword" id="oldPassword">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">新密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="password" name="password" id="password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">再次确认:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="password" name="confirm" id="confirm">
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
|
||||
<script>
|
||||
$("#form-user-resetPwd").validate({
|
||||
rules:{
|
||||
oldPassword:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: ctx + "system/user/profile/checkPassword",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
data: {
|
||||
password: function() {
|
||||
return $("input[name='oldPassword']").val();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
minlength: 5,
|
||||
maxlength: 20
|
||||
},
|
||||
confirm: {
|
||||
required: true,
|
||||
equalTo: "#password"
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
oldPassword: {
|
||||
required: "请输入原密码",
|
||||
remote: "原密码错误"
|
||||
},
|
||||
password: {
|
||||
required: "请输入新密码",
|
||||
minlength: "密码不能小于6个字符",
|
||||
maxlength: "密码不能大于20个字符"
|
||||
},
|
||||
confirm: {
|
||||
required: "请再次输入新密码",
|
||||
equalTo: "两次密码输入不一致"
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-user-resetPwd">
|
||||
<input name="userId" type="hidden" th:value="${user.userId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">登录名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" name="loginName" th:value="${user.loginName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">输入密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="password" name="password" id="password" th:value="${@config.getKey('sys.user.initPassword')}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script type="text/javascript">
|
||||
$("#form-user-resetPwd").validate({
|
||||
rules:{
|
||||
password:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
maxlength: 20
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(ctx + "system/user/resetPwd", $('#form-user-resetPwd').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
217
ruoyi-admin/src/main/resources/templates/system/user/user.html
Normal file
217
ruoyi-admin/src/main/resources/templates/system/user/user.html
Normal file
@@ -0,0 +1,217 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
|
||||
|
||||
<body class="gray-bg">
|
||||
<div class="ui-layout-west">
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-grid"></i> 组织机构
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a type="button" class="btn btn-box-tool menuItem" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>
|
||||
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-content">
|
||||
<div id="tree" class="ztree"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div ui-layout-center">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="user-form">
|
||||
<input type="hidden" id="deptId" name="deptId">
|
||||
<input type="hidden" id="parentId" name="parentId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
登录名称:<input type="text" name="loginName"/>
|
||||
</li>
|
||||
<li>
|
||||
手机号码:<input type="text" name="phonenumber"/>
|
||||
</li>
|
||||
<li>
|
||||
用户状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>创建时间: </label>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:user:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
|
||||
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
|
||||
var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
|
||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||
var prefix = ctx + "system/user";
|
||||
|
||||
$(function() {
|
||||
$('body').layout({ west__size: 185 });
|
||||
queryUserList();
|
||||
queryDeptTree();
|
||||
});
|
||||
|
||||
function queryUserList() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
sortName: "createTime",
|
||||
sortOrder: "desc",
|
||||
modalName: "用户",
|
||||
search: false,
|
||||
showExport: false,
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'userId',
|
||||
title: '用户ID'
|
||||
},
|
||||
{
|
||||
field: 'loginName',
|
||||
title: '登录名称',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'userName',
|
||||
title: '用户名称'
|
||||
},
|
||||
{
|
||||
field: 'dept.deptName',
|
||||
title: '部门'
|
||||
},
|
||||
{
|
||||
field: 'email',
|
||||
title: '邮箱',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'phonenumber',
|
||||
title: '手机'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(datas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + resetPwdFlag + '" href="#" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
}
|
||||
|
||||
function queryDeptTree()
|
||||
{
|
||||
var url = ctx + "system/dept/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
$("#deptId").val(treeNode.id);
|
||||
$("#parentId").val(treeNode.pId);
|
||||
$.table.search();
|
||||
}
|
||||
}
|
||||
|
||||
$('#btnExpand').click(function() {
|
||||
$._tree.expandAll(true);
|
||||
$(this).hide();
|
||||
$('#btnCollapse').show();
|
||||
});
|
||||
|
||||
$('#btnCollapse').click(function() {
|
||||
$._tree.expandAll(false);
|
||||
$(this).hide();
|
||||
$('#btnExpand').show();
|
||||
});
|
||||
|
||||
$('#btnRefresh').click(function() {
|
||||
queryDeptTree();
|
||||
});
|
||||
|
||||
/*用户管理-部门*/
|
||||
function dept() {
|
||||
var url = ctx + "system/dept";
|
||||
createMenuItem(url, "部门管理");
|
||||
}
|
||||
|
||||
/*用户管理-重置密码*/
|
||||
function resetPwd(userId) {
|
||||
var url = prefix + '/resetPwd/' + userId;
|
||||
$.modal.open("重置密码", url, '800', '300');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user