Commit 69d8f75b by NGO THI HONG

#19120 Update CHK_pu

parent f6bd51d6
{
"newReport": true,
"continousWork": true,
"reportWarning": true,
"dashboardHome": false
}
\ No newline at end of file
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
</span> </span>
</a> </a>
<h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang" data-msg="labelPickUp">ピックアップ</h1> <h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang" data-msg="labelPickUp">ピックアップ</h1>
<a class="nav-link text-white lht-0 p-1"> <a href="javascript:CHK_L.sendAppCommand('refreshContent');" class="nav-link text-white lht-0 p-1">
<img class="icon" src="img/icon_update.svg" alt="更新"> <img class="icon" src="img/icon_update.svg" alt="更新">
<span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonRefresh" href="javascript:CHK_L.sendAppCommand('refreshContent');"> <span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonRefresh">
更新 更新
</span> </span>
</a> </a>
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
<main> <main>
<div class="tab-wrap"> <div class="tab-wrap">
<input id="tab-NewReport" type="radio" name="tab-task" class="tab-switch"> <input id="tab-NewReport" type="radio" name="tab-task" class="tab-switch">
<input id="tab-ContinueWork" type="radio" name="tab-task" class="tab-switch" checked> <input id="tab-ContinousWork" type="radio" name="tab-task" class="tab-switch" checked>
<input id="tab-ReportWithWarning" type="radio" name="tab-task" class="tab-switch"> <input id="tab-ReportWithWarning" type="radio" name="tab-task" class="tab-switch">
<ul class="tab-menu pl-0"> <ul class="tab-menu pl-0">
<li class="tab-label list-unstyled on" id="liTabNewReport"><label class="tab-label-NewReport fs-9 multi-lang" data-msg="labelNewReport" for="tab-NewReport" >新規報告</label><div class="task-cnt" id="count-NewReport"></div></li> <li class="tab-label list-unstyled on" id="liTabNewReport" data-active="newReport" onclick="CHK_pu.changeActivePickup(this);"><label class="tab-label-NewReport fs-9 multi-lang" data-msg="labelNewReport" for="tab-NewReport" >新規報告</label><div class="task-cnt" id="count-NewReport"></div></li>
<li class="tab-label list-unstyled" id="liTabContinueWork"><label class="tab-label-ContinueWork fs-9 multi-lang" data-msg="labelContinueWork" for="tab-ContinueWork" >工程作業</label><div class="task-cnt" id="count-ContinueWork"></div></li> <li class="tab-label list-unstyled" id="liTabContinousWork" data-active="continousWork" onclick="CHK_pu.changeActivePickup(this);"><label class="tab-label-ContinousWork fs-9 multi-lang" data-msg="labelContinousWork" for="tab-ContinousWork" >工程作業</label><div class="task-cnt" id="count-ContinousWork"></div></li>
<li class="tab-label list-unstyled" id="liTabReportWithWarning"><label class="tab-label-ReportWithWarning fs- multi-lang" data-msg="labelReportWithWarning" for="tab-ReportWithWarning" >警告を含む報告</label><div class="task-cnt" id="count-ReportWithWarning"></div></li> <li class="tab-label list-unstyled" id="liTabReportWithWarning" data-active="reportWarning" onclick="CHK_pu.changeActivePickup(this);"><label class="tab-label-ReportWithWarning fs- multi-lang" data-msg="labelReportWithWarning" for="tab-ReportWithWarning" >警告を含む報告</label><div class="task-cnt" id="count-ReportWithWarning"></div></li>
</ul> </ul>
<div class="tab-content-area"> <div class="tab-content-area">
<!-- 新規報告 --> <!-- 新規報告 -->
...@@ -68,13 +68,13 @@ ...@@ -68,13 +68,13 @@
</div> </div>
</div> </div>
<!-- 工程作業 --> <!-- 工程作業 -->
<div id="tab-content-ContinueWork" class="tab-content"> <div id="tab-content-ContinousWork" class="tab-content">
<div class="container-fluid"> <div class="container-fluid">
<div class="not-found text-dark mb-1 p-3 d-none" id="notFoundContinueWork"> <div class="not-found text-dark mb-1 p-3 d-none" id="notFoundContinousWork">
<img src="img/icon_not_found.svg" class="mb-3" alt="該当する作業がありません。"> <img src="img/icon_not_found.svg" class="mb-3" alt="該当する作業がありません。">
<div class="fs-9 text-secondary font-weight-bold">該当する作業がありません。</div> <div class="fs-9 text-secondary font-weight-bold">該当する作業がありません。</div>
</div> </div>
<ul class="task-list p-0 mt-3" id="continueWork-list"> <ul class="task-list p-0 mt-3" id="continousWork-list">
</ul> </ul>
</div> </div>
...@@ -99,7 +99,6 @@ ...@@ -99,7 +99,6 @@
<div id="footer"></div> <div id="footer"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="js/app.js"></script> <script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
</body> </body>
......
...@@ -2,41 +2,51 @@ ...@@ -2,41 +2,51 @@
var CHK_pu = {}; var CHK_pu = {};
CHK_pu.newReportList; CHK_pu.newReportList;
CHK_pu.continueWorkReport; CHK_pu.continousWorkReport;
CHK_pu.reportWithWarning; CHK_pu.reportWithWarning;
CHK_pu.pickupActive = "newReport";
CHK_pu.countNewReportList = 0; CHK_pu.countNewReportList = 0;
CHK_pu.countContinueWorkReport = 0; CHK_pu.countContinousWorkReport = 0;
CHK_pu.countReportWithWarning= 0; CHK_pu.countReportWithWarning= 0;
CHK_pu.initCommon = function() { CHK_pu.initCommon = function() {
CHK_pu.countNewReportList = 0; CHK_pu.countNewReportList = 0;
CHK_pu.countContinueWorkReport = 0; CHK_pu.countContinousWorkReport = 0;
CHK_pu.countReportWithWarning = 0; CHK_pu.countReportWithWarning = 0;
CHK_pu.newReportList = {list_0: []}; CHK_pu.newReportList = {list_0: []};
CHK_pu.continueWorkReport = {list_0: []}; CHK_pu.continousWorkReport = {list_0: []};
CHK_pu.reportWithWarning = {list_0: []}; CHK_pu.reportWithWarning = {list_0: []};
} }
CHK_pu.init = function() { CHK_pu.init = function() {
console.log("CHK_pu.init");
CHK.initCommon(); CHK.initCommon();
$("#footer").load("main-footer.html", function() { $("#footer").load("main-footer.html", function() {
CHK_Footer.activeDashboardBottomNav(); CHK_Footer.activeDashboardBottomNav();
}); });
CHK_pu.settingPickup();
if(CHK.operation == null || typeof CHK.operation === 'undefined') if(CHK.operation == null || typeof CHK.operation === 'undefined')
{ {
CHK.loadJson(CHK.jsonPath.operationList, function (json) { CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK.operation = json; CHK.operation = json;
CHK_pu.initoperationList(CHK.operation.operationList); CHK_pu.initOperationList(CHK.operation.operationList);
}); });
CHK_pu.settingPickup();
CHK_pu.initSettingActivePickup();
return; return;
} }
CHK_pu.initoperationList(CHK.operation.operationList); CHK_pu.initOperationList(CHK.operation.operationList);
CHK_pu.settingPickup();
CHK_pu.initSettingActivePickup();
} }
CHK_pu.initoperationList = function(operationList) {
CHK_pu.initOperationList = function(operationList) {
operationList = operationList.sort(function(a,b) { operationList = operationList.sort(function(a,b) {
if (!a.operationLastEditDate) { if (!a.operationLastEditDate) {
a.operationLastEditDate = "1900-01-01 09:00:00"; a.operationLastEditDate = "1900-01-01 09:00:00";
...@@ -49,37 +59,77 @@ CHK_pu.initoperationList = function(operationList) { ...@@ -49,37 +59,77 @@ CHK_pu.initoperationList = function(operationList) {
return 0; return 0;
}); });
CHK_pu.createNewReportList(operationList); CHK_pu.createNewReportList(operationList);
CHK_pu.createContinueWorkList(operationList); CHK_pu.createContinousWorkList(operationList);
CHK_pu.createReportWithWarning(operationList); CHK_pu.createReportWithWarning(operationList);
CHK_pu.setCountElementInPickup(); CHK_pu.setCountElementInPickup();
} }
CHK_pu.settingPickup = function() { CHK_pu.settingPickup = function() {
var isEnableNewReport = CHK_DashboardSetting.isSettingEnabled("dashboardSettingNewReport");
if(isEnableNewReport == true) CHK.loadDashboardSetting(function() {
$("#liTabNewReport").css("display","none"); if(!CHK.dashboardSetting.newReport)
var isEnableContinueWork = CHK_DashboardSetting.isSettingEnabled("dashboardSettingContinousWork"); {
if(isEnableContinueWork == true) $("#liTabNewReport").css("display","none");
$("#liTabContinueWork").css("display","none"); }
var isEnableReportWithWarning = CHK_DashboardSetting.isSettingEnabled("dashboardSettingReportWarning"); if(!CHK.dashboardSetting.continousWork)
if(isEnableReportWithWarning == true) {
$("#liTabReportWithWarning").css("display","none"); $("#liTabContinousWork").css("display","none");
}
if(!CHK.dashboardSetting.reportWarning)
{
$("#liTabReportWithWarning").css("display","none");
}
});
} }
CHK_pu.initSettingActivePickup = function() {
var urlParam = CHK.getUrlParameter();
CHK_pu.pickupActive = urlParam.pickupActive;
CHK_pu.settingActivePickup(CHK_pu.pickupActive);
}
CHK_pu.settingActivePickup = function(pickupActive) {
CHK_pu.pickupActive = pickupActive;
$('#liTabNewReport').removeClass('on');
$('#liTabContinousWork').removeClass('on');
$('#liTabReportWithWarning').removeClass('on');
if(pickupActive == "newReport")
{
$('#liTabNewReport').addClass('on');
return;
}
if(pickupActive == "continousWork")
{
$('#liTabContinousWork').addClass('on');
return;
}
if(pickupActive == "reportWarning")
{
$('#liTabReportWithWarning').addClass('on');
return;
}
}
CHK_pu.changeActivePickup = function(liPickupTab) {
CHK_pu.settingActivePickup($(liPickupTab).attr("data-active"));
}
CHK_pu.goBack = function() { CHK_pu.goBack = function() {
history.back(); history.back();
} }
CHK_pu.setCountElementInPickup = function() { CHK_pu.setCountElementInPickup = function() {
console.log("setCountElementInPickup" , CHK_pu.countNewReportList, CHK_pu.countContinousWorkReport, CHK_pu.countReportWithWarning );
$("#count-NewReport")[0].innerHTML = CHK_pu.countNewReportList; $("#count-NewReport")[0].innerHTML = CHK_pu.countNewReportList;
$("#count-ContinueWork")[0].innerHTML = CHK_pu.countContinueWorkReport; $("#count-ContinousWork")[0].innerHTML = CHK_pu.countContinousWorkReport;
$("#count-ReportWithWarning")[0].innerHTML = CHK_pu.countReportWithWarning; $("#count-ReportWithWarning")[0].innerHTML = CHK_pu.countReportWithWarning;
} }
CHK_pu.createNewReportList = function(operationList, isSearched = false) { CHK_pu.createNewReportList = function(operationList, isSearched = false) {
console.log("createNewReportList" , operationList ); //console.log("createNewReportList" , operationList );
$("#newReport-list").empty(); $("#newReport-list").empty();
CHK_pu.countNewReportList = 0; CHK_pu.countNewReportList = 0;
if (typeof operationList === 'undefined' || operationList.length < 1) { if (typeof operationList === 'undefined' || operationList.length < 1) {
$('#notFoundNewReport').removeClass('d-none'); $('#notFoundNewReport').removeClass('d-none');
return; return;
...@@ -105,7 +155,6 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) { ...@@ -105,7 +155,6 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) {
ahrefRequiredFlg.append(divTitle); ahrefRequiredFlg.append(divTitle);
ahrefRequiredFlg.append(iIcon); ahrefRequiredFlg.append(iIcon);
messageli.append(ahrefRequiredFlg); messageli.append(ahrefRequiredFlg);
//console.log(li );
$("#newReport-list").append(messageli); $("#newReport-list").append(messageli);
CHK_pu.countNewReportList = CHK_pu.countNewReportList + 1; CHK_pu.countNewReportList = CHK_pu.countNewReportList + 1;
...@@ -115,23 +164,22 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) { ...@@ -115,23 +164,22 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) {
if(CHK.isAndroid) { if(CHK.isAndroid) {
android.hideLoading(); android.hideLoading();
} }
console.log("CHK_pu.countNewReportList " , CHK_pu.countNewReportList );
console.log("end createNewReportList" );
}; };
CHK_pu.createContinueWorkList = function(operationList, isSearched = false) { CHK_pu.createContinousWorkList = function(operationList, isSearched = false) {
$("#continueWork-list").empty(); $("#continousWork-list").empty();
CHK_pu.countContinueWorkReport = 0; CHK_pu.countContinousWorkReport = 0;
console.log("createContinueWorkList" ); if (typeof operationList === 'undefined' || operationList.length < 1) {
$('#notFoundContinousWork').removeClass('d-none');
return;
}
$('#notFoundContinousWork').addClass('d-none');
for (var i = 0; i < operationList.length; i++) { for (var i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3) if (operationList[i].reportType === 3)
{ {
if (!operationList[i].processList || operationList[i].processList.length == 0) continue; if (!operationList[i].processList || operationList[i].processList.length == 0) continue;
console.log("operationList[i].operationName", operationList[i].operationName );
console.log("operationList[i].process_list", operationList[i].processList[0] );
//TODO aタグlist.html 転移処理 //TODO aタグlist.html 転移処理
var messageli = $("<li class='item list-unstyled rounded border mb-2' name = 'operationId_" + operationList[i].operationId + "'></li>") ; var messageli = $("<li class='item list-unstyled rounded border mb-2' name = 'operationId_" + operationList[i].operationId + "'></li>") ;
var ahrefRequiredFlg ; var ahrefRequiredFlg ;
...@@ -158,33 +206,34 @@ CHK_pu.createContinueWorkList = function(operationList, isSearched = false) { ...@@ -158,33 +206,34 @@ CHK_pu.createContinueWorkList = function(operationList, isSearched = false) {
ahrefRequiredFlg.append(iIcon); ahrefRequiredFlg.append(iIcon);
messageli.append(ahrefRequiredFlg); messageli.append(ahrefRequiredFlg);
$("#continueWork-list").append(messageli); $("#continousWork-list").append(messageli);
CHK_pu.countContinueWorkReport = CHK_pu.countContinueWorkReport + 1; CHK_pu.countContinousWorkReport = CHK_pu.countContinousWorkReport + 1;
} }
} }
// show not found if // show not found if
if (CHK_pu.countContinueWorkReport < 1) { if (CHK_pu.countContinousWorkReport < 1) {
$('#notFoundNewReport').removeClass('d-none'); $('#notFoundContinousWork').removeClass('d-none');
return;
} }
$('#notFoundNewReport').addClass('d-none');
if(CHK.isAndroid) { if(CHK.isAndroid) {
android.hideLoading(); android.hideLoading();
} }
console.log("CHK_pu.countContinueWorkReport " , CHK_pu.countContinueWorkReport );
}; };
CHK_pu.createReportWithWarning = function(operationList, isSearched = false) { CHK_pu.createReportWithWarning = function(operationList, isSearched = false) {
$("#reportWithWarning-list").empty(); $("#reportWithWarning-list").empty();
CHK_pu.countReportWithWarning = 0; CHK_pu.countReportWithWarning = 0;
console.log("createReportWithWarning" );
if (typeof operationList === 'undefined' || operationList.length < 1) {
$('#notFoundReportWithWarning').removeClass('d-none');
return;
}
$('#notFoundReportWithWarning').addClass('d-none');
for (var i = 0; i < operationList.length; i++) { for (var i = 0; i < operationList.length; i++) {
console.log("lengh", operationList[i].warningReportList.length );
if(operationList[i].warningReportList.length === 0) continue; if(operationList[i].warningReportList.length === 0) continue;
//TODO aタグlist.html 転移処理 //TODO aタグlist.html 転移処理
var operationNameLi; var operationNameLi;
...@@ -236,9 +285,11 @@ CHK_pu.createReportWithWarning = function(operationList, isSearched = false) { ...@@ -236,9 +285,11 @@ CHK_pu.createReportWithWarning = function(operationList, isSearched = false) {
} }
} }
// show not found if
if (CHK_pu.countReportWithWarning < 1) {
$('#notFoundReportWithWarning').removeClass('d-none');
}
if(CHK.isAndroid) { if(CHK.isAndroid) {
android.hideLoading(); android.hideLoading();
} }
console.log("CHK_pu.countReportWithWarning " , CHK_pu.countReportWithWarning );
console.log("End createReportWithWarning" );
}; };
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment