Commit 051d2e6b by Kim Eunchul

Merge branch 'feature/1.4.0' into 'feature/1.4.0_kim-ec'

# Conflicts:
#   app/index.html
#   app/script/check.js
parents c2657f11 5d0e71bd
......@@ -10250,7 +10250,8 @@ input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-
.navbar {
position: relative;
padding: .5rem 1rem
padding: .5rem 1rem;
height: 50px;
}
.navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl {
......@@ -20191,7 +20192,7 @@ button {
text-align: -webkit-center;
border-radius: 15px;
z-index: 1032;
height: calc(50vh);
height: auto;
width: 60%;
position: absolute;
top: calc(5vh);
......
......@@ -20,7 +20,7 @@
<body onload="CHK_L.init();" style="position: relative; margin-top: 53px;">
<header style="position: fixed; width: 100%; top: 0px; left: 0; z-index: 999;">
<nav class="navbar navbar-dark bg-primary">
<a class="navbar-brand category-btn lht-0" href="#" onclick="CHK.openCategory();" >
<a class="navbar-brand category-btn lht-0 d-none" id="operationGroupMasterButton" href="javascript:CHK.setCategoryHeight();">
<i class="fa fa-folder fs-12 p-1" id="category-toggle-button"></i>
<span class="d-none d-md-inline fs-10">カテゴリー</span>
</a>
......
......@@ -42,6 +42,8 @@ CHK.operationGroupMaster; //カテゴリーデータ
CHK.operationGroupMasterRelation; //作業・カテゴリー関係データ
CHK.pushMessage; //コミュニケーションデータ
var scanResultCode; //スキャンしたRFID,バーコード
var pageLang; // ページ設定言語
var isSetCategory = true
var CATEGORY_HEIGHT; //カテゴリー描画用固定値(高さ)
......@@ -60,8 +62,7 @@ var msgMap = { // velocity?
completeUpload: {ja:"登録が完了しました。<br/>右上の閉じるボタンをクリックし、画面を閉じてください。", ko:"등록했습니다. <br/>오른쪽 위의 닫기버튼을 클릭해, 화면을 닫아주세요.", en:"Registered. <br/>Please click the close button in the upper right and close the screen."},
Yes: {ja:"はい", ko:"Yes", en:"Yes"},
No: {ja:"いいえ", ko:"No", en:"No"},
onlyRfid:{ja:"RFID又はバーコードが設定されています。<br/>該当コードを読み込んでください。", ko:"RFID또는 바코드가 설정되어있습니다. <br/>해당코드를 스캔해주십시오.", en:"RFID or barcode is set. <br/>Please scan the code."},
notExistCode:{ja:"読み込んだコードと一致しません。<br/>コードを確認してもう一度お願いします。<br/>", ko:"스캔된코드와 일치하는 작업이 존재하지않습니다. <br/>코드를 확인하고 한번도 시도해주세요. <br/>", en:"No action exists that matches the scanned code. <br/>Please check the code and try it once. <br/>"},
onlyRfid:{ja:"RFID又はバーコードが設定されています。\n該当コードを読み込んでください。", ko:"RFID또는 바코드가 설정되어있습니다.\n해당코드를 스캔해주십시오.", en:"RFID or barcode is set.\nPlease scan the code."},
overwriteCheck: {ja:"未公開のバージョンの簡易帳票が存在します。<br/>上書きしますか?", ko:"미공개 버전의 간이 서류가 존재합니다. <br/>덮어 쓰시겠습니까?", en:"There is an unpublished version of the quick report. <br/>Do you want to overwrite?"},
dateError: {ja:"検索日が不正です。", ko:"잘못된 검색일입니다.", en:"Please enter correct search date."},
};
......@@ -84,9 +85,9 @@ function getLang() {
return pageLang;
}
// メッセージを取得
function getMsg(key) {
lang = getLang();
// 言語コードをセット
function setLangCode() {
lang = getLang();
if (lang.split("-")[0] == "ja") {
lang = "ja";
} else if (lang.split("-")[0] == "ko") {
......@@ -94,6 +95,12 @@ function getMsg(key) {
} else {
lang = "en";
}
}
// メッセージを取得
function getMsg(key) {
setLangCode();
var msg = msgMap[key];
if (!msg) {
return "";
......@@ -281,6 +288,7 @@ CHK.initCommon = function() {
CHK.isAndroid = urlParam.app && urlParam.app == "android";
CHK.isIOS = urlParam.app && urlParam.app == "ios";
CHK.isRFIDBarcodeScan = urlParam.isRFIDBarcodeScan && urlParam.isRFIDBarcodeScan == "1";
CHK.isOperationGroupMaster = urlParam.isOperationGroupMaster && urlParam.isOperationGroupMaster == "1";
CHK.sortIndex = urlParam.sortIndex;
// ウェブの場合、作業一覧の表示広さを変更
if (CHK.isWeb) {
......@@ -295,6 +303,9 @@ CHK.initCommon = function() {
if (CHK.isIOS && CHK.isRFIDBarcodeScan) {
$("#rfidScanButton").removeClass("d-none");
}
if (CHK.isOperationGroupMaster) {
$("#operationGroupMasterButton").removeClass("d-none");
}
CHK.debug = urlParam.debug;
CHK.isMobile = urlParam.mobile_flg && urlParam.mobile_flg == "1";
......@@ -443,6 +454,20 @@ CHK.initReportApp = function (callback) {
}
/**
* カテゴリー表示領域の高さ調整
*/
CHK.setCategoryHeight = function() {
//カテゴリー高さ固定
if(isSetCategory){
CATEGORY_HEIGHT = $('main').height();
console.log(CATEGORY_HEIGHT);
isSetCategory = false
}
$('#category-menu').height(CATEGORY_HEIGHT);
$('#overlayDiv').height(CATEGORY_HEIGHT);
}
/**
* 作業報告初期処理、Web
*
* @param callback コールバック
......@@ -2848,10 +2873,41 @@ CHK.changeSortType = function(sortType) {
* 作業一覧描画
*/
CHK.createOperationList = function(operationList, isSearched = false) {
var searchKeyword = $("#searchTaskName").val();
var searchStartDate = $("#searchStartDate").val();
var searchEndDate = $("#searchEndDate").val();
var operationGroupMasterId = CHK.operationGroupMasterId;
$('#operationTable').empty();
if (isSearched) {
operationList = CHK.operation.searchOperationList;
}
operationList = operationList.filter(function(operation) {
var result = true;
if (searchKeyword.length) {
result = result * operation.operationName.includes(searchKeyword);
}
if (searchStartDate.length && !searchEndDate.length) {
result = result * (operation.operationStartDate >= searchStartDate);
}
if (searchEndDate.length && !searchStartDate.length) {
result = result * (operation.operationEndDate <= searchEndDate);
}
if (searchStartDate.length && searchEndDate.length) {
result = result * ((operation.operationStartDate <= searchEndDate) && (operation.operationEndDate >= searchStartDate));
}
if (operationGroupMasterId != 0) {
var operationGroupMasterIdList = CHK.operationGroupMasterRelation.operationGroupMasterRelationList.filter(function(operationGroupMasterRelation) {
return operationGroupMasterRelation.operationId == operation.operationId;
})
result = result * operationGroupMasterIdList.filter(function(operationGroupMaster){
return operationGroupMaster.operationGroupMasterId == operationGroupMasterId;
}).length;
}
return result;
})
if (operationList.length > 1) {
var sortType = $(".sort-type.active").data("sort");
if (isSearched) {
......@@ -2941,6 +2997,9 @@ CHK.createOperationList = function(operationList, isSearched = false) {
operationTR.append(iconTd);
$(".table tbody").append(operationTR);
if(CHK.isAndroid) {
android.hideLoading();
}
}
};
......@@ -3048,6 +3107,12 @@ CHK.startScan = function() {
}
$(".scan-overlay").removeClass("d-none");
$(".scan-area").removeClass("d-none");
var positionY = $(document).scrollTop() + screen.height/8;
var height = screen.height/4;
$(".scan-area").css("top", positionY);
$(".scan-area").css("min-height", height);
$("body").css("overflow", "hidden");
}
CHK.scanClose = function() {
......@@ -3062,9 +3127,18 @@ CHK.scanClose = function() {
}
$(".scan-overlay").addClass("d-none");
$(".scan-area").addClass("d-none");
$("body").css("overflow", "visible");
}
document.addEventListener('visibilitychange', () => {
// バックグラウンド遷移時
if (document.visibilityState === 'hidden') {
CHK.scanClose();
}
});
CHK.scanResult = function(scannedCode, scanType) {
scanResultCode = scannedCode;
if (scannedCode == null || !(scannedCode.length)) {
return;
}
......@@ -3074,6 +3148,7 @@ CHK.scanResult = function(scannedCode, scanType) {
var resultCode = scannedCode;
if (scanType == 1) {
resultCode = scannedCode.substring(4);
scanResultCode = resultCode;
}
return operation.permitCode == resultCode;
})[0];
......@@ -3101,15 +3176,26 @@ CHK.alertClose = function() {
}
CHK.displayAlert = function(msgCode) {
$("#alertMsg").html(getMsg(msgCode));
$(".alert-overlay").removeClass("d-none");
$(".alert-area").removeClass("d-none");
var positionY = $(document).scrollTop() + screen.height/8;
var height = screen.height/4;
$(".alert-area").css("top", positionY);
$(".alert-area").css("min-height", height);
$("body").css("overflow", "hidden");
// RFID(バーコード)関連は通常のアラート表示
if (msgCode == "notExistCode") {
// scanResultCodeを代入するため別で処理
setLangCode();
var notExistCodeMessage = {ja:"読み込んだコードと一致しません。\n\n読み込んだコード:" + scanResultCode + "\n\nコードを確認してもう一度お願いします。", ko:"스캔된코드와 일치하는 작업이 존재하지않습니다.\n\n스캔 한 코드: " + scanResultCode + "\n\n코드를 확인하고 한번도 시도해주세요.", en:"No action exists that matches the scanned code.\n\nScanned code: " + scanResultCode + "\n\nPlease check the code and try it once."};
var msg = notExistCodeMessage[lang];
alert(msg);
} else if (msgCode == "onlyRfid") {
alert(getMsg(msgCode));
} else {
$("#alertMsg").html(getMsg(msgCode));
$(".alert-overlay").removeClass("d-none");
$(".alert-area").removeClass("d-none");
var positionY = $(document).scrollTop() + screen.height/8;
var height = screen.height/4;
$(".alert-area").css("top", positionY);
$(".alert-area").css("min-height", height);
$("body").css("overflow", "hidden");
}
}
CHK.resetSearch = function() {
......
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