Commit b490414d by Lee Munkyeong

カテゴリー検索対応

parent 773ca169
......@@ -10,7 +10,6 @@
<link rel="stylesheet" type="text/css" href="css/app.css">
<link rel="stylesheet" type="text/css" href="css/fontawesome_relative_path.css">
<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>
......@@ -20,8 +19,8 @@
<body onload="CHK_L.init();">
<header>
<nav class="navbar navbar-dark bg-primary">
<a class="navbar-brand category-btn lht-0" href="#">
<i class="fa fa-folder fs-12 p-1"></i>
<a class="navbar-brand category-btn lht-0" href="#" >
<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>
</nav>
......@@ -42,10 +41,7 @@
<main>
<nav aria-label="breadcrumb">
<ol class="breadcrumb border-bottom px-0">
<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">すべて</a></li>
<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">カテゴリー名</a></li>
<li class="breadcrumb-item active" aria-current="page"><span class="text-dark">サブカテゴリー名</span></li>
<ol class="breadcrumb border-bottom px-0" id="groupMasterPath">
</ol>
</nav>
......
......@@ -239,11 +239,12 @@ CHK_L.updateList = function() {
* アプリにコマンド送信
* @param {any} command
*/
CHK_L.sendAppCommand = function (command, operationId, contentId) {
CHK_L.sendAppCommand = function (command, operationId, contentId, operationGroupMasterId) {
var param = {};
param.cmd = CHK.getCommand(command);
param.operationId = operationId;
param.contentId = contentId;
param.operationGroupMasterId = operationGroupMasterId;
CHK.sendABookCheckApi(param);
}
......
......@@ -42,6 +42,7 @@ CHK.pushMessage; //コミュニケーションデータ
var pageLang; // ページ設定言語
var msgMap = { // velocity?
all:{ja:"全て", ko:"전체", en:"All"},
inputLoginInfo: {ja:"ログイン情報を入力してください", ko:"로그인 정보를 입력해주세요.", en:"Please enter your login information"},
txtLoginAccPath: {ja:"アカウントパス", ko:"사업자경로", en:"Account path"},
txtLoginId: {ja:"ログインID", ko:"아이디", en:"ID"},
......@@ -148,7 +149,8 @@ CHK.apiCmd = {
localSave: "localSaveTaskReport", //ローカル保存
changeReport: "changeTaskReport", //報告レポート変更
getGroupTreeInfo: "getGroupTreeInfo", //担当グループ参照用 ログインユーザーが所属しているグループ取得
deleteProcess: "deleteProcess"
deleteProcess: "deleteProcess",
changeOperationGroupMaster: "changeOperationGroupMaster"
};
//CMS送信用コマンド
CHK.actCmd = {
......@@ -370,6 +372,7 @@ CHK.initReport = function(callback) {
* @param callback コールバック
*/
CHK.initReportApp = function (callback) {
CHK.isSearched = false;
// 作業一覧JSONデータ
CHK.loadJson(CHK.jsonPath.operationList, function (json) {
if (CHK.isAndroid) {
......@@ -382,9 +385,6 @@ CHK.initReportApp = function (callback) {
// カテゴリーJSONデータ
CHK.loadJson(CHK.jsonPath.operationGroupMasterList, function (json) {
if (CHK.isAndroid) {
$('.group-category-list').remove();
}
CHK.operationGroupMaster = json;
//カテゴリー設定
CHK.createCategory(CHK.operationGroupMaster.operationGroupMasterList);
......@@ -2705,30 +2705,43 @@ CHK.showWhiteFrame = function() {
* カテゴリー設定
*/
CHK.createCategory = function(operationGroupMasterList) {
if (CHK.isAndroid) {
$('.group-category-list').remove();
$("#groupMasterPath").empty();
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>');
} else {
$("#groupMasterPath").append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + CHK.operationGroupMasterId + '</a></li>');
}
}
//パンくずリスト初期表示(全体)
$('.breadcrumb li').eq(1).hide();
$('.breadcrumb li').eq(2).hide();
//サイドメニューカテゴリー構造作成
operationGroupMasterList.sort((a, b) => (a.operationGroupMasterId > b.operationGroupMasterId) ? 1 : -1);
var noCategory = $("<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='CHK.changeOperationGroupMaster(0);'>全て</a></dt></dl>");
$('#category-menu').append(noCategory);
//TODO operationGroupMasterId順番と深さの仕様確認要
for (var i = 0; i < operationGroupMasterList.length; i++) {
if (operationGroupMasterList[i].operationGroupMasterLevel == 0 ){ //0 : カテゴリー全体
var categoryParent = $("<dl id=groupMasterId_"+ operationGroupMasterList[i].operationGroupMasterId +" class='group-category-list'><dt class='menu-ttl'><a href=''>"+ operationGroupMasterList[i].operationGroupMasterName +"</a></dt></dl>");
var categoryParent = $("<dl id=groupMasterId_"+ operationGroupMasterList[i].operationGroupMasterId +" class='group-category-list'><dt class='menu-ttl'><a onclick='CHK.changeOperationGroupMaster(" + operationGroupMasterList[i].operationGroupMasterId + ");'>"+ operationGroupMasterList[i].operationGroupMasterName +"</a></dt></dl>");
$('#category-menu').append(categoryParent);
} else {
if($('#groupMasterId_'+operationGroupMasterList[i].parentOperationGroupMasterId).length > 0){
var categoryChild;
if ($('#groupMasterId_'+ operationGroupMasterList[i].parentOperationGroupMasterId +'>dd').length > 0){
categoryChild = $("<li class='drawer-menu2'><a href=''>"+ operationGroupMasterList[i].operationGroupMasterName +"</a></li>");
categoryChild = $("<li class='drawer-menu2'><a onclick='CHK.changeOperationGroupMaster(" + operationGroupMasterList[i].operationGroupMasterId + ");'>"+ operationGroupMasterList[i].operationGroupMasterName +"</a></li>");
$('#groupMasterId_'+operationGroupMasterList[i].parentOperationGroupMasterId+' >dd >ul').append(categoryChild);
} else {
categoryChild = $("<dd style='display:none;'><ul class='drawer-menu2 menu-link'><li class='drawer-menu2'><a href=''>"+ operationGroupMasterList[i].operationGroupMasterName +"</a></li></ul></dd>");
categoryChild = $("<dd style='display:none;'><ul class='drawer-menu2 menu-link'><li class='drawer-menu2'><a onclick='CHK.changeOperationGroupMaster(" + operationGroupMasterList[i].operationGroupMasterId + ");'>"+ operationGroupMasterList[i].operationGroupMasterName +"</a></li></ul></dd>");
$('#groupMasterId_'+operationGroupMasterList[i].parentOperationGroupMasterId).append(categoryChild);
}
}
}
}
acdMenu();
};
/**
......@@ -2789,7 +2802,7 @@ CHK.createOperationList = function(operationList) {
}
};
/**
/**Oper
* Date表示(yyyy/MM/dd)hh以下省略
*/
function setOperationDate(date){
......@@ -2806,10 +2819,10 @@ CHK.search = function() {
var searchEndDate = $("#searchEndDate").val();
var searchResult;
if (CHK.isAndroid) {
searchResult = JSON.parse(android.searchOperationList(searchKeyword, searchStartDate, searchEndDate));
CHK.isSearched = true;
CHK.operation.searchOperationList = searchResult.operationList;
CHK.createOperationList(searchResult.operationList);
searchResult = JSON.parse(android.searchOperationList(searchKeyword, searchStartDate, searchEndDate, CHK.operationGroupMasterId));
CHK.isSearched = true;
CHK.operation.searchOperationList = searchResult.operationList;
CHK.createOperationList(searchResult.operationList);
}
};
......@@ -2817,4 +2830,30 @@ CHK.changeSortType = function(sortType) {
$(".sort-type").removeClass("active");
$(sortType).addClass("active");
CHK.createOperationList(CHK.operation.operationList);
}
// カテゴリーのドロワーメニュー開閉
function acdMenu() {
//デフォルトでアコーディオンの中身を非表示
$(".drawer-menu dd").css("display", "none");
$(".drawer-menu2 ul").css("display", "none");
//第2階層のアコーディオン 
$(".drawer-menu dt").on('click', function() {
$(".drawer-menu dt").not(this).removeClass("open").next().slideUp("fast");
$(this).toggleClass("open").next().slideToggle("fast");
});
//第3階層のアコーディオン
$(".drawer-menu2 p").on('click', function() {
$(".drawer-menu2 p").not(this).removeClass("openAcd").next().slideUp("fast");
$(this).toggleClass("openAcd").next().slideToggle("fast");
});
}
CHK.changeOperationGroupMaster = function(operationGroupMasterId) {
$('#category-toggle-button').click();
CHK.operationGroupMasterId = operationGroupMasterId;
CHK.createCategory(CHK.operationGroupMaster.operationGroupMasterList);
CHK.search();
}
\ 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