Commit 773ca169 by Lee Munkyeong

作業検索及びソート対応

parent afcf3947
......@@ -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 {
......
......@@ -14,6 +14,7 @@
<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/constant.js?__UPDATEID__"></script>
</head>
<body onload="CHK_L.init();">
......@@ -101,10 +102,11 @@
</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>
......
......@@ -2735,6 +2735,35 @@ CHK.createCategory = function(operationGroupMasterList) {
* 作業一覧描画
*/
CHK.createOperationList = function(operationList) {
$('#operationTable').empty();
if (CHK.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 転移処理
......@@ -2778,7 +2807,14 @@ CHK.search = function() {
var searchResult;
if (CHK.isAndroid) {
searchResult = JSON.parse(android.searchOperationList(searchKeyword, searchStartDate, searchEndDate));
$('#operationTable').empty();
CHK.isSearched = true;
CHK.operation.searchOperationList = searchResult.operationList;
CHK.createOperationList(searchResult.operationList);
}
};
\ No newline at end of file
};
CHK.changeSortType = function(sortType) {
$(".sort-type").removeClass("active");
$(sortType).addClass("active");
CHK.createOperationList(CHK.operation.operationList);
}
\ 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