feat: 발주기관 GNB에서 지도 열기 기능 추가

main
thkim 2025-02-03 18:06:20 +09:00
parent cb90c10405
commit 5667560c1c
13 changed files with 198 additions and 720 deletions

View File

@ -1,6 +1,7 @@
#src\main\resources\egovframework\egovProps\globals.properties #src\main\resources\egovframework\egovProps\globals.properties
src\main\webapp\com\css\common.v2.0.css src\main\webapp\com\css\common.v2.0.css
src\main\webapp\com\css\common.v2.0.css.map src\main\webapp\com\css\common.v2.0.css.map
src\main\java\geoinfo\main\login\LoginController.java
src\main\webapp\WEB-INF\views\drilling\common\includeTopMenu.jsp src\main\webapp\WEB-INF\views\drilling\common\includeTopMenu.jsp
src\main\webapp\js\home\index.js src\main\webapp\js\home\index.js
src\main\webapp\WEB-INF\views\drilling\home\drilling_index.jsp src\main\webapp\WEB-INF\views\drilling\home\drilling_index.jsp
@ -8,6 +9,7 @@ src\main\webapp\WEB-INF\views\drilling\common\includeTopMenu.jsp
src\main\webapp\WEB-INF\views\drilling\input\drilling_input.jsp src\main\webapp\WEB-INF\views\drilling\input\drilling_input.jsp
src\main\webapp\WEB-INF\views\drilling\inquiry\drilling_inquiry_project.jsp src\main\webapp\WEB-INF\views\drilling\inquiry\drilling_inquiry_project.jsp
src\main\webapp\WEB-INF\views\drilling\inquiry\drilling_inquiry.jsp src\main\webapp\WEB-INF\views\drilling\inquiry\drilling_inquiry.jsp
src\main\webapp\com\js\drilling\drilling-common.js
#src\main\webapp\com\img\drilling\banner_0308_02_1.jpg #src\main\webapp\com\img\drilling\banner_0308_02_1.jpg
#src\main\webapp\com\img\drilling\banner_0410_01_3.jpg #src\main\webapp\com\img\drilling\banner_0410_01_3.jpg
#src\main\webapp\com\img\drilling\banner_0818_01_1.jpg #src\main\webapp\com\img\drilling\banner_0818_01_1.jpg

View File

@ -63,6 +63,9 @@ public class DrillingHomeController {
@Autowired @Autowired
DrillingHomeService drillingHomeService; DrillingHomeService drillingHomeService;
@Autowired
DrillingInquiryService drillingInquiryService;
@RequestMapping(value = "/drilling/index.do") @RequestMapping(value = "/drilling/index.do")
public String drillingInquiry(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws Exception { public String drillingInquiry(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws Exception {
@ -70,6 +73,29 @@ public class DrillingHomeController {
return "isError"; return "isError";
} }
String userId = MyUtil.getStringFromObject( request.getSession().getAttribute("USERID") );
String cls = MyUtil.getStringFromObject( request.getSession().getAttribute("CLS") );
model.addAttribute("userId", userId);
model.addAttribute("cls", cls);
try {
HashMap<String, Object> spGetProjectMbrParams = drillingInquiryService.spGetProjectMbr( request, params, userId );
model.addAttribute("mbr", spGetProjectMbrParams);
} catch (Exception e) {
// TODO Auto-generated catch block
String strTxt =
"---------- BUG REPORTING START ----------" + "\n" +
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
"params:[\n" + params.toString() + "\n]\n" +
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
"---------- BUG REPORTING END ----------" + "\n" +
"";
System.out.println(strTxt);
}
return "/drilling/home/drilling_index"; return "/drilling/home/drilling_index";
} }
} }

View File

@ -301,17 +301,17 @@ public class LoginController {
phoneNo = certResult.get("phoneNo"); phoneNo = certResult.get("phoneNo");
} }
catch(IndexOutOfBoundsException ex){ catch(IndexOutOfBoundsException ex){
rda.addFlashAttribute("msg", "잘못된 접근입니다."); rda.addFlashAttribute("msg", "잘못된 접근입니다. code: 1");
mv.setViewName("redirect:topMenuSelect.do?url=pwsearch"); mv.setViewName("redirect:topMenuSelect.do?url=pwsearch");
return mv; return mv;
} }
catch(NumberFormatException ex){ catch(NumberFormatException ex){
rda.addFlashAttribute("msg", "잘못된 접근입니다."); rda.addFlashAttribute("msg", "잘못된 접근입니다. code: 2");
mv.setViewName("redirect:topMenuSelect.do?url=pwsearch"); mv.setViewName("redirect:topMenuSelect.do?url=pwsearch");
return mv; return mv;
} }
catch(Exception ex){ catch(Exception ex){
rda.addFlashAttribute("msg", "잘못된 접근입니다."); rda.addFlashAttribute("msg", "잘못된 접근입니다. code: 3");
mv.setViewName("redirect:topMenuSelect.do?url=pwsearch"); mv.setViewName("redirect:topMenuSelect.do?url=pwsearch");
return mv; return mv;
} }
@ -596,7 +596,7 @@ public class LoginController {
"userId:[" + "null" + "]\n" + "userId:[" + "null" + "]\n" +
"\n--------------------------------------------------------------\n" "\n--------------------------------------------------------------\n"
); );
mv.setViewName("/"); mv.setViewName("redirect:/index.do?cntyn=0");
} else { } else {
users.remove(userId, request.getSession()); users.remove(userId, request.getSession());
RequestContextHolder.getRequestAttributes().removeAttribute(userId, RequestAttributes.SCOPE_SESSION); RequestContextHolder.getRequestAttributes().removeAttribute(userId, RequestAttributes.SCOPE_SESSION);

View File

@ -1,64 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:if test="${'2' == cls}">
<header>
<!-- 네비게이션 시작 -->
<nav class="navbar navbar-default bootsnav navbar-fixed-top">
<div class="nav-header-bg"></div>
<div class="nav-header-line"></div>
<div class="nav-header-container">
<div class="nav-header-inner">
<!-- 글로벌 시작 -->
<div class="navbar-global-wrapper">
<!-- 로고 시작 -->
<div class="logo-wrapper">
<a href="index.do?cntyn=0" target="_self" onfocus="this.blur()" title="국토지반정보 포털시스템" class="logo">
<img src="${pageContext.request.contextPath}/com/img/common/header/logo_v2.png" class="logo-dark" alt="국토지반정보 포털시스템 로고">
</a>
<span class="page-system-title">프로젝트 등록</span>
</div>
<!-- 로고 끝 -->
<!-- 글로벌 링크 시작 -->
<div class="global-link-wrapper">
<ul>
<!-- 로그인시 시작 -->
<li>
<c:choose>
<c:when test="${cls != 1}">
<span class="username-zone"><span class="username">${userName}(${userId})</span>님이 로그인하셨습니다.</span>
</c:when>
<c:otherwise>
<span class="username-zone"><span class="username">${companyName}(${userId})</span>님이 로그인하셨습니다.</span>
</c:otherwise>
</c:choose>
</li>
<li>
<a href="/logout.do?location=left" onFocus='this.blur()' class="btn top-btn-member logout-btn">로그아웃</a>
</li>
<!-- 로그인시 끝 -->
</ul>
</div>
<!-- 글로벌 링크 끝 -->
</div>
<!-- 글로벌 끝 -->
<!-- 메뉴 시작 -->
<div class="navbar-collapse-wrapper">
<div class="navbar-collapse collapse">
<ul id="accordion" class="nav navbar-nav">
<!-- 1뎁스 메뉴 시작 -->
<li id="projectList" class="dropdown simple-dropdown">
<a href="/drilling/inquiry.do" data-target="navbar-nav-webManage">부산관리청 관리자님 환영합니다</a>
</li>
<!-- 1뎁스 메뉴 끝 -->
</ul>
</div>
</div>
<!-- 메뉴 끝 -->
</div>
</div>
</nav>
<!-- 네비게이션 끝 -->
</header>
</c:if>

View File

@ -11,6 +11,12 @@
</div> </div>
<input type="hidden" id="gl-district" name="gl-district" value="" />
<input type="hidden" id="gm-district" name="gm-district" value="" />
<input type="hidden" id="gs-district" name="gs-district" value="" />
<input type="hidden" id="gf-district" name="gf-district" value="" />
<input type="hidden" id="last-team-name" name="last-team-name" value="" />
<!-- header --------------------------------------------> <!-- header -------------------------------------------->
<header class="drilling-wrap-header"> <header class="drilling-wrap-header">
<div id="header_cont"> <div id="header_cont">
@ -45,7 +51,7 @@
<nav class="gnb" id="gnb"> <nav class="gnb" id="gnb">
<ul> <ul>
<li class=""> <li class="">
<a href="https://www.molit.go.kr/wrocm/USR/WPGE0201/m_34849/DTL.jsp"> <a href='javascript:void(0);' onclick="onClickBtnViewOnMap()">
지도 보기 지도 보기
</a> </a>
<div class="depth2_box" style="display: none;"> <div class="depth2_box" style="display: none;">

View File

@ -57,7 +57,7 @@
<div> <div>
<!-- 메뉴 서비스 --> <!-- 메뉴 서비스 -->
<ul class="wrap_service"> <ul class="wrap_service">
<li class="item01"><a href="https://www.calspia.go.kr/portal/" title="새창"><i>지도 보기</i></a></li> <li class="item01"><a href='javascript:void(0);' onclick="onClickBtnViewOnMap()"><i>지도 보기</i></a></li>
<li class="item02"><a href="/drilling/inquiry-project.do"><i>건설 조회</i></a></li> <li class="item02"><a href="/drilling/inquiry-project.do"><i>건설 조회</i></a></li>
<li class="item03"><a href="/drilling/inquiry.do"><i>입력 조회</i></a></li> <li class="item03"><a href="/drilling/inquiry.do"><i>입력 조회</i></a></li>
<li class="item04"><a href="/drilling/input.do"><i>입력 하기</i></a></li> <li class="item04"><a href="/drilling/input.do"><i>입력 하기</i></a></li>

View File

@ -70,12 +70,12 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content1"> <div class="content1">
<div class="page-top-check"> <div class="page-top-check">
<p class="check-title"><span class="last-team-name" id="last-team-name"></span></p> <p class="check-title"><span class="last-team-name-span" id="last-team-name-span"></span></p>
<ul class="check-category"> <ul class="check-category">
<li id="gl-district"></li> <li id="gl-district-li"></li>
<li id="gm-district"></li> <li id="gm-district-li"></li>
<li id="gs-district"></li> <li id="gs-district-li"></li>
<li id="gf-district"></li> <li id="gf-district-li"></li>
</ul> </ul>
<p class="check-title">기관명이 없을 시, 연락 바랍니다. 연락처: <span class="contact-tel">031-995-0934</span></p> <p class="check-title">기관명이 없을 시, 연락 바랍니다. 연락처: <span class="contact-tel">031-995-0934</span></p>
</div> </div>
@ -105,68 +105,42 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
<script type="text/javascript"> <script type="text/javascript">
var tableId = 0; var tableId = 0;
function setName(inputValue, arrDistrict, index ) {
let xhr; targetId = arrDistrict[index];
if(window.XMLHttpRequest) {
xhr = new XMLHttpRequest(); if( inputValue != null && inputValue !== "" ) {
document.getElementById(targetId).innerText = inputValue;
if( 0 < index ) {
const element = document.getElementById(arrDistrict[index-1]);
toggleClass(element, 'has-arrow');
}
} else { } else {
// IE5, IE6 일때 document.getElementById(targetId).style.display = "none";
xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
} }
function departments() { function callbackDepartments() {
xhr.open('GET', '/drilling/input/departments.do', true);
xhr.setRequestHeader('Content-type', 'application/json');
xhr.onreadystatechange = function() { const glDistrict = document.getElementById('gl-district') .value;
if (xhr.readyState === 4 && xhr.status === 200) { const gmDistrict = document.getElementById('gm-district') .value;
// 요청 성공 시 처리 const gsDistrict = document.getElementById('gs-district') .value;
const obj = JSON.parse(xhr.responseText); const gfDistrict = document.getElementById('gf-district') .value;
console.log('%o', obj); const lastTeamName = document.getElementById('last-team-name') .value;
var lastTeamName = ""; const arrDistrict= ['gl-district-li', 'gm-district-li', 'gs-district-li', 'gf-district-li'];
setName( glDistrict, arrDistrict, 0);
setName( gmDistrict, arrDistrict, 1);
setName( gsDistrict, arrDistrict, 2);
setName( gfDistrict, arrDistrict, 3);
document.getElementById('last-team-name-span').innerText = lastTeamName;
if( obj.data.glDistrict != null ) {
document.getElementById('gl-district').innerText = obj.data.glDistrict;
lastTeamName = obj.data.glDistrict;
} else {
document.getElementById('gl-district').style.display = "none";
}
if( obj.data.gmDistrict != null ) {
document.getElementById('gm-district').innerText = obj.data.gmDistrict;
lastTeamName = obj.data.gmDistrict;
} else {
document.getElementById('gm-district').style.display = "none";
}
if( obj.data.gsDistrict != null ) {
document.getElementById('gs-district').innerText = obj.data.gsDistrict;
lastTeamName = obj.data.gsDistrict;
} else {
document.getElementById('gs-district').style.display = "none";
}
if( obj.data.gfDistrict != null ) {
document.getElementById('gf-district').innerText = obj.data.gfDistrict;
lastTeamName = obj.data.gfDistrict;
} else {
document.getElementById('gf-district').style.display = "none";
} }
// 가장 마지막 이름을 알아내야 함.
document.getElementById('last-team-name').innerText = lastTeamName;
} else if (xhr.readyState === 4) {
// 요청 실패 시 처리
console.error('요청 실패:', xhr.status);
}
};
xhr.send();
}
departments();
function getToday() { function getToday() {
const today = new Date(); const today = new Date();
const year = today.getFullYear(); const year = today.getFullYear();

View File

@ -37,18 +37,8 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
<!-- javascript start--> <!-- javascript start-->
<script type="text/javascript"> <script type="text/javascript">
let xhr;
if(window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else {
// IE5, IE6 일때
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
function trim(str) {
str = String(str);
return str.replace(/^\s+|\s+$/g, '');
}
function onClickBtnSearch() { function onClickBtnSearch() {
const pagingEle = document.getElementById('paging'); const pagingEle = document.getElementById('paging');

View File

@ -37,68 +37,6 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
<!-- javascript start--> <!-- javascript start-->
<script type="text/javascript"> <script type="text/javascript">
let xhr;
if(window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else {
// IE5, IE6 일때
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
function trim(str) {
str = String(str);
return str.replace(/^\s+|\s+$/g, '');
}
function departments() {
if(typeof XMLHttpRequest != 'undefined'){
xhr = new XMLHttpRequest();
}
xhr.open('GET', '/drilling/input/departments.do', true);
xhr.setRequestHeader('Content-type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
// 요청 성공 시 처리
const obj = JSON.parse(xhr.responseText);
console.log('%o', obj);
var lastTeamName = "";
if( obj.data.glDistrict != null ) {
document.getElementById('gl-district').value = obj.data.glDistrict;
lastTeamName = obj.data.glDistrict;
}
if( obj.data.gmDistrict != null ) {
document.getElementById('gm-district').value = obj.data.gmDistrict;
lastTeamName = obj.data.gmDistrict;
}
if( obj.data.gsDistrict != null ) {
document.getElementById('gs-district').value = obj.data.gsDistrict;
lastTeamName = obj.data.gsDistrict;
}
if( obj.data.gfDistrict != null ) {
document.getElementById('gf-district').value = obj.data.gfDistrict;
lastTeamName = obj.data.gfDistrict;
}
// 가장 마지막 이름을 알아내야 함.
document.getElementById('last-team-name').value = lastTeamName;
} else if (xhr.readyState === 4) {
// 요청 실패 시 처리
console.error('요청 실패:', xhr.status);
}
};
xhr.send();
}
function onClickBtnSearch() { function onClickBtnSearch() {
const pagingEle = document.getElementById('paging'); const pagingEle = document.getElementById('paging');
const activeLinks = pagingEle.querySelectorAll('li.is-active a'); const activeLinks = pagingEle.querySelectorAll('li.is-active a');
@ -226,44 +164,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
xhr.send(); xhr.send();
} }
function onClickBtnViewOnMap() {
const projectMasterCompanyName = '${mbr.projectMasterCompanyName}';
let projectCode = '${mbr.ProjectCode}';
let minX = Number('${mbr.v_min_x}');
let minY = Number('${mbr.v_min_y}');
let maxX = Number('${mbr.v_max_x}');
let maxY = Number('${mbr.v_max_y}');
const gl = document.getElementById('gl-district').value;
const gm = document.getElementById('gm-district').value;
const gs = document.getElementById('gs-district').value;
const gf = document.getElementById('gf-district').value;
const lastTeamName = document.getElementById('last-team-name').value;
openMap('${sessionScope.USERID}','${cls}', gl, gm, gs, gf, lastTeamName, projectMasterCompanyName, maxX-minX, maxY-minY);
}
function openMap(userid,cls, gl = null, gm = null, gs = null, gf = null, lastTeamName = null, projectMasterCompanyName = null, positionX= null, positionY= null)
{
win = 'map';
sizeX=window.screen.width;
sizeY=window.screen.height;
let userArea = projectMasterCompanyName;
if( userArea == null ) {
if( userid === 't3-1' ) {
userArea = "충청남도";
} else if( userid === 't3-2' ) {
userArea = "부산광역시";
}
}
var mapWin = window.open("/map/mapMain.do?userArea=" + encodeURIComponent(userArea) + "&gl=" + gl + "&gm=" + gm + "&gs=" + gs + "&gf=" + gf + "&lastTeamName=" + lastTeamName + "&positionX=" + positionX + "&positionY=" + positionY + "#tab_1_1","mapWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + sizeX + ",height=" + sizeY + ",left=0,top=0");
mapWin.focus();
}
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
@ -414,12 +315,6 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
</div> </div>
</div> </div>
<input type="hidden" id="gl-district" name="gl-district" value="" />
<input type="hidden" id="gm-district" name="gm-district" value="" />
<input type="hidden" id="gs-district" name="gs-district" value="" />
<input type="hidden" id="gf-district" name="gf-district" value="" />
<input type="hidden" id="last-team-name" name="last-team-name" value="" />
<!-- 내용 끝 --> <!-- 내용 끝 -->
</div> </div>
</div> </div>

View File

@ -6001,7 +6001,7 @@ ul.faq-q > li textarea {
line-height: 18px; line-height: 18px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.drilling .check-title .last-team-name { .drilling .check-title .last-team-name-span {
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
line-height: 32px; line-height: 32px;
@ -6020,7 +6020,7 @@ ul.faq-q > li textarea {
.drilling .check-category li:last-child::after { .drilling .check-category li:last-child::after {
content: none; content: none;
} }
.drilling .check-category li::after { .drilling .check-category li.has-arrow::after {
content: ""; content: "";
display: inline-block; display: inline-block;
width: 24px; width: 24px;

File diff suppressed because one or more lines are too long

View File

@ -4194,7 +4194,7 @@ ul.faq-q > li textarea {
font-size: 14px; font-size: 14px;
line-height: 18px; line-height: 18px;
margin-bottom: 10px; margin-bottom: 10px;
.last-team-name { .last-team-name-span {
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
line-height: 32px; line-height: 32px;
@ -4213,6 +4213,7 @@ ul.faq-q > li textarea {
content: none; content: none;
} }
} }
&.has-arrow {
&::after { &::after {
content: ""; content: "";
display: inline-block; display: inline-block;
@ -4220,6 +4221,7 @@ ul.faq-q > li textarea {
height: 16px; height: 16px;
background:url(/com/img/common/icon/ico_category_arrow.png) no-repeat 14px 4px; background:url(/com/img/common/icon/ico_category_arrow.png) no-repeat 14px 4px;
} }
}
} }
} }

View File

@ -1,473 +1,120 @@
/* ---------------------------------- let xhr;
if(window.XMLHttpRequest) {
Name : common.js xhr = new XMLHttpRequest();
Categorie : 적응형 레이아웃의 공통기능을 위한 js } else {
Author : 이상혁 // IE5, IE6 일때
Version : v.1.0 xhr = new ActiveXObject("Microsoft.XMLHTTP");
Created : 2020-03-02
Last update : 2020-03-02
-------------------------------------*/
/*==============================================================*/
// browser 체크 시작
/*==============================================================*/
var isMobile = false;
var isiPhoneiPad = false;
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
isMobile = true;
} }
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { function onClickBtnViewOnMap() {
isiPhoneiPad = true; const projectMasterCompanyName = '${mbr.projectMasterCompanyName}';
} let projectCode = '${mbr.ProjectCode}';
/*==============================================================*/
// browser 체크 끝
/*==============================================================*/
/*==============================================================*/ let minX = Number('${mbr.v_min_x}');
// 메뉴 사이즈 및 포지션 체크 시작 let minY = Number('${mbr.v_min_y}');
/*==============================================================*/ let maxX = Number('${mbr.v_max_x}');
function SetMegamenuPosition() { let maxY = Number('${mbr.v_max_y}');
if ($(window).width() > 991) {
setTimeout(function () {
// var totalHeight = $('nav.navbar').outerHeight();
var totalHeight = $('navbar-collapse-wrapper').outerHeight(); // 시추 상단 메뉴 2뎁스 포지션을 구하기 위한 1뎁스 높이값
$('.mega-menu').css({top: totalHeight}); const gl = document.getElementById('gl-district').value;
if ($('.navbar-brand-top').length === 0) const gm = document.getElementById('gm-district').value;
$('.dropdown.simple-dropdown > .dropdown-menu').css({top: totalHeight}); const gs = document.getElementById('gs-district').value;
}, 200); const gf = document.getElementById('gf-district').value;
} else { const lastTeamName = document.getElementById('last-team-name').value;
$('.mega-menu').css('top', '');
$('.dropdown.simple-dropdown > .dropdown-menu').css('top', ''); openMap('${sessionScope.USERID}','${cls}', gl, gm, gs, gf, lastTeamName, projectMasterCompanyName, maxX-minX, maxY-minY);
}
} }
// page title space function openMap(userid,cls, gl = null, gm = null, gs = null, gf = null, lastTeamName = null, projectMasterCompanyName = null, positionX= null, positionY= null)
function setPageTitleSpace() { {
if ($('.navbar').hasClass('navbar-top') || $('nav').hasClass('navbar-fixed-top')) { win = 'map';
if ($('.top-space').length > 0) { sizeX=window.screen.width;
// var top_space_height = $('.navbar').outerHeight(); sizeY=window.screen.height;
var top_space_height = $('.navbar-collapse-wrapper').outerHeight(); // 시추 상단 메뉴 2뎁스 포지션을 구하기 위한 1뎁스 높이값
if ($('.top-header-area').length > 0) { let userArea = projectMasterCompanyName;
top_space_height = top_space_height + $('.top-header-area').outerHeight(); if( userArea == null ) {
} if( userid === 't3-1' ) {
$('.top-space').css('margin-top', top_space_height + "px"); userArea = "충청남도";
} else if( userid === 't3-2' ) {
userArea = "부산광역시";
} }
} }
var mapWin = window.open("/map/mapMain.do?userArea=" + encodeURIComponent(userArea) + "&gl=" + gl + "&gm=" + gm + "&gs=" + gs + "&gf=" + gf + "&lastTeamName=" + lastTeamName + "&positionX=" + positionX + "&positionY=" + positionY + "#tab_1_1","mapWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + sizeX + ",height=" + sizeY + ",left=0,top=0");
mapWin.focus();
} }
/*==============================================================*/
// 메뉴 사이즈 및 포지션 체크 끝
/*==============================================================*/
/*==============================================================*/
// sticky nav 시작
/*==============================================================*/
$(window).on("scroll", init_scroll_navigate);
function init_scroll_navigate() {
var headerHeight = $('nav').outerHeight();
if (!$('header').hasClass('no-sticky')) {
if ($(document).scrollTop() >= headerHeight) {
$('header').addClass('sticky');
} else if ($(document).scrollTop() <= headerHeight) {
$('header').removeClass('sticky');
setTimeout(function () {
setPageTitleSpace();
}, 500);
}
SetMegamenuPosition();
}
function trim(str) {
str = String(str);
return str.replace(/^\s+|\s+$/g, '');
} }
/*==============================================================*/
// sticky nav 끝
/*==============================================================*/
/*==============================================================*/ function departments() {
// 메인비쥬얼 (parallax) 시작
/*==============================================================*/ if(typeof XMLHttpRequest != 'undefined'){
function stellarParallax() { xhr = new XMLHttpRequest();
if ($(window).width() > 1024) {
$.stellar();
} else {
$.stellar('destroy');
$('.parallax').css('background-position', '');
} }
} xhr.open('GET', '/drilling/input/departments.do', true);
/*==============================================================*/ xhr.setRequestHeader('Content-type', 'application/json');
// 메인비쥬얼 (parallax) 끝
/*==============================================================*/
/*==============================================================*/ xhr.onreadystatechange = function() {
// full screen 시작
/*==============================================================*/ if (xhr.readyState === 4 && xhr.status === 200) {
function fullScreenHeight() { // 요청 성공 시 처리
var element = $(".full-screen"); const obj = JSON.parse(xhr.responseText);
var $minheight = $(window).height(); console.log('%o', obj);
element.parents('section').imagesLoaded(function () {
if ($(".top-space .full-screen").length > 0) var lastTeamName = "";
{
var $headerheight = $("header nav.navbar").outerHeight(); if( obj.data.glDistrict != null ) {
$(".top-space .full-screen").css('min-height', $minheight - $headerheight); document.getElementById('gl-district').value = obj.data.glDistrict;
} else { lastTeamName = obj.data.glDistrict;
element.css('min-height', $minheight);
} }
}); if( obj.data.gmDistrict != null ) {
document.getElementById('gm-district').value = obj.data.gmDistrict;
var minwidth = $(window).width(); lastTeamName = obj.data.gmDistrict;
$(".full-screen-width").css('min-width', minwidth); }
} if( obj.data.gsDistrict != null ) {
/*==============================================================*/ document.getElementById('gs-district').value = obj.data.gsDistrict;
// full screen 끝 lastTeamName = obj.data.gsDistrict;
/*==============================================================*/ }
if( obj.data.gfDistrict != null ) {
/*==============================================================*/ document.getElementById('gf-district').value = obj.data.gfDistrict;
// RESIZE 될때마다 함수적용 시작 lastTeamName = obj.data.gfDistrict;
/*==============================================================*/
function SetResizeContent() {
SetMegamenuPosition();
setPageTitleSpace();
stellarParallax();
fullScreenHeight();
}
/*==============================================================*/
// RESIZE 될때마다 함수적용 시작
/*==============================================================*/
/*==============================================================*/
// RESIZE 시작
/*==============================================================*/
$(window).resize(function (event) {
setTimeout(function () {
SetResizeContent();
}, 500);
event.preventDefault();
});
/*==============================================================*/
// RESIZE 끝
/*==============================================================*/
/*==============================================================*/
// READY 시작
/*==============================================================*/
$(document).ready(function () {
SetResizeContent();
// HTML 전용 현재 메뉴에 대한 활성 클래스
var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") + 1);
var $hash = window.location.hash.substring(1);
if ($hash) {
$hash = "#" + $hash;
pgurl = pgurl.replace($hash, "");
} else {
pgurl = pgurl.replace("#", "");
} }
$(".nav li a").each(function () { // 가장 마지막 이름을 알아내야 함.
if ($(this).attr("href") == pgurl || $(this).attr("href") == pgurl + '.html') { document.getElementById('last-team-name').value = lastTeamName;
$(this).parent().addClass("active");
$(this).parents('li.dropdown').addClass("active"); if( typeof callbackDepartments !== 'undefined' ) {
callbackDepartments();
} }
});
$(window).scroll(function () {
if ($(this).scrollTop() > 150)
$('.scroll-top-arrow').fadeIn('slow');
else
$('.scroll-top-arrow').fadeOut('slow');
});
// 페이지 스크롤 top 버튼
$('.scroll-top-arrow').on('click', function () {
$('html, body').animate({ scrollTop: 0 }, 800);
return false;
});
/*============================================================== } else if (xhr.readyState === 4) {
// wow animation - on scroll 시작 // 요청 실패 시 처리
==============================================================*/ console.error('요청 실패:', xhr.status);
var wow = new WOW({ }
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: false,
live: true
});
$(window).imagesLoaded(function () {
wow.init();
});
/*==============================================================
// wow animation - on scroll 끝
==============================================================*/
/*==============================================================*/
// 오른쪽 sidebar 시작
/*==============================================================*/
var menuRight = document.getElementById('cbp-spmenu-s2'),
showRightPush = document.getElementById('showRightPush'),
body = document.body;
if (showRightPush) {
showRightPush.onclick = function () {
classie.toggle(this, 'active');
if (menuRight)
classie.toggle(menuRight, 'cbp-spmenu-open');
}; };
}
var test = document.getElementById('close-pushmenu'); xhr.send();
if (test) { }
test.onclick = function () {
classie.toggle(this, 'active');
if (menuRight)
classie.toggle(menuRight, 'cbp-spmenu-open');
};
}
/*==============================================================*/
// 오른쪽 sidebar 끝
/*==============================================================*/
/*==============================================================*/
// magnificPopup 시작
/*==============================================================*/
function ScrollStop() {
return false;
}
function ScrollStart() { function toggleClass(element, className) {
return true; if (element.className) {
} if (element.className.indexOf(className) >= 0) {
element.className = element.className.replace(className, '').trim();
$('.header-search-form').magnificPopup({
mainClass: 'mfp-fade',
closeOnBgClick: true,
preloader: false,
fixedContentPos: false,
closeBtnInside: false,
callbacks: {
open: function () {
setTimeout(function () {
$('.search-input').focus();
}, 500);
$('#search-header').parent().addClass('search-popup');
if (!isMobile) {
$('body').addClass('overflow-hidden');
} else { } else {
$('body, html').on('touchmove', function (e) { element.className += ' ' + className;
e.preventDefault();
});
} }
},
close: function () {
if (!isMobile) {
$('body').removeClass('overflow-hidden');
$('#search-header input[type=text]').each(function (index) {
if (index == 0) {
$(this).val('');
$("#search-header").find("input:eq(" + index + ")").css({ "border": "none", "border-bottom": "2px solid rgba(255,255,255,0.5)" });
}
});
document.onmousewheel = ScrollStart;
} else { } else {
$('body, html').unbind('touchmove'); element.className = className;
} }
} }
}
});
$('.header-menu-all').magnificPopup({ document.addEventListener("DOMContentLoaded", function(event) {
mainClass: 'mfp-fade', departments();
closeOnBgClick: true,
preloader: false,
fixedContentPos: false,
closeBtnInside: false,
callbacks: {
open: function () {
$('#menu-all').parent().addClass('menu-all-popup-content');
if (!isMobile) {
$('body').addClass('overflow-hidden menu-all-popup-wrapper');
} else {
$('body, html').on('touchmove', function (e) {
e.preventDefault();
});
}
},
close: function () {
if (!isMobile) {
$('body').removeClass('overflow-hidden menu-all-popup-wrapper');
document.onmousewheel = ScrollStart;
} else {
$('body, html').unbind('touchmove');
}
}
}
});
$('.login-btn').magnificPopup({
mainClass: 'mfp-fade',
closeOnBgClick: false,
preloader: false,
fixedContentPos: false,
closeBtnInside: true,
showCloseBtn: true,
callbacks: {
open: function () {
var accountTypeWrapperEle = document.getElementById("account-type-wrapper");
accountTypeWrapperEle.style.display="block";
var signinWrapperEle = document.getElementById("signin-wrapper");
signinWrapperEle.style.display="none";
var signInPrefix = document.getElementById("sign-in-prefix");
signInPrefix.innerHTML = '';
// 로그인 팝업 뒤로가기 버튼
var mfpBackButton = document.getElementById("mfp-back");
mfpBackButton.style.display = "none";
$('#login').parent().addClass('login-popup-content');
if (!isMobile) {
$('body').addClass('overflow-hidden login-popup-wrapper');
} else {
$('body, html').on('touchmove', function (e) {
e.preventDefault();
});
}
},
close: function () {
if (!isMobile) {
$('body').removeClass('overflow-hidden login-popup-wrapper');
document.onmousewheel = ScrollStart;
} else {
$('body, html').unbind('touchmove');
}
}
}
});
$('.temp-password-btn').magnificPopup({
mainClass: 'mfp-fade',
closeOnBgClick: true,
preloader: false,
fixedContentPos: false,
closeBtnInside: false,
callbacks: {
open: function () {
$('#tempPassword').parent().addClass('temp-password-popup-content');
if (!isMobile) {
$('body').addClass('overflow-hidden temp-password-popup-wrapper');
} else {
$('body, html').on('touchmove', function (e) {
e.preventDefault();
});
}
},
close: function () {
if (!isMobile) {
$('body').removeClass('overflow-hidden temp-password-popup-wrapper');
document.onmousewheel = ScrollStart;
} else {
$('body, html').unbind('touchmove');
}
}
}
});
$('.status-btn').magnificPopup({
mainClass: 'mfp-fade',
closeOnBgClick: true,
preloader: false,
fixedContentPos: false,
closeBtnInside: false,
callbacks: {
open: function () {
$('#status-id').parent().addClass('status-popup-content');
if (!isMobile) {
$('body').addClass('overflow-hidden status-popup-wrapper');
} else {
$('body, html').on('touchmove', function (e) {
e.preventDefault();
});
}
},
close: function () {
if (!isMobile) {
$('body').removeClass('overflow-hidden status-popup-wrapper');
document.onmousewheel = ScrollStart;
} else {
$('body, html').unbind('touchmove');
}
}
}
});
$('.mfp-popup-close').click(function() {
$.magnificPopup.close();
});
/*==============================================================*/
// magnificPopup 끝
/*==============================================================*/
}); });
/*==============================================================*/
// READY 끝
/*==============================================================*/
/*==============================================================*/
// Page Load 시작
/*==============================================================*/
$(window).load(function () {
var hash = window.location.hash.substr(1);
if (hash != "") {
setTimeout(function () {
$(window).imagesLoaded(function () {
var scrollAnimationTime = 1200,
scrollAnimation = 'easeInOutExpo';
var target = '#' + hash;
if ($(target).length > 0) {
$('html, body').stop()
.animate({
'scrollTop': $(target).offset().top
}, scrollAnimationTime, scrollAnimation, function () {
window.location.hash = target;
});
}
});
}, 500);
}
// 메인에서만 카운트
$('.main .timer').countTo({
//from: 50,
//to: 2500,
//speed: 1000,
refreshInterval: 50,
formatter: function (value, options) {
return value.toFixed(0).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); // 숫자 3자리 마다 콤마
},
onUpdate: function (value) {
console.debug(this);
},
onComplete: function (value) {
console.debug(this);
}
});
});
/*==============================================================*/
// Page Load 끝
/*==============================================================*/
/*==============================================================*/
// 커스텀 시작
/*==============================================================*/
// 메뉴 가로사이즈 제한시 position:fixed 가로 스크롤
$(window).scroll(function() {
$('.navbar-fixed-top').css({left: 0 - $(this).scrollLeft()});
});
/*==============================================================*/
// 커스텀 끝
/*==============================================================*/