Commit 6bcc7530 by NGUYEN HOANG SON

Merge branch 'feature/1.0_check_web_dev' into feature/1.0_check_web_dev_50268

# Conflicts:
#	abvw/common/json/lang/lang-en.json
#	abvw/common/json/lang/lang-ja.json
#	abvw/common/json/lang/lang-ko.json
parents bb12f258 8402599e
......@@ -2,17 +2,16 @@
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header bg-dark10">
<h5 class="modal-title">確認</h5>
<h5 class="modal-title lang" lang="confirmation"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
XXXXしますか?
<div class="modal-body" id="msgModel">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">はい</button>
<button type="button" class="btn btn-tertiary" data-dismiss="modal">いいえ</button>
<button type="button" class="btn btn-primary lang" lang="confirmYes">はい</button>
<button type="button" class="btn btn-tertiary lang" lang="confirmNo" data-dismiss="modal"></button>
</div>
</div>
</div>
......
......@@ -2,7 +2,7 @@
* Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
.fa,.fab,.fad,.fal,.far,.fas {
.fa,.fab,.fad,.fal,.far,.fas {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
......@@ -14392,6 +14392,9 @@ a.bg-white:focus,a.bg-white:hover,button.bg-white:focus,button.bg-white:hover {
.w-120px {
width: 120px!important;
}
.w-250px {
width: 250px!important;
}
.h-25 {
height: 25%!important
......@@ -14613,6 +14616,26 @@ a.bg-white:focus,a.bg-white:hover,button.bg-white:focus,button.bg-white:hover {
margin-left: 3rem!important
}
.m-6 {
margin: 3.5rem!important
}
.mt-6,.my-6 {
margin-top: 3.5rem!important
}
.mr-6,.mx-6 {
margin-right: 3.5rem!important
}
.mb-6,.my-6 {
margin-bottom: 3.5rem!important
}
.ml-6,.mx-6 {
margin-left: 3.5rem!important
}
.p-0 {
padding: 0!important
}
......@@ -14733,6 +14756,10 @@ a.bg-white:focus,a.bg-white:hover,button.bg-white:focus,button.bg-white:hover {
padding-left: 3rem!important
}
.pl-6,.px-6 {
padding-left: 3.5rem!important
}
.m-n1 {
margin: -.25rem!important
}
......@@ -20655,6 +20682,53 @@ button {
padding: 4px 7px
}
.type-icon {
line-height: 0;
padding: 5px;
}
.type-icon .report:before{
content: '';
background-image: url("/abvw/common/img/type_icon_report.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 40px;
height: 40px;
display: inline-block;
}
.type-icon .questionary:before{
content: '';
background-image: url("/abvw/common/img/type_icon_questionary.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 40px;
height: 40px;
display: inline-block;
}
.type-icon .inspection:before{
content: '';
background-image: url("/abvw/common/img/type_icon_inspection.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 40px;
height: 40px;
display: inline-block;
}
.type-icon .proccess:before{
content: '';
background-image: url("/abvw/common/img/type_icon_proccess.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 40px;
height: 40px;
display: inline-block;
}
.block-title {
border-bottom: 1px solid #0070ca
}
......
......@@ -38,16 +38,14 @@ ul.message-list li.read{
}
/* task list */
.task-list li a > div:nth-of-type(2){
min-height: 45px;
}
.view-block {
display: grid;
grid-template-columns: repeat(4,1fr);
grid-template-columns: repeat(3,1fr);
column-gap: 10px;
}
@media screen and (max-width: 992px) {
.view-block {
grid-template-columns: repeat(3,1fr);
}
}
@media screen and (max-width: 767px) {
.view-block {
grid-template-columns: repeat(2,1fr);
......
......@@ -32,7 +32,6 @@
<a class="dropdown-item " href="#" data-toggle="modal" data-target="#confirm-modal">
<img src="../common/img/menu_icon_logout.svg" alt="ログアウト" class="navbar-dropdown-icon">
<span class="lang" style=" color: #6c757d;" lang="dspLogout"></span>
</a>
</div>
</div>
......
$(function(){
hide_del_btn();
});
// 追加ボタン押下
/** Handle press the Add button */
$('.add').on('click',function(){
var base = $(this).parent().parent().parent('.tb-item');
base.find('.del').show();
// 入力フォームをクローン
// clone input form
base.clone(true).insertAfter(base);
// 追加した要素にスクロール
// Scroll to added element
$("html,body").animate({scrollTop:base.next().offset().top});
// 入力フォームアコーディオン表示
// Input form accordion display
base.parent().parent('.tb').find('.ac-tb-form').show();
});
// 削除ボタン押下
/** Handle press the Delete button */
$('.del').on('click',function(){
var base = $(this).parent().parent().parent('.tb-item');
var tbwrap = base.parent('.tb-wrap');
var tb = tbwrap.parent('.tb');
// エリアの削除
// Delete area
base.remove();
// ボタンの表示非表示切り替え
// Hidden delete button
hide_del_btn();
// フォームエリア表示切り替え
// Form area display switch
tbWrapClear(tbwrap);
// 折りたたみアイコン非表示
// Hide collapse icon
if(tb.find('.ac-tb-form').is(':hidden')){
tb.find('.fold-area').addClass('hide');
}
});
// 閉じるボタン押下
/** handle Press the close button */
$('.close-window').on('click',function(){
window.close();
});
// 表領域のフォームが一つの時、削除ボタンを非表示
/** Hide delete button when there is only one tablespace form */
function hide_del_btn(){
$('.tb-wrap').each(function(i, elem){
var len = $(elem).find('.tb-item').length;
//表の項目が一つの場合
// When there is one item in the table
if(len <= 1){
$(elem).find('.del').hide();
$(this).children('.tb-item').removeClass('visually-hidden');
// 入力フォームアコーディオン非表示
// Input form accordion hidden
$(this).parent().find('.ac-tb-form').hide();
}
});
}
// アコーディオンを閉めている際にフォームを削除した場合
// 子要素がすべて非表示の場合、親要素を非表示とする
/** Handle when deleting while closing the accordion */
function tbWrapClear(tbwrap){
// If you delete the form while closing the accordion
// Hide parent element if all child elements are hidden
if(tbwrap.children(':not(.visually-hidden)').length == 0){
tbwrap.addClass("visually-hidden");
}
......@@ -65,7 +63,7 @@ function tbWrapClear(tbwrap){
}
}
// 入力フォームアコーディオン
/** input form accordion */
$('.ac-tb-form').on('click',function(){
var tb = $(this).parent().parent().parent('.tb');
var elems = tb.find('.tb-wrap').find('.tb-item');
......@@ -79,28 +77,28 @@ $('.ac-tb-form').on('click',function(){
});
$(this).text('開く');
// フォームエリア表示切り替え
// Form area display switch
tbWrapClear(tbwrap);
// 折りたたみアイコン表示
// Collapse icon view
tb.find('.fold-area').removeClass('hide');
}else{
elems.removeClass('visually-hidden');
$(this).text('閉じる');
// フォームエリア表示切り替え
// Form area display switch
tbWrapClear(tbwrap);
// 折りたたみアイコン非表示
// Hide collapse icon
tb.find('.fold-area').addClass('hide');
}
// 開閉
// opening and closing
$(this).toggleClass("hide");
});
// トグル切り替え
/** toggle switch */
$(".toggle").on("click", function() {
$(this).toggleClass("checked");
if(!$('input[name="check"]').prop("checked")) {
......@@ -111,24 +109,25 @@ $(".toggle").on("click", function() {
});
// メニュー表示
/** Menu display */
$('.c-dropdown-trigger').on("click",function(){
$('[data-target="' + $(this).attr('id') + '"]').toggleClass('show');
$('.mask').removeClass('hide');
});
// メニューを閉じる
/** Close menu */
$('.mask').on("click",function(){
$('.mask').addClass('hide');
$('.c-dropdown-menu').removeClass('show');
});
// カードリスト選択
/** Select card list */
$('.select-card-list .card .select-label').on("click",function(){
$(this).closest('.select-card-list').find('.card').removeClass('selected');
$(this).closest('.card').addClass('selected');
});
// リスト表示切替(リスト表示)
/** List display switching (list display) */
$('.view-menu .view-list-btn').on("click",function(){
$('.view-block-btn').removeClass('active');
$('.view-list-btn').addClass('active');
......@@ -136,7 +135,7 @@ $('.view-menu .view-list-btn').on("click",function(){
$('.view-content').addClass('view-list');
});
// リスト表示切替(グリッド表示)
/** List display switching (grid display) */
$('.view-menu .view-block-btn').on("click",function(){
$('.view-list-btn').removeClass('active');
$('.view-block-btn').addClass('active');
......@@ -144,7 +143,7 @@ $('.view-menu .view-block-btn').on("click",function(){
$('.view-content').addClass('view-block');
});
// ローディング
/** loading */
$(function(){
function e() {
setTimeout(function(){
......
......@@ -46,14 +46,22 @@
"newRegistrationTitle":"New Registration",
"continousWorkTitle":"Continous Work",
"processWorkTitle":"Process work",
"reportWarningTitle":"Report With Warning",
"reportWarningTitle":"Report With Warnings",
"workWithWarningsTitle":"Work with warnings",
"messageListTitle":"Message List",
"sendMessageTitle":"Send Message",
"distanceSupportTitle":"DistanceSupport",
"distanceSupportTitle":"Distance Support",
"chatTitle":"Chat",
"makeDashboardAsHome":"Make dashboard your home screen",
"makeDashboardAsHome":"Set dashboard to home screen",
"btnKeep":"Keep",
"addNew":"Add New",
"display":" display",
"reportLevelReport":"Report",
"reportLevelAnswer":"Answer",
"msgNotFound":"There is no applicable work.",
"confirmation":"confirmation",
"confirmYes":"Yes",
"confirmNo":"No",
"messageListEmpty":"No Messages",
"messageDetail":"Message Details",
"operationName":"Operation Name",
......
......@@ -54,6 +54,14 @@
"chatTitle":"チャット",
"makeDashboardAsHome":"ダッシュボードをホーム画面にする",
"btnKeep":"保存",
"addNew":"新規追加",
"display":" 件表示",
"reportLevelReport":"報告",
"reportLevelAnswer":"回答",
"msgNotFound":"該当する作業がありません。",
"confirmation":"確認",
"confirmYes":"はい",
"confirmNo":"いいえ",
"messageListEmpty":"メッセージがありません。",
"messageDetail":"メッセージ詳細",
"operationName":"作業名",
......
......@@ -54,6 +54,14 @@
"chatTitle":"Chat",
"makeDashboardAsHome":"Make dashboard your home screen",
"btnKeep":"Keep",
"addNew":"Add New",
"display":" display",
"reportLevelReport":"Report",
"reportLevelAnswer":"Answer",
"msgNotFound":"There is no applicable work.",
"confirmation":"confirmation",
"confirmYes":"Yes",
"confirmNo":"No",
"messageListEmpty":"No Messages",
"messageDetail":"Message Details",
"operationName":"Operation Name",
......
......@@ -32,7 +32,6 @@
<body onload="DASHBOARD.init();">
<!-- header -->
<!-- <?php include('common/header.html');?> -->
<div id="includedHeader"></div>
<!-- dashboard -->
<main>
......@@ -65,7 +64,6 @@
<div id="includedDashboardSetting"></div>
<!-- confirm -->
<!-- <?php include('common/confirm-modal.html');?> -->
<div id="includedConfirmModal"></div>
</body>
......
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<title>ピックアップ</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
<link href="../common/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- main css -->
<link rel="stylesheet" type="text/css" href="../common/css/newdash/app.css">
<link rel="stylesheet" type="text/css" href="../common/css/newdash/header.css">
<link rel="stylesheet" type="text/css" href="../common/css/newdash/style.css">
<!-- vender css -->
<link rel="stylesheet" type="text/css" href="../common/css/newdash/fontawesome_relative_path.css">
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/web/i18n.js?__UPDATEID__"></script>
<script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script>
<!-- main js -->
<script type="text/javascript" src="../js/dashboardSetting/dashboard-setting.js"></script>
<script type="text/javascript" src="../js/dashboard/dashboard.js"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/pickup/pickup.js"></script>
</head>
<body onload="PICKUP.init();">
<!-- header -->
<div id="includedHeader"></div>
<!-- pickup -->
<main>
<div class="container">
<!-- breadcrumb -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb px-0 mb-0">
<li class="breadcrumb-item"><a href="dashboard.html" class="text-decoration-none text-underline lang" lang="dashboard"></a></li>
<li class="breadcrumb-item active lang" lang="pickup" aria-current="page"><span></span></li>
</ol>
</nav>
<!-- title -->
<h1 class="fs-14 font-weight-bold pt-sm-4 pt-2 pb-3 mb-0 lang" lang="pickup"></h1>
<!-- tab -->
<ul class="nav nav-tabs line" id="myTab" role="tablist">
<li class="nav-item" id="liTabNewReport">
<a class="nav-link active" data-toggle="tab" href="#tab-content-NewReport" role="tab" aria-controls="tab-content-NewReport" aria-expanded="true">
<div class="text-center lang" lang="addNew"></div>
</a>
</li>
<li class="nav-item" id="liTabContinousWork">
<a class="nav-link" data-toggle="tab" href="#tab-content-ContinousWork" role="tab" aria-controls="tab-content-ContinousWork">
<div class="text-center lang" lang="processWorkTitle"></div>
</a>
</li>
<li class="nav-item" id="liTabReportWithWarning">
<a class="nav-link" data-toggle="tab" href="#tab-content-ReportWithWarnings" role="tab" aria-controls="tab-content-ReportWithWarnings">
<div class="text-center lang" lang="reportWarningTitle"></div>
</a>
</li>
</ul>
<!-- tab content-->
<!-- new -->
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="tab-content-NewReport" role="tabpanel" aria-labelledby="1-tab">
<!-- view menu -->
<nav aria-label="view" class="view-menu mt-2" id="viewMenuNewReport">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9" id="count-NewReport"></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="リスト表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="リスト表示">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="グリッド表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="グリッド表示">
</a>
</div>
</div>
</nav>
<!-- task list -->
<ul class="p-0 mt-3 card-list task-list view-content view-block" id="newReport-list">
</ul>
</div>
<!-- proccess -->
<div class="tab-pane fade" id="tab-content-ContinousWork" role="tabpanel" aria-labelledby="2-tab">
<!-- view menu -->
<nav aria-label="view" class="view-menu mt-2" id="viewMenuContinuousWork">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9" id="count-ContinuousWork"></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="リスト表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="リスト表示">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="グリッド表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="グリッド表示">
</a>
</div>
</div>
</nav>
<!-- task list -->
<ul class="p-0 mt-3 card-list task-list view-content view-block" id="continousWork-list">
</ul>
</div>
<!-- alert -->
<div class="tab-pane fade" id="tab-content-ReportWithWarnings" role="tabpanel" aria-labelledby="3-tab">
<!-- view menu -->
<nav aria-label="view" class="view-menu mt-2" id="viewMenuReportWithWarnings">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9" d="count-ReportWithWarnings"></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="リスト表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="リスト表示">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="グリッド表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="グリッド表示">
</a>
</div>
</div>
</nav>
<!-- task list -->
<ul class="p-0 mt-3 card-list task-list view-content view-block" id="reportWithWarnings-list">
</ul>
</div>
</div>
</div>
</main>
<!-- confirm -->
<div id="includedConfirmModal"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="../common/js/newdash/app.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/newdash/common.js?__UPDATEID__"></script>
</body>
</html>
\ No newline at end of file
/**
* pickup js in pickup.html
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var PICKUP = {};
PICKUP.newReportList;
PICKUP.continousWorkReport;
PICKUP.reportWithWarning;
PICKUP.pickupActive = "newReport";
PICKUP.countNewReportList = 0;
PICKUP.countContinousWorkReport = 0;
PICKUP.countReportWithWarning= 0;
/**
* Report type
*/
PICKUP.REPORT_TYPE = {
REPORTONLY: 0, //report only
INSPECT: 1, //rountine
WITHREPLY: 2, // report answer
WORKFLOW: 3 // continuous
}
/**
* operation type
*/
PICKUP.OPERATION_TYPE = {
LIST: "0",
DRAWING: "1",
VTOUR: "2",
PDF: "3"
};
/**
* task type of report answer
*/
PICKUP.REPLYREPORT_TASK_TYPE = {
REPORT: 0,
ANSWER: 1
}
/**
* default Pickup List
*/
PICKUP.defaultPickupList = {
operationList:[]
}
PICKUP.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pickup/';
PICKUP.getNewReportListApiUrl = PICKUP.baseApiUrl + 'newReportList';
PICKUP.getContinuousWorkListApiUrl = PICKUP.baseApiUrl + 'continuousWorkList';
PICKUP.getReportWithWarningsListApiUrl = PICKUP.baseApiUrl + 'reportWithWarnings';
/**
* Call get new report list api get data
*/
PICKUP.getNewreportListData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
COMMON.cmsAjax(PICKUP.getNewReportListApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('DASHBOARD.getNewreportListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
});
};
/**
* Call get Continuous Work list api get data
* @param {*} callback
*/
PICKUP.getContinuousWorkListData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
COMMON.cmsAjax(PICKUP.getContinuousWorkListApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('DASHBOARD.getContinuousWorkListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
});
};
/**
* Call get Report With Warnings list api get data
* @param {*} callback
*/
PICKUP.getReportWithWarningsListData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
COMMON.cmsAjax(PICKUP.getReportWithWarningsListApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('DASHBOARD.getReportWithWarningListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
});
};
/**
* Initialization pickup html
*/
PICKUP.init = function() {
console.log("PICKUP.init");
TEMPLATE.loadHearder();
TEMPLATE.loadConfirmModal();
PICKUP.initSettingActivePickup();
PICKUP.settingPickup();
}
/**
* Setting pickup data
*/
PICKUP.settingPickup = function() {
DashboardSetting.getSettingData(function (settings) {
$("#liTabNewReport").addClass('d-none');
$("#liTabContinousWork").addClass('d-none');
$("#liTabReportWithWarning").addClass('d-none');
if(settings.newReport)
{
$("#liTabNewReport").removeClass('d-none');
PICKUP.initNewReportTab();
}
if(settings.continousWork)
{
$("#liTabContinousWork").removeClass('d-none');
PICKUP.initContinuosWorkTab();
}
if(settings.reportWarning)
{
$("#liTabReportWithWarning").removeClass('d-none');
PICKUP.initReportWithWarningsTab();
}
});
}
/**
* init Setting Active Pickup
*/
PICKUP.initSettingActivePickup = function() {
var urlParam = COMMON.getUrlParameter();
PICKUP.pickupActive = urlParam.pickupActive;
PICKUP.settingActivePickup(PICKUP.pickupActive);
}
/**
* setting Active Pickup
* @param {*} pickupActive
* @returns
*/
PICKUP.settingActivePickup = function(pickupActive) {
PICKUP.pickupActive = pickupActive;
$('#liTabNewReport a').removeClass('active');
$('#liTabContinousWork a').removeClass('active');
$('#liTabReportWithWarning a').removeClass('active');
$('#tab-content-NewReport').removeClass('active show');
$('#tab-content-ContinousWork').removeClass('active show');
$('#tab-content-ReportWithWarnings').removeClass('active show');
if(pickupActive == "newReport")
{
$('#liTabNewReport a').addClass('active');
$('#tab-content-NewReport').addClass('active show');
return;
}
if(pickupActive == "continousWork")
{
$('#liTabContinousWork a').addClass('active');
$('#tab-content-ContinousWork').addClass('active show');
return;
}
if(pickupActive == "reportWarning")
{
$('#liTabReportWithWarning a').addClass('active');
$('#tab-content-ReportWithWarnings').addClass('active show');
return;
}
}
/**
* Initialization show not found pickup item html
* @param {*} elementId
*/
PICKUP.showNotFoundPickupItem = function(elementId) {
$(elementId).removeClass();
$(elementId).addClass('p-0 mt-3 card-list');
let li = $("<li class='card mb-2 not-found'></li>");
let div = $("<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>");
let imgdiv = $("<img src=\"../common/img/icon_not_found.svg\" alt='" + I18N.i18nText('msgNotFound') +"' class='not-found-img mb-2'>");
let childDiv = $("<div class='fs-9 text-secondary font-weight-bold'>" + I18N.i18nText('msgNotFound') +"</div>");
div.append(imgdiv);
div.append(childDiv);
li.append(div);
$(elementId).append(li);
}
/**
* Initialization view pickup menu html
* @param {*} elementId
* @param {*} count
*/
PICKUP.showCountDisplayPickupItem = function(elementId, count) {
let span = $('<span>' + I18N.i18nText('display') +'</span>');
$(elementId).append(count);
$(elementId).append(span);
}
/**
* Initialization new report list html
*/
PICKUP.initNewReportTab = function() {
PICKUP.getNewreportListData(function (json) {
PICKUP.createNewReportList(json.operationList);
});
}
/**
* Initialization continuous work list html
*/
PICKUP.initContinuosWorkTab = function() {
PICKUP.getContinuousWorkListData(function (json) {
PICKUP.createContinousWorkList(json.operationList);
});
}
/**
* Initialization continuous work list html
*/
PICKUP.initReportWithWarningsTab = function() {
PICKUP.getReportWithWarningsListData(function (json) {
PICKUP.createReportWithWarningList(json.operationList);
});
}
/**
* sort New report operation list
* @param {*} operationList
* @returns
*/
PICKUP.sortNewReportList = function(operationList) {
operationList = operationList.sort(function(a,b) {
if (a.operationId < b.operationId) return 1;
if (a.operationId > b.operationId) return -1;
return 0;
});
return operationList;
}
/**
* Implement new report list html
* @param {*} operationListOld
* @returns
*/
PICKUP.createNewReportList = function(operationListOld) {
let operationList = PICKUP.sortNewReportList(operationListOld);
$('#viewMenuNewReport').removeClass('d-none');
$("#newReport-list").empty();
PICKUP.countNewReportList = 0;
if (typeof operationList === 'undefined' || operationList.length < 1) {
PICKUP.showNotFoundPickupItem("#newReport-list");
$('#viewMenuNewReport').addClass('d-none');
return;
}
$('#newReport-list').addClass('task-list view-content view-block');
let classIcon ;
for (let i = 0; i < operationList.length; i++) {
switch (operationList[i].reportType)
{
case PICKUP.REPORT_TYPE.REPORTONLY:
classIcon = "report";
break;
case PICKUP.REPORT_TYPE.INSPECT:
classIcon = "inspection";
break;
case PICKUP.REPORT_TYPE.WITHREPLY:
classIcon = "questionary";
break;
case PICKUP.REPORT_TYPE.WORKFLOW:
classIcon = "proccess";
break;
}
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $("<a href='report-list.html' class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'>"
+ "<span class='" + classIcon + "'></span>"
+ "</div></div>")
let divText = $("<div class='pl-5 h-100 d-flex align-items-center'>"
+ "<div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>"
+ "</div></div>");
ahrefRequiredFlg.append(divIcon);
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$("#newReport-list").append(messageli);
PICKUP.countNewReportList = PICKUP.countNewReportList + 1;
}
// show not found if
if (PICKUP.countNewReportList == 0) {
PICKUP.showNotFoundPickupItem("#newReport-list");
$('#viewMenuNewReport').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem("#count-NewReport", PICKUP.countNewReportList )
}
/**
* sort continuous work operation list
* @param {*} operationList
* @returns
*/
PICKUP.sortContinousWorkList = function(operationList) {
let newOperationList = [];
for (let i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3)
{
if(typeof operationList[i].processList === 'undefined' ) continue;
if (operationList[i].processList && operationList[i].processList.length != 0)
{
for( let j = 0; j < operationList[i].processList.length; j++ )
{
if(typeof operationList[i].processList[j].phaseList === 'undefined' ) continue;
for(let g = 0; g < operationList[i].processList[j].phaseList.length; g++ )
{
if(operationList[i].processList[j].phaseList[g].phaseStatus != 999)
{
let item = {reportType: operationList[i].reportType,
operationType: operationList[i].operationType,
phaseList: operationList[i].processList[j].phaseList,
processKey: operationList[i].processList[j].processKey,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationId: operationList[i].operationId,
contentId: operationList[i].contentId,
operationName: operationList[i].operationName,
taskCode: operationList[i].processList[j].taskCode,
taskKey: operationList[i].processList[j].taskKey,
taskName: operationList[i].processList[j].taskName,
updateDate: operationList[i].processList[j].phaseList[g].updateDate,
phaseNo: operationList[i].processList[j].phaseList[g].phaseNo,
phaseName: operationList[i].processList[j].phaseList[g].phaseName
};
newOperationList.push(item);
}
}
}
}
}
}
newOperationList = newOperationList.sort(function(a,b) {
if (!a.updateDate) {
a.updateDate = "1900-01-01 00:00:00";
}
if (!b.updateDate) {
b.updateDate = "1900-01-01 00:00:00";
}
if (a.updateDate < b.updateDate) return 1;
if (a.updateDate > b.updateDate) return -1;
return 0;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return newOperationList;
}
/**
* Implement continous work html
* @param {*} operationListOld
* @returns
*/
PICKUP.createContinousWorkList = function(operationListOld) {
let operationList = PICKUP.sortContinousWorkList(operationListOld);
$('#viewMenuContinuousWork').removeClass('d-none');
$("#continousWork-list").empty();
PICKUP.countContinousWorkReport = 0;
if (typeof operationList === 'undefined' || operationList.length < 1) {
PICKUP.showNotFoundPickupItem("#continousWork-list");
$('#viewMenuContinuousWork').addClass('d-none');
return;
}
$('#continousWork-list').addClass('task-list view-content view-block');
for (let i = 0; i < operationList.length; i++) {
let directKey = operationList[i].processKey;
if (operationList[i].operationType == PICKUP.OPERATION_TYPE.VTOUR || operationList[i].operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = operationList[i].taskKey;
}
let messageli = $("<li class='card mb-2' id = 'list_" + operationList[i].processKey + "$" + operationList[i].phaseNo + "'></li>") ;
let ahrefRequiredFlg ;
if (operationList[i].permitCodeRequiredFlg == 1)
{
ahrefRequiredFlg = $("<a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
}
else
{
ahrefRequiredFlg = $("<a href=\"javascript:CHK_L.sendAppCommand('goOperation', '" + operationList[i].operationId + "', '" + operationList[i].contentId
+ " ', null ,'DETAIL_FORM_INPUT' ,'CONTINOUS_WORK','" + directKey + "','" + operationList[i].phaseNo + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
}
let divProccess = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>");
let divInfor = $("<div class='pl-5 h-100 d-flex align-items-center'></div>");
let divChildInfor = $("<div class='w-100'></div>");
let divOperationName = $("<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + operationList[i].phaseName + "</div>");
let divProcessName = $("<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>");
let divReportInfor = $("<div class='d-flex justify-content-between align-items-center'></div>");
let divReportName = $("<div class='fs-10 text-truncate'>" + operationList[i].taskName + "</div>");
let divReportCode = $("<div class='fs-8 text-secondary text-truncate'>" + operationList[i].taskCode + "</div>");
divReportInfor.append(divReportName);
divReportInfor.append(divReportCode);
divChildInfor.append(divOperationName);
divChildInfor.append(divProcessName);
divChildInfor.append(divReportInfor);
divInfor.append(divChildInfor);
ahrefRequiredFlg.append(divProccess);
ahrefRequiredFlg.append(divInfor);
messageli.append(ahrefRequiredFlg);
$("#continousWork-list").append(messageli);
PICKUP.countContinousWorkReport = PICKUP.countContinousWorkReport + 1;
}
// show not found if
if (PICKUP.countContinousWorkReport == 0) {
PICKUP.showNotFoundPickupItem("#continousWork-list");
$('#viewMenuContinuousWork').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem("#count-ContinuousWork", PICKUP.countContinousWorkReport )
};
/**
* sort report with warnings list
* @param {*} operationList
* @returns
*/
PICKUP.sortWarningList = function(operationList) {
let newOperationList = [];
for (let i = 0; i < operationList.length; i++) {
if(typeof operationList[i].warningReportList === 'undefined' ) continue;
if (operationList[i].warningReportList && operationList[i].warningReportList.length != 0)
{
for( let j = 0; j < operationList[i].warningReportList.length; j++ )
{
let item = {reportType: operationList[i].reportType,
operationType: operationList[i].operationType,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationId: operationList[i].operationId,
contentId: operationList[i].contentId,
operationName: operationList[i].operationName,
taskCode: operationList[i].warningReportList[j].taskCode,
taskKey: operationList[i].warningReportList[j].taskKey,
taskName: operationList[i].warningReportList[j].taskName,
taskType: operationList[i].warningReportList[j].taskType,
updateDate: operationList[i].warningReportList[j].updateDate,
reportStartDateString: operationList[i].warningReportList[j].reportStartDateString,
reportEndDateString: operationList[i].warningReportList[j].reportEndDateString,
processKey: operationList[i].warningReportList[j].processKey,
phaseNo: operationList[i].warningReportList[j].phaseNo,
phaseName: operationList[i].warningReportList[j].phaseName
};
newOperationList.push(item);
}
}
}
newOperationList = newOperationList.sort(function(a,b) {
if (!a.updateDate) {
a.updateDate = "1900-01-01 00:00:00";
}
if (!b.updateDate) {
b.updateDate = "1900-01-01 00:00:00";
}
if (a.updateDate < b.updateDate) return 1;
if (a.updateDate > b.updateDate) return -1;
return 0;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return newOperationList;
}
/**
* init Warning Report With ReportOnly Type
* @param {*} report
* @returns
*/
PICKUP.initWarningReportWithReportOnlyType = function(report) {
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:CHK_L.sendAppCommand('goOperation', '" + report.operationId + "', '" + report.contentId
+ " ', null ,'DETAIL_FORM_INPUT' ,'REPORT_WARNING','" + report.taskKey + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'><span class='report'></span></div></div>"
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>"
+ "<div class='fs-8 text-secondary text-truncate'> " + report.taskCode + "</div>"
+ "</div></div></div></a></li>");
return ele;
}
PICKUP.initWarningReportWithInspectType = function(report) {
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:CHK_L.sendAppCommand('goOperation', '" + report.operationId + "', '" + report.contentId
+ " ', null ,'DETAIL_FORM_INPUT' ,'REPORT_WARNING','" + report.taskKey + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'><span class='inspection'></span></div></div>"
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'></div>"
+ "<div class='fs-8 text-secondary text-truncate'>" + PICKUP.getInspectDate(report.reportStartDateString) + " ~ " + PICKUP.getInspectDate(report.reportEndDateString)
+ "</div></div></div></div></a></li>");
return ele;
}
/**
* init Warning Report With AnswerReport Type
* @param {*} report
* @param {*} reportTypeMsg
* @returns
*/
PICKUP.initWarningReportWithAnswerReportType = function(report, reportTypeMsg) {
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:CHK_L.sendAppCommand('goOperation', '" + report.operationId + "', '" + report.contentId
+ " ', null ,'DETAIL_FORM_INPUT' ,'REPORT_WARNING','" + report.taskKey + "','" + report.taskType + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>"
+ "<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + reportTypeMsg + "</div>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>"
+ "<div class='fs-8 text-secondary text-truncate'>" + report.taskCode+ "</div>"
+ "</div></div></div></a></li>");
return ele;
}
/**
* init Warning Report With Continuous Report Type
* @param {*} report
* @returns
*/
PICKUP.initWarningReportWithContinuousReportType = function(report) {
let directKey = report.processKey;
if (report.operationType == PICKUP.OPERATION_TYPE.VTOUR || report.operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = report.taskKey;
if (report.phaseNo > 1) {
//find taskKey of phaseNo 1
for (let k = 0; k < operationList.length; k++) {
if (operationList[k].phaseNo == 1 && operationList[k].processKey == report.processKey) {
directKey = operationList[k].taskKey;
break;
}
}
}
}
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:CHK_L.sendAppCommand('goOperation', '" + report.operationId + "', '" + report.contentId
+ " ', null ,'DETAIL_FORM_INPUT' ,'REPORT_WARNING','" + directKey + "','" + report.phaseNo + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'><span class='proccess'></span></div></div>"
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + report.phaseName + "</div>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>"
+ "<div class='fs-8 text-secondary text-truncate'>" + report.taskCode+ "</div>"
+ "</div></div></div></a></li>");
return ele;
}
/**
* create Report With Warnings List html
* @param {*} operationListOld
* @returns
*/
PICKUP.createReportWithWarningList = function(operationListOld) {
let operationList = PICKUP.sortWarningList(operationListOld);
$('#viewMenuReportWithWarnings').removeClass('d-none');
$("#reportWithWarnings-list").empty();
PICKUP.countReportWithWarning = 0;
if (typeof operationList === 'undefined' || operationList.length < 1) {
PICKUP.showNotFoundPickupItem("#reportWithWarnings-list");
$('#viewMenuReportWithWarnings').addClass('d-none');
return;
}
$('#reportWithWarnings-list').addClass('task-list view-content view-block');
const msgLevelReport = I18N.i18nText('reportLevelReport');
const msgLevelAnswer = I18N.i18nText('reportLevelAnswer');
for (let i = 0; i < operationList.length; i++) {
let operationNameLi;
switch (operationList[i].reportType)
{
case PICKUP.REPORT_TYPE.REPORTONLY:
operationNameLi = PICKUP.initWarningReportWithReportOnlyType(operationList[i]);
break;
case PICKUP.REPORT_TYPE.INSPECT:
operationNameLi = PICKUP.initWarningReportWithInspectType(operationList[i]);
break;
case PICKUP.REPORT_TYPE.WITHREPLY: // report answer
if( operationList[i].taskType == PICKUP.REPLYREPORT_TASK_TYPE.REPORT )
{
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelReport);
}
else
{
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelAnswer);
}
break;
case PICKUP.REPORT_TYPE.WORKFLOW: // continouswork
operationNameLi = PICKUP.initWarningReportWithContinuousReportType(operationList[i]);
break;
}
$("#reportWithWarnings-list").append(operationNameLi);
PICKUP.countReportWithWarning = PICKUP.countReportWithWarning + 1;
}
// show not found if
if (PICKUP.countReportWithWarning == 0) {
PICKUP.showNotFoundPickupItem("#reportWithWarnings-list");
$('#viewMenuReportWithWarnings').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem("#count-ReportWithWarnings", PICKUP.countReportWithWarning )
};
/**
* get Inspect Date format
* @param {*} dateString
* @returns
*/
PICKUP.getInspectDate = function(dateString) {
let date = new Date(dateString)
return date.getFullYear() + "/" + ("0" + (date.getMonth() + 1)).slice(-2) + "/" + ("0" + date.getDate()).slice(-2) ;
}
\ No newline at end of file
/**
* Header js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var TEMPLATE = {};
/** load common data */
TEMPLATE.loadCommon = function() {
$("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n();
});
$("#includedDashboardSetting").load("dashboard-setting.html", function() {
DashboardSetting.init();
I18N.initi18n();
});
$("#includedConfirmModal").load("../common/confirm-modal.html", function() {
I18N.initi18n();
});
}
TEMPLATE.loadHearder = function() {
$("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n();
});
}
TEMPLATE.loadDashboardSetting = function() {
$("#includedDashboardSetting").load("dashboard-setting.html", function() {
DashboardSetting.init();
I18N.initi18n();
});
}
TEMPLATE.loadConfirmModal = function() {
$("#includedConfirmModal").load("../common/confirm-modal.html", function() {
I18N.initi18n();
});
}
\ 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