|
|
|
|
@ -44,143 +44,98 @@
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="gs_booking">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
<div class="box_column">
|
|
|
|
|
<div class="containers">
|
|
|
|
|
|
|
|
|
|
<!-- 상단 3개 그리드 -->
|
|
|
|
|
<div class="grid-row-top">
|
|
|
|
|
<!-- 1. 연도별 경고/과태료 합계 -->
|
|
|
|
|
<div class="grid-wrap">
|
|
|
|
|
<div class="grid-title">연도별 합계</div>
|
|
|
|
|
<div id="gridYear"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 2. 연도별 단속수단 -->
|
|
|
|
|
<div class="grid-wrap">
|
|
|
|
|
<div class="grid-title">연도별 단속수단</div>
|
|
|
|
|
<div id="gridDevice"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 3. 위반유형별 경고/과태료 -->
|
|
|
|
|
<div class="grid-wrap">
|
|
|
|
|
<div class="grid-title">위반유형별</div>
|
|
|
|
|
<div id="gridType"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 하단 1개 그리드 -->
|
|
|
|
|
<div class="grid-row-bottom">
|
|
|
|
|
<div class="grid-wrap">
|
|
|
|
|
<div class="grid-title">상세 통계</div>
|
|
|
|
|
<div id="gridDetail"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="gs_booking">
|
|
|
|
|
<!-- 상단 3개 그리드 -->
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
<div class="box_column">
|
|
|
|
|
<div class="containers">
|
|
|
|
|
<!-- 연도별 경고/과태료/전체 -->
|
|
|
|
|
<div id="gridYear" class="stat-grid-top"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<style>
|
|
|
|
|
/* 전체 컨테이너 */
|
|
|
|
|
.gs_booking {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 상단 3개 그리드 영역 */
|
|
|
|
|
.grid-row-top {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 260px; /* 반드시 px 지정 */
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 상단 개별 박스 */
|
|
|
|
|
.grid-row-top .grid-wrap {
|
|
|
|
|
flex: 1;
|
|
|
|
|
border: 1px solid #c0c0c0;
|
|
|
|
|
background: #fff;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
<div class="box_column">
|
|
|
|
|
<div class="containers">
|
|
|
|
|
<!-- 자동단속기/안전신문고/합계 -->
|
|
|
|
|
<div id="gridDevice" class="stat-grid-top"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
/* 하단 1개 그리드 영역 */
|
|
|
|
|
.grid-row-bottom {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 260px;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
<div class="box_column">
|
|
|
|
|
<div class="containers">
|
|
|
|
|
<!-- 위반유형별 경고/과태료/합계 -->
|
|
|
|
|
<div id="gridType" class="stat-grid-top"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
.grid-row-bottom .grid-wrap {
|
|
|
|
|
height: 100%;
|
|
|
|
|
border: 1px solid #c0c0c0;
|
|
|
|
|
background: #fff;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
<!-- 하단 1개 그리드 (상세 합계) -->
|
|
|
|
|
<div class="row stat-grid-bottom-row">
|
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
<div class="box_column">
|
|
|
|
|
<div class="containers">
|
|
|
|
|
<!-- 단계별(계도/사전/부과/독촉) 합계 -->
|
|
|
|
|
<div id="gridDetail" class="stat-grid-bottom"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<style>
|
|
|
|
|
.stat-grid-top {
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 그리드 타이틀 */
|
|
|
|
|
.grid-title {
|
|
|
|
|
flex: 0 0 30px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
padding-left: 8px;
|
|
|
|
|
background: #f5f5f5;
|
|
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
|
|
.stat-grid-bottom {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#gridYear,
|
|
|
|
|
#gridDevice,
|
|
|
|
|
#gridType,
|
|
|
|
|
#gridDetail {
|
|
|
|
|
flex: 1;
|
|
|
|
|
min-height: 0;
|
|
|
|
|
.stat-grid-row {
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 버튼 우측 정렬 */
|
|
|
|
|
.btn-area-right {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
text-align: right;
|
|
|
|
|
.stat-grid-bottom-row {
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
let INIT_POPUP = null;
|
|
|
|
|
let SEARCH_COND = {};
|
|
|
|
|
|
|
|
|
|
let GRID_YEAR = null;
|
|
|
|
|
let GRID_DEVICE = null;
|
|
|
|
|
let GRID_TYPE = null;
|
|
|
|
|
let GRID_DETAIL = null;
|
|
|
|
|
|
|
|
|
|
// 검색조건 세팅
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
let searchStartDt = $.trim(nvl($("#searchStartDt").val(), ""));
|
|
|
|
|
let searchEndDt = $.trim(nvl($("#searchEndDt").val(), ""));
|
|
|
|
|
|
|
|
|
|
SEARCH_COND = {}; // 항상 새로 만듦
|
|
|
|
|
SEARCH_COND.searchStartDt = searchStartDt;
|
|
|
|
|
SEARCH_COND.searchEndDt = searchEndDt;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const fnBiz = {
|
|
|
|
|
|
|
|
|
|
init: () => {
|
|
|
|
|
initGrid();
|
|
|
|
|
initGridYear();
|
|
|
|
|
initGridDevice();
|
|
|
|
|
initGridType();
|
|
|
|
|
initGridDetail();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
eventListener: () => {
|
|
|
|
|
|
|
|
|
|
// 검색 버튼
|
|
|
|
|
// 검색 버튼
|
|
|
|
|
$('#search_btn').on('click', function () {
|
|
|
|
|
let startDate = $("#searchStartDt").val();
|
|
|
|
|
let endDate = $("#searchEndDt").val();
|
|
|
|
|
@ -202,114 +157,69 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#page").val(1);
|
|
|
|
|
GRID.readData(1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 검색어 엔터
|
|
|
|
|
$('#searchKeyword').on('keypress', function (e) {
|
|
|
|
|
if (e.which === 13) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
$('#search_btn').trigger('click');
|
|
|
|
|
}
|
|
|
|
|
[GRID_YEAR, GRID_DEVICE, GRID_TYPE, GRID_DETAIL].forEach(grid => {
|
|
|
|
|
if (grid) {
|
|
|
|
|
grid.readData(1);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// perPage 변경 이벤트 추가
|
|
|
|
|
$('#perPageSelect').on('change', () => {
|
|
|
|
|
const pagination = TuiGrid.instance.getPagination();
|
|
|
|
|
if (!pagination) return;
|
|
|
|
|
const perPage = $('#perPageSelect').val();
|
|
|
|
|
|
|
|
|
|
[GRID_YEAR, GRID_DEVICE, GRID_TYPE, GRID_DETAIL].forEach(grid => {
|
|
|
|
|
if (!grid || !grid.getPagination) return;
|
|
|
|
|
|
|
|
|
|
pagination.setItemsPerPage($('#perPageSelect').val());
|
|
|
|
|
pagination.reset(TuiGrid.instance.getRowCount());
|
|
|
|
|
pagination.movePageTo(1);
|
|
|
|
|
const pagination = grid.getPagination();
|
|
|
|
|
if (!pagination) return;
|
|
|
|
|
|
|
|
|
|
pagination.setItemsPerPage(perPage);
|
|
|
|
|
pagination.reset(grid.getRowCount());
|
|
|
|
|
pagination.movePageTo(1);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 상태 탭 클릭
|
|
|
|
|
$('.state-tabs li').on('click', function () {
|
|
|
|
|
$('.state-tabs li').removeClass('on');
|
|
|
|
|
$(this).addClass('on');
|
|
|
|
|
$('#btnHwp').on('click', function () {
|
|
|
|
|
setSearchCond();
|
|
|
|
|
|
|
|
|
|
if (!SEARCH_COND.searchStartDt || !SEARCH_COND.searchEndDt) {
|
|
|
|
|
alert("조회일자를 먼저 선택해 주세요.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const state = $(this).data('state') || '';
|
|
|
|
|
$('#tabState').val(state);
|
|
|
|
|
const queryString = $.param({
|
|
|
|
|
searchStartDt: SEARCH_COND.searchStartDt,
|
|
|
|
|
searchEndDt: SEARCH_COND.searchEndDt
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
SEARCH_COND = {};
|
|
|
|
|
GRID.readData(1);
|
|
|
|
|
const url = '<c:url value="/search/caution/caution-hwp-download.do"/>' + '?' + queryString;
|
|
|
|
|
window.open(url, '_blank');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** tui-grid Set */
|
|
|
|
|
const initGrid = () => {
|
|
|
|
|
|
|
|
|
|
// 1. 연도별 합계
|
|
|
|
|
GRID_YEAR = new tui.Grid({
|
|
|
|
|
el: document.getElementById('gridYear'),
|
|
|
|
|
bodyHeight: '200',
|
|
|
|
|
rowHeaders: [],
|
|
|
|
|
scrollX: false,
|
|
|
|
|
scrollY: true,
|
|
|
|
|
columns: [
|
|
|
|
|
{ header: '구분', name: 'gbn', width: 80, align: 'center' },
|
|
|
|
|
{ header: '경고', name: 'warnCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '과태료', name: 'fineCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '전체', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
],
|
|
|
|
|
data: []
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 2. 연도별 단속수단
|
|
|
|
|
GRID_DEVICE = new tui.Grid({
|
|
|
|
|
el: document.getElementById('gridDevice'),
|
|
|
|
|
bodyHeight: '200',
|
|
|
|
|
rowHeaders: [],
|
|
|
|
|
scrollX: false,
|
|
|
|
|
scrollY: true,
|
|
|
|
|
columns: [
|
|
|
|
|
{ header: '구분', name: 'gbn', width: 80, align: 'center' },
|
|
|
|
|
{ header: '자동단속기', name: 'autoCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '안전신문고', name: 'safeCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '합계', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
],
|
|
|
|
|
data: []
|
|
|
|
|
});
|
|
|
|
|
const initGridYear = () => {
|
|
|
|
|
const perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
|
|
|
|
|
|
|
|
|
// 3. 위반유형별
|
|
|
|
|
GRID_TYPE = new tui.Grid({
|
|
|
|
|
el: document.getElementById('gridType'),
|
|
|
|
|
bodyHeight: '200',
|
|
|
|
|
rowHeaders: [],
|
|
|
|
|
scrollX: false,
|
|
|
|
|
scrollY: true,
|
|
|
|
|
columns: [
|
|
|
|
|
{ header: '구분', name: 'gbn', width: 120, align: 'left' },
|
|
|
|
|
{ header: '경고', name: 'warnCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '과태료', name: 'fineCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '합계', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
],
|
|
|
|
|
data: []
|
|
|
|
|
});
|
|
|
|
|
const gridColumns = [
|
|
|
|
|
{ header: '구분', name: 'year', width: 80, align: 'center' },
|
|
|
|
|
{ header: '경고', name: 'insCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '과태료', name: 'violCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '전체', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// 4. 상세 통계 (하단)
|
|
|
|
|
GRID_DETAIL = new tui.Grid({
|
|
|
|
|
el: document.getElementById('gridDetail'),
|
|
|
|
|
bodyHeight: '220',
|
|
|
|
|
rowHeaders: [],
|
|
|
|
|
scrollX: true,
|
|
|
|
|
scrollY: true,
|
|
|
|
|
columns: [
|
|
|
|
|
{ header: '구분', name: 'gbn', width: 80, align: 'center' },
|
|
|
|
|
{ header: '계도-일반', name: 'cdGen', width: 90, align: 'right' },
|
|
|
|
|
{ header: '계도-등기', name: 'cd5', width: 90, align: 'right' },
|
|
|
|
|
{ header: '사전-일반', name: 'sjGen', width: 90, align: 'right' },
|
|
|
|
|
{ header: '사전-등기', name: 'sj5', width: 90, align: 'right' },
|
|
|
|
|
{ header: '부과-일반', name: 'bgGen', width: 90, align: 'right' },
|
|
|
|
|
{ header: '부과-등기', name: 'bg5', width: 90, align: 'right' },
|
|
|
|
|
{ header: '독촉-일반', name: 'dcGen', width: 90, align: 'right' },
|
|
|
|
|
{ header: '독촉-등기', name: 'dc5', width: 90, align: 'right' },
|
|
|
|
|
{ header: '합계', name: 'totalCnt', width: 90, align: 'right' }
|
|
|
|
|
],
|
|
|
|
|
data: []
|
|
|
|
|
});
|
|
|
|
|
const gridOptions = {
|
|
|
|
|
el: 'gridYear',
|
|
|
|
|
rowHeaders: ['rowNum'],
|
|
|
|
|
columns: gridColumns,
|
|
|
|
|
noData: "자료가 없습니다.",
|
|
|
|
|
height: 100,
|
|
|
|
|
bodyHeight: 80,
|
|
|
|
|
pageOptions: {
|
|
|
|
|
useClient: true, // 통계는 클라이언트 페이징이 편함
|
|
|
|
|
perPage: perPage
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const gridDatasource = {
|
|
|
|
|
api: {
|
|
|
|
|
@ -325,93 +235,184 @@
|
|
|
|
|
setSearchCond();
|
|
|
|
|
SEARCH_COND.perPage = params.perPage;
|
|
|
|
|
SEARCH_COND.page = params.page;
|
|
|
|
|
SEARCH_COND.gridId = 'YEAR';
|
|
|
|
|
|
|
|
|
|
return $.param(SEARCH_COND);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GRID_YEAR = TuiGrid.of(gridOptions, gridDatasource, (res) => {});
|
|
|
|
|
GRID_YEAR.readData(1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initGridDevice = () => {
|
|
|
|
|
const perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
|
|
|
|
|
|
|
|
|
const gridColumns = [
|
|
|
|
|
{ header: '구분', name: 'year', width: 80, align: 'center' },
|
|
|
|
|
{ header: '자동단속기', name: 'cctvCnt', width: 100, align: 'right' },
|
|
|
|
|
{ header: '안전신문고', name: 'smgCnt', width: 100, align: 'right' },
|
|
|
|
|
{ header: '합계', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const gridOptions = {
|
|
|
|
|
el: 'grid',
|
|
|
|
|
rowHeaders: ['checkbox'],
|
|
|
|
|
el: 'gridDevice',
|
|
|
|
|
rowHeaders: ['rowNum'],
|
|
|
|
|
columns: gridColumns,
|
|
|
|
|
noData: "처리 할 초기자료가 없습니다.",
|
|
|
|
|
noData: "자료가 없습니다.",
|
|
|
|
|
height: 100,
|
|
|
|
|
bodyHeight: 80,
|
|
|
|
|
pageOptions: {
|
|
|
|
|
useClient: false,
|
|
|
|
|
useClient: true,
|
|
|
|
|
perPage: perPage
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 실제 GRID 생성
|
|
|
|
|
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
|
|
|
|
// 서버 응답 후 페이지 정보 세팅
|
|
|
|
|
const data = res.data || {};
|
|
|
|
|
if (data.pagination) {
|
|
|
|
|
$("#currentPage").text(data.pagination.page || '');
|
|
|
|
|
$("#totalPages").text(data.pagination.totalPages || '');
|
|
|
|
|
const gridDatasource = {
|
|
|
|
|
api: {
|
|
|
|
|
readData: {
|
|
|
|
|
url: '<c:url value="/search/caution/caution-select.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;
|
|
|
|
|
SEARCH_COND.gridId = 'DEVICE';
|
|
|
|
|
|
|
|
|
|
return $.param(SEARCH_COND);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GRID_DEVICE = TuiGrid.of(gridOptions, gridDatasource, (res) => {});
|
|
|
|
|
GRID_DEVICE.readData(1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initGridType = () => {
|
|
|
|
|
const perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
|
|
|
|
|
|
|
|
|
const gridColumns = [
|
|
|
|
|
{ header: '위반유형', name: 'vlId', width: 120, align: 'left' },
|
|
|
|
|
{ header: '경고', name: 'insCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '과태료', name: 'violCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '합계', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const gridOptions = {
|
|
|
|
|
el: 'gridType',
|
|
|
|
|
rowHeaders: ['rowNum'],
|
|
|
|
|
columns: gridColumns,
|
|
|
|
|
noData: "자료가 없습니다.",
|
|
|
|
|
height: 100,
|
|
|
|
|
bodyHeight: 80,
|
|
|
|
|
pageOptions: {
|
|
|
|
|
useClient: true,
|
|
|
|
|
perPage: perPage
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 더블 클릭 이벤트
|
|
|
|
|
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";
|
|
|
|
|
const gridDatasource = {
|
|
|
|
|
api: {
|
|
|
|
|
readData: {
|
|
|
|
|
url: '<c:url value="/search/caution/caution-select.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;
|
|
|
|
|
SEARCH_COND.gridId = 'TYPE';
|
|
|
|
|
|
|
|
|
|
// 1) localStorage에 저장
|
|
|
|
|
console.log(e)
|
|
|
|
|
return $.param(SEARCH_COND);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
|
|
|
|
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
|
|
|
|
GRID_TYPE = TuiGrid.of(gridOptions, gridDatasource, (res) => {});
|
|
|
|
|
GRID_TYPE.readData(1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
console.log(cursor);
|
|
|
|
|
const initGridDetail = () => {
|
|
|
|
|
const perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
|
|
|
|
|
|
|
|
|
const gridColumns = [
|
|
|
|
|
{ header: '구분', name: 'year', width: 80, align: 'center' },
|
|
|
|
|
{ header: '계도-일반', name: 'instructNormalCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '계도-등기', name: 'instructRegistCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '사전-일반', name: 'sajunNormalCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '사전-등기', name: 'sajunRegistCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '부과-일반', name: 'bugwaNormalCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '부과-등기', name: 'bugwaRegistCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '독촉-일반', name: 'dokNormalCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '독촉-등기', name: 'dokRegistCnt', width: 80, align: 'right' },
|
|
|
|
|
{ header: '합계', name: 'totalCnt', width: 80, align: 'right' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const state = { cursor, mmCodes, savedAt: Date.now() };
|
|
|
|
|
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
|
|
|
|
const gridOptions = {
|
|
|
|
|
el: 'gridDetail',
|
|
|
|
|
rowHeaders: ['rowNum'],
|
|
|
|
|
columns: gridColumns,
|
|
|
|
|
noData: "자료가 없습니다.",
|
|
|
|
|
height: 150,
|
|
|
|
|
bodyHeight: 100,
|
|
|
|
|
pageOptions: {
|
|
|
|
|
useClient: true,
|
|
|
|
|
perPage: perPage
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
|
|
|
|
if (!INIT_POPUP || INIT_POPUP.closed) {
|
|
|
|
|
INIT_POPUP = window.open(popUrl, popTitle, popOption);
|
|
|
|
|
} else {
|
|
|
|
|
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
|
|
|
|
INIT_POPUP.focus();
|
|
|
|
|
INIT_POPUP.INIT_POP_API.search();
|
|
|
|
|
const gridDatasource = {
|
|
|
|
|
api: {
|
|
|
|
|
readData: {
|
|
|
|
|
url: '<c:url value="/search/caution/caution-select.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;
|
|
|
|
|
SEARCH_COND.gridId = 'DETAIL';
|
|
|
|
|
|
|
|
|
|
// 최초 1페이지 조회
|
|
|
|
|
GRID.readData(1);
|
|
|
|
|
return $.param(SEARCH_COND);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GRID_DETAIL = TuiGrid.of(gridOptions, gridDatasource, (res) => {});
|
|
|
|
|
GRID_DETAIL.readData(1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const loadWarningStats = () => {
|
|
|
|
|
|
|
|
|
|
setSearchCond();
|
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '<c:url value="/caution/statistics.ajax"/>',
|
|
|
|
|
type: 'POST',
|
|
|
|
|
data: SEARCH_COND,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
const startInput = $("#searchStartDt");
|
|
|
|
|
const endInput = $("#searchEndDt");
|
|
|
|
|
|
|
|
|
|
const yearList = res.yearList || [];
|
|
|
|
|
const deviceList = res.deviceList || [];
|
|
|
|
|
const typeList = res.typeList || [];
|
|
|
|
|
const detailList = res.detailList || [];
|
|
|
|
|
if (!startInput.val() || !endInput.val()) {
|
|
|
|
|
const today = new Date();
|
|
|
|
|
const yyyy = today.getFullYear();
|
|
|
|
|
const mm = String(today.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
const dd = String(today.getDate()).padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
GRID_YEAR.resetData(yearList);
|
|
|
|
|
GRID_DEVICE.resetData(deviceList);
|
|
|
|
|
GRID_TYPE.resetData(typeList);
|
|
|
|
|
GRID_DETAIL.resetData(detailList);
|
|
|
|
|
},
|
|
|
|
|
error: function () {
|
|
|
|
|
alert('경고 통계 조회 중 오류가 발생했습니다.');
|
|
|
|
|
const todayStr = yyyy + "-" + mm + "-" + dd;
|
|
|
|
|
const firstDayOfYear = yyyy + "-01-01";
|
|
|
|
|
|
|
|
|
|
startInput.val(firstDayOfYear);
|
|
|
|
|
endInput.val(todayStr);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 레디펑션
|
|
|
|
|
$(function () {
|
|
|
|
|
fnBiz.init();
|
|
|
|
|
fnBiz.eventListener();
|
|
|
|
|
});
|
|
|
|
|
|