Commit 499fc2f3 by NGO THI HONG

#49114 implement back button

parent 98e46f5f
......@@ -16,16 +16,18 @@
<script src="js/jquery-1.11.2.min.js?__UPDATEID__"></script>
<script src="script/check.js?__UPDATEID__"></script>
<script src="script/check-list.js?__UPDATEID__"></script>
<script src="script/check-dashboard-setting.js?__UPDATEID__"></script>
<script src="script/check-foriOS.js"></script>
<script src="script/constant.js?__UPDATEID__"></script>
<script src="script/check_pu.js?__UPDATEID__"></script>
<script src="script/check-footer.js"></script>
</head>
<body onload="CHK_pu.init();">
<header >
<nav class="navbar navbar-dark bg-primary position-fixed fixed-top w-100">
<a href="index.html" class="navbar-brand category-btn lht-0">
<a href="javascript:CHK_pu.goBack();" class="navbar-brand category-btn lht-0">
<i class="fas fa-chevron-left fs-12 p-1"></i>
<span class="d-none d-md-inline fs-10 multi-lang" data-msg="buttonBack">
戻る
......@@ -34,7 +36,7 @@
<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">
<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" onclick="CHK_pu.init();">
<span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonRefresh" href="javascript:CHK_L.sendAppCommand('refreshContent');">
更新
</span>
</a>
......@@ -49,14 +51,18 @@
<input id="tab-ContinueWork" type="radio" name="tab-task" class="tab-switch" checked>
<input id="tab-ReportWithWarning" type="radio" name="tab-task" class="tab-switch">
<ul class="tab-menu pl-0">
<li class="tab-label list-unstyled on"><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"><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"><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 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" 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="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>
</ul>
<div class="tab-content-area">
<!-- 新規報告 -->
<div id="tab-content-NewReport" class="tab-content on">
<div class="container-fluid">
<div class="not-found text-dark mb-1 p-3 d-none" id="notFoundNewReport">
<img src="img/icon_not_found.svg" class="mb-3" alt="該当する作業がありません。">
<div class="fs-9 text-secondary font-weight-bold">該当する作業がありません。</div>
</div>
<ul class="task-list p-0 mt-3" id="newReport-list">
</ul>
</div>
......@@ -64,6 +70,10 @@
<!-- 工程作業 -->
<div id="tab-content-ContinueWork" class="tab-content">
<div class="container-fluid">
<div class="not-found text-dark mb-1 p-3 d-none" id="notFoundContinueWork">
<img src="img/icon_not_found.svg" class="mb-3" alt="該当する作業がありません。">
<div class="fs-9 text-secondary font-weight-bold">該当する作業がありません。</div>
</div>
<ul class="task-list p-0 mt-3" id="continueWork-list">
</ul>
......@@ -72,6 +82,10 @@
<!-- 警告を含む報告 -->
<div id="tab-content-ReportWithWarning" class="tab-content">
<div class="container-fluid">
<div class="not-found text-dark mb-1 p-3 d-none " id="notFoundReportWithWarning">
<img src="img/icon_not_found.svg" class="mb-3" alt="該当する作業がありません。">
<div class="fs-9 text-secondary font-weight-bold">該当する作業がありません。</div>
</div>
<ul class="task-list p-0 mt-3" id="reportWithWarning-list">
</ul>
......@@ -84,26 +98,7 @@
<footer class="fixed-bottom bg-light">
<nav class="d-flex justify-content-around">
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none">
<img src="img/icon_dashboard.svg" alt="ダッシュボード" class="p-1">
<div class="fs-7">ダッシュボード</div>
</a>
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none text-secondary">
<i class="fas fa-tasks fs-14 p-1"></i>
<div class="fs-7">作業一覧</div>
</a>
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none text-secondary">
<i class="fas fa-folder fs-14 p-1"></i>
<div class="fs-7">関連資料</div>
</a>
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none text-secondary">
<i class="fas fa-cog fs-14 p-1"></i>
<div class="fs-7">設定</div>
</a>
</nav>
</footer>
<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/common.js"></script>
......
......@@ -21,27 +21,54 @@ CHK_pu.initCommon = function() {
CHK_pu.init = function() {
CHK.initCommon();
// 作業一覧JSONデータ
CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK_pu.operation = json;
CHK_pu.operation.operationList = CHK_pu.operation.operationList.sort(function(a,b) {
if (!a.operationLastEditDate) {
a.operationLastEditDate = "1900-01-01 09:00:00";
}
if (!b.operationLastEditDate) {
b.operationLastEditDate = "1900-01-01 09:00:00";
}
if (a.operationLastEditDate < b.operationLastEditDate) return 1;
if (a.operationLastEditDate > b.operationLastEditDate) return -1;
return 0;
});
CHK_pu.createNewReportList(CHK_pu.operation.operationList);
CHK_pu.createContinueWorkList(CHK_pu.operation.operationList);
CHK_pu.createReportWithWarning(CHK_pu.operation.operationList);
CHK_pu.setCountElementInPickup();
$("#footer").load("main-footer.html", function() {
CHK_Footer.activeDashboardBottomNav();
});
CHK_pu.settingPickup();
if(CHK.operation == null || typeof CHK.operation === 'undefined')
{
CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK.operation = json;
CHK_pu.initoperationList(CHK.operation.operationList);
});
return;
}
CHK_pu.initoperationList(CHK.operation.operationList);
}
CHK_pu.initoperationList = function(operationList) {
operationList = operationList.sort(function(a,b) {
if (!a.operationLastEditDate) {
a.operationLastEditDate = "1900-01-01 09:00:00";
}
if (!b.operationLastEditDate) {
b.operationLastEditDate = "1900-01-01 09:00:00";
}
if (a.operationLastEditDate < b.operationLastEditDate) return 1;
if (a.operationLastEditDate > b.operationLastEditDate) return -1;
return 0;
});
CHK_pu.createNewReportList(operationList);
CHK_pu.createContinueWorkList(operationList);
CHK_pu.createReportWithWarning(operationList);
CHK_pu.setCountElementInPickup();
}
CHK_pu.settingPickup = function() {
var isEnableNewReport = CHK_DashboardSetting.isSettingEnabled("dashboardSettingNewReport");
if(isEnableNewReport == true)
$("#liTabNewReport").css("display","none");
var isEnableContinueWork = CHK_DashboardSetting.isSettingEnabled("dashboardSettingContinousWork");
if(isEnableContinueWork == true)
$("#liTabContinueWork").css("display","none");
var isEnableReportWithWarning = CHK_DashboardSetting.isSettingEnabled("dashboardSettingReportWarning");
if(isEnableReportWithWarning == true)
$("#liTabReportWithWarning").css("display","none");
}
CHK_pu.goBack = function() {
history.back();
}
CHK_pu.setCountElementInPickup = function() {
$("#count-NewReport")[0].innerHTML = CHK_pu.countNewReportList;
......@@ -51,7 +78,14 @@ CHK_pu.setCountElementInPickup = function() {
CHK_pu.createNewReportList = function(operationList, isSearched = false) {
console.log("createNewReportList" , operationList );
$("#newReport-list").empty();
CHK_pu.countNewReportList = 0;
if (typeof operationList === 'undefined' || operationList.length < 1) {
$('#notFoundNewReport').removeClass('d-none');
return;
}
$('#notFoundNewReport').addClass('d-none');
for (var i = 0; i < operationList.length; i++) {
//TODO aタグlist.html 転移処理
......@@ -77,6 +111,7 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) {
CHK_pu.countNewReportList = CHK_pu.countNewReportList + 1;
}
if(CHK.isAndroid) {
android.hideLoading();
}
......@@ -87,6 +122,8 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) {
CHK_pu.createContinueWorkList = function(operationList, isSearched = false) {
$("#continueWork-list").empty();
CHK_pu.countContinueWorkReport = 0;
console.log("createContinueWorkList" );
for (var i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3)
......@@ -126,6 +163,15 @@ CHK_pu.createContinueWorkList = function(operationList, isSearched = false) {
}
}
// show not found if
if (CHK_pu.countContinueWorkReport < 1) {
$('#notFoundNewReport').removeClass('d-none');
return;
}
$('#notFoundNewReport').addClass('d-none');
if(CHK.isAndroid) {
android.hideLoading();
}
......@@ -134,6 +180,8 @@ CHK_pu.createContinueWorkList = function(operationList, isSearched = false) {
CHK_pu.createReportWithWarning = function(operationList, isSearched = false) {
$("#reportWithWarning-list").empty();
CHK_pu.countReportWithWarning = 0;
console.log("createReportWithWarning" );
for (var i = 0; i < operationList.length; i++) {
console.log("lengh", operationList[i].warningReportList.length );
......
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