Commit da4f0e9c by NGUYEN THI MY DUYEN

index design change

parent 462e03ac
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</a> </a>
</li> </li>
<li class="nav-link"> <li class="nav-link">
<a href="task-list.html" class="d-block text-center text-decoration-none"> <a href="index.html" class="d-block text-center text-decoration-none">
<img src="../common/img/nav_icon_task.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid lang" lang="workList"> <img src="../common/img/nav_icon_task.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid lang" lang="workList">
<div class="fs-7 d-sm-block d-none lang" lang="workList"></div> <div class="fs-7 d-sm-block d-none lang" lang="workList"></div>
</a> </a>
......
...@@ -26,11 +26,7 @@ HEADER.goToHomePage = function (pageId) { ...@@ -26,11 +26,7 @@ HEADER.goToHomePage = function (pageId) {
* Go page of operationList * Go page of operationList
*/ */
HEADER.goOperationList = function () { HEADER.goOperationList = function () {
$('#footer').load(CONSTANT.PAGE_NAME.FOOTER, function () { OL.init();
sessionStorage.activeTab = CONSTANT.PAGE_TAB.OPERATION_LIST;
HEADER.activeInitBottomNav('operationListBottomNav');
TOP.showPage(CONSTANT.PAGE_NAME.OPERATION_LIST);
});
}; };
/** /**
......
...@@ -14,6 +14,13 @@ OL.isOperationGroupMaster = 0; //0: category(operationGroupMaster) not exist 1: ...@@ -14,6 +14,13 @@ OL.isOperationGroupMaster = 0; //0: category(operationGroupMaster) not exist 1:
OL.sortIndex; OL.sortIndex;
OL.operationGroupMasterId; OL.operationGroupMasterId;
OL.REPORT_TYPE = {
REPORTONLY: 0, //report only
INSPECT: 1, //rountine
WITHREPLY: 2, // report answer
WORKFLOW: 3 // continuous
}
/** /**
* process on page load. * process on page load.
* 1.get all data. * 1.get all data.
...@@ -23,6 +30,10 @@ OL.operationGroupMasterId; ...@@ -23,6 +30,10 @@ OL.operationGroupMasterId;
OL.init = function () { OL.init = function () {
console.log('OperationList start'); console.log('OperationList start');
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadConfirmModal("#includedConfirmModal");
TEMPLATE.loadCategoryModal("#includedCategoryModal");
//get all data of operation list scene //get all data of operation list scene
OL.getAllDataWeb(sessionStorage.OL_searchKeyWord, sessionStorage.OL_sortIndex, sessionStorage.OL_searchStartDate, sessionStorage.OL_searchEndDate, sessionStorage.OL_operationGroupMasterId); OL.getAllDataWeb(sessionStorage.OL_searchKeyWord, sessionStorage.OL_sortIndex, sessionStorage.OL_searchStartDate, sessionStorage.OL_searchEndDate, sessionStorage.OL_operationGroupMasterId);
...@@ -137,35 +148,51 @@ OL.createOperationList = function (operationList) { ...@@ -137,35 +148,51 @@ OL.createOperationList = function (operationList) {
//create & show //create & show
for (let i = 0; i < operationList.length; i++) { for (let i = 0; i < operationList.length; i++) {
let operationTR = $('<tr/>'); let classIcon ;
switch (operationList[i].reportType)
const operationNameTd = $( {
"<td class='operationId_" + case OL.REPORT_TYPE.REPORTONLY:
operationList[i].operationId + classIcon = "report";
"'><a href=\"javascript:OL.sendOperation('" + break;
operationList[i].operationId + case OL.REPORT_TYPE.INSPECT:
"', '" + classIcon = "inspection";
operationList[i].operationType + break;
"', '" + case OL.REPORT_TYPE.WITHREPLY:
operationList[i].reportType + classIcon = "questionary";
"', '" + break;
operationList[i].enableAddReport + case OL.REPORT_TYPE.WORKFLOW:
"');\" class='d-block text-black text-decoration-none mb-1'>" + classIcon = "proccess";
operationList[i].operationName + break;
"</a><div class='fa-sm mobile_operation_date'><i class='far fa-clock fa-blue' style='color:blue;margin-right:10px'></i>" + }
OL.setOperationDate(operationList[i].operationStartDate) + let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
' ~ ' + let ahrefRequiredFlg = $("<a href=\"javascript:OL.sendOperation('"
OL.setOperationDate(operationList[i].operationEndDate) + + operationList[i].operationId
'</div></td>', + "', '"
); + operationList[i].operationType
const operationStartDateTd = $('<td/>', { class: 'operationStartDate' }).text(OL.setOperationDate(operationList[i].operationStartDate)); + "', '"
const operationEndDateTd = $('<td/>', { class: 'operationEndDate' }).text(OL.setOperationDate(operationList[i].operationEndDate)); + operationList[i].reportType
+ "', '"
operationTR.append(operationNameTd); + operationList[i].enableAddReport
operationTR.append(operationStartDateTd); + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
operationTR.append(operationEndDateTd); let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'>"
$('.table tbody').append(operationTR); + "<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>");
let divDate = $("<div class='fs-8 text-secondary text-truncate'>"
+ OL.setOperationDate(operationList[i].operationStartDate)
+ ' ~ '
+ OL.setOperationDate(operationList[i].operationEndDate)
+ "</div>");
ahrefRequiredFlg.append(divIcon);
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$('#operationTable').append(messageli);
} }
}; };
......
...@@ -30,6 +30,13 @@ TEMPLATE.loadConfirmModal = function(elmentId) { ...@@ -30,6 +30,13 @@ TEMPLATE.loadConfirmModal = function(elmentId) {
}); });
} }
/** Template load category model */
TEMPLATE.loadCategoryModal = function(elmentId) {
$(elmentId).load("../common/category-modal.html", function() {
I18N.initi18n();
});
}
/** Template load operation select */ /** Template load operation select */
TEMPLATE.loadOperationSelect = function(elmentId, selectCallback) { TEMPLATE.loadOperationSelect = function(elmentId, selectCallback) {
$(elmentId).load("operation-select.html", function() { $(elmentId).load("operation-select.html", function() {
......
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