단속팀 조회 기능 추가

main
이범준 1 year ago
parent ec9995b98d
commit ad43bc0a57

@ -73,7 +73,7 @@ public class CrdnQuery extends CmmnQuery {
//기타 //기타
private String vhrno; private String vhrno;
private String cvlcptPrcsPicNm; private String cvlcptPrcsPicNm;
private String teamNm;
public String getGridType() { public String getGridType() {
return ifEmpty(gridType, () -> null); return ifEmpty(gridType, () -> null);
@ -183,6 +183,15 @@ public class CrdnQuery extends CmmnQuery {
return self(); return self();
} }
public String getTeamNm() {
return ifEmpty(teamNm, () -> null);
}
public <T extends CrdnQuery> T setTeamNm(String teamNm) {
this.teamNm = teamNm;
return self();
}
public String getSchCvlcptRcptYmdFrom() { public String getSchCvlcptRcptYmdFrom() {
return ifEmpty(schCvlcptRcptYmdFrom, () -> null); return ifEmpty(schCvlcptRcptYmdFrom, () -> null);
} }

@ -17,6 +17,12 @@ public interface CrdnTeamMapper extends AbstractMapper {
*/ */
List<DataObject> selectTeamList(CrdnQuery query); List<DataObject> selectTeamList(CrdnQuery query);
/** .<br />
* @param query
* @return
*/
List<DataObject> selectRemovedTeamList(CrdnQuery query);
/** .<br /> /** .<br />
* @param teamId ID * @param teamId ID
* @return * @return

@ -21,6 +21,12 @@ public interface CrdnStngService {
*/ */
List<DataObject> getTeamList(CrdnQuery query); List<DataObject> getTeamList(CrdnQuery query);
/** .
* @param query
* @return
*/
List<DataObject> getRemovedTeamList(CrdnQuery query);
/** . /** .
* @param teamId ID * @param teamId ID
* @return * @return

@ -225,6 +225,14 @@ public class CrdnStngBean extends AbstractComponent {
return crdnTeamMapper.selectTeamList(query); return crdnTeamMapper.selectTeamList(query);
} }
/** .
* @param query
* @return
*/
public List<DataObject> selectRemovedTeamList(CrdnQuery query) {
return crdnTeamMapper.selectRemovedTeamList(query);
}
/** . /** .
* @param teamId ID * @param teamId ID
* @return * @return
@ -299,4 +307,5 @@ public class CrdnStngBean extends AbstractComponent {
return exmptnVhclMapper.selectExemptionVehicleHistoryList(exmptnVhclId); return exmptnVhclMapper.selectExemptionVehicleHistoryList(exmptnVhclId);
} }
} }

@ -34,6 +34,11 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng
return crdnStngBean.selectTeamList(query); return crdnStngBean.selectTeamList(query);
} }
@Override
public List<DataObject> getRemovedTeamList(CrdnQuery query) {
return crdnStngBean.selectRemovedTeamList(query);
}
@Override @Override
public DataObject getTeamInfo(String teamId) { public DataObject getTeamInfo(String teamId) {
return crdnStngBean.selectTeamInfo(teamId); return crdnStngBean.selectTeamInfo(teamId);

@ -1,10 +1,18 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnStngService; import cokr.xit.fims.crdn.service.CrdnStngService;
/** .<br /> /** .<br />
@ -17,14 +25,22 @@ public class Crdn07Controller extends ApplicationController {
public class METHOD_URL { public class METHOD_URL {
public static final String public static final String
crackdownTeamManagementMain = "/010/main.do", crackdownTeamManagementMain = "/010/main.do"
getTeamInfo = "/010/list.do" , getTeamList = "/010/list.do"
, getRemovedTeamList = "/010/removedTeamList.do"
, getTeamInfo = "/010/info.do"
; ;
} }
@Resource(name="crdnStngService") @Resource(name="crdnStngService")
private CrdnStngService crdnStngService; private CrdnStngService crdnStngService;
@Resource(name="globalStngMapper")
protected GlobalStngMapper globalStngMapper;
@Resource(name="userMapper")
protected UserMapper userMapper;
/** . /** .
* @return fims/crdn/crdn07010-main * @return fims/crdn/crdn07010-main
*/ */
@ -33,10 +49,48 @@ public class Crdn07Controller extends ApplicationController {
mav.setViewName("fims/crdn/crdn07010-main"); mav.setViewName("fims/crdn/crdn07010-main");
mav.addObject("pageName", "crdn07010-main"); mav.addObject("pageName", "crdn07010-main");
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM054","FIM071","FIM002");
mav.addObject("FIM054List", commonCodes.get("FIM054"));
mav.addObject("FIM071List", commonCodes.get("FIM071"));
mav.addObject("FIM002List", commonCodes.get("FIM002"));
addCodes(commonCodes, mav, "FIM054");
addCodes(commonCodes, mav, "FIM071");
addCodes(commonCodes, mav, "FIM002");
return mav; return mav;
} }
/** .<br /> /** .<br />
* {@link CrdnStngService#getTeamList(query)}
* @param crdn
* @return jsonView
*/
public ModelAndView getTeamList(CrdnQuery query) {
ModelAndView mav = new ModelAndView("jsonView");
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
String curDeptCode = currentUser.getDeptCode();
String sggCd = globalStngMapper.selectSggCd(curDeptCode);
query.setSggCd(sggCd);
return setCollectionInfo(new ModelAndView("jsonView"), crdnStngService.getTeamList(query),"");
}
/** .<br />
* {@link CrdnStngService#getRemovedTeamList(query)}
* @param crdn
* @return jsonView
*/
public ModelAndView getRemovedTeamList(CrdnQuery query) {
ModelAndView mav = new ModelAndView("jsonView");
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
String curDeptCode = currentUser.getDeptCode();
String sggCd = globalStngMapper.selectSggCd(curDeptCode);
query.setSggCd(sggCd);
return setCollectionInfo(new ModelAndView("jsonView"), crdnStngService.getRemovedTeamList(query),"");
}
/** .<br />
* {@link CrdnStngService#getTeamInfo(String)} * {@link CrdnStngService#getTeamInfo(String)}
* @param crdn * @param crdn
* @return jsonView * @return jsonView

@ -301,6 +301,18 @@ public class BpvController {
@RequestMapping(name="전용차로과태료업무 단속팀 관리", value=CLASS_URL+Crdn07Controller.CLASS_URL) @RequestMapping(name="전용차로과태료업무 단속팀 관리", value=CLASS_URL+Crdn07Controller.CLASS_URL)
class Crdn07Controller extends cokr.xit.fims.crdn.web.Crdn07Controller { class Crdn07Controller extends cokr.xit.fims.crdn.web.Crdn07Controller {
@Override
@RequestMapping(name="전용차로과태료업무 단속팀 목록 조회", value=METHOD_URL.getTeamList)
public ModelAndView getTeamList(CrdnQuery query) {
return super.getTeamList(query);
}
@Override
@RequestMapping(name="전용차로과태료업무 비사용 단속팀 목록 조회", value=METHOD_URL.getRemovedTeamList)
public ModelAndView getRemovedTeamList(CrdnQuery query) {
return super.getRemovedTeamList(query);
}
@Override @Override
@RequestMapping(name="전용차로과태료업무 단속팀 정보 조회", value=METHOD_URL.getTeamInfo) @RequestMapping(name="전용차로과태료업무 단속팀 정보 조회", value=METHOD_URL.getTeamInfo)
public ModelAndView getTeamInfo(String teamId) { public ModelAndView getTeamInfo(String teamId) {

@ -313,6 +313,18 @@ public class PvsController {
@RequestMapping(name="주정차과태료업무 단속팀 관리", value=CLASS_URL+Crdn07Controller.CLASS_URL) @RequestMapping(name="주정차과태료업무 단속팀 관리", value=CLASS_URL+Crdn07Controller.CLASS_URL)
class Crdn07Controller extends cokr.xit.fims.crdn.web.Crdn07Controller { class Crdn07Controller extends cokr.xit.fims.crdn.web.Crdn07Controller {
@Override
@RequestMapping(name="주정차과태료업무 단속팀 목록 조회", value=METHOD_URL.getTeamList)
public ModelAndView getTeamList(CrdnQuery query) {
return super.getTeamList(query);
}
@Override
@RequestMapping(name="주정차과태료업무 비사용 단속팀 목록 조회", value=METHOD_URL.getRemovedTeamList)
public ModelAndView getRemovedTeamList(CrdnQuery query) {
return super.getRemovedTeamList(query);
}
@Override @Override
@RequestMapping(name="주정차과태료업무 단속팀 정보 조회", value=METHOD_URL.getTeamInfo) @RequestMapping(name="주정차과태료업무 단속팀 정보 조회", value=METHOD_URL.getTeamInfo)
public ModelAndView getTeamInfo(String teamId) { public ModelAndView getTeamInfo(String teamId) {

@ -4,15 +4,40 @@
<select id="selectTeamList" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="dataobject"> <select id="selectTeamList" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="dataobject">
/* 단속팀 목록 조회(crdnTeamMapper.selectTeamList) */ /* 단속팀 목록 조회(crdnTeamMapper.selectTeamList) */
SELECT TEAM_ID SELECT A.TEAM_ID
, TEAM_NM , A.TEAM_NM
, TEAMER_1 , A.CRDN_SE_CD
, TEAMER_2 , A.TEAMER_1
, TEAMER_3 , A.TEAMER_2
, TEAMER_4 , A.TEAMER_3
FROM TB_TEAM_INFO , A.TEAMER_4
WHERE SGG_CD = #{sggCd} , A.ETC_CN
AND TASK_SE_CD = #{taskSeCd} , A.REG_DT
FROM TB_TEAM_INFO A
WHERE A.USE_YN = 'Y'
AND A.SGG_CD = #{sggCd}
AND A.TASK_SE_CD = #{taskSeCd}
ORDER BY A.TEAM_NM
</select>
<select id="selectRemovedTeamList" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="dataobject">
/* 비사용 단속팀 목록 조회(crdnTeamMapper.selectRemovedTeamList) */
SELECT A.TEAM_ID
, A.TEAM_NM
, A.CRDN_SE_CD
, A.TEAMER_1
, A.TEAMER_2
, A.TEAMER_3
, A.TEAMER_4
, A.ETC_CN
, A.REG_DT
, A.MDFCN_DT
FROM TB_TEAM_INFO A
WHERE A.USE_YN = 'N'
AND A.SGG_CD = #{sggCd}
AND A.TASK_SE_CD = #{taskSeCd}
AND A.TEAM_NM = #{teamNm}
ORDER BY A.MDFCN_DT
</select> </select>
<select id="selectTeamInfo" parameterType="string" resultType="dataobject"> <select id="selectTeamInfo" parameterType="string" resultType="dataobject">

@ -1,14 +1,455 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
pageEncoding="UTF-8"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!DOCTYPE html>
<html> <div class="content-wrapper">
<head> <div class="container-xxl flex-grow-1 px-0">
<meta charset="UTF-8"> <c:set var="pageKorName" scope="request">단속팀 관리</c:set>
<title>Insert title here</title> <div class="card">
</head> <div class="wrapper-list">
<body> <div>
주정차과태료, 전용차로과태료 기능 준비중... <!-- 조회조건 -->
<!-- 단속조명,단속구분,단속원1,단속원2,단속원3,단속원4,특이사항, 등록일,해체일 --> <div class="container-page-btn">
<!-- 조회,등록,수정,삭제,비사용단속조 조회 --> <button type="button" id="btnReset--${pageName}" class="btn btn-outline-dark" title="초기화">초기화</button>
</body> <span class="container-window-btn-right">
</html> <button type="button" id="btnSearch--${pageName}" class="btn btn-search" title="검색">검색</button>
</span>
</div>
<form id="frmSearch--${pageName}" name="frmSearch">
<div class="container-search">
<div class="row g-1">
<div class="col-6">
<label class="form-label fw-bold form-search-title">업무구분</label>
<span class="form-search-linebox">
<c:forEach items="${FIM054List}" var="item">
<c:if test="${item.code == 'PVS' or item.code == 'BPV'}">
<label>
<input name="taskSeCd" type="radio" value="${item.code}"
class="form-check-input" alt="업무구분"
onchange="pageObject['${pageName}'].fnResetAndChangeBiz(this.value);">
${item.value}
</label>
</c:if>
</c:forEach>
</span>
</div>
</div>
</div>
</form>
<!-- 리스트 -->
<div>
<span class="container-page-btn">
<div class="d-flex flex-row justify-content-between">
<label id="useTeamPaging--${pageName}PagingInfo" class="dataTables_info"
role="status" aria-live="polite"></label>
<ul id="useTeamPaging--${pageName}" class="pagination pagination-primary">
</ul>
</div>
</span>
</div>
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="table-responsive--${pageName}" class="table-responsive"
style="overflow-x: scroll;height:300px;overflow-y: scroll;">
<table id="DataTables_Table_0--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr id="useTeamTheadTr--${pageName}">
<th style="width: 200px;">단속조</th>
<th style="width: 200px;">단속구분</th>
<th style="width: 200px;">단속원1</th>
<th style="width: 200px;">단속원2</th>
<th style="width: 200px;">단속원3</th>
<th style="width: 200px;">단속원4</th>
<th style="width: 200px;">특이사항</th>
<th style="width: 200px;">등록일</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="useTeamTbody--${pageName}"></tbody>
<template id="useTeamRow--${pageName}">
<tr data-key="{TEAM_ID}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAM_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_SE_CD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_1}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_2}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_3}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_4}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{ETC_CN}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{REG_DT}</td>
<td class="dummy-td"></td>
</tr>
</template>
<template id="useTeamNotFound--${pageName}">
<tr>
<td valign="top" colspan="9" class="dataTables_empty text-center">단속팀 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- 입력, 수정 -->
<div class="card">
<form id="frmEdit--${pageName}">
<div class="row g-1">
<div class="col-md-3">
<label for="teamNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end required">
단속조명
</label>
<input type="text" id="teamNm--${pageName}" name="vhrno" class="form-control"
data-maxlengthb="20" required />
</div>
<div class="col-md-9">
<label for="teamNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
단속구분
</label>
<select id="crdnSeCd--${pageName}" name="crdnSeCd" class="form-select">
<option value=""></option>
<c:forEach items="${FIM002List}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
<div class="col-md-3">
<label for="teamer1--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
단속원1
</label>
<input type="text" id="teamer1--${pageName}" name="teamer1" class="form-control"
data-maxlengthb="20" />
</div>
<div class="col-md-3">
<label for="teamer2--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
단속원2
</label>
<input type="text" id="teamer2--${pageName}" name="teamer2" class="form-control"
data-maxlengthb="20" />
</div>
<div class="col-md-3">
<label for="teamer3--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
단속원3
</label>
<input type="text" id="teamer3--${pageName}" name="teamer3" class="form-control"
data-maxlengthb="20" />
</div>
<div class="col-md-3">
<label for="teamer4--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
단속원4
</label>
<input type="text" id="teamer4--${pageName}" name="teamer4" class="form-control"
data-maxlengthb="20" />
</div>
<div class="col-md-12">
<label for="etcCn--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
특이사항
</label>
<input type="text" id="etcCn--${pageName}" name="etcCn"
class="form-control w-px-700" data-maxlengthb="1000" />
</div>
</div>
<div class="row mt-4 justify-content-end mb-3">
<div class="col-md-6">
<div class="row justify-content-end">
<div class="col-sm-3">
<button type="button" id="btnSave--${pageName}" class="btn btn-primary">저장</button>
<button type="button" id="btnRemove--${pageName}" class="btn btn-primary">삭제</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- 비사용 리스트 -->
<div class="container-search">
<div class="row g-1">
<div class="col-6">
<label class="form-label fw-bold form-search-title" for="deletedTeamNm--${pageName}">선택된 단속조</label>
<span class="form-search-linebox">
<input type="text" class="form-control" id="deletedTeamNm--${pageName}" name="deletedTeamNm" />
<button type="button" id="btnShowDeleted--${pageName}" class="btn btn-search">비사용 단속조 조회</button>
</span>
</div>
</div>
</div>
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="table-responsive--${pageName}" class="table-responsive"
style="overflow-x: scroll;height:300px;overflow-y: scroll;">
<table id="DataTables_Table_1--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr id="delTeamTheadTr--${pageName}">
<th style="width: 200px;">단속조</th>
<th style="width: 200px;">단속구분</th>
<th style="width: 200px;">단속원1</th>
<th style="width: 200px;">단속원2</th>
<th style="width: 200px;">단속원3</th>
<th style="width: 200px;">단속원4</th>
<th style="width: 200px;">특이사항</th>
<th style="width: 200px;">등록일</th>
<th style="width: 200px;">해체일</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="delTeamTbody--${pageName}"></tbody>
<template id="delTeamRow--${pageName}">
<tr data-key="{TEAM_ID}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAM_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_SE_CD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_1}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_2}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_3}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{TEAMER_4}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{ETC_CN}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{REG_DT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{MDFCN_DT}</td>
<td class="dummy-td"></td>
</tr>
</template>
<template id="delTeamNotFound--${pageName}">
<tr>
<td valign="top" colspan="10" class="dataTables_empty text-center">조회된 정보가 없습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="/WEB-INF/jsp/include/bottom.jsp" />
<div class="content-backdrop fade"></div>
</div>
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
var FIM071 = new CommonCodes(${FIM071});
var FIM002 = new CommonCodes(${FIM002});
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.useTeamControl = new DatasetControl({
urls : {
load : "",
remove : ""
},
dataGetter : obj => obj["List"], appendData:false,
keymapper : info => info ? info.TEAM_ID : "",
formats: {
OGDP_SE_CD : FIM071,
CRDN_SE_CD : FIM002,
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat
}
});
$P.delTeamControl = new DatasetControl({
urls : { },
dataGetter : obj => obj["List"], appendData: false,
keymapper : info => info ? info.TEAM_ID : "",
formats: {
OGDP_SE_CD : FIM071,
CRDN_SE_CD : FIM002,
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat
}
});
/**************************************************************************
* DatasetControl.on
**************************************************************************/
$P.useTeamControl.onDatasetChange = (obj) => {
$P.renderUseTeamList(obj["Total"]);
$("#teamPaging--${pageName}").setPagingInfo({
list: $P.useTeamControl.dataset,
prefix: "useTeamPaging--${pageName}",
start: obj["Start"],
totalSize: obj["Total"],
fetchSize: obj["Total"],
func: "pageObject['${pageName}'].useTeamControl.load({index})"
});
};
$P.useTeamControl.onCurrentChange = (item) => {
if(!item){
return;
}
$("#useTeamTbody--${pageName}").setCurrentRow(item.data.TEAM_ID);
$("#teamNm--${pageName}").val(item.data.TEAM_NM);
$("#crdnSeCd--${pageName}").val(item.data.CRDN_SE_CD);
$("#teamer1--${pageName}").val(item.data.TEAMER_1);
$("#teamer2--${pageName}").val(item.data.TEAMER_2);
$("#teamer3--${pageName}").val(item.data.TEAMER_3);
$("#teamer4--${pageName}").val(item.data.TEAMER_4);
$("#etcCn--${pageName}").val(item.data.ETC_CN);
$("#deletedTeamNm--${pageName}").val(item.data.TEAM_NM);
}
$P.delTeamControl.onDatasetChange = (obj) => {
var delTeamList = $P.delTeamControl.dataset;
var empty = delTeamList.empty;
var notFound = [document.getElementById("delTeamNotFound--${pageName}").innerHTML];
var found = document.getElementById("delTeamRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "")
.replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : delTeamList.inStrings(found,replacer);
$("#delTeamTbody--${pageName}").html(trs.join());
};
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $("#frmSearch--${pageName}");
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
$P.useTeamControl.setData([]);
var editForm = $("#frmEdit--${pageName}");
editForm.find("input[type='text']").val("");
editForm.find("input[type='hidden']").val("");
$P.delTeamControl.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.useTeamControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do");
$P.useTeamControl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do");
}
$P.refreshUseTeamList = () => {
if($P.useTeamControl.query.pageNum == null){
$P.useTeamControl.query.pageNum = 1;
}
$P.useTeamControl.load(1);
}
$P.searchUseTeamList = () => {
$P.useTeamControl.query = $P.getParams();
$P.useTeamControl.load(1);
}
$P.clickUseTeamList = (dataKey) => {
$P.useTeamControl.setCurrent(dataKey);
}
$P.renderUseTeamList = (total) => {
var useTeamList = $P.useTeamControl.dataset;
var empty = useTeamList.empty;
var notFound = [document.getElementById("useTeamNotFound--${pageName}").innerHTML];
var found = document.getElementById("useTeamRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickUseTeamList('" + dataItem.getValue("TEAM_ID") + "');")
.replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : useTeamList.inStrings(found,replacer);
$("#useTeamTbody--${pageName}").html(trs.join());
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
return data;
}
$P.fnSave = () => {
}
$P.fnRemove = () => {
var dataKey = $P.useTeamControl.getCurrent()["TEAM_ID"];
ajax.get({
url : $P.useTeamControl.urls.remove,
data : {
"teamId" : dataKey
},
success : resp => {
if(resp.saved){
$P.refreshUseTeamList();
}
}
});
};
$P.fnShowDeleted = () => {
var teamNm = $("#deletedTeamNm--${pageName}").val();
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
ajax.get({
url : wctx.url("/" + taskSeCd + "/crdn/crdn07/010/removedTeamList.do"),
data: {
"teamNm" : teamNm,
"taskSeCd" : taskSeCd
},
success:resp => {
$P.delTeamControl.setData(resp);
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset());
$("#btnSearch--${pageName}").on("click", () => $P.searchUseTeamList());
$("#btnSave--${pageName}").on('click', () => { $P.fnSave(); });
$("#btnRemove--${pageName}").on('click', () => { $P.fnRemove(); });
$("#btnShowDeleted--${pageName}").on('click', () => { $P.fnShowDeleted(); });
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
$("#DataTables_Table_1--${pageName}").find("th").resizable({handles : "e"});
/**************************************************************************
* 초기화
**************************************************************************/
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$("#frmSearch--${pageName} input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
$P.fnResetAndChangeBiz(defaultBizValue);
});
</script>

Loading…
Cancel
Save