|
|
|
@ -39,14 +39,8 @@
|
|
|
|
|
<div class="modal-dialog modal-sm" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-body" style="min-height:10em; min-width:30%;">
|
|
|
|
|
<span class="row g-3" style="display: flex;flex-direction:column">
|
|
|
|
|
<span id="selectTaskButtons" class="row g-3" style="display: flex;flex-direction:column">
|
|
|
|
|
<div style="text-align:center" class="h3 fw-bold">업무를 선택하세요.</div>
|
|
|
|
|
<button type="button" class="btn btn-xl btn-primary">주정차</button>
|
|
|
|
|
<button type="button" class="btn btn-xl btn-primary">전용차로</button>
|
|
|
|
|
<button type="button" class="btn btn-xl btn-primary">장애인</button>
|
|
|
|
|
<button type="button" class="btn btn-xl btn-primary">전기차</button>
|
|
|
|
|
<button type="button" class="btn btn-xl btn-primary">밤샘주차</button>
|
|
|
|
|
<button type="button" class="btn btn-xl btn-primary">미세먼지</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -72,15 +66,9 @@
|
|
|
|
|
pageObject.childReq = [];
|
|
|
|
|
pageObject.parentRes = [];
|
|
|
|
|
|
|
|
|
|
var ALL_TASK = {
|
|
|
|
|
"PVS" : "주정차위반",
|
|
|
|
|
"BPV" : "전용차로위반",
|
|
|
|
|
"DPV" : "장애인전용",
|
|
|
|
|
"ECA" : "전기차주차",
|
|
|
|
|
"TPV" : "밤샘주차위반",
|
|
|
|
|
"DVS" : "미세먼지"
|
|
|
|
|
};
|
|
|
|
|
var ALL_TASK = {};
|
|
|
|
|
var MY_INFO = {};
|
|
|
|
|
var PARAM_TASK = "${param.taskSeCd}";
|
|
|
|
|
|
|
|
|
|
function getBrowserName() {
|
|
|
|
|
var agent = navigator.userAgent.toUpperCase();
|
|
|
|
@ -112,6 +100,74 @@
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function fnGetAllTask(){
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "get",
|
|
|
|
|
url: wctx.url("/code/getAllTaskSeCd.do"),
|
|
|
|
|
data: {},
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function(resp, textStatus, jqXHR) {
|
|
|
|
|
ALL_TASK = resp.allTask;
|
|
|
|
|
resolve({resp, textStatus, jqXHR});
|
|
|
|
|
},
|
|
|
|
|
error: function(jqXHR, textStatus, error) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
async function fnGetMyInfo(){
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "get",
|
|
|
|
|
url: wctx.url("/user/myInfo.do"),
|
|
|
|
|
data: {},
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function(resp, textStatus, jqXHR) {
|
|
|
|
|
MY_INFO = resp.myInfo;
|
|
|
|
|
resolve({resp, textStatus, jqXHR});
|
|
|
|
|
},
|
|
|
|
|
error: function(jqXHR, textStatus, error) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function fnSelectDefaultTask(taskSeCd){
|
|
|
|
|
ajax.get({
|
|
|
|
|
url : wctx.url("/user/saveDefaultTask.do"),
|
|
|
|
|
data : {
|
|
|
|
|
"taskSeCd" : taskSeCd
|
|
|
|
|
},
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
if(resp.saved){
|
|
|
|
|
$("#selectTaskModal").modal("hide");
|
|
|
|
|
initIndexPage(PARAM_TASK, taskSeCd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initIndexPage(paramTask, userDefaultTask){
|
|
|
|
|
|
|
|
|
|
if(paramTask != "" || $("#layout-navbar").find("input[name='taskSeCd'][value='"+paramTask+"']").length > 0){
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd'][value='"+paramTask+"']").prop("checked", true);
|
|
|
|
|
} else if(userDefaultTask != "" || $("#layout-navbar").find("input[name='taskSeCd'][value='"+userDefaultTask+"']").length > 0){
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd'][value='"+userDefaultTask+"']").prop("checked", true);
|
|
|
|
|
} else {
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd']").eq(0).prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//좌측상단제목
|
|
|
|
|
var checkedId = $("#layout-navbar input[name='taskSeCd']:checked")[0].id;
|
|
|
|
|
var checkedText = $("label[for='"+checkedId+"']").text();
|
|
|
|
|
$("#home").html("과태료통합관리시스템<br/>("+checkedText+")");
|
|
|
|
|
|
|
|
|
|
//대시보드 로드
|
|
|
|
|
${dashboardScript}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
${functions}
|
|
|
|
|
|
|
|
|
|
${topScript}
|
|
|
|
@ -121,86 +177,79 @@
|
|
|
|
|
$(function(){
|
|
|
|
|
${onload}
|
|
|
|
|
|
|
|
|
|
ajax.get({
|
|
|
|
|
url:wctx.url("/user/myInfo.do"),
|
|
|
|
|
data : {},
|
|
|
|
|
success : resp => {
|
|
|
|
|
|
|
|
|
|
MY_INFO = resp.myInfo;
|
|
|
|
|
|
|
|
|
|
var msg = "";
|
|
|
|
|
var available = true;
|
|
|
|
|
|
|
|
|
|
if(MY_INFO.user.status == "A" || MY_INFO.user.status == "D" || MY_INFO.user.locked == "Y"){
|
|
|
|
|
|
|
|
|
|
if(MY_INFO.user.status == "A"){
|
|
|
|
|
msg = "계정이 미승인 상태입니다.";
|
|
|
|
|
} else if(MY_INFO.user.status == "D"){
|
|
|
|
|
msg = "삭제된 계정입니다.";
|
|
|
|
|
} else if(MY_INFO.user.locked == "Y"){
|
|
|
|
|
msg = "잠금처리된 계정입니다.";
|
|
|
|
|
}
|
|
|
|
|
available = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!(MY_INFO.info.isAdmin) && !(MY_INFO.info.hasTaskAuth)){
|
|
|
|
|
msg = "계정에 부여된 업무권한이 없습니다.";
|
|
|
|
|
available = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(msg != ""){
|
|
|
|
|
alert(msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//로그아웃
|
|
|
|
|
if(!available){
|
|
|
|
|
var form = $("<form action=\"/logout.do\", method=\"POST\">");
|
|
|
|
|
$("<input name=\"${_csrf.parameterName}\" value=\"${_csrf.token}\" type=\"hidden\">").appendTo(form);
|
|
|
|
|
form.appendTo("body").submit();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//사용자별 선택가능한 업무 라디오버튼 렌더링
|
|
|
|
|
for(var i=0; i < MY_INFO.info.taskForUser.length; i++){
|
|
|
|
|
var taskCd = MY_INFO.info.taskForUser[i];
|
|
|
|
|
var taskNm = ALL_TASK[taskCd];
|
|
|
|
|
|
|
|
|
|
var radio = "";
|
|
|
|
|
radio += "<span>";
|
|
|
|
|
radio += "<input type='radio' id='taskSeCd"+(i+1)+"--top' name='taskSeCd' value='"+taskCd+"' title='"+taskNm+"' />";
|
|
|
|
|
radio += "<label for='taskSeCd"+(i+1)+"--top'>"+taskNm+"</label>";
|
|
|
|
|
radio += "</span>";
|
|
|
|
|
$("#taskSeCd--Top").append(radio);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//업무선택 모달 다이얼로그
|
|
|
|
|
if(MY_INFO.info.defaultTask == null || MY_INFO.info.defaultTask == ""){
|
|
|
|
|
//$("#selectTaskModal").modal("show");
|
|
|
|
|
//return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//업무 체크
|
|
|
|
|
if("${param.taskSeCd}" == "" || $("#layout-navbar").find("input[name='taskSeCd'][value='${param.taskSeCd}']").length == 0){
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd'][value='DPV']").prop("checked", true);
|
|
|
|
|
} else {
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd'][value='${param.taskSeCd}']").prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd']").on("click", function(){
|
|
|
|
|
$("#userNav--top").click();
|
|
|
|
|
window.open(wctx.url("/")+"?taskSeCd="+this.value, "_blank", "");
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//좌측상단제목
|
|
|
|
|
var checkedId = $("#layout-navbar input[name='taskSeCd']:checked")[0].id;
|
|
|
|
|
var checkedText = $("label[for='"+checkedId+"']").text();
|
|
|
|
|
$("#home").html("과태료통합관리시스템<br/>("+checkedText+")");
|
|
|
|
|
|
|
|
|
|
//대시보드 로드
|
|
|
|
|
${dashboardScript}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
fnGetAllTask()
|
|
|
|
|
.then(() => {
|
|
|
|
|
return fnGetMyInfo();
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
|
|
var msg = "";
|
|
|
|
|
var available = true;
|
|
|
|
|
|
|
|
|
|
if(MY_INFO.user.status == "A" || MY_INFO.user.status == "D" || MY_INFO.user.locked == "Y"){
|
|
|
|
|
|
|
|
|
|
if(MY_INFO.user.status == "A"){
|
|
|
|
|
msg = "계정이 미승인 상태입니다.";
|
|
|
|
|
} else if(MY_INFO.user.status == "D"){
|
|
|
|
|
msg = "삭제된 계정입니다.";
|
|
|
|
|
} else if(MY_INFO.user.locked == "Y"){
|
|
|
|
|
msg = "잠금처리된 계정입니다.";
|
|
|
|
|
}
|
|
|
|
|
available = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!(MY_INFO.info.isAdmin) && !(MY_INFO.info.hasTaskAuth)){
|
|
|
|
|
msg = "계정에 부여된 업무권한이 없습니다.";
|
|
|
|
|
available = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(msg != ""){
|
|
|
|
|
alert(msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//로그아웃
|
|
|
|
|
if(!available){
|
|
|
|
|
var form = $("<form action=\"/logout.do\", method=\"POST\">");
|
|
|
|
|
$("<input name=\"${_csrf.parameterName}\" value=\"${_csrf.token}\" type=\"hidden\">").appendTo(form);
|
|
|
|
|
form.appendTo("body").submit();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//사용자별 선택가능한 업무 렌더링
|
|
|
|
|
for(var i=0; i < MY_INFO.info.taskForUser.length; i++){
|
|
|
|
|
var taskCd = MY_INFO.info.taskForUser[i];
|
|
|
|
|
var taskNm = ALL_TASK[taskCd];
|
|
|
|
|
|
|
|
|
|
var radio = "";
|
|
|
|
|
radio += "<span>";
|
|
|
|
|
radio += "<input type='radio' id='taskSeCd"+(i+1)+"--top' name='taskSeCd' value='"+taskCd+"' title='"+taskNm+"' />";
|
|
|
|
|
radio += "<label for='taskSeCd"+(i+1)+"--top'>"+taskNm+"</label>";
|
|
|
|
|
radio += "</span>";
|
|
|
|
|
$("#taskSeCd--Top").append(radio);
|
|
|
|
|
|
|
|
|
|
var button = `<button type="button" class="btn btn-xl btn-primary" onclick="fnSelectDefaultTask('`
|
|
|
|
|
+taskCd
|
|
|
|
|
+`');">`
|
|
|
|
|
+taskNm
|
|
|
|
|
+`</button>`;
|
|
|
|
|
$("#selectTaskButtons").append(button);
|
|
|
|
|
}
|
|
|
|
|
$("#layout-navbar input[name='taskSeCd']").on("click", function(){
|
|
|
|
|
$("#userNav--top").click();
|
|
|
|
|
window.open(wctx.url("/")+"?taskSeCd="+this.value, "_blank", "");
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//업무선택 모달 다이얼로그
|
|
|
|
|
if(MY_INFO.info.defaultTask == null || MY_INFO.info.defaultTask == ""){
|
|
|
|
|
$("#selectTaskModal").modal("show");
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
initIndexPage(PARAM_TASK, MY_INFO.info.defaultTask);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|