문자전송 현황 메뉴 추가

main
이범준 1 month ago
parent 59358d4575
commit cbd7fa8719

@ -0,0 +1,212 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">문자전송 현황</c:set>
<!-- inner page html -->
<div class="content-wrapper" data-doctx="${pageName}">
<!-- Content -->
<div class="container-xxl flex-grow-1 px-0">
<div class="card wrapper-list">
<!-- 상단 버튼 -->
<div class="container-page-btn">
<button type="button" class="btn btn-outline-dark w-px-120" name="btnReset" title="초기화">
초기화
</button>
<span class="container-window-btn-right">
<button type="button" class="btn btn-search w-px-120" name="btnSearch" title="검색">
검색
</button>
</span>
</div>
<!-- 상단 버튼 -->
<!-- 검색 조건 영역 -->
<form name="frmSearch">
<!-- 메인 조건 -->
<div class="container-search">
<div class="row g-1">
<div class="col-6">
<span class="form-label fw-bold form-search-title w-px-120 text-end required">입력일자</span>
<span class="form-search-linebox">
<input type="text" name="schInputDateFrom"
class="form-control form-date" required
data-fmt-type="day" title="시작 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
~
<input type="text" name="schInputDateTo"
class="form-control form-date" required
data-fmt-type="day" title="종료 날짜 선택">
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</span>
</div>
<div class="col-6">
</div>
</div>
</div> <!-- 메인 조건 -->
</form>
<!-- 검색 조건 영역 -->
<!-- 업무 버튼 및 건수 표시 -->
<div>
<div class="container-page-btn" name="gridButtonArea">
<!-- 건수, 페이지 표시 -->
<div class="d-flex flex-row justify-content-between">
<span is="paging-info" class="dataTables_info" name="dataPagingInfo" role="status" aria-live="polite"></span>
<ul class="pagination pagination-primary" name="dataPaging">
</ul>
</div>
</div>
</div>
<!-- 업무 버튼 및 건수 표시 -->
<!-- DataTables(그리드) -->
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-500" name="tableRspns">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr name="theadTr" data-search-target="[data-doctx='${pageName}']">
<th>고유아이디</th>
<th>입력일시</th>
<th>상태</th>
<th>송신번호</th>
<th>수신번호</th>
<th>발송목적</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody name="tbodyList">
</tbody>
<template is="curly-brackets" name="tmpltRows">
<tr data-index="{data-index}">
<td>MSG_KEY</td>
<td>INPUT_DATE</td>
<td>MSG_STATE_NM</td>
<td>CALLBACK</td>
<td>PHONE</td>
<td></td>
<td class="dummy-td"></td>
</tr>
</template>
<template name="tmpltNotFound">
<tr class="cmn">
<td valign="top" colspan="7" class="dataTables_empty text-center">정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- DataTables(그리드) -->
</div> <!-- <div class="card wrapper-list"> -->
</div> <!-- <div class="container-xxl flex-grow-1 px-0"> -->
<!-- Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- / inner page html <div class="content-wrapper"> -->
<script>
LoadScript("mngt03010Script", wctx.url("/webjars/js/fims/mngt/mngt03010.js?ver=${ver}"));
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// datasetControl
$P.ctrl = newMngt03010Control("${pageName}", "[data-doctx=${pageName}]");
// paging
$P.pagingSupport = new FimsPagingSupport({
ctrl: $P.ctrl // DatasetControl
, ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시
, linkContainer: "[name='dataPaging']" // <ul class="pagination pagination-primary" name="dataPaging">
});
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// dataTable 클릭 이벤트
$P.dataTableClick = (dataIndex) => {
if (dataIndex == "") return;
$P.$findn("tbodyList").setCurrentRow(dataIndex);
Apply.toDataset.current($P.ctrl.dataset, dataIndex);
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 초기화 버튼 이벤트
$P.fnReset = () => {
// 화면 초기화
$P.findn("frmSearch").reset();
// dataset 초기화
$P.ctrl.dataset.clear();
// input, select 초기화
let searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
searchForm.find("input[type='checkbox']").prop("checked", false);
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function(){ $(this).find("option:eq(0)").prop("selected", true); });
$P.$findn("schInputDateFrom").datepicker('setDate', DateSupport.getAddDay(-7));
$P.$findn("schInputDateTo").datepicker('setDate', TODAY());
}
// 검색 버튼 이벤트
$P.fnSearchList = () => {
// 검색조건
$P.ctrl.query = new FimsFormFields($P.selectorn("frmSearch")).get(); // 검색 조건
$P.ctrl.query.fetchSize = DEFAULT_FETCH_SIZE; // 한번에 조회되는 자료 건수
$P.ctrl.query.delYn = "N"; // 삭제 여부
$P.ctrl.load(1);
}
/**************************************************************************
* 초기 설정
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 기본 버튼 이벤트
$P.$findn("btnReset").on("click", () => { $P.fnReset() }); // 초기화
$P.$findn("btnSearch").on("click", () => { $P.fnSearchList() }); // 검색
// DataTables width 변경 조정
Componentization.fnMakeResizableTable($P.findn("tableRspns"));
// DataTables 스크롤 이벤트 생성
Componentization.fnMakeScrollableTable($P.findn("tableRspns"), $P.scrollDataList);
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmSearch")); // 달력 초기화
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 설정
$P.fnReset();
});
</script>

@ -0,0 +1,63 @@
function newMngt03010Control(pageName, doctx="[data-doctx='mngt03010']") {
let ctrl = new DatasetControl({
doctx: doctx
, prefix: "msgMngt"
, prefixName: "문자전송관리"
, dataGetter: obj => obj["List"]
, keys: ["MSG_KEY"]
, appendData: true
, infoSize: "xl"
, urls: {
load: wctx.url("/mngt/mngt03/010/list.do")
}
, formats: {
REG_DT: datetimeFormat
}
});
// 검색 조건
ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인
/**************************************************************************
* DatasetControl Events
**************************************************************************/
// Dataset 변경 이벤트
ctrl.onDatasetChange = (obj, option) => {
// 데이터 셋
let dataList = ctrl.dataset;
let empty = dataList.empty;
// 업무별 dataTables(그리드) tr, td
let foundContent = ctrl.find("[name='tmpltRows']").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');")
.replace(/{ondblclick}/gi, "");
let trs = empty ?
[ctrl.find("[name='tmpltNotFound']").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer);
let noMore = (dataList.length >= obj["Paging"]?.totalSize); // 전체 건수
let initScroll = (ctrl.query.pageNum < 2);
if (option != null && option.reloaded) {
initScroll = false;
}
// dataTables(그리드)에 자료 표시 td
ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore);
// dataTables(그리드)에 페이지 표시 pagingInfo
pageObject[pageName].pagingSupport.setPagingInfo(obj);
};
// 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => {
Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']"));
};
return ctrl;
}
Loading…
Cancel
Save