계정정보수정 화면 추가

main
이범준 11 months ago
parent d93f48eae5
commit 77e5c502a5

@ -82,6 +82,22 @@ public class UserController extends cokr.xit.base.user.web.UserController<Manage
return mav;
}
@RequestMapping(name="내 정보 조회",value="/openMyInfo.do")
public ModelAndView openMyInfo() {
ModelAndView mav = new ModelAndView("fims/user/user-info");
DataObject userInfo = userService.getUserInfo(currentUser().getId());
mav.addObject("userInfo", toJson(userInfo));
mav.addObject("allFactionList", factionMapper.selectAllFactionList());
DataObject params = new DataObject().set("currentUser", currentUser());
List<DataObject> ableFactionList = factionMapper.selectAbleFactionList(params);
mav.addObject("ableFactionList", ableFactionList);
return mav;
}
@RequestMapping(name="설정정보 조회",value="/stngInfo.do")
public ModelAndView getStngInfo(String type) {
ModelAndView mav = new ModelAndView("jsonView");

@ -0,0 +1,329 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/resources/image/favicon.ico" />
<!-- Fonts -->
<link rel="stylesheet" href="/resources/font/publicsans/fontface.css" />
<!-- Icons. Uncomment required icon fonts -->
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/boxicons.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/fontawesome.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/flag-icons.css" />
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-icon.css" />
<!-- Core CSS -->
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-core.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/css/theme-default.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/css/docs.css" />
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-core-extend.css" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.css" />
<link rel="stylesheet" href="/resources/css/styles.css" />
<link rel="stylesheet" href="/resources/css/fims/framework/common/common.css"/>
<link rel="stylesheet" href="/resources/lib/fims/framework/jquery-ui/1.13.2/themes/redmond/jquery-ui.css" />
<link rel="stylesheet" href="/resources/lib/fims/framework/datepicker/datepicker.css" />
<title>사용자정보</title>
</head>
<body>
<form id="user-form">
<div class="row g-3 mt-4">
<div class="col-md-6">
<div class="row">
<div class="col-sm-3 text-sm-end">
<label class="col-form-label required">
기관 / 부서
</label>
<br/>
<div class="dropdown">
<button type="button"
class="btn btn-md btn-secondary dropdown-toggle"
data-bs-toggle="dropdown"
>선택</button>
<ul class="dropdown-menu" style="max-height: 300px;overflow-y:auto;">
<c:forEach items="${ableFactionList}" var="item">
<li>
<a class="dropdown-item"
onclick="setFactionCodeValues('${item.INST_CD}','${item.DEPT_CD}')">${item.FACTION_NM}</a>
</li>
</c:forEach>
</ul>
</div>
</div>
<div class="col-sm-9">
<select name="institute" class="form-select" data-map="NSTT_CD"
required title="기관/부서" disabled style="background-image:none;">
<c:forEach items="${allFactionList}" var="item">
<option value="${item.INST_CD}">${item.INST_NM}</option>
</c:forEach>
</select>
<br/>
<select name="deptCode" class="form-select" data-map="DEPT_CD"
required title="기관/부서" disabled style="background-image:none;">
<c:forEach items="${allFactionList}" var="item">
<option value="${item.DEPT_CD}">${item.DEPT_NM}</option>
</c:forEach>
</select>
</div>
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end required" for="account">
계정
</label>
<div class="col-sm-9">
<input name="id" type="hidden" data-map="USER_ID" />
<input name="account" type="text" required data-map="USER_ACNT" class="form-control"
placeholder="사용자 계정" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end required" for="name">
이름
</label>
<div class="col-sm-9">
<input name="name" type="text" required data-map="USER_NM" class="form-control"
placeholder="사용자 이름" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end required" for="password">
비밀번호
</label>
<div class="col-sm-9">
<input name="password" type="password" required class="form-control" placeholder="비밀번호" />
</div>
</div>
</div>
<div class="col-md-6 hidden">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end required" for="confirmPassword">
비밀번호 확인
</label>
<div class="col-sm-9">
<input name="confirmPassword" type="password" required class="form-control"
placeholder="비밀번호 확인" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="birthday">
생년월일
</label>
<div class="col-sm-9">
<input name="birthday" type="text" data-map="BRDT" class="form-control dob-picker"
placeholder="YYYY-MM-DD"/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="gender">성별</label>
<div class="col-sm-9">
<span class="d-inline-flex" style="flex-wrap: wrap;width: 100%;height: 100%;align-content: center;">
<div class="form-check form-check-inline">
<input name="gender" value="M" type="radio" data-map="GENDER" class="form-check-input"/>
<label class="form-check-label" for="male">남자</label>
</div>
<div class="form-check form-check-inline">
<input name="gender" value="F" type="radio" data-map="GENDER" class="form-check-input"/>
<label class="form-check-label" for="female">여자</label>
</div>
</span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end required" for="emailAddress">이메일 주소</label>
<div class="col-sm-9">
<input name="emailAddress" type="email" required data-map="EML_ADRS" class="form-control"
placeholder="이메일 주소" />
</div>
</div>
</div>
<div class="col-md-6 select2-primary">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="mobilePhoneNo">전화번호(무선)</label>
<div class="col-sm-9">
<input name="mobilePhoneNo" type="text" data-map="MBL_TELNO" class="form-control phone-mask"
placeholder="010-0000-0000" />
</div>
</div>
</div>
<div class="col-md-6 select2-primary">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="phoneNo">전화번호(유선)</label>
<div class="col-sm-9">
<input name="phoneNo" type="text" data-map="TELNO" class="form-control phone-mask"
placeholder="000-0000-0000" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="faxNo">팩스</label>
<div class="col-sm-9">
<input name="faxNo" type="text" data-map="FXNO" class="form-control phone-mask"
placeholder="000-0000-0000"/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for=positionName>직위</label>
<div class="col-sm-9">
<input name="positionName" type="text" data-map="POS_NM" class="form-control"
placeholder="직위"/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="status">상태</label>
<div class="col-sm-9">
<input name="status" type="text" data-map="STTS" class="form-control"
placeholder="상태"/>
</div>
</div>
</div>
</div>
<div class="row mt-4 justify-content-end">
<div class="col-md-6">
<div class="row justify-content-end">
<div class="col-sm-3">
<button type="button" onclick="saveUser();" class="btn btn-primary">저장</button>
</div>
</div>
</div>
</div>
</form>
<datalist id="allFactionList">
<c:forEach items="${allFactionList}" var="item">
<option value="${item.FACTION_CD}">${item.FACTION_NM}</option>
</c:forEach>
</datalist>
<script type="text/JavaScript" src="/resources/3rd-party/sneat/libs/jquery/jquery.js" ></script>
<script src="/resources/3rd-party/sneat/libs/popper/popper.js"></script>
<script src="/resources/3rd-party/sneat/js/bootstrap.js"></script>
<script src="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="/resources/3rd-party/sneat/libs/hammer/hammer.js"></script>
<script src="/resources/3rd-party/sneat/libs/i18n/i18n.js"></script>
<script src="/resources/3rd-party/sneat/js/menu.js"></script>
<script src="/resources/3rd-party/sneat/libs/jstree/jstree.js"></script>
<script src="/resources/3rd-party/jstree/jstree-support.js"></script>
<script src="/resources/3rd-party/sneat/libs/chartjs/chartjs.js"></script>
<script src="/resources/lib/fims/framework/jquery-ui/1.13.2/jquery-ui.js"></script>
<script src="/resources/js/base/base.js"></script>
<script src="/resources/js/base/base-fims.js"></script>
<script src="/resources/js/base/dataset.js"></script>
<script src="/resources/js/base/user.js"></script>
<script>
var userFields = new FormFields("#user-form");
var userControl = new UserControl();
userControl.setInfo = obj => {
userFields.set(obj);
let create = isEmpty(obj.USER_ACNT);
$("input[name='account']").prop("readonly", !create);
$("input[type='password']").each(function(){
let password = $(this).prop("required", create);
let div = password.parent().parent().parent();
if (create) {
div.show();
} else
div.hide();
});
$("#user-form").find("input,select")
.change(function() {
let input = $(this),
name = input.attr("data-map"),
val = input.val();
userControl.setValue(name, val);
})
.onEnterPress(saveUser);
document.querySelector("input[name='" + (create ? "account" : "name") + "']").focus();
}
userControl.onModify = (changed) => {
if (["USER_NM", "EML_ADRS", "MBL_TELNO"].filter(e => changed.includes(e)).length < 1)
return;
userControl.dataset.setState();
}
function saveUser() {
if (!$("#user-form").find("input,select").validInputs()) return;
let match = Array.from(document.querySelectorAll("input[type='password']"))
.map(input => input.value)
.reduce((total, current) => total == current);
if (!match) {
dialog.alert({
content:"비밀번호와 비밀번호 확인이 다릅니다.",
onClose:function(){
document.querySelector("input[name='confirmPassword']").focus();
}
});
return;
}
dialog.alert({
content:"현재 사용자 정보를 저장하시겠습니까?",
onOK:() => {
save(userFields.get());
}
});
}
function save(info){
var create = isEmpty(info.id)
ajax.post({
url:!create ? userControl.urls.update : userControl.urls.create,
data:info,
success: (resp) => {
if(resp.saved){
dialog.alert({
content : "저장됐습니다.",
onClose : function() { window.close(); }
});
}
}
});
}
function setFactionCodeValues(institute, deptCode){
$("#user-form [name='institute']").val(institute).trigger("change")
$("#user-form [name='deptCode']").val(deptCode).trigger("change")
}
var userInfo = ${userInfo};
userControl.setInfo(userInfo);
wctx.csrf = window.opener.wctx.csrf;
</script>
</body>
</html>

@ -103,12 +103,18 @@
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<li onclick="fnOpenMyInfo();">
<a class="dropdown-item" href="#">
<i class="bx bx-user me-2"></i>
<span class="align-middle">계정 정보 수정</span>
</a>
</li>
<li onclick="">
<a class="dropdown-item" href="#">
<i class="bx bx-user me-2"></i>
<span class="align-middle">비밀번호 변경</span>
</a>
</li>
<li>
<a class="dropdown-item" href="#">
<i class="bx bx-cog me-2"></i>
@ -172,6 +178,14 @@
</nav>
<c:set var="topScript" scope="request">
function fnOpenMyInfo(){
window.open(
wctx.url("/user/openMyInfo.do")
,"changeMyInfo"
,'top=10, left=10, width=950, height=500'
);
}
function showHelp(){
dialog.alert({
content: '070-4490-74XX',

Loading…
Cancel
Save