Commit bc3a9f61 by Lee Munkyeong

Merge branch 'feature/1.4.0_lmk' into 'feature/1.4.0'

Feature/1.4.0 lmk

See merge request !4
parents bc119407 67359662
...@@ -10254,7 +10254,6 @@ input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn- ...@@ -10254,7 +10254,6 @@ input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-
} }
.navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl { .navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl {
display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: space-between justify-content: space-between
...@@ -20189,6 +20188,7 @@ button { ...@@ -20189,6 +20188,7 @@ button {
} }
.scan-area { .scan-area {
text-align: -webkit-center;
border-radius: 15px; border-radius: 15px;
z-index: 1032; z-index: 1032;
height: calc(40%); height: calc(40%);
...@@ -20211,14 +20211,13 @@ button { ...@@ -20211,14 +20211,13 @@ button {
} }
.loading-spinner { .loading-spinner {
margin-left: 33%;
margin-top: 10%;
color: lightslategray; color: lightslategray;
} }
.loading-close { .loading-close {
margin-top: 3%; margin-right: 1%;
margin-left: 85%; margin-top: 1%;
display: inherit;
} }
.overlay.open { .overlay.open {
......
...@@ -24,7 +24,11 @@ ...@@ -24,7 +24,11 @@
<i class="fa fa-folder fs-12 p-1" id="category-toggle-button"></i> <i class="fa fa-folder fs-12 p-1" id="category-toggle-button"></i>
<span class="d-none d-md-inline fs-10">カテゴリー</span> <span class="d-none d-md-inline fs-10">カテゴリー</span>
</a> </a>
<a class="navbar-brand lht-0" href="#" style="margin:0px"> <a class="navbar-brand lht-0" href="#" style="margin: 0 10px 0 10px;float: right;">
<i class="fa fa-redo fs-12 p-1" id="updateButton" onclick="CHK_L.sendAppCommand('refreshContent');"></i>
<span class="d-none d-md-inline fs-10">更新</span>
</a>
<a class="navbar-brand lht-0" href="#" style="margin: 0 10px 0 10px;float: right;">
<i class="fa fa-wifi fs-12 p-1" id="rfidScanButton" onclick="CHK.startScan();"></i> <i class="fa fa-wifi fs-12 p-1" id="rfidScanButton" onclick="CHK.startScan();"></i>
<span class="d-none d-md-inline fs-10">スキャン</span> <span class="d-none d-md-inline fs-10">スキャン</span>
</a> </a>
...@@ -104,13 +108,13 @@ ...@@ -104,13 +108,13 @@
</a> </a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item sort-type" data-sort="0" onclick="CHK.changeSortType(this);">作業名順</a> <a class="dropdown-item sort-type" data-sort="0" onclick="CHK.changeSortType(this);">作業名順</a>
<a class="dropdown-item sort-type" data-sort="1" onclick="CHK.changeSortType(this);">作業期間が新しい順</a> <a class="dropdown-item sort-type active" data-sort="1" id="defaultSort" onclick="CHK.changeSortType(this);">作業期間が新しい順</a>
<a class="dropdown-item sort-type active" data-sort="2" onclick="CHK.changeSortType(this);">作業期間が古い順</a> <a class="dropdown-item sort-type" data-sort="2" onclick="CHK.changeSortType(this);">作業期間が古い順</a>
<a class="dropdown-item sort-type" data-sort="3" onclick="CHK.changeSortType(this);">報告タイプ順</a> <a class="dropdown-item sort-type" data-sort="3" onclick="CHK.changeSortType(this);">報告タイプ順</a>
<a class="dropdown-item sort-type" data-sort="4" onclick="CHK.changeSortType(this);">閲覧日が新しい順</a> <a class="dropdown-item sort-type" data-sort="4" onclick="CHK.changeSortType(this);">閲覧日が新しい順</a>
</div> </div>
<a href="javascript:CHK_L.sendAppCommand('refreshContent');" class="text-decoration-none py-2 lht-0 d-inline-block ml-3"> <a href="javascript:CHK.resetSearch();" class="text-decoration-none py-2 lht-0 d-inline-block ml-3">
<i class="fa fa-redo text-dark"></i> <i class="fa fa-times text-dark"></i>
<span class="d-none d-md-inline text-dark fs-10"> <span class="d-none d-md-inline text-dark fs-10">
リセット リセット
</span> </span>
......
...@@ -247,7 +247,6 @@ CHK_L.sendAppCommand = function (command, operationId, contentId, operationGroup ...@@ -247,7 +247,6 @@ CHK_L.sendAppCommand = function (command, operationId, contentId, operationGroup
param.operationGroupMasterId = operationGroupMasterId; param.operationGroupMasterId = operationGroupMasterId;
CHK.sendABookCheckApi(param); CHK.sendABookCheckApi(param);
} }
/** /**
* 定期点検リストを更新 * 定期点検リストを更新
* *
......
...@@ -137,6 +137,7 @@ CHK.apiCmd = { ...@@ -137,6 +137,7 @@ CHK.apiCmd = {
goOperation: "goOperation", //作業開始 goOperation: "goOperation", //作業開始
goPanoramaEdit: "goPanoramaEdit", //パノラマ作業資料編集 goPanoramaEdit: "goPanoramaEdit", //パノラマ作業資料編集
refreshContent: "refreshContent", //新着更新 refreshContent: "refreshContent", //新着更新
resetSearch: "resetSearch", //検索条件初期化
editAttached: "editAttached", //添付ファイル編集 editAttached: "editAttached", //添付ファイル編集
saveAttached: "saveAttached", //添付ファイル保存 saveAttached: "saveAttached", //添付ファイル保存
insertReport: "insertTaskReport", //作業報告保存 insertReport: "insertTaskReport", //作業報告保存
...@@ -391,10 +392,8 @@ CHK.initReportApp = function (callback) { ...@@ -391,10 +392,8 @@ CHK.initReportApp = function (callback) {
// 作業一覧JSONデータ // 作業一覧JSONデータ
CHK.loadJson(CHK.jsonPath.operationList, function (json) { CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK.operation = json; CHK.operation = json;
if (CHK.isAndroid || CHK.isIOS) { $('#operationTable').empty();
$('#operationTable').empty(); CHK.operation.searchOperationList = json.operationList;
CHK.operation.searchOperationList = json.operationList;
}
//作業一覧描画 //作業一覧描画
CHK.createOperationList(CHK.operation.operationList); CHK.createOperationList(CHK.operation.operationList);
}); });
...@@ -408,7 +407,7 @@ CHK.initReportApp = function (callback) { ...@@ -408,7 +407,7 @@ CHK.initReportApp = function (callback) {
// 作業・カテゴリー関係JSONデータ // 作業・カテゴリー関係JSONデータ
CHK.loadJson(CHK.jsonPath.operationGroupMasterRelationList, function (json) { CHK.loadJson(CHK.jsonPath.operationGroupMasterRelationList, function (json) {
CHK.operationGroupMasterRelation = json;
}); });
// コミュニケーションデータJSONデータ // コミュニケーションデータJSONデータ
...@@ -2391,6 +2390,7 @@ CHK.showRelatedContent = function(urlPath, contentId, pageNum) { ...@@ -2391,6 +2390,7 @@ CHK.showRelatedContent = function(urlPath, contentId, pageNum) {
} }
} }
CHK.getOneTimeKey = function(url, callback) { CHK.getOneTimeKey = function(url, callback) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
...@@ -2743,21 +2743,19 @@ CHK.showWhiteFrame = function() { ...@@ -2743,21 +2743,19 @@ CHK.showWhiteFrame = function() {
*/ */
CHK.createCategory = function(operationGroupMasterList) { CHK.createCategory = function(operationGroupMasterList) {
if (CHK.isAndroid || CHK.isIOS) { $('.group-category-list').remove();
$('.group-category-list').remove(); $("#groupMasterPath").empty();
$("#groupMasterPath").empty(); if (typeof CHK.operationGroupMasterId == 'undefined' || CHK.operationGroupMasterId == 0) {
if (typeof CHK.operationGroupMasterId == 'undefined' || CHK.operationGroupMasterId == 0) { $("#groupMasterPath").append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + getMsg("all") + '</a></li>');
$("#groupMasterPath").append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + getMsg("all") + '</a></li>'); } else {
} else { var groupMaster = operationGroupMasterList.filter(it => it.operationGroupMasterId == CHK.operationGroupMasterId)[0];
var groupMaster = operationGroupMasterList.filter(it => it.operationGroupMasterId == CHK.operationGroupMasterId)[0]; var groupMasterPathIdlist = groupMaster.treePath.split('/');
var groupMasterPathIdlist = groupMaster.treePath.split('/'); groupMasterPathIdlist.forEach( function (parentId){
groupMasterPathIdlist.forEach( function (parentId){ var pathOperationGroupMaster = operationGroupMasterList.filter(it => it.operationGroupMasterId == parentId)[0];
var pathOperationGroupMaster = operationGroupMasterList.filter(it => it.operationGroupMasterId == parentId)[0]; $("#groupMasterPath").append('<li class="breadcrumb-item"><a onclick="CHK.changeOperationGroupMaster('
$("#groupMasterPath").append('<li class="breadcrumb-item"><a onclick="CHK.changeOperationGroupMaster(' + pathOperationGroupMaster.operationGroupMasterId + ');" class="text-decoration-none text-dark">'
+ pathOperationGroupMaster.operationGroupMasterId + ');" class="text-decoration-none text-dark">' + pathOperationGroupMaster.operationGroupMasterName + '</a></li>');
+ pathOperationGroupMaster.operationGroupMasterName + '</a></li>'); });
});
}
} }
//サイドメニューカテゴリー構造作成 //サイドメニューカテゴリー構造作成
...@@ -2803,7 +2801,7 @@ CHK.createCategory = function(operationGroupMasterList) { ...@@ -2803,7 +2801,7 @@ CHK.createCategory = function(operationGroupMasterList) {
if (CHK.isIOS) { if (CHK.isIOS) {
sortIndex = CHK_iOS.getSortType(); sortIndex = CHK_iOS.getSortType();
} else if (CHK.isAndroid) { } else if (CHK.isAndroid) {
// TODO: 端末に保存したsortTypeを取得 sortIndex = android.getSortType();
} }
let sortType = document.getElementsByClassName("sort-type")[sortIndex]; let sortType = document.getElementsByClassName("sort-type")[sortIndex];
CHK.changeSortType(sortType); CHK.changeSortType(sortType);
...@@ -2829,28 +2827,23 @@ CHK.createOperationList = function(operationList, isSearched = false) { ...@@ -2829,28 +2827,23 @@ CHK.createOperationList = function(operationList, isSearched = false) {
if (CHK.isIOS) { if (CHK.isIOS) {
webkit.messageHandlers.saveSortType.postMessage(sortType); webkit.messageHandlers.saveSortType.postMessage(sortType);
} else if (CHK.isAndroid) { } else if (CHK.isAndroid) {
// TODO: sortTypeを端末に保存 android.setSortType(sortType);
} }
} }
switch(sortType) { switch(sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME: case CHK_CONSTANT.SORT_TYPE.NAME:
console.log(sortType);
operationList.sort((a, b) => (a.operationName > b.operationName) ? 1 : -1); operationList.sort((a, b) => (a.operationName > b.operationName) ? 1 : -1);
break; break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC: case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
console.log(sortType);
operationList.sort((a, b) => (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) ? 1 : -1); operationList.sort((a, b) => (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) ? 1 : -1);
break; break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC: case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
console.log(sortType);
operationList.sort((a, b) => (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) ? 1 : -1); operationList.sort((a, b) => (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) ? 1 : -1);
break; break;
case CHK_CONSTANT.SORT_TYPE.TYPE: case CHK_CONSTANT.SORT_TYPE.TYPE:
console.log(sortType);
operationList.sort((a, b) => (a.operationType < b.operationType) ? 1 : -1); operationList.sort((a, b) => (a.operationType < b.operationType) ? 1 : -1);
break; break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE: case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
console.log(sortType);
operationList.sort((a, b) => (a.lastEditDate < b.lastEditDate) ? 1 : -1); operationList.sort((a, b) => (a.lastEditDate < b.lastEditDate) ? 1 : -1);
break; break;
} }
...@@ -2904,24 +2897,33 @@ CHK.search = function() { ...@@ -2904,24 +2897,33 @@ CHK.search = function() {
var searchKeyword = $("#searchTaskName").val(); var searchKeyword = $("#searchTaskName").val();
var searchStartDate = $("#searchStartDate").val(); var searchStartDate = $("#searchStartDate").val();
var searchEndDate = $("#searchEndDate").val(); var searchEndDate = $("#searchEndDate").val();
var operationGroupMasterId = CHK.operationGroupMasterId;
var searchResult; var searchResult;
if (CHK.isAndroid) {
searchResult = JSON.parse(android.searchOperationList(searchKeyword, searchStartDate, searchEndDate, CHK.operationGroupMasterId)); searchResult = CHK.operation.operationList.filter(function(operation) {
CHK.isSearched = true; var result = true;
CHK.operation.searchOperationList = searchResult.operationList; if (searchKeyword.length) {
CHK.createOperationList(searchResult.operationList); result = result * operation.operationName.includes(searchKeyword);
// TODO: カテゴリの保存 }
} else if (CHK.isIOS) { if (searchStartDate.length) {
searchResult = CHK_iOS.searchOperationList(searchKeyword, searchStartDate, searchEndDate, CHK.operationGroupMasterId); result = result * (operation.operationEndDate >= searchStartDate);
CHK.isSearched = true; }
CHK.operation.searchOperationList = searchResult.operationList; if (searchEndDate.length) {
CHK.createOperationList(searchResult.operationList); result = result * (operation.operationStartDate <= searchEndDate);
webkit.messageHandlers.saveOperationGroupMaster.postMessage(CHK.operationGroupMasterId); }
let searchButtonTaped = searchKeyword != "" || searchStartDate != "" || searchEndDate != ""; if (operationGroupMasterId != 0) {
if (searchButtonTaped) { var operationGroupMasterIdList = CHK.operationGroupMasterRelation.operationGroupMasterRelationList.filter(function(operationGroupMasterRelation) {
webkit.messageHandlers.showSearchResultToast.postMessage(searchResult.operationList.length); return operationGroupMasterRelation.operationId == operation.operationId;
} })
} result = result * operationGroupMasterIdList.filter(function(operationGroupMaster){
return operationGroupMaster.operationGroupMasterId == operationGroupMasterId;
}).length;
}
return result;
})
CHK.isSearched = true;
CHK.operation.searchOperationList = searchResult;
CHK.createOperationList(searchResult, CHK.isSearched);
}; };
/** /**
...@@ -2990,19 +2992,32 @@ CHK.scanClose = function() { ...@@ -2990,19 +2992,32 @@ CHK.scanClose = function() {
$(".scan-area").addClass("d-none"); $(".scan-area").addClass("d-none");
} }
CHK.scanResult = function(scannedCode) { CHK.scanResult = function(scannedCode, scanType) {
if (scannedCode == null || !(scannedCode.length)) {
return;
}
CHK.scanClose(); CHK.scanClose();
var operationList = CHK.operation.searchOperationList; var operationList = CHK.operation.searchOperationList;
var scannedOperation = operationList.filter(function(operation) { var scannedOperation = operationList.filter(function(operation) {
return operation.permitCode == scannedCode; return operation.permitCode == scannedCode.substring(4);
})[0]; })[0];
if (scannedOperation != null) { if (scannedOperation != null) {
CHK_L.sendAppCommand('goOperation', scannedOperation.operationId, scannedOperation.contentId); CHK.sendScanResult('goOperation', scannedOperation.operationId, scannedOperation.contentId, scanType);
} else { } else {
CHK.displayAlert("notExistCode"); CHK.displayAlert("notExistCode");
} }
} }
CHK.sendScanResult = function (command, operationId, contentId, scanType) {
var param = {};
param.cmd = CHK.getCommand(command);
param.operationId = operationId;
param.contentId = contentId;
param.scanType = scanType;
CHK.sendABookCheckApi(param);
}
CHK.alertClose = function() { CHK.alertClose = function() {
$(".alert-overlay").addClass("d-none"); $(".alert-overlay").addClass("d-none");
$(".alert-area").addClass("d-none"); $(".alert-area").addClass("d-none");
...@@ -3012,4 +3027,11 @@ CHK.displayAlert = function(msgCode) { ...@@ -3012,4 +3027,11 @@ CHK.displayAlert = function(msgCode) {
$("#alertMsg").html(getMsg(msgCode)); $("#alertMsg").html(getMsg(msgCode));
$(".alert-overlay").removeClass("d-none"); $(".alert-overlay").removeClass("d-none");
$(".alert-area").removeClass("d-none"); $(".alert-area").removeClass("d-none");
}
CHK.resetSearch = function() {
$('#searchTaskName').val('');
$('#searchStartDate').val('');
$('#searchEndDate').val('');
CHK.changeSortType($('#defaultSort'));
} }
\ 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