feat : 민원접수 대기자료 작업중
parent
71fedb8aa1
commit
fdab55778d
@ -0,0 +1,50 @@
|
||||
package go.kr.project.biz.minwon.wait.controller;
|
||||
|
||||
|
||||
import egovframework.constant.TilesConstants;
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
import go.kr.project.biz.minwon.wait.service.MinwonWaitService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
|
||||
public class MinwonWaitController {
|
||||
|
||||
private final MinwonWaitService minwonWaitService;
|
||||
|
||||
/**
|
||||
* 민원접수 대기자료 목록 페이지
|
||||
* @return 뷰 경로
|
||||
*/
|
||||
@GetMapping("/minwon/wait/wait.do")
|
||||
@Operation(summary = "민원접수 대기자료", description="민원접수 대기자료 목록 페이지를 조회합니다.")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "조회 성공")
|
||||
})
|
||||
public String minwonWaitView(){
|
||||
|
||||
return "biz/minwon/wait/wait" + TilesConstants.BASE;
|
||||
}
|
||||
|
||||
@PostMapping("/minwon/wait/minwonwait-myBatis.ajax")
|
||||
public ResponseEntity<?> minwonwaitAjaxMybatis(@RequestBody MinwonWaitDto.Request.Search waitDto, String searchKeyword) {
|
||||
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> result = minwonWaitService.findminwonwaitMybatis(waitDto);
|
||||
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package go.kr.project.biz.minwon.wait.dto;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public class MinwonWaitDto {
|
||||
public static class Request {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Search {
|
||||
private String mmRegse;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Response {
|
||||
@Getter
|
||||
@Setter
|
||||
public static class cpMainAnswerCancel{
|
||||
private String mmCode;
|
||||
private String mmDlgb;
|
||||
private String asBbsNo;
|
||||
private String mmSgnm;
|
||||
private String mmSgtel;
|
||||
private String mmDate;
|
||||
private String asLimitDt;
|
||||
private String mmIndt;
|
||||
private String asJsno;
|
||||
private String mmCarno;
|
||||
private String ccCause;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package go.kr.project.biz.minwon.wait.mapper;
|
||||
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MinwonWaitMapper {
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitMybatis(MinwonWaitDto.Request.Search waitDto);
|
||||
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitSearchMybatis(MinwonWaitDto.Request.Search waitDto, String searchKeyword);
|
||||
}
|
||||
@ -0,0 +1,178 @@
|
||||
//package go.kr.project.biz.minwon.wait.repository;
|
||||
//
|
||||
//import com.querydsl.core.types.Projections;
|
||||
//import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
//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;
|
||||
//
|
||||
//@Repository
|
||||
//@RequiredArgsConstructor
|
||||
//public class MinwonWaitQueryDsRepository {
|
||||
//
|
||||
// private final JPAQueryFactory queryFactory;
|
||||
//
|
||||
// public List<MinwonWaitDto.Response.WaitAnswers> findWaitAnswers(MinwonWaitDto.Request.SearchMinwonWaitList dto) {
|
||||
//
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// //cpAnswer.asState.eq("01")
|
||||
// cpMain.mmState.eq("01"),
|
||||
// cpAnswer.asState.eq("0")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// public List<MinwonWaitDto.Response.WaitAnswers> findWaitAnswersSearch(MinwonWaitDto.Request.SearchMinwonWaitList dto, String searchCondition, String searchKeyword, String searchStartDt, String searchEndDt) {
|
||||
//
|
||||
// if (searchCondition.equals("jsdate")) {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asJsdate.between(searchStartDt, searchEndDt)
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// } else if (searchCondition.equals("jsno")) {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asJsno.like("%" + searchKeyword + "%")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// } else if (searchCondition.equals("iimitdt")) {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asLimitDt.between(searchStartDt, searchEndDt)
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// } else {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0")
|
||||
// cpAnswer.asJsno.like("%" +searchKeyword + "%")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
//
|
||||
///*
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asJsno.like("%" + searchKeyword + "%")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// */
|
||||
//
|
||||
// }
|
||||
//}
|
||||
@ -0,0 +1,13 @@
|
||||
package go.kr.project.biz.minwon.wait.service;
|
||||
|
||||
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MinwonWaitService {
|
||||
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitMybatis(MinwonWaitDto.Request.Search waitDto);
|
||||
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitSearchMybatis(MinwonWaitDto.Request.Search waitDto, String searchKeyword);
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package go.kr.project.biz.minwon.wait.service.impl;
|
||||
|
||||
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
import go.kr.project.biz.minwon.wait.mapper.MinwonWaitMapper;
|
||||
import go.kr.project.biz.minwon.wait.service.MinwonWaitService;
|
||||
import go.kr.project.domain.repo.cp.CpAnswerRepository;
|
||||
import go.kr.project.domain.repo.cp.CpMainRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class MinwonWaitServiceImpl implements MinwonWaitService {
|
||||
|
||||
private final CpMainRepository cpMainRepository;
|
||||
private final CpAnswerRepository cpAnswerRepository;
|
||||
// private final MinwonWaitQueryDsRepository minwonWaitQueryDsRepository;
|
||||
private final MinwonWaitMapper minwonWaitMapper;
|
||||
|
||||
@Override
|
||||
public List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitMybatis(MinwonWaitDto.Request.Search waitDto) {
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> result = minwonWaitMapper.findminwonwaitMybatis(waitDto);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitSearchMybatis(MinwonWaitDto.Request.Search waitDto, String searchKeyword) {
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> result = minwonWaitMapper.findminwonwaitSearchMybatis(waitDto, searchKeyword);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!-- 여기는 매퍼인터페이스를 경로를 정확히 입력해야 바인딩이 된다. -->
|
||||
<mapper namespace="go.kr.project.biz.minwon.wait.mapper.MinwonWaitMapper">
|
||||
|
||||
<select id="findminwonwaitMybatis"
|
||||
parameterType="go.kr.project.biz.minwon.wait.dto.MinwonWaitDto$Request$Search"
|
||||
resultType="go.kr.project.biz.minwon.wait.dto.MinwonWaitDto$Response$cpMainAnswerCancel">
|
||||
select mm_Code
|
||||
, mm_Dlgb
|
||||
, mm_BbsNo
|
||||
, mm_Sgnm
|
||||
, mm_Sgtel
|
||||
, mm_Date
|
||||
, as_LimitDt
|
||||
, mm_Indt
|
||||
, as_Jsno
|
||||
, mm_Carno
|
||||
, cc_Cause
|
||||
from cp_main
|
||||
inner join cp_answer on (mm_code = as_mmcode)
|
||||
left outer join cp_cancel on (mm_code = cc_mmcode)
|
||||
where as_State = '01'
|
||||
</select>
|
||||
|
||||
<select id="findminwonwaitSearchMybatis"
|
||||
parameterType="go.kr.project.biz.minwon.wait.dto.MinwonWaitDto$Request$Search"
|
||||
resultType="go.kr.project.biz.minwon.wait.dto.MinwonWaitDto$Response$cpMainAnswerCancel">
|
||||
select mm_Code
|
||||
, mm_Dlgb
|
||||
, mm_BbsNo
|
||||
, mm_Sgnm
|
||||
, mm_Sgtel
|
||||
, mm_Date
|
||||
, as_LimitDt
|
||||
, mm_Indt
|
||||
, as_Jsno
|
||||
, mm_Carno
|
||||
, cc_Cause
|
||||
from cp_main
|
||||
inner join cp_answer on (mm_code = as_mmcode)
|
||||
left outer join cp_cancel on (mm_code = cc_mmcode)
|
||||
where as_State = '01'
|
||||
and as_dlgb = #{mmDlgb}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,313 @@
|
||||
<%@ 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 TOTAL_INFO = 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: () => {
|
||||
let self = this;
|
||||
// 검색 버튼 클릭 이벤트
|
||||
$('#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);
|
||||
// 그리드 데이터 리로드
|
||||
self.grid.instance.readData(1);
|
||||
});
|
||||
|
||||
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||
$('#searchKeyword').on('keypress', function(e) {
|
||||
if (e.which === 13) { // 엔터키 코드는 13
|
||||
e.preventDefault(); // 기본 이벤트 방지
|
||||
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||
}
|
||||
});
|
||||
|
||||
// perPage 변경 이벤트 추가
|
||||
$('#perPageSelect').on('change', function() {
|
||||
let perPage = parseInt($(this).val(), 10);
|
||||
// Grid의 perPage 설정 변경 및 데이터 리로드
|
||||
self.grid.instance.setPerPage(perPage);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** tui-grid Set */
|
||||
const 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
|
||||
}
|
||||
];
|
||||
const gridDatasource = {
|
||||
api: {
|
||||
readData: {
|
||||
url: '<c:url value="/minwon/wait/minwonwait-myBatis.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);
|
||||
}
|
||||
}
|
||||
|
||||
const 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 = '/total/info.do';
|
||||
var popTitle = "TotalInfo";
|
||||
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 (!TOTAL_INFO || TOTAL_INFO.closed) {
|
||||
TOTAL_INFO = window.open(popUrl, popTitle, popOption);
|
||||
} else {
|
||||
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||
TOTAL_INFO.focus();
|
||||
TOTAL_INFO.TOTAL_INFO_POPUP_API.search();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 레디펑션
|
||||
$(function () {
|
||||
|
||||
fnBiz.init();
|
||||
fnBiz.eventListener();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue