로그인 기관 표시 수정

main
이범준 11 months ago
parent e23d643603
commit c2e8cdc144

@ -68,6 +68,14 @@ public class MainController extends AbstractController {
.addObject("duplicate", user != null);
}
@RequestMapping(name="기관 목록", value="/error/instList.do")
public ModelAndView instList(String account, String institute) {
List<DataObject> instList = factionMapper.selectAllInstList();
return new ModelAndView("jsonView")
.addObject("instList", instList);
}
@GetMapping(name="홈", value={"/", "/index.do"})
public ModelAndView mainPage() {
return new ModelAndView("index");

@ -39,4 +39,10 @@ public interface FactionMapper extends AbstractMapper {
* @return ,,,,,
*/
DataObject selectFactionInfoOfUser(String userId);
/** .<br />
* @param
* @return
*/
List<DataObject> selectAllInstList();
}

@ -57,9 +57,6 @@ LEFT OUTER JOIN TB_DEPT B ON (A.INST_CD = B.INST_CD)
</otherwise>
</choose>
</select>
<select id="selectFactionInfoOfUser" parameterType="string" resultType="dataobject">
@ -76,4 +73,12 @@ SELECT S.SGG_CD
WHERE U.USER_ID = #{userId}
</select>
<select id="selectAllInstList" parameterType="string" resultType="dataobject">
/* 모든 기관 조회(factionMapper.selectAllInstList) */
SELECT INST_CD
, INST_NM
FROM TB_SGG
WHERE USE_YN = 'Y'
</select>
</mapper>

@ -54,9 +54,6 @@
<div class="input-group">
<select id="institute" name="institute" class="form-select mb-2"
style="height:45px;width:100%;max-width:560px;">
<option value="4060000">파주시</option>
<option value="4050000">용인시</option>
<option value="3910000">평택시</option>
<option value="default">기본</option>
</select>
</div>
@ -90,15 +87,13 @@
<template id="selectInstDialogTemplate">
<select class="form-select form-control-sm" id="selectInst">
<option value="">선택</option>
<option value="4060000">파주시</option>
<option value="4050000">용인시</option>
<option value="3910000">평택시</option>
</select>
</template>
<jsp:include page="/WEB-INF/jsp/include/tail.jsp" />
<script type="text/javascript">
var INST_LIST = [];
${functions}
@ -132,12 +127,6 @@ function login() {
});
}
$(function(){
$("#formAuthentication input").onEnterPress(login);
if ($("#userId").val())
$("#password").focus();
});
/**
* 회원가입 팝업
*/
@ -147,7 +136,13 @@ $(function(){
title : "기관 선택",
content : document.getElementById("selectInstDialogTemplate").innerHTML,
size : "sm",
init : () => {},
init : () => {
var options = "";
for(var i=0; i < INST_LIST.length; i++){
options += "<option value='"+INST_LIST[i].INST_CD+"'>"+INST_LIST[i].INST_NM+"</option>";
}
$("#selectInst").append(options);
},
onOK : () => {
if($("#selectInst").val() == ""){
alert("기관을 선택하세요.");
@ -179,6 +174,27 @@ $(function(){
}
$(function(){
$("#formAuthentication input").onEnterPress(login);
if ($("#userId").val())
$("#password").focus();
ajax.get({
url : wctx.url("/error/instList.do"),
data : { },
success : (resp) => {
INST_LIST = resp.instList;
var options = "";
for(var i=0; i < INST_LIST.length; i++){
options += "<option value='"+INST_LIST[i].INST_CD+"'>"+INST_LIST[i].INST_NM+"</option>";
}
$("#institute").append(options);
$("#institute").val("4060000");
}
});
});
</script>
</body>
</html>

Loading…
Cancel
Save