Commit 5902765a by Takumi Imai

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

Feature/1.0 check web dev 50267

See merge request !13
parents 8402599e ab2b5b8e
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
"msgNotFound":"There is no applicable work.", "msgNotFound":"There is no applicable work.",
"confirmation":"confirmation", "confirmation":"confirmation",
"confirmYes":"Yes", "confirmYes":"Yes",
"confirmNo":"No" "confirmNo":"No",
"messageListEmpty":"No Messages"
} }
\ No newline at end of file
...@@ -61,6 +61,6 @@ ...@@ -61,6 +61,6 @@
"msgNotFound":"該当する作業がありません。", "msgNotFound":"該当する作業がありません。",
"confirmation":"確認", "confirmation":"確認",
"confirmYes":"はい", "confirmYes":"はい",
"confirmNo":"いいえ" "confirmNo":"いいえ",
"messageListEmpty":"メッセージがありません。"
} }
\ No newline at end of file
...@@ -61,5 +61,6 @@ ...@@ -61,5 +61,6 @@
"msgNotFound":"There is no applicable work.", "msgNotFound":"There is no applicable work.",
"confirmation":"confirmation", "confirmation":"confirmation",
"confirmYes":"Yes", "confirmYes":"Yes",
"confirmNo":"No" "confirmNo":"No",
"messageListEmpty":"No Messages"
} }
\ No newline at end of file
<!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 type="text/javascript" src="../common/js/newdash/app.js"></script>
<script type="text/javascript" src="../common/js/newdash/common.js"></script>
<script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/pushMessageList/push-message-list.js"></script>
</head>
<body onload="PushMessageList.init();">
<!-- header -->
<div id="includedHeader"></div>
<!-- message list -->
<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="messageListTitle" 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="messageListTitle"></h1>
<!-- message -->
<ul class="card-list message-list p-0" id="messageList">
<li class="card mb-2 not-found d-none">
<div class="text-dark mb-1 px-3 py-5 text-center m-auto">
<img src="../common/img/icon_not_found.svg" alt="メッセージがありません。" class="not-found-img mb-2">
<div class="fs-9 text-secondary font-weight-bold lang" lang="messageListEmpty"></div>
</div>
</li>
</ul>
</div>
</main>
</body>
</html>
\ No newline at end of file
/**
* Push Message List JS in push-message-list.html
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var PushMessageList = {};
PushMessageList.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pushMessageList/';
/**
* Init when html onload
*/
PushMessageList.init = function() {
$("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n();
});
PushMessageList.getMessageList(function(messageList) {
PushMessageList.generateMessageListHtml(messageList.pushMessageList);
});
}
/**
* get Message List from CMS
* @param {function} callback
*/
PushMessageList.getMessageList = function (callback) {
let param = {
sid: COMMON.getSid(),
};
const url = PushMessageList.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('PushMessageList.getMessageList error');
if (callback) {
callback(PushMessageList.dummyMessageListJson);
}
});
};
/**
* handle click message event
* @param {string} pushMessageId
*/
PushMessageList.clickMessage = function(pushMessageId) {
COMMON.goUrlWithCurrentParams('push-message-detail.html', {pushMessageId: pushMessageId});
}
/**
* generate message list html
* @param {array} messageList
* @returns
*/
PushMessageList.generateMessageListHtml = function(messageList) {
if (typeof messageList === 'undefined' || messageList.length < 1) {
//show not found
$('#messageList .not-found').removeClass('d-none');
return;
}
$('#messageList .not-found').addClass('d-none');
for (var i = 0; i < messageList.length; i++) {
let message = messageList[i];
var messageId = message.pushMessageId;
var mTitle = message.pushMessage;
var mDate = message.pushSendDate;
var mSubtitle = message.operationName;
var messageLi = $('<li class="card mb-2" id="pushMessageId_' + messageId + '"/>');
if (message.readingFlg) {
messageLi.addClass('read');
} else {
messageLi.addClass('unread');
}
var messageA = $('<a class="d-block px-3 py-2 text-decoration-none text-dark"/>');
messageA.attr('href', "javascript:PushMessageList.clickMessage('" + messageId +"');");
var titleDiv = $('<div class="fs-12 text-truncate">' + mTitle + '</div>');
var subTitleMainDiv = $('<div class="d-flex justify-content-between align-items-center"></div>');
var subTitleDiv = $('<div class="fs-10 text-truncate">' + mSubtitle + '</div>');
var dateDiv = $('<div class="fs-8 text-secondary text-nowrap">' + mDate + '</div>');
subTitleMainDiv.append(subTitleDiv);
subTitleMainDiv.append(dateDiv);
messageA.append(titleDiv);
messageA.append(subTitleMainDiv);
messageLi.append(messageA);
$('#messageList').append(messageLi);
}
};
/**
* dummy message list JSON for test
*/
PushMessageList.dummyMessageListJson = {
pushMessageList: [{
pushMessageId: 1,
pushMessage: 'メッセージ内容が入ります。',
pushSendDate: '2022/07/06 14:14',
operationName: '作業名が入ります。',
readingFlg: 0,
}, {
pushMessageId: 2,
pushMessage: 'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。',
pushSendDate: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
operationName: '作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。',
readingFlg: 1,
}]
};
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