|
|
|
@ -48,16 +48,16 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row g-1 my-2">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<select id="schDateOpt--${pageName}" name="schDateOpt" class="form-select">
|
|
|
|
|
<select id="dayColumn--${pageName}" name="dayColumn" class="form-select">
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<span class="form-search-linebox">
|
|
|
|
|
<input type="text" id="schDateFrom--${pageName}" name="schDateFrom"
|
|
|
|
|
<input type="text" id="firstDay--${pageName}" name="firstDay"
|
|
|
|
|
class="form-control form-date"
|
|
|
|
|
data-fmt-type="day" title="시작 날짜 선택" />
|
|
|
|
|
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
|
|
|
|
|
~
|
|
|
|
|
<input type="text" id="schDateTo--${pageName}" name="schDateTo"
|
|
|
|
|
<input type="text" id="lastDay--${pageName}" name="lastDay"
|
|
|
|
|
class="form-control form-date"
|
|
|
|
|
data-fmt-type="day" title="종료 날짜 선택">
|
|
|
|
|
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
|
|
|
|
@ -100,7 +100,7 @@
|
|
|
|
|
<label class="form-label fw-bold form-search-title text-end">집계항목</label>
|
|
|
|
|
<select id="preset--${pageName}" name="preset"
|
|
|
|
|
class="form-select w-100" style="max-width:100%">
|
|
|
|
|
<option value="TOT_CNT" selected>전체건수</option>
|
|
|
|
|
<option value="totCnt" selected>전체건수</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -173,6 +173,7 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
var $P = pageObject["${pageName}"];
|
|
|
|
|
|
|
|
|
|
$P.statQuery = {};
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* pageObject.function
|
|
|
|
|
**************************************************************************/
|
|
|
|
@ -230,11 +231,30 @@ $(document).ready(function(){
|
|
|
|
|
$P.getNumberValueInfoList = () => {
|
|
|
|
|
var numberValuefoLiost = [];
|
|
|
|
|
|
|
|
|
|
var preset = $("#preset--${pageName}").find(":selected");
|
|
|
|
|
|
|
|
|
|
if(preset.val() == "totCnt"){
|
|
|
|
|
numberValuefoLiost = [{ aggregateType : "count" }];
|
|
|
|
|
return numberValuefoLiost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
numberValuefoLiost = window[preset.val()];
|
|
|
|
|
|
|
|
|
|
return numberValuefoLiost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.getCodeSubsetInfoList = () => {
|
|
|
|
|
var codeSubsetInfoList = [];
|
|
|
|
|
|
|
|
|
|
var preset = $("#preset--${pageName}").find(":selected");
|
|
|
|
|
|
|
|
|
|
if(window[preset.val()+"_codeSubsetInfoList"] != undefined){
|
|
|
|
|
codeSubsetInfoList = window[preset.val()+"_codeSubsetInfoList"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return codeSubsetInfoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.changeGrid = () => {
|
|
|
|
|
|
|
|
|
|
$("#masterThead--${pageName}").html("");
|
|
|
|
@ -279,30 +299,59 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$P.searchStat = () => {
|
|
|
|
|
|
|
|
|
|
var statQuery = {
|
|
|
|
|
structureType : "aggregate"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var formFields = new FimsFormFields("#frmSearch--${pageName}");
|
|
|
|
|
var formFieldsData = formFields.get();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(formFieldsData.firstDay == "" || formFieldsData.lastDay == ""){
|
|
|
|
|
dialog.alert("시작일자와 종료일자를 입력하세요.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var statQuery = {
|
|
|
|
|
structureType : "aggregate",
|
|
|
|
|
decimalPoint : 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//업무구분
|
|
|
|
|
if(formFieldsData.taskSeCd != ""){
|
|
|
|
|
statQuery.taskSeCd = formFieldsData.taskSeCd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//날짜 조회조건
|
|
|
|
|
statQuery.dayColumn = formFieldsData.dayColumn;
|
|
|
|
|
statQuery.firstDay = formFieldsData.firstDay;
|
|
|
|
|
statQuery.lastDay = formFieldsData.lastDay;
|
|
|
|
|
|
|
|
|
|
//통계 유형
|
|
|
|
|
var preset = $("#preset--${pageName}").find(":selected");
|
|
|
|
|
if(preset.val() == "totCnt"){
|
|
|
|
|
statQuery.statDomain = $("#defaultStatDomain--${pageName}").val();
|
|
|
|
|
} else {
|
|
|
|
|
statQuery.statDomain = preset[0].dataset.statDomain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//집계 그룹 정보
|
|
|
|
|
statQuery.groupInfoList = $P.getGroupInfoList();
|
|
|
|
|
statQuery.groupInfoList = $P.getGroupInfoList();
|
|
|
|
|
|
|
|
|
|
//수치값 정보
|
|
|
|
|
statQuery.numberValueInfoList = $P.getNumberValueInfoList();
|
|
|
|
|
|
|
|
|
|
//코드서브셋 정보
|
|
|
|
|
statQuery.codeSubsetInfoList = $P.getCodeSubsetInfoList();
|
|
|
|
|
|
|
|
|
|
//상세목록 조회 여부
|
|
|
|
|
statQuery.refListYn = formFieldsData.refListYn;
|
|
|
|
|
|
|
|
|
|
$P.statQuery = JSON.parse(JSON.stringify(statQuery));
|
|
|
|
|
|
|
|
|
|
statQuery = fnJsonToFormData(statQuery, "groupInfoList");
|
|
|
|
|
statQuery = fnJsonToFormData(statQuery, "numberValueInfoList");
|
|
|
|
|
statQuery = fnJsonToFormData(statQuery, "codeSubsetInfoList");
|
|
|
|
|
|
|
|
|
|
ajax.get({
|
|
|
|
|
url : wctx.url("/stat/stat01/010/info.do"),
|
|
|
|
|
data : defaultQuery,
|
|
|
|
|
data : statQuery,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
var stat = resp.stat;
|
|
|
|
|
$P.renderStat(stat);
|
|
|
|
@ -312,7 +361,22 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.renderStat = (stat) => {
|
|
|
|
|
$("#masterTbody--${pageName}").html("");
|
|
|
|
|
|
|
|
|
|
var statItems = stat.statItems;
|
|
|
|
|
|
|
|
|
|
if(statItems == null || statItems.length == 0){
|
|
|
|
|
dialog.alert("조회된 자료가 없습니다.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//비율 소수점
|
|
|
|
|
var decimalPoint = 0;
|
|
|
|
|
if($P.statQuery.decimalPoint != null){
|
|
|
|
|
decimalPoint = $P.statQuery.decimalPoint;
|
|
|
|
|
}
|
|
|
|
|
var pointMove = Number.parseFloat(0.1 ** decimalPoint).toFixed(decimalPoint);
|
|
|
|
|
|
|
|
|
|
for(var i=0; i < statItems.length; i++){
|
|
|
|
|
var statItem = statItems[i];
|
|
|
|
|
|
|
|
|
@ -320,18 +384,34 @@ $(document).ready(function(){
|
|
|
|
|
var itemNames = statItem.itemName;
|
|
|
|
|
|
|
|
|
|
var numberValues = statItem.numberValue;
|
|
|
|
|
//
|
|
|
|
|
// "tr"
|
|
|
|
|
// "td" itemNames.length
|
|
|
|
|
// "td" numberValues.length
|
|
|
|
|
|
|
|
|
|
var tr = "<tr>";
|
|
|
|
|
|
|
|
|
|
for(var j=0; j < itemNames.length; j++){
|
|
|
|
|
tr += "<td>" + itemNames[j] + "</td>";
|
|
|
|
|
}
|
|
|
|
|
for(var k=0; k < numberValues.length; k++){
|
|
|
|
|
tr += "<td class='text-end' >";
|
|
|
|
|
|
|
|
|
|
if($P.statQuery.numberValueInfoList[k].aggregateType == "ratio"){
|
|
|
|
|
tr += Number.parseFloat(numberValues[k] * pointMove).toFixed(decimalPoint);
|
|
|
|
|
tr += " %";
|
|
|
|
|
} else {
|
|
|
|
|
tr += numberFormat.format(numberValues[k]);
|
|
|
|
|
}
|
|
|
|
|
tr += "</td>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tr += "</tr>";
|
|
|
|
|
|
|
|
|
|
$("#masterTbody--${pageName}").append(tr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initDatepicker("frmSearch--${pageName}"); //달력 초기화
|
|
|
|
|
|
|
|
|
|
$("#schDateOpt--${pageName}").append(document.getElementById("schDateOptDatalist--${pageName}").innerHTML);
|
|
|
|
|
$("#dayColumn--${pageName}").append(document.getElementById("dayColumnDatalist--${pageName}").innerHTML);
|
|
|
|
|
|
|
|
|
|
$("#searchForMenu--${pageName}").append(document.getElementById("searchForMenuTemplate--${pageName}").innerHTML);
|
|
|
|
|
|
|
|
|
@ -358,4 +438,6 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$P.changeGrid();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|