Commit 87292941 by Takatoshi Miura

Merge commit '1dc0cccc' into feature/1.4.0_miura

# Conflicts:
#	app/index.html
#	app/script/check.js
parents fa9227de 1dc0cccc
......@@ -6093,7 +6093,7 @@
font-weight: 900;
font-display: block;
src: url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?6606667d9800a27eb8b5f61ccb66d510);
src: url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?6606667d9800a27eb8b5f61ccb66d510?#iefix) format("embedded-opentype"),url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?3eb06c702e27fb110194f5a16c45cb8e) format("woff2"),url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff?f4f93856730733912b1e06ad64c0baf7) format("woff"),url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?915a0b79c22a1c1f64da9e0a90a12f02) format("truetype"),url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.svg?0454203f26b33fc02e2b686b317aab3d#fontawesome) format("svg")
src: url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?6606667d9800a27eb8b5f61ccb66d510?#iefix) format("embedded-opentype"),url(../fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?3eb06c702e27fb110194f5a16c45cb8e) format("woff2"),url(../fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff?f4f93856730733912b1e06ad64c0baf7) format("woff"),url(../fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?915a0b79c22a1c1f64da9e0a90a12f02) format("truetype"),url(./fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.svg?0454203f26b33fc02e2b686b317aab3d#fontawesome) format("svg")
}
.fa,.far,.fas {
......
......@@ -15,6 +15,7 @@
<script src="script/check.js?__UPDATEID__"></script>
<script src="script/check-list.js?__UPDATEID__"></script>
<script src="script/check-foriOS.js"></script>
<script src="script/constant.js?__UPDATEID__"></script>
</head>
<body onload="CHK_L.init();">
......@@ -52,12 +53,12 @@
<nav aria-label="search">
<div class="row">
<div class="col-7 col-md-5 col-lg-4">
<div class="form-group has-search">
<i class="fas fa-search form-control-feedback"></i>
<input type="text" class="form-control" placeholder="作業名">
<div class="form-group has-search input-group">
<input type="text" class="form-control" placeholder="作業名" id="searchTaskName">
<div class="input-group-append">
<i class="fas fa-search input-group-text" onclick="CHK.search();"></i>
</div>
</div>
</div>
<div class="col-1 col-md-2 duration-area">
......@@ -71,34 +72,29 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="form-group">
<label>開始日</label>
<div class="input-group date" id="datetimepicker1" data-target-input="nearest">
<input type="text" name="start" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker1" placeholder="選択" inputmode="none">
<div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label>終了日</label>
<div class="input-group date" id="datetimepicker2" data-target-input="nearest">
<input type="text" name="end" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker2" placeholder="選択" inputmode="none">
<div class="input-group-append" data-target="#datetimepicker2" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label>開始日</label>
<div class="input-group date" id="datetimepicker1" data-target-input="nearest">
<input type="text" name="start" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker1" placeholder="選択" inputmode="none" id="searchStartDate">
<div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label>終了日</label>
<div class="input-group date" id="datetimepicker2" data-target-input="nearest">
<input type="text" name="end" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker2" placeholder="選択" inputmode="none" id="searchEndDate">
<div class="input-group-append" data-target="#datetimepicker2" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar"></i></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-4 col-md-5 col-lg-6 text-right">
<a href="#" class="text-decoration-none py-2 lht-0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-offset="-120, 0">
<i class="fa fa-sort text-dark"></i>
......@@ -107,12 +103,12 @@
</span>
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">作業名順</a>
<a class="dropdown-item" href="#">作業期間が新しい順</a>
<a class="dropdown-item active" href="#">作業期間が古い順</a>
<a class="dropdown-item" href="#">閲覧日が新しい順</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="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="4" onclick="CHK.changeSortType(this);">閲覧日が新しい順</a>
</div>
<a href="javascript:CHK_L.sendAppCommand('refreshContent');" class="text-decoration-none py-2 lht-0 d-inline-block ml-3">
<i class="fa fa-redo text-dark"></i>
<span class="d-none d-md-inline text-dark fs-10">
......@@ -120,7 +116,6 @@
</span>
</a>
</div>
</div>
</nav>
......
......@@ -382,10 +382,11 @@ CHK.initReport = function(callback) {
CHK.initReportApp = function (callback) {
// 作業一覧JSONデータ
CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK.operation = json;
if (CHK.isAndroid || CHK.isIOS) {
$('#operationTable').empty();
CHK.operation.searchOperationList = json.operationList;
}
CHK.operation = json;
//作業一覧描画
CHK.createOperationList(CHK.operation.operationList);
});
......@@ -2765,7 +2766,36 @@ CHK.createCategory = function(operationGroupMasterList) {
/**
* 作業一覧描画
*/
CHK.createOperationList = function(operationList) {
CHK.createOperationList = function(operationList, isSearched = false) {
$('#operationTable').empty();
if (isSearched) {
operationList = CHK.operation.searchOperationList;
}
if (operationList.length > 1) {
var sortType = $(".sort-type.active").data("sort");
switch(sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME:
console.log(sortType);
operationList.sort((a, b) => (a.operationName > b.operationName) ? 1 : -1);
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
console.log(sortType);
operationList.sort((a, b) => (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) ? 1 : -1);
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
console.log(sortType);
operationList.sort((a, b) => (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) ? 1 : -1);
break;
case CHK_CONSTANT.SORT_TYPE.TYPE:
console.log(sortType);
operationList.sort((a, b) => (a.operationType < b.operationType) ? 1 : -1);
break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
console.log(sortType);
operationList.sort((a, b) => (a.lastEditDate < b.lastEditDate) ? 1 : -1);
break;
}
}
for (var i = 0; i < operationList.length; i++) {
var operationTR = $("<tr/>");
//TODO aタグlist.html 転移処理
......@@ -2797,4 +2827,25 @@ CHK.createOperationList = function(operationList) {
function setOperationDate(date){
var operationDate = date.replace(/-/g, "/").substring(0,10);
return operationDate;
};
\ No newline at end of file
};
/**
* 作業一覧検索
*/
CHK.search = function() {
var searchKeyword = $("#searchTaskName").val();
var searchStartDate = $("#searchStartDate").val();
var searchEndDate = $("#searchEndDate").val();
var searchResult;
if (CHK.isAndroid) {
searchResult = JSON.parse(android.searchOperationList(searchKeyword, searchStartDate, searchEndDate));
CHK.operation.searchOperationList = searchResult.operationList;
CHK.createOperationList(searchResult.operationList, true);
}
};
CHK.changeSortType = function(sortType) {
$(".sort-type").removeClass("active");
$(sortType).addClass("active");
CHK.createOperationList(CHK.operation.operationList, true);
}
\ No newline at end of file
var CHK_CONSTANT = {};
CHK_CONSTANT.SORT_TYPE = {
NAME: 0,
START_DATE_DESC: 1,
START_DATE_ASC: 2,
TYPE: 3,
LAST_EDIT_DATE: 4,
};
\ 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