Merge pull request 'kurt/kurt' (#25) from kurt/kurt into dev
Reviewed-on: http://211.119.124.110:3000/cjm/clean-parking/pulls/25pull/27/head
commit
e283a23656
@ -0,0 +1,50 @@
|
|||||||
|
package go.kr.project.biz.post.notice.status.controller;
|
||||||
|
|
||||||
|
import egovframework.constant.TilesConstants;
|
||||||
|
import egovframework.util.ApiResponseUtil;
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.dto.PreNoticeSendTargetDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.service.PreNoticeSendTargetService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class NoticeStatusController {
|
||||||
|
|
||||||
|
private final PreNoticeSendTargetService preNoticeSendTargetService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 발송/반송 > 고지서 발송현황 목록 페이지
|
||||||
|
* @return 뷰 경로
|
||||||
|
*/
|
||||||
|
@GetMapping("post/notice/status/noticeStatus.do")
|
||||||
|
public String minwonInitView() {
|
||||||
|
|
||||||
|
return "biz/post/notice/status/noticeStatus" + TilesConstants.BASE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("post/notice/status/noticeStatus.ajax")
|
||||||
|
public ResponseEntity<?> getPreNoticeSendTargetistAjax(@ModelAttribute MinwonInitDto.Request.SearchMinwonInitList dto) {
|
||||||
|
|
||||||
|
// 총 게시물 수 조회
|
||||||
|
int totalCount = 0;
|
||||||
|
dto.setTotalCount(totalCount);
|
||||||
|
|
||||||
|
// 페이징 처리를 위한 설정
|
||||||
|
dto.setPagingYn("N");
|
||||||
|
|
||||||
|
// 리스트 조회
|
||||||
|
List<PreNoticeSendTargetDto.Response.PreNoticeSendTarget> result = preNoticeSendTargetService.findPreNoticeSendTarget();
|
||||||
|
|
||||||
|
return ApiResponseUtil.successWithGrid(result, dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package go.kr.project.biz.post.notice.status.service;
|
||||||
|
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface NoticeStatusService {
|
||||||
|
List<MinwonInitDto.Response.InitAnswers> findPreNoticeSendTarget();
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package go.kr.project.biz.post.notice.status.service.impl;
|
||||||
|
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import go.kr.project.biz.post.notice.status.service.NoticeStatusService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class NoticsStatusServiceImpl implements NoticeStatusService {
|
||||||
|
@Override
|
||||||
|
public List<MinwonInitDto.Response.InitAnswers> findPreNoticeSendTarget() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.sendTarget.controller;
|
||||||
|
|
||||||
|
import egovframework.constant.TilesConstants;
|
||||||
|
import egovframework.util.ApiResponseUtil;
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.dto.PreNoticeSendTargetDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.service.PreNoticeSendTargetService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PreNoticeSendTargetController {
|
||||||
|
|
||||||
|
private final PreNoticeSendTargetService preNoticeSendTargetService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 발송/반송 > 사전통보 > 사전통보 대상 목록 페이지
|
||||||
|
* @return 뷰 경로
|
||||||
|
*/
|
||||||
|
@GetMapping("post/preNotice/sendTarget/sendTarget.do")
|
||||||
|
public String preNoticeSendTargetView() {
|
||||||
|
|
||||||
|
return "biz/post/preNotice/sendTarget/preNoticeSendTarget" + TilesConstants.BASE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/post/preNotice/sendTarget/sendTargetList.ajax")
|
||||||
|
public ResponseEntity<?> getPreNoticeSendTargetistAjax(@ModelAttribute PreNoticeSendTargetDto.Request.Search dto) {
|
||||||
|
|
||||||
|
// 총 게시물 수 조회
|
||||||
|
int totalCount = 0;
|
||||||
|
dto.setTotalCount(totalCount);
|
||||||
|
|
||||||
|
// 페이징 처리를 위한 설정
|
||||||
|
dto.setPagingYn("N");
|
||||||
|
|
||||||
|
// 리스트 조회
|
||||||
|
List<PreNoticeSendTargetDto.Response.PreNoticeSendTarget> result = preNoticeSendTargetService.findPreNoticeSendTarget();
|
||||||
|
|
||||||
|
return ApiResponseUtil.successWithGrid(result, dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.sendTarget.dto;
|
||||||
|
|
||||||
|
import go.kr.project.domain.entity.CpAnswer;
|
||||||
|
import go.kr.project.domain.entity.CpMain;
|
||||||
|
import go.kr.project.domain.entity.CpOwner;
|
||||||
|
import go.kr.project.system.common.model.PagingVO;
|
||||||
|
import go.kr.project.vo.CpAnswerVO;
|
||||||
|
import go.kr.project.vo.CpMainVO;
|
||||||
|
import go.kr.project.vo.CpOwnerVO;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
public class PreNoticeSendTargetDto {
|
||||||
|
|
||||||
|
public static class Request {
|
||||||
|
|
||||||
|
public static class Search extends PagingVO {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Response {
|
||||||
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public static class PreNoticeSendTargetEntities{
|
||||||
|
private CpMain cpMain;
|
||||||
|
private CpAnswer cpAnswer;
|
||||||
|
private CpOwner cpOwner;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Builder
|
||||||
|
public static class PreNoticeSendTarget {
|
||||||
|
private CpMainVO cpMain;
|
||||||
|
private CpAnswerVO cpAnswer;
|
||||||
|
private CpOwnerVO cpOwner;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.sendTarget.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PreNoticeSendTargetMapper {
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.sendTarget.repository;
|
||||||
|
|
||||||
|
import com.querydsl.core.types.Projections;
|
||||||
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.dto.PreNoticeSendTargetDto;
|
||||||
|
import go.kr.project.vo.mapper.EntityVoMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static go.kr.project.domain.entity.QCpAnswer.cpAnswer;
|
||||||
|
import static go.kr.project.domain.entity.QCpMain.cpMain;
|
||||||
|
import static go.kr.project.domain.entity.QCpOwner.cpOwner;
|
||||||
|
import static go.kr.project.domain.entity.QCpUser.cpUser;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PreNoticeSendTargetQueryDslRepository {
|
||||||
|
|
||||||
|
private final JPAQueryFactory queryFactory;
|
||||||
|
|
||||||
|
public List<PreNoticeSendTargetDto.Response.PreNoticeSendTargetEntities> findPreNoticeSendTarget() {
|
||||||
|
|
||||||
|
String aaa = null;
|
||||||
|
String bbb = null;
|
||||||
|
String ccc = null;
|
||||||
|
|
||||||
|
List<PreNoticeSendTargetDto.Response.PreNoticeSendTargetEntities> result = queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.fields(
|
||||||
|
PreNoticeSendTargetDto.Response.PreNoticeSendTargetEntities.class,
|
||||||
|
cpMain,
|
||||||
|
cpAnswer,
|
||||||
|
cpOwner
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(cpMain)
|
||||||
|
.leftJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||||
|
.leftJoin(cpUser).on(cpAnswer.asReuser.eq(cpUser.umCode))
|
||||||
|
.leftJoin(cpOwner).on(cpMain.mmOmcode.eq(cpOwner.omCode))
|
||||||
|
.where(
|
||||||
|
cpMain.mmSggcode.eq(aaa),
|
||||||
|
cpMain.mmState.eq(bbb),
|
||||||
|
cpAnswer.asState.ne("0").or(cpAnswer.asState.isNull()),
|
||||||
|
cpMain.mmLawgb.eq(ccc)
|
||||||
|
)
|
||||||
|
.orderBy(cpMain.mmCarno.asc(), cpMain.mmDate.asc(), cpMain.mmTime.asc())
|
||||||
|
.fetch();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.sendTarget.service;
|
||||||
|
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.dto.PreNoticeSendTargetDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PreNoticeSendTargetService {
|
||||||
|
List<PreNoticeSendTargetDto.Response.PreNoticeSendTarget> findPreNoticeSendTarget();
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.sendTarget.service.impl;
|
||||||
|
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.dto.PreNoticeSendTargetDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.repository.PreNoticeSendTargetQueryDslRepository;
|
||||||
|
import go.kr.project.biz.post.preNotice.sendTarget.service.PreNoticeSendTargetService;
|
||||||
|
import go.kr.project.vo.mapper.EntityVoMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PreNoticeSendTargetServiceImpl implements PreNoticeSendTargetService {
|
||||||
|
|
||||||
|
private final EntityVoMapper mapper;
|
||||||
|
private final PreNoticeSendTargetQueryDslRepository preNoticeSendTargetQueryDslRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PreNoticeSendTargetDto.Response.PreNoticeSendTarget> findPreNoticeSendTarget() {
|
||||||
|
|
||||||
|
List<PreNoticeSendTargetDto.Response.PreNoticeSendTargetEntities> list = preNoticeSendTargetQueryDslRepository.findPreNoticeSendTarget();
|
||||||
|
|
||||||
|
list.stream().map(e ->
|
||||||
|
PreNoticeSendTargetDto.Response.PreNoticeSendTarget.builder()
|
||||||
|
.cpMain(mapper.toCpMainVO(e.getCpMain()))
|
||||||
|
.cpAnswer(mapper.toCpAnswerVO(e.getCpAnswer()))
|
||||||
|
.cpOwner(mapper.toCpOwnerVO(e.getCpOwner()))
|
||||||
|
.build()
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.status.controller;
|
||||||
|
|
||||||
|
import egovframework.constant.TilesConstants;
|
||||||
|
import egovframework.util.ApiResponseUtil;
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.status.service.StatusService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class StatusController {
|
||||||
|
|
||||||
|
private final StatusService statusService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 발송/반송 > 사전통보 > 사전통보 현황 목록 페이지
|
||||||
|
* @return 뷰 경로
|
||||||
|
*/
|
||||||
|
@GetMapping("/post/preNotice/status/status.do")
|
||||||
|
public String minwonInitView() {
|
||||||
|
|
||||||
|
return "preNoticeStatus" + TilesConstants.BASE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("post/preNotice/status/status.ajax")
|
||||||
|
public ResponseEntity<?> getPreNoticeStatusListAjax(@ModelAttribute MinwonInitDto.Request.SearchMinwonInitList dto) {
|
||||||
|
|
||||||
|
// 총 게시물 수 조회
|
||||||
|
int totalCount = 0;
|
||||||
|
dto.setTotalCount(totalCount);
|
||||||
|
|
||||||
|
// 페이징 처리를 위한 설정
|
||||||
|
dto.setPagingYn("N");
|
||||||
|
|
||||||
|
// 리스트 조회
|
||||||
|
List<MinwonInitDto.Response.InitAnswers> result = statusService.findPreNoticeStatus();
|
||||||
|
|
||||||
|
return ApiResponseUtil.successWithGrid(result, dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.status.service;
|
||||||
|
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface StatusService {
|
||||||
|
|
||||||
|
List<MinwonInitDto.Response.InitAnswers> findPreNoticeStatus();
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package go.kr.project.biz.post.preNotice.status.service.impl;
|
||||||
|
|
||||||
|
import go.kr.project.biz.minwon.init.dto.MinwonInitDto;
|
||||||
|
import go.kr.project.biz.post.preNotice.status.service.StatusService;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class StatusServiceImpl implements StatusService {
|
||||||
|
@Override
|
||||||
|
public List<MinwonInitDto.Response.InitAnswers> findPreNoticeStatus() {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
|
<!-- Main body -->
|
||||||
|
<div class="main_body">
|
||||||
|
<section id="section8" class="main_bars">
|
||||||
|
<div class="bgs-main">
|
||||||
|
<section id="section5">
|
||||||
|
<div class="sub_title"></div>
|
||||||
|
<button type="button" onclick="location.href='<c:url value='/template/noticeSample/register.do'/>'" class="newbtn bg1">등록</button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="contants_body">
|
||||||
|
<div class="gs_b_top">
|
||||||
|
<ul class="lef">
|
||||||
|
<li class="th">검색구분</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchCondition" name="searchCondition" class="input">
|
||||||
|
<option value="">검색구분</option>
|
||||||
|
<option value="title" <c:if test="${paramVO.searchCondition eq 'title'}">selected</c:if>>제목</option>
|
||||||
|
<option value="contents" <c:if test="${paramVO.searchCondition eq 'contents'}">selected</c:if>>내용</option>
|
||||||
|
<option value="writer" <c:if test="${paramVO.searchCondition eq 'writer'}">selected</c:if>>수정자명</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">검색어</li>
|
||||||
|
<li><input type="text" id="searchKeyword" name="searchKeyword" class="input" value="${param.searchKeyword}"/></li>
|
||||||
|
<li class="th">담당자지정</li>
|
||||||
|
<li><input type="text" id="worker" name="worker" class="input" value=""/></li>
|
||||||
|
<li class="th">사용여부</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchUseYn" name="searchUseYn" class="input">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="Y" <c:if test="${param.searchUseYn eq 'Y'}">selected</c:if>>사용</option>
|
||||||
|
<option value="N" <c:if test="${param.searchUseYn eq 'N'}">selected</c:if>>미사용</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">접수일자 지정</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" id="searchStartDt" name="searchStartDt" class="input calender datepicker bottom" value="${param.searchStartDt}" /> ~
|
||||||
|
<input type="text" id="searchEndDt" name="searchEndDt" class="input calender datepicker" value="${param.searchEndDt}" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="rig2">
|
||||||
|
<li>
|
||||||
|
<select id="perPageSelect" class="input">
|
||||||
|
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||||
|
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||||
|
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||||
|
</select>
|
||||||
|
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="gs_booking">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box_column">
|
||||||
|
<div class="containers">
|
||||||
|
<div id="grid"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /Main body -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let GRID = null;
|
||||||
|
let INIT_POPUP = null;
|
||||||
|
|
||||||
|
let SEARCH_COND = {};
|
||||||
|
|
||||||
|
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||||
|
|
||||||
|
// 검색정보 셋팅
|
||||||
|
let setSearchCond = function() {
|
||||||
|
let searchCondition = $.trim(nvl($("#searchCondition").val(), ""));
|
||||||
|
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||||
|
let searchUseYn = $.trim(nvl($("#searchUseYn").val(), ""));
|
||||||
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
||||||
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
||||||
|
|
||||||
|
SEARCH_COND.searchCondition = searchCondition;
|
||||||
|
SEARCH_COND.searchKeyword = searchKeyword;
|
||||||
|
SEARCH_COND.searchUseYn = searchUseYn;
|
||||||
|
SEARCH_COND.searchStartDt = searchStartDt;
|
||||||
|
SEARCH_COND.searchEndDt = searchEndDt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const fnBiz = {
|
||||||
|
|
||||||
|
|
||||||
|
init: () => {
|
||||||
|
initGrid();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
eventListener: () => {
|
||||||
|
// 검색 버튼 클릭 이벤트
|
||||||
|
$('#search_btn').on('click', function() {
|
||||||
|
// 등록일 from~to 유효성 검사
|
||||||
|
let startDate = $("#searchStartDt").val();
|
||||||
|
let endDate = $("#searchEndDt").val();
|
||||||
|
|
||||||
|
// 시작일과 종료일 중 하나만 입력된 경우 체크
|
||||||
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
||||||
|
alert("등록일 검색 시 시작일과 종료일을 모두 입력해주세요.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일과 종료일이 모두 입력된 경우 유효성 검사
|
||||||
|
if (startDate && endDate) {
|
||||||
|
if (!isDate(startDate) || !isDate(endDate)) {
|
||||||
|
alert("유효한 날짜 형식이 아닙니다. (YYYY-MM-DD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일이 종료일보다 늦은 경우 체크
|
||||||
|
let startDateObj = new Date(startDate);
|
||||||
|
let endDateObj = new Date(endDate);
|
||||||
|
|
||||||
|
if (startDateObj > endDateObj) {
|
||||||
|
alert("시작일은 종료일보다 이후일 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지를 1로 리셋
|
||||||
|
$("#page").val(1);
|
||||||
|
// 그리드 데이터 리로드
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||||
|
$('#searchKeyword').on('keypress', function(e) {
|
||||||
|
if (e.which === 13) { // 엔터키 코드는 13
|
||||||
|
e.preventDefault(); // 기본 이벤트 방지
|
||||||
|
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// perPage 변경 이벤트 추가
|
||||||
|
$('#perPageSelect').on('change', () => {
|
||||||
|
const pagination = TuiGrid.instance.getPagination();
|
||||||
|
|
||||||
|
GRID.setPerPage($('#perPageSelect').val());
|
||||||
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||||
|
pagination.reset(TuiGrid.instance.getRowCount());
|
||||||
|
pagination.movePageTo(1);
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** tui-grid Set */
|
||||||
|
let initGrid = () => {
|
||||||
|
const gridColumns = [
|
||||||
|
{header: '등록구분', name: 'mmDlgb', sortable: true, width: 50,},
|
||||||
|
{header: '목록번호', name: 'asBbsNo', sortable: true, width: 70,},
|
||||||
|
{header: '신고자', name: 'mmSgnm', sortable: true, width: 100,},
|
||||||
|
{header: '담당자', name: 'mmSgtel', sortable: true, width: 100,},
|
||||||
|
{header: '전화번호', name: 'asTel', width: 150,},
|
||||||
|
{header: '접수일자', name: 'asJsdate', sortable: true, width: 70,},
|
||||||
|
{header: '처리기한', name: 'asLimitDt', sortable: true, width: 70,},
|
||||||
|
{header: '위반일자', name: 'mmDate', sortable: true, width: 150,},
|
||||||
|
{header: '첨부', name: 'mmImagegb', width: 150,},
|
||||||
|
{header: '사진갯수', name: 'mmImagecnt', width: 50,},
|
||||||
|
{header: '위반내용', name: 'mmSgcont', width: 250,},
|
||||||
|
{header: '접수번호', name: 'asJsno', sortable: true, width: 150,},
|
||||||
|
{header: '차량번호', name: 'mmCarno', sortable: true, width: 150,},
|
||||||
|
{header: 'mmCode', name: 'mmCode', sortable: true, width: 150, align: 'center', hidden: true}
|
||||||
|
];
|
||||||
|
let gridDatasource = {
|
||||||
|
api: {
|
||||||
|
readData: {
|
||||||
|
url: '<c:url value="/minwon/init/list.ajax"/>',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
processData: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initialRequest: true, //초기화시 조회
|
||||||
|
serializer: function (params) {
|
||||||
|
setSearchCond();
|
||||||
|
SEARCH_COND.perPage = params.perPage;
|
||||||
|
SEARCH_COND.page = params.page;
|
||||||
|
return $.param(SEARCH_COND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let gridOptions = {
|
||||||
|
el: 'grid',
|
||||||
|
rowHeaders: ['checkbox'],
|
||||||
|
columns: gridColumns,
|
||||||
|
noData: "처리 할 초기자료가 없습니다.",
|
||||||
|
pageOptions: {
|
||||||
|
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||||
|
perPage: perPage,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||||
|
|
||||||
|
GRID.on("dblclick", (e) => {
|
||||||
|
var popUrl = '/minwon/init/init_popup.do';
|
||||||
|
var popTitle = "initPopup";
|
||||||
|
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||||
|
|
||||||
|
// 1) localStorage에 저장
|
||||||
|
console.log(e)
|
||||||
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||||
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||||
|
|
||||||
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||||
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||||
|
|
||||||
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||||
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
||||||
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
||||||
|
} else {
|
||||||
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||||
|
INIT_POPUP.focus();
|
||||||
|
INIT_POPUP.INIT_POP_API.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 레디펑션
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
fnBiz.init();
|
||||||
|
fnBiz.eventListener();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
|
<!-- Main body -->
|
||||||
|
<div class="main_body">
|
||||||
|
<section id="section8" class="main_bars">
|
||||||
|
<div class="bgs-main">
|
||||||
|
<section id="section5">
|
||||||
|
<div class="sub_title"></div>
|
||||||
|
<button type="button" onclick="location.href='<c:url value='/template/noticeSample/register.do'/>'" class="newbtn bg1">등록</button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="contants_body">
|
||||||
|
<div class="gs_b_top">
|
||||||
|
<ul class="lef">
|
||||||
|
<li class="th">검색구분</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchCondition" name="searchCondition" class="input">
|
||||||
|
<option value="">검색구분</option>
|
||||||
|
<option value="title" <c:if test="${paramVO.searchCondition eq 'title'}">selected</c:if>>제목</option>
|
||||||
|
<option value="contents" <c:if test="${paramVO.searchCondition eq 'contents'}">selected</c:if>>내용</option>
|
||||||
|
<option value="writer" <c:if test="${paramVO.searchCondition eq 'writer'}">selected</c:if>>수정자명</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">검색어</li>
|
||||||
|
<li><input type="text" id="searchKeyword" name="searchKeyword" class="input" value="${param.searchKeyword}"/></li>
|
||||||
|
<li class="th">담당자지정</li>
|
||||||
|
<li><input type="text" id="worker" name="worker" class="input" value=""/></li>
|
||||||
|
<li class="th">사용여부</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchUseYn" name="searchUseYn" class="input">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="Y" <c:if test="${param.searchUseYn eq 'Y'}">selected</c:if>>사용</option>
|
||||||
|
<option value="N" <c:if test="${param.searchUseYn eq 'N'}">selected</c:if>>미사용</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">접수일자 지정</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" id="searchStartDt" name="searchStartDt" class="input calender datepicker bottom" value="${param.searchStartDt}" /> ~
|
||||||
|
<input type="text" id="searchEndDt" name="searchEndDt" class="input calender datepicker" value="${param.searchEndDt}" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="rig2">
|
||||||
|
<li>
|
||||||
|
<select id="perPageSelect" class="input">
|
||||||
|
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||||
|
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||||
|
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||||
|
</select>
|
||||||
|
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="gs_booking">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box_column">
|
||||||
|
<div class="containers">
|
||||||
|
<div id="grid"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /Main body -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let GRID = null;
|
||||||
|
let INIT_POPUP = null;
|
||||||
|
|
||||||
|
let SEARCH_COND = {};
|
||||||
|
|
||||||
|
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||||
|
|
||||||
|
// 검색정보 셋팅
|
||||||
|
let setSearchCond = function() {
|
||||||
|
let searchCondition = $.trim(nvl($("#searchCondition").val(), ""));
|
||||||
|
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||||
|
let searchUseYn = $.trim(nvl($("#searchUseYn").val(), ""));
|
||||||
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
||||||
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
||||||
|
|
||||||
|
SEARCH_COND.searchCondition = searchCondition;
|
||||||
|
SEARCH_COND.searchKeyword = searchKeyword;
|
||||||
|
SEARCH_COND.searchUseYn = searchUseYn;
|
||||||
|
SEARCH_COND.searchStartDt = searchStartDt;
|
||||||
|
SEARCH_COND.searchEndDt = searchEndDt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const fnBiz = {
|
||||||
|
|
||||||
|
|
||||||
|
init: () => {
|
||||||
|
initGrid();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
eventListener: () => {
|
||||||
|
// 검색 버튼 클릭 이벤트
|
||||||
|
$('#search_btn').on('click', function() {
|
||||||
|
// 등록일 from~to 유효성 검사
|
||||||
|
let startDate = $("#searchStartDt").val();
|
||||||
|
let endDate = $("#searchEndDt").val();
|
||||||
|
|
||||||
|
// 시작일과 종료일 중 하나만 입력된 경우 체크
|
||||||
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
||||||
|
alert("등록일 검색 시 시작일과 종료일을 모두 입력해주세요.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일과 종료일이 모두 입력된 경우 유효성 검사
|
||||||
|
if (startDate && endDate) {
|
||||||
|
if (!isDate(startDate) || !isDate(endDate)) {
|
||||||
|
alert("유효한 날짜 형식이 아닙니다. (YYYY-MM-DD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일이 종료일보다 늦은 경우 체크
|
||||||
|
let startDateObj = new Date(startDate);
|
||||||
|
let endDateObj = new Date(endDate);
|
||||||
|
|
||||||
|
if (startDateObj > endDateObj) {
|
||||||
|
alert("시작일은 종료일보다 이후일 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지를 1로 리셋
|
||||||
|
$("#page").val(1);
|
||||||
|
// 그리드 데이터 리로드
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||||
|
$('#searchKeyword').on('keypress', function(e) {
|
||||||
|
if (e.which === 13) { // 엔터키 코드는 13
|
||||||
|
e.preventDefault(); // 기본 이벤트 방지
|
||||||
|
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// perPage 변경 이벤트 추가
|
||||||
|
$('#perPageSelect').on('change', () => {
|
||||||
|
const pagination = TuiGrid.instance.getPagination();
|
||||||
|
|
||||||
|
GRID.setPerPage($('#perPageSelect').val());
|
||||||
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||||
|
pagination.reset(TuiGrid.instance.getRowCount());
|
||||||
|
pagination.movePageTo(1);
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** tui-grid Set */
|
||||||
|
let initGrid = () => {
|
||||||
|
const gridColumns = [
|
||||||
|
{header: '등록구분', name: 'mmDlgb', sortable: true, width: 50,},
|
||||||
|
{header: '목록번호', name: 'asBbsNo', sortable: true, width: 70,},
|
||||||
|
{header: '신고자', name: 'mmSgnm', sortable: true, width: 100,},
|
||||||
|
{header: '담당자', name: 'mmSgtel', sortable: true, width: 100,},
|
||||||
|
{header: '전화번호', name: 'asTel', width: 150,},
|
||||||
|
{header: '접수일자', name: 'asJsdate', sortable: true, width: 70,},
|
||||||
|
{header: '처리기한', name: 'asLimitDt', sortable: true, width: 70,},
|
||||||
|
{header: '위반일자', name: 'mmDate', sortable: true, width: 150,},
|
||||||
|
{header: '첨부', name: 'mmImagegb', width: 150,},
|
||||||
|
{header: '사진갯수', name: 'mmImagecnt', width: 50,},
|
||||||
|
{header: '위반내용', name: 'mmSgcont', width: 250,},
|
||||||
|
{header: '접수번호', name: 'asJsno', sortable: true, width: 150,},
|
||||||
|
{header: '차량번호', name: 'mmCarno', sortable: true, width: 150,},
|
||||||
|
{header: 'mmCode', name: 'mmCode', sortable: true, width: 150, align: 'center', hidden: true}
|
||||||
|
];
|
||||||
|
let gridDatasource = {
|
||||||
|
api: {
|
||||||
|
readData: {
|
||||||
|
url: '<c:url value="/minwon/init/list.ajax"/>',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
processData: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initialRequest: true, //초기화시 조회
|
||||||
|
serializer: function (params) {
|
||||||
|
setSearchCond();
|
||||||
|
SEARCH_COND.perPage = params.perPage;
|
||||||
|
SEARCH_COND.page = params.page;
|
||||||
|
return $.param(SEARCH_COND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let gridOptions = {
|
||||||
|
el: 'grid',
|
||||||
|
rowHeaders: ['checkbox'],
|
||||||
|
columns: gridColumns,
|
||||||
|
noData: "처리 할 초기자료가 없습니다.",
|
||||||
|
pageOptions: {
|
||||||
|
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||||
|
perPage: perPage,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||||
|
|
||||||
|
GRID.on("dblclick", (e) => {
|
||||||
|
var popUrl = '/minwon/init/init_popup.do';
|
||||||
|
var popTitle = "initPopup";
|
||||||
|
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||||
|
|
||||||
|
// 1) localStorage에 저장
|
||||||
|
console.log(e)
|
||||||
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||||
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||||
|
|
||||||
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||||
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||||
|
|
||||||
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||||
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
||||||
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
||||||
|
} else {
|
||||||
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||||
|
INIT_POPUP.focus();
|
||||||
|
INIT_POPUP.INIT_POP_API.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 레디펑션
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
fnBiz.init();
|
||||||
|
fnBiz.eventListener();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
|
<!-- Main body -->
|
||||||
|
<div class="main_body">
|
||||||
|
<section id="section8" class="main_bars">
|
||||||
|
<div class="bgs-main">
|
||||||
|
<section id="section5">
|
||||||
|
<div class="sub_title"></div>
|
||||||
|
<button type="button" onclick="location.href='<c:url value='/template/noticeSample/register.do'/>'" class="newbtn bg1">등록</button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="contants_body">
|
||||||
|
<div class="gs_b_top">
|
||||||
|
<ul class="lef">
|
||||||
|
<li class="th">검색구분</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchCondition" name="searchCondition" class="input">
|
||||||
|
<option value="">검색구분</option>
|
||||||
|
<option value="title" <c:if test="${paramVO.searchCondition eq 'title'}">selected</c:if>>제목</option>
|
||||||
|
<option value="contents" <c:if test="${paramVO.searchCondition eq 'contents'}">selected</c:if>>내용</option>
|
||||||
|
<option value="writer" <c:if test="${paramVO.searchCondition eq 'writer'}">selected</c:if>>수정자명</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">검색어</li>
|
||||||
|
<li><input type="text" id="searchKeyword" name="searchKeyword" class="input" value="${param.searchKeyword}"/></li>
|
||||||
|
<li class="th">담당자지정</li>
|
||||||
|
<li><input type="text" id="worker" name="worker" class="input" value=""/></li>
|
||||||
|
<li class="th">사용여부</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchUseYn" name="searchUseYn" class="input">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="Y" <c:if test="${param.searchUseYn eq 'Y'}">selected</c:if>>사용</option>
|
||||||
|
<option value="N" <c:if test="${param.searchUseYn eq 'N'}">selected</c:if>>미사용</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">접수일자 지정</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" id="searchStartDt" name="searchStartDt" class="input calender datepicker bottom" value="${param.searchStartDt}" /> ~
|
||||||
|
<input type="text" id="searchEndDt" name="searchEndDt" class="input calender datepicker" value="${param.searchEndDt}" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="rig2">
|
||||||
|
<li>
|
||||||
|
<select id="perPageSelect" class="input">
|
||||||
|
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||||
|
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||||
|
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||||
|
</select>
|
||||||
|
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="gs_booking">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box_column">
|
||||||
|
<div class="containers">
|
||||||
|
<div id="grid"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /Main body -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let GRID = null;
|
||||||
|
let INIT_POPUP = null;
|
||||||
|
|
||||||
|
let SEARCH_COND = {};
|
||||||
|
|
||||||
|
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||||
|
|
||||||
|
// 검색정보 셋팅
|
||||||
|
let setSearchCond = function() {
|
||||||
|
let searchCondition = $.trim(nvl($("#searchCondition").val(), ""));
|
||||||
|
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||||
|
let searchUseYn = $.trim(nvl($("#searchUseYn").val(), ""));
|
||||||
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
||||||
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
||||||
|
|
||||||
|
SEARCH_COND.searchCondition = searchCondition;
|
||||||
|
SEARCH_COND.searchKeyword = searchKeyword;
|
||||||
|
SEARCH_COND.searchUseYn = searchUseYn;
|
||||||
|
SEARCH_COND.searchStartDt = searchStartDt;
|
||||||
|
SEARCH_COND.searchEndDt = searchEndDt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const fnBiz = {
|
||||||
|
|
||||||
|
|
||||||
|
init: () => {
|
||||||
|
initGrid();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
eventListener: () => {
|
||||||
|
// 검색 버튼 클릭 이벤트
|
||||||
|
$('#search_btn').on('click', function() {
|
||||||
|
// 등록일 from~to 유효성 검사
|
||||||
|
let startDate = $("#searchStartDt").val();
|
||||||
|
let endDate = $("#searchEndDt").val();
|
||||||
|
|
||||||
|
// 시작일과 종료일 중 하나만 입력된 경우 체크
|
||||||
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
||||||
|
alert("등록일 검색 시 시작일과 종료일을 모두 입력해주세요.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일과 종료일이 모두 입력된 경우 유효성 검사
|
||||||
|
if (startDate && endDate) {
|
||||||
|
if (!isDate(startDate) || !isDate(endDate)) {
|
||||||
|
alert("유효한 날짜 형식이 아닙니다. (YYYY-MM-DD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일이 종료일보다 늦은 경우 체크
|
||||||
|
let startDateObj = new Date(startDate);
|
||||||
|
let endDateObj = new Date(endDate);
|
||||||
|
|
||||||
|
if (startDateObj > endDateObj) {
|
||||||
|
alert("시작일은 종료일보다 이후일 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지를 1로 리셋
|
||||||
|
$("#page").val(1);
|
||||||
|
// 그리드 데이터 리로드
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||||
|
$('#searchKeyword').on('keypress', function(e) {
|
||||||
|
if (e.which === 13) { // 엔터키 코드는 13
|
||||||
|
e.preventDefault(); // 기본 이벤트 방지
|
||||||
|
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// perPage 변경 이벤트 추가
|
||||||
|
$('#perPageSelect').on('change', () => {
|
||||||
|
const pagination = TuiGrid.instance.getPagination();
|
||||||
|
|
||||||
|
GRID.setPerPage($('#perPageSelect').val());
|
||||||
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||||
|
pagination.reset(TuiGrid.instance.getRowCount());
|
||||||
|
pagination.movePageTo(1);
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** tui-grid Set */
|
||||||
|
let initGrid = () => {
|
||||||
|
const gridColumns = [
|
||||||
|
{header: '등록구분', name: 'mmDlgb', sortable: true, width: 50,},
|
||||||
|
{header: '목록번호', name: 'asBbsNo', sortable: true, width: 70,},
|
||||||
|
{header: '신고자', name: 'mmSgnm', sortable: true, width: 100,},
|
||||||
|
{header: '담당자', name: 'mmSgtel', sortable: true, width: 100,},
|
||||||
|
{header: '전화번호', name: 'asTel', width: 150,},
|
||||||
|
{header: '접수일자', name: 'asJsdate', sortable: true, width: 70,},
|
||||||
|
{header: '처리기한', name: 'asLimitDt', sortable: true, width: 70,},
|
||||||
|
{header: '위반일자', name: 'mmDate', sortable: true, width: 150,},
|
||||||
|
{header: '첨부', name: 'mmImagegb', width: 150,},
|
||||||
|
{header: '사진갯수', name: 'mmImagecnt', width: 50,},
|
||||||
|
{header: '위반내용', name: 'mmSgcont', width: 250,},
|
||||||
|
{header: '접수번호', name: 'asJsno', sortable: true, width: 150,},
|
||||||
|
{header: '차량번호', name: 'mmCarno', sortable: true, width: 150,},
|
||||||
|
{header: 'mmCode', name: 'mmCode', sortable: true, width: 150, align: 'center', hidden: true}
|
||||||
|
];
|
||||||
|
let gridDatasource = {
|
||||||
|
api: {
|
||||||
|
readData: {
|
||||||
|
url: '<c:url value="/minwon/init/list.ajax"/>',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
processData: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initialRequest: true, //초기화시 조회
|
||||||
|
serializer: function (params) {
|
||||||
|
setSearchCond();
|
||||||
|
SEARCH_COND.perPage = params.perPage;
|
||||||
|
SEARCH_COND.page = params.page;
|
||||||
|
return $.param(SEARCH_COND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let gridOptions = {
|
||||||
|
el: 'grid',
|
||||||
|
rowHeaders: ['checkbox'],
|
||||||
|
columns: gridColumns,
|
||||||
|
noData: "처리 할 초기자료가 없습니다.",
|
||||||
|
pageOptions: {
|
||||||
|
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||||
|
perPage: perPage,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||||
|
|
||||||
|
GRID.on("dblclick", (e) => {
|
||||||
|
var popUrl = '/minwon/init/init_popup.do';
|
||||||
|
var popTitle = "initPopup";
|
||||||
|
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||||
|
|
||||||
|
// 1) localStorage에 저장
|
||||||
|
console.log(e)
|
||||||
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||||
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||||
|
|
||||||
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||||
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||||
|
|
||||||
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||||
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
||||||
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
||||||
|
} else {
|
||||||
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||||
|
INIT_POPUP.focus();
|
||||||
|
INIT_POPUP.INIT_POP_API.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 레디펑션
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
fnBiz.init();
|
||||||
|
fnBiz.eventListener();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
|
<!-- Main body -->
|
||||||
|
<div class="main_body">
|
||||||
|
<section id="section8" class="main_bars">
|
||||||
|
<div class="bgs-main">
|
||||||
|
<section id="section5">
|
||||||
|
<div class="sub_title"></div>
|
||||||
|
<button type="button" onclick="location.href='<c:url value='/template/noticeSample/register.do'/>'" class="newbtn bg1">등록</button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="contants_body">
|
||||||
|
<div class="gs_b_top">
|
||||||
|
<ul class="lef">
|
||||||
|
<li class="th">검색구분</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchCondition" name="searchCondition" class="input">
|
||||||
|
<option value="">검색구분</option>
|
||||||
|
<option value="title" <c:if test="${paramVO.searchCondition eq 'title'}">selected</c:if>>제목</option>
|
||||||
|
<option value="contents" <c:if test="${paramVO.searchCondition eq 'contents'}">selected</c:if>>내용</option>
|
||||||
|
<option value="writer" <c:if test="${paramVO.searchCondition eq 'writer'}">selected</c:if>>수정자명</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">검색어</li>
|
||||||
|
<li><input type="text" id="searchKeyword" name="searchKeyword" class="input" value="${param.searchKeyword}"/></li>
|
||||||
|
<li class="th">담당자지정</li>
|
||||||
|
<li><input type="text" id="worker" name="worker" class="input" value=""/></li>
|
||||||
|
<li class="th">사용여부</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchUseYn" name="searchUseYn" class="input">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="Y" <c:if test="${param.searchUseYn eq 'Y'}">selected</c:if>>사용</option>
|
||||||
|
<option value="N" <c:if test="${param.searchUseYn eq 'N'}">selected</c:if>>미사용</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">접수일자 지정</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" id="searchStartDt" name="searchStartDt" class="input calender datepicker bottom" value="${param.searchStartDt}" /> ~
|
||||||
|
<input type="text" id="searchEndDt" name="searchEndDt" class="input calender datepicker" value="${param.searchEndDt}" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="rig2">
|
||||||
|
<li>
|
||||||
|
<select id="perPageSelect" class="input">
|
||||||
|
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||||
|
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||||
|
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||||
|
</select>
|
||||||
|
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="gs_booking">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box_column">
|
||||||
|
<div class="containers">
|
||||||
|
<div id="grid"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /Main body -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let GRID = null;
|
||||||
|
let INIT_POPUP = null;
|
||||||
|
|
||||||
|
let SEARCH_COND = {};
|
||||||
|
|
||||||
|
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||||
|
|
||||||
|
// 검색정보 셋팅
|
||||||
|
let setSearchCond = function() {
|
||||||
|
let searchCondition = $.trim(nvl($("#searchCondition").val(), ""));
|
||||||
|
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||||
|
let searchUseYn = $.trim(nvl($("#searchUseYn").val(), ""));
|
||||||
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
||||||
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
||||||
|
let searchState = $("#searchEndDt").val()
|
||||||
|
|
||||||
|
SEARCH_COND.searchCondition = searchCondition;
|
||||||
|
SEARCH_COND.searchKeyword = searchKeyword;
|
||||||
|
SEARCH_COND.searchUseYn = searchUseYn;
|
||||||
|
SEARCH_COND.searchStartDt = searchStartDt;
|
||||||
|
SEARCH_COND.searchEndDt = searchEndDt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const fnBiz = {
|
||||||
|
|
||||||
|
|
||||||
|
init: () => {
|
||||||
|
initGrid();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
eventListener: () => {
|
||||||
|
// 검색 버튼 클릭 이벤트
|
||||||
|
$('#search_btn').on('click', function() {
|
||||||
|
// 등록일 from~to 유효성 검사
|
||||||
|
let startDate = $("#searchStartDt").val();
|
||||||
|
let endDate = $("#searchEndDt").val();
|
||||||
|
|
||||||
|
// 시작일과 종료일 중 하나만 입력된 경우 체크
|
||||||
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
||||||
|
alert("등록일 검색 시 시작일과 종료일을 모두 입력해주세요.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일과 종료일이 모두 입력된 경우 유효성 검사
|
||||||
|
if (startDate && endDate) {
|
||||||
|
if (!isDate(startDate) || !isDate(endDate)) {
|
||||||
|
alert("유효한 날짜 형식이 아닙니다. (YYYY-MM-DD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일이 종료일보다 늦은 경우 체크
|
||||||
|
let startDateObj = new Date(startDate);
|
||||||
|
let endDateObj = new Date(endDate);
|
||||||
|
|
||||||
|
if (startDateObj > endDateObj) {
|
||||||
|
alert("시작일은 종료일보다 이후일 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지를 1로 리셋
|
||||||
|
$("#page").val(1);
|
||||||
|
// 그리드 데이터 리로드
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||||
|
$('#searchKeyword').on('keypress', function(e) {
|
||||||
|
if (e.which === 13) { // 엔터키 코드는 13
|
||||||
|
e.preventDefault(); // 기본 이벤트 방지
|
||||||
|
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// perPage 변경 이벤트 추가
|
||||||
|
$('#perPageSelect').on('change', () => {
|
||||||
|
const pagination = TuiGrid.instance.getPagination();
|
||||||
|
|
||||||
|
GRID.setPerPage($('#perPageSelect').val());
|
||||||
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||||
|
pagination.reset(TuiGrid.instance.getRowCount());
|
||||||
|
pagination.movePageTo(1);
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** tui-grid Set */
|
||||||
|
let initGrid = () => {
|
||||||
|
const gridColumns = [
|
||||||
|
{header: '등록구분', name: '', sortable: true, width: 50,},
|
||||||
|
{header: '목록번호', name: '', sortable: true, width: 70,},
|
||||||
|
{header: '접수일', name: '', sortable: true, width: 100,},
|
||||||
|
{header: '신고자', name: '', sortable: true, width: 100,},
|
||||||
|
{header: '담당자', name: '', width: 150,},
|
||||||
|
{header: '위반내용', name: '', sortable: true, width: 70,},
|
||||||
|
{header: '위반일시', name: '', sortable: true, width: 70,},
|
||||||
|
{header: '차량번호', name: '', sortable: true, width: 150,},
|
||||||
|
{header: '소유자', name: '', width: 150,},
|
||||||
|
{header: '소유주구분', name: '', width: 50,},
|
||||||
|
{header: '주민번호', name: '', width: 250,},
|
||||||
|
{header: '위반장소', name: '', sortable: true, width: 150,},
|
||||||
|
{header: 'mmCode', name: 'mmCode', sortable: true, width: 150, align: 'center', hidden: true}
|
||||||
|
];
|
||||||
|
let gridDatasource = {
|
||||||
|
api: {
|
||||||
|
readData: {
|
||||||
|
url: '<c:url value="/post/preNotice/sendTarget/sendTargetList.ajax"/>',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
processData: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initialRequest: true, //초기화시 조회
|
||||||
|
serializer: function (params) {
|
||||||
|
setSearchCond();
|
||||||
|
SEARCH_COND.perPage = params.perPage;
|
||||||
|
SEARCH_COND.page = params.page;
|
||||||
|
return $.param(SEARCH_COND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let gridOptions = {
|
||||||
|
el: 'grid',
|
||||||
|
rowHeaders: ['checkbox'],
|
||||||
|
columns: gridColumns,
|
||||||
|
noData: "조회된 사전통보 대상이 없습니다.",
|
||||||
|
pageOptions: {
|
||||||
|
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||||
|
perPage: perPage,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||||
|
|
||||||
|
GRID.on("dblclick", (e) => {
|
||||||
|
var popUrl = '/minwon/init/init_popup.do';
|
||||||
|
var popTitle = "initPopup";
|
||||||
|
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||||
|
|
||||||
|
// 1) localStorage에 저장
|
||||||
|
console.log(e)
|
||||||
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||||
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||||
|
|
||||||
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||||
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||||
|
|
||||||
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||||
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
||||||
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
||||||
|
} else {
|
||||||
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||||
|
INIT_POPUP.focus();
|
||||||
|
INIT_POPUP.INIT_POP_API.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 레디펑션
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
fnBiz.init();
|
||||||
|
fnBiz.eventListener();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
|
<!-- Main body -->
|
||||||
|
<div class="main_body">
|
||||||
|
<section id="section8" class="main_bars">
|
||||||
|
<div class="bgs-main">
|
||||||
|
<section id="section5">
|
||||||
|
<div class="sub_title"></div>
|
||||||
|
<button type="button" onclick="location.href='<c:url value='/template/noticeSample/register.do'/>'" class="newbtn bg1">등록</button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="contants_body">
|
||||||
|
<div class="gs_b_top">
|
||||||
|
<ul class="lef">
|
||||||
|
<li class="th">검색구분</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchCondition" name="searchCondition" class="input">
|
||||||
|
<option value="">검색구분</option>
|
||||||
|
<option value="title" <c:if test="${paramVO.searchCondition eq 'title'}">selected</c:if>>제목</option>
|
||||||
|
<option value="contents" <c:if test="${paramVO.searchCondition eq 'contents'}">selected</c:if>>내용</option>
|
||||||
|
<option value="writer" <c:if test="${paramVO.searchCondition eq 'writer'}">selected</c:if>>수정자명</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">검색어</li>
|
||||||
|
<li><input type="text" id="searchKeyword" name="searchKeyword" class="input" value="${param.searchKeyword}"/></li>
|
||||||
|
<li class="th">담당자지정</li>
|
||||||
|
<li><input type="text" id="worker" name="worker" class="input" value=""/></li>
|
||||||
|
<li class="th">사용여부</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchUseYn" name="searchUseYn" class="input">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="Y" <c:if test="${param.searchUseYn eq 'Y'}">selected</c:if>>사용</option>
|
||||||
|
<option value="N" <c:if test="${param.searchUseYn eq 'N'}">selected</c:if>>미사용</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">접수일자 지정</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" id="searchStartDt" name="searchStartDt" class="input calender datepicker bottom" value="${param.searchStartDt}" /> ~
|
||||||
|
<input type="text" id="searchEndDt" name="searchEndDt" class="input calender datepicker" value="${param.searchEndDt}" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="rig2">
|
||||||
|
<li>
|
||||||
|
<select id="perPageSelect" class="input">
|
||||||
|
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||||
|
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||||
|
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||||
|
</select>
|
||||||
|
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="gs_booking">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box_column">
|
||||||
|
<div class="containers">
|
||||||
|
<div id="grid"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /Main body -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let GRID = null;
|
||||||
|
let INIT_POPUP = null;
|
||||||
|
|
||||||
|
let SEARCH_COND = {};
|
||||||
|
|
||||||
|
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||||
|
|
||||||
|
// 검색정보 셋팅
|
||||||
|
let setSearchCond = function() {
|
||||||
|
let searchCondition = $.trim(nvl($("#searchCondition").val(), ""));
|
||||||
|
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||||
|
let searchUseYn = $.trim(nvl($("#searchUseYn").val(), ""));
|
||||||
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
||||||
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
||||||
|
|
||||||
|
SEARCH_COND.searchCondition = searchCondition;
|
||||||
|
SEARCH_COND.searchKeyword = searchKeyword;
|
||||||
|
SEARCH_COND.searchUseYn = searchUseYn;
|
||||||
|
SEARCH_COND.searchStartDt = searchStartDt;
|
||||||
|
SEARCH_COND.searchEndDt = searchEndDt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const fnBiz = {
|
||||||
|
|
||||||
|
|
||||||
|
init: () => {
|
||||||
|
initGrid();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
eventListener: () => {
|
||||||
|
// 검색 버튼 클릭 이벤트
|
||||||
|
$('#search_btn').on('click', function() {
|
||||||
|
// 등록일 from~to 유효성 검사
|
||||||
|
let startDate = $("#searchStartDt").val();
|
||||||
|
let endDate = $("#searchEndDt").val();
|
||||||
|
|
||||||
|
// 시작일과 종료일 중 하나만 입력된 경우 체크
|
||||||
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
||||||
|
alert("등록일 검색 시 시작일과 종료일을 모두 입력해주세요.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일과 종료일이 모두 입력된 경우 유효성 검사
|
||||||
|
if (startDate && endDate) {
|
||||||
|
if (!isDate(startDate) || !isDate(endDate)) {
|
||||||
|
alert("유효한 날짜 형식이 아닙니다. (YYYY-MM-DD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일이 종료일보다 늦은 경우 체크
|
||||||
|
let startDateObj = new Date(startDate);
|
||||||
|
let endDateObj = new Date(endDate);
|
||||||
|
|
||||||
|
if (startDateObj > endDateObj) {
|
||||||
|
alert("시작일은 종료일보다 이후일 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지를 1로 리셋
|
||||||
|
$("#page").val(1);
|
||||||
|
// 그리드 데이터 리로드
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||||
|
$('#searchKeyword').on('keypress', function(e) {
|
||||||
|
if (e.which === 13) { // 엔터키 코드는 13
|
||||||
|
e.preventDefault(); // 기본 이벤트 방지
|
||||||
|
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// perPage 변경 이벤트 추가
|
||||||
|
$('#perPageSelect').on('change', () => {
|
||||||
|
const pagination = TuiGrid.instance.getPagination();
|
||||||
|
|
||||||
|
GRID.setPerPage($('#perPageSelect').val());
|
||||||
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||||
|
pagination.reset(TuiGrid.instance.getRowCount());
|
||||||
|
pagination.movePageTo(1);
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** tui-grid Set */
|
||||||
|
let initGrid = () => {
|
||||||
|
const gridColumns = [
|
||||||
|
{header: '등록구분', name: 'mmDlgb', sortable: true, width: 50,},
|
||||||
|
{header: '목록번호', name: 'asBbsNo', sortable: true, width: 70,},
|
||||||
|
{header: '신고자', name: 'mmSgnm', sortable: true, width: 100,},
|
||||||
|
{header: '담당자', name: 'mmSgtel', sortable: true, width: 100,},
|
||||||
|
{header: '전화번호', name: 'asTel', width: 150,},
|
||||||
|
{header: '접수일자', name: 'asJsdate', sortable: true, width: 70,},
|
||||||
|
{header: '처리기한', name: 'asLimitDt', sortable: true, width: 70,},
|
||||||
|
{header: '위반일자', name: 'mmDate', sortable: true, width: 150,},
|
||||||
|
{header: '첨부', name: 'mmImagegb', width: 150,},
|
||||||
|
{header: '사진갯수', name: 'mmImagecnt', width: 50,},
|
||||||
|
{header: '위반내용', name: 'mmSgcont', width: 250,},
|
||||||
|
{header: '접수번호', name: 'asJsno', sortable: true, width: 150,},
|
||||||
|
{header: '차량번호', name: 'mmCarno', sortable: true, width: 150,},
|
||||||
|
{header: 'mmCode', name: 'mmCode', sortable: true, width: 150, align: 'center', hidden: true}
|
||||||
|
];
|
||||||
|
let gridDatasource = {
|
||||||
|
api: {
|
||||||
|
readData: {
|
||||||
|
url: '<c:url value="/minwon/init/list.ajax"/>',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
processData: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initialRequest: true, //초기화시 조회
|
||||||
|
serializer: function (params) {
|
||||||
|
setSearchCond();
|
||||||
|
SEARCH_COND.perPage = params.perPage;
|
||||||
|
SEARCH_COND.page = params.page;
|
||||||
|
return $.param(SEARCH_COND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let gridOptions = {
|
||||||
|
el: 'grid',
|
||||||
|
rowHeaders: ['checkbox'],
|
||||||
|
columns: gridColumns,
|
||||||
|
noData: "처리 할 초기자료가 없습니다.",
|
||||||
|
pageOptions: {
|
||||||
|
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||||
|
perPage: perPage,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||||
|
|
||||||
|
GRID.on("dblclick", (e) => {
|
||||||
|
var popUrl = '/minwon/init/init_popup.do';
|
||||||
|
var popTitle = "initPopup";
|
||||||
|
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||||
|
|
||||||
|
// 1) localStorage에 저장
|
||||||
|
console.log(e)
|
||||||
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||||
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||||
|
|
||||||
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||||
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||||
|
|
||||||
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||||
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
||||||
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
||||||
|
} else {
|
||||||
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||||
|
INIT_POPUP.focus();
|
||||||
|
INIT_POPUP.INIT_POP_API.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 레디펑션
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
fnBiz.init();
|
||||||
|
fnBiz.eventListener();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
<%--
|
||||||
|
Created by IntelliJ IDEA.
|
||||||
|
User: kurt
|
||||||
|
Date: 2025. 11. 25.
|
||||||
|
Time: 오후 3:41
|
||||||
|
To change this template use File | Settings | File Templates.
|
||||||
|
--%>
|
||||||
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
|
<!-- Main body -->
|
||||||
|
<div class="main_body">
|
||||||
|
<section id="section8" class="main_bars">
|
||||||
|
<div class="bgs-main">
|
||||||
|
<section id="section5">
|
||||||
|
<div class="sub_title"></div>
|
||||||
|
<button type="button" onclick="location.href='<c:url value='/template/noticeSample/register.do'/>'" class="newbtn bg1">등록</button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="contants_body">
|
||||||
|
<div class="gs_b_top">
|
||||||
|
<ul class="lef">
|
||||||
|
<li class="th">검색구분</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchCondition" name="searchCondition" class="input">
|
||||||
|
<option value="">검색구분</option>
|
||||||
|
<option value="title" <c:if test="${paramVO.searchCondition eq 'title'}">selected</c:if>>제목</option>
|
||||||
|
<option value="contents" <c:if test="${paramVO.searchCondition eq 'contents'}">selected</c:if>>내용</option>
|
||||||
|
<option value="writer" <c:if test="${paramVO.searchCondition eq 'writer'}">selected</c:if>>수정자명</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">검색어</li>
|
||||||
|
<li><input type="text" id="searchKeyword" name="searchKeyword" class="input" value="${param.searchKeyword}"/></li>
|
||||||
|
<li class="th">담당자지정</li>
|
||||||
|
<li><input type="text" id="worker" name="worker" class="input" value=""/></li>
|
||||||
|
<li class="th">사용여부</li>
|
||||||
|
<li>
|
||||||
|
<select id="searchUseYn" name="searchUseYn" class="input">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="Y" <c:if test="${param.searchUseYn eq 'Y'}">selected</c:if>>사용</option>
|
||||||
|
<option value="N" <c:if test="${param.searchUseYn eq 'N'}">selected</c:if>>미사용</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="th">접수일자 지정</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" id="searchStartDt" name="searchStartDt" class="input calender datepicker bottom" value="${param.searchStartDt}" /> ~
|
||||||
|
<input type="text" id="searchEndDt" name="searchEndDt" class="input calender datepicker" value="${param.searchEndDt}" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="rig2">
|
||||||
|
<li>
|
||||||
|
<select id="perPageSelect" class="input">
|
||||||
|
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||||
|
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||||
|
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||||
|
</select>
|
||||||
|
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="gs_booking">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box_column">
|
||||||
|
<div class="containers">
|
||||||
|
<div id="grid"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /Main body -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let GRID = null;
|
||||||
|
let INIT_POPUP = null;
|
||||||
|
|
||||||
|
let SEARCH_COND = {};
|
||||||
|
|
||||||
|
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||||
|
|
||||||
|
// 검색정보 셋팅
|
||||||
|
let setSearchCond = function() {
|
||||||
|
let searchCondition = $.trim(nvl($("#searchCondition").val(), ""));
|
||||||
|
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||||
|
let searchUseYn = $.trim(nvl($("#searchUseYn").val(), ""));
|
||||||
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
||||||
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
||||||
|
|
||||||
|
SEARCH_COND.searchCondition = searchCondition;
|
||||||
|
SEARCH_COND.searchKeyword = searchKeyword;
|
||||||
|
SEARCH_COND.searchUseYn = searchUseYn;
|
||||||
|
SEARCH_COND.searchStartDt = searchStartDt;
|
||||||
|
SEARCH_COND.searchEndDt = searchEndDt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const fnBiz = {
|
||||||
|
|
||||||
|
|
||||||
|
init: () => {
|
||||||
|
initGrid();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
eventListener: () => {
|
||||||
|
// 검색 버튼 클릭 이벤트
|
||||||
|
$('#search_btn').on('click', function() {
|
||||||
|
// 등록일 from~to 유효성 검사
|
||||||
|
let startDate = $("#searchStartDt").val();
|
||||||
|
let endDate = $("#searchEndDt").val();
|
||||||
|
|
||||||
|
// 시작일과 종료일 중 하나만 입력된 경우 체크
|
||||||
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
||||||
|
alert("등록일 검색 시 시작일과 종료일을 모두 입력해주세요.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일과 종료일이 모두 입력된 경우 유효성 검사
|
||||||
|
if (startDate && endDate) {
|
||||||
|
if (!isDate(startDate) || !isDate(endDate)) {
|
||||||
|
alert("유효한 날짜 형식이 아닙니다. (YYYY-MM-DD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작일이 종료일보다 늦은 경우 체크
|
||||||
|
let startDateObj = new Date(startDate);
|
||||||
|
let endDateObj = new Date(endDate);
|
||||||
|
|
||||||
|
if (startDateObj > endDateObj) {
|
||||||
|
alert("시작일은 종료일보다 이후일 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지를 1로 리셋
|
||||||
|
$("#page").val(1);
|
||||||
|
// 그리드 데이터 리로드
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||||
|
$('#searchKeyword').on('keypress', function(e) {
|
||||||
|
if (e.which === 13) { // 엔터키 코드는 13
|
||||||
|
e.preventDefault(); // 기본 이벤트 방지
|
||||||
|
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// perPage 변경 이벤트 추가
|
||||||
|
$('#perPageSelect').on('change', () => {
|
||||||
|
const pagination = TuiGrid.instance.getPagination();
|
||||||
|
|
||||||
|
GRID.setPerPage($('#perPageSelect').val());
|
||||||
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||||
|
pagination.reset(TuiGrid.instance.getRowCount());
|
||||||
|
pagination.movePageTo(1);
|
||||||
|
TuiGrid.instance.readData(1);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** tui-grid Set */
|
||||||
|
let initGrid = () => {
|
||||||
|
const gridColumns = [
|
||||||
|
{header: '등록구분', name: 'mmDlgb', sortable: true, width: 50,},
|
||||||
|
{header: '목록번호', name: 'asBbsNo', sortable: true, width: 70,},
|
||||||
|
{header: '신고자', name: 'mmSgnm', sortable: true, width: 100,},
|
||||||
|
{header: '담당자', name: 'mmSgtel', sortable: true, width: 100,},
|
||||||
|
{header: '전화번호', name: 'asTel', width: 150,},
|
||||||
|
{header: '접수일자', name: 'asJsdate', sortable: true, width: 70,},
|
||||||
|
{header: '처리기한', name: 'asLimitDt', sortable: true, width: 70,},
|
||||||
|
{header: '위반일자', name: 'mmDate', sortable: true, width: 150,},
|
||||||
|
{header: '첨부', name: 'mmImagegb', width: 150,},
|
||||||
|
{header: '사진갯수', name: 'mmImagecnt', width: 50,},
|
||||||
|
{header: '위반내용', name: 'mmSgcont', width: 250,},
|
||||||
|
{header: '접수번호', name: 'asJsno', sortable: true, width: 150,},
|
||||||
|
{header: '차량번호', name: 'mmCarno', sortable: true, width: 150,},
|
||||||
|
{header: 'mmCode', name: 'mmCode', sortable: true, width: 150, align: 'center', hidden: true}
|
||||||
|
];
|
||||||
|
let gridDatasource = {
|
||||||
|
api: {
|
||||||
|
readData: {
|
||||||
|
url: '<c:url value="/minwon/init/list.ajax"/>',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
processData: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initialRequest: true, //초기화시 조회
|
||||||
|
serializer: function (params) {
|
||||||
|
setSearchCond();
|
||||||
|
SEARCH_COND.perPage = params.perPage;
|
||||||
|
SEARCH_COND.page = params.page;
|
||||||
|
return $.param(SEARCH_COND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let gridOptions = {
|
||||||
|
el: 'grid',
|
||||||
|
rowHeaders: ['checkbox'],
|
||||||
|
columns: gridColumns,
|
||||||
|
noData: "처리 할 초기자료가 없습니다.",
|
||||||
|
pageOptions: {
|
||||||
|
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||||
|
perPage: perPage,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||||
|
|
||||||
|
GRID.on("dblclick", (e) => {
|
||||||
|
var popUrl = '/minwon/init/init_popup.do';
|
||||||
|
var popTitle = "initPopup";
|
||||||
|
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||||
|
|
||||||
|
// 1) localStorage에 저장
|
||||||
|
console.log(e)
|
||||||
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||||
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||||
|
|
||||||
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||||
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||||
|
|
||||||
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||||
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
||||||
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
||||||
|
} else {
|
||||||
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||||
|
INIT_POPUP.focus();
|
||||||
|
INIT_POPUP.INIT_POP_API.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 레디펑션
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
fnBiz.init();
|
||||||
|
fnBiz.eventListener();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue