Files
RuoYi/ruoyi-admin/src/main/resources/templates/system/user/profile/edit.html

122 lines
3.9 KiB
HTML
Raw Normal View History

2018-07-09 08:44:52 +08:00
<!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">
2018-08-27 09:00:36 +08:00
<div class="radio-box">
2018-07-09 08:44:52 +08:00
<input type="radio" id="radio1" th:field="*{sex}" name="sex" value="0">
<label for="radio1"></label>
</div>
2018-08-27 09:00:36 +08:00
<div class="radio-box">
2018-07-09 08:44:52 +08:00
<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() {
2018-08-23 17:06:31 +08:00
return $("#userId").val();
2018-07-09 08:44:52 +08:00
},
"email": function() {
2018-08-23 17:06:31 +08:00
return $.common.trim($("#email").val());
2018-07-09 08:44:52 +08:00
}
},
dataFilter: function (data, type) {
2018-08-23 17:06:31 +08:00
return $.validate.unique(data);
2018-07-09 08:44:52 +08:00
}
}
},
phonenumber:{
required:true,
isPhone:true,
remote: {
url: ctx + "system/user/checkPhoneUnique",
type: "post",
dataType: "json",
data: {
"userId": function() {
2018-08-23 17:06:31 +08:00
return $("#userId").val();
2018-07-09 08:44:52 +08:00
},
"phonenumber": function() {
2018-08-23 17:06:31 +08:00
return $.common.trim($("#phonenumber").val());
2018-07-09 08:44:52 +08:00
}
},
dataFilter: function (data, type) {
2018-08-23 17:06:31 +08:00
return $.validate.unique(data);
2018-07-09 08:44:52 +08:00
}
}
},
},
messages: {
"email": {
remote: "Email已经存在"
},
"phonenumber":{
remote: "手机号码已经存在"
}
2019-02-25 13:19:06 +08:00
},
focusCleanup: true
2018-07-09 08:44:52 +08:00
});
2018-10-03 21:44:14 +08:00
function submitHandler() {
2018-10-03 23:11:09 +08:00
if ($.validate.form()) {
2018-10-03 21:44:14 +08:00
$.operate.save(ctx + "system/user/profile/update", $('#form-user-edit').serialize());
}
}
2018-07-09 08:44:52 +08:00
</script>
</body>
</html>