Commit 0f6a0704 by Kang Donghun

add to display pdfPrint button

parent 739e1686
...@@ -1105,6 +1105,33 @@ ...@@ -1105,6 +1105,33 @@
return true; return true;
} }
/**
* check quick report
*/
COMMON.checkQuickReport = function (callback) {
if (sessionStorage.getItem("operationId")) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = sessionStorage.getItem("operationId");
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT;
COMMON.cmsAjax(
url,
params,
false,
function (result) {
if (callback) callback(result);
},
function () {
COMMON.showAlert('msgOperationEmpty');
COMMON.avwScreenMove('index.html');
},
);
} else {
COMMON.showAlert('error');
COMMON.avwScreenMove('index.html');
}
};
/* /*
* Operations for session storage [ end ] * Operations for session storage [ end ]
*/ */
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
<div id="includedMainTitle"></div> <div id="includedMainTitle"></div>
<div class="quickReportBtn" id="quickReportBtn" onclick="submitForm();">
<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom"
title="pdfPrint">
</div>
<!-- report list --> <!-- report list -->
<div class="mb-5" id="report-form"></div> <div class="mb-5" id="report-form"></div>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
$(document).ready(function() { $(document).ready(function() {
RL.init(); RL.init();
console.log("RL.isQuickReport : " + RL.isQuickReport); console.log("RL.isQuickReport : " + RL.isQuickReport);
COMMON.closeLoading();
}); });
</script> </script>
</head> </head>
......
...@@ -5,13 +5,21 @@ ...@@ -5,13 +5,21 @@
var RF = {}; var RF = {};
RF.isQuickReport;
RF.addReportFlg;
/** /**
* init * init
*/ */
RF.init = function () { RF.init = function () {
//Check if user is logged in //Check if user is logged in
COMMON.checkAuth(false); COMMON.checkAuth(false);
COMMON.checkQuickReport(function(result) {
if (result) {
result.isQuickReport = RF.isQuickReport;
result.addReportFlg = RF.addReportFlg;
}
})
RF.loadCommon(); RF.loadCommon();
RF.initFormView(); RF.initFormView();
}; };
...@@ -22,7 +30,7 @@ RF.init = function () { ...@@ -22,7 +30,7 @@ RF.init = function () {
RF.loadCommon = function () { RF.loadCommon = function () {
TEMPLATE.loadHeader('#includedHeader'); TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal'); TEMPLATE.loadConfirmModal('#includedConfirmModal');
RF.initBreadcrumb();
}; };
/** /**
...@@ -80,7 +88,7 @@ RF.initBreadcrumb = function () { ...@@ -80,7 +88,7 @@ RF.initBreadcrumb = function () {
} else { } else {
if (sessionStorage.getItem("pickUpType")) sessionStorage.removeItem("pickUpType"); if (sessionStorage.getItem("pickUpType")) sessionStorage.removeItem("pickUpType");
if ((addReportFlg) && addReportFlg == 1) { if ((RF.addReportFlg) && RF.addReportFlg == 1) {
navs = [ navs = [
{ {
titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST, titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
...@@ -106,9 +114,22 @@ RF.initBreadcrumb = function () { ...@@ -106,9 +114,22 @@ RF.initBreadcrumb = function () {
] ]
} }
} }
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, RF.loadMainTitleCallback);
} }
/**
* load main title callcack
*/
RF.loadMainTitleCallback = function () {
//add dashboard setting item
if (RF.isQuickReport) {
var elmA = $('<div class="quickReportBtn" id="quickReportBtn" onclick="submitForm();">');
let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdfPrint">');
elmA.append(elmImg);
$('#mainTitleHeader').after(elmA);
}
};
/** /**
* iinit form view * iinit form view
*/ */
...@@ -136,7 +157,6 @@ RF.initFormView = function () { ...@@ -136,7 +157,6 @@ RF.initFormView = function () {
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM; const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
$('#report-form').load(url, params, function () { $('#report-form').load(url, params, function () {
initPageLoad(); initPageLoad();
RF.initBreadcrumb();
COMMON.closeLoading(); COMMON.closeLoading();
}); });
} else { } else {
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
var RL = {}; var RL = {};
RL.isQuickReport;
/** /**
* init * init
*/ */
...@@ -17,7 +19,9 @@ ...@@ -17,7 +19,9 @@
console.log("kdh check closeLoading RL.init2"); console.log("kdh check closeLoading RL.init2");
console.log('ReportList init start'); console.log('ReportList init start');
console.log("kdh check closeLoading RL.init3"); console.log("kdh check closeLoading RL.init3");
RL.checkQuickReport(); COMMON.checkQuickReport(function(result) {
if (result) RL.isQuickReport = result.isQuickReport;
} );
console.log("kdh check closeLoading RL.init4"); console.log("kdh check closeLoading RL.init4");
RL.loadCommon(); RL.loadCommon();
console.log("kdh check closeLoading RL.init5"); console.log("kdh check closeLoading RL.init5");
...@@ -70,34 +74,32 @@ ...@@ -70,34 +74,32 @@
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_LIST, navs, RL.loadMainTitleCallback); TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_LIST, navs, RL.loadMainTitleCallback);
} }
RL.isQuickReport;
/** /**
* check quick report * check quick report
*/ */
RL.checkQuickReport = function () { // RL.checkQuickReport = function () {
if (sessionStorage.getItem("operationId")) { // if (sessionStorage.getItem("operationId")) {
let params = {}; // let params = {};
params.sid = COMMON.getSid(); // params.sid = COMMON.getSid();
params.operationId = sessionStorage.getItem("operationId"); // params.operationId = sessionStorage.getItem("operationId");
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT; // let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT;
COMMON.cmsAjax( // COMMON.cmsAjax(
url, // url,
params, // params,
false, // false,
function (result) { // function (result) {
RL.isQuickReport = result.isQuickReport; // RL.isQuickReport = result.isQuickReport;
}, // },
function () { // function () {
COMMON.showAlert('msgOperationEmpty'); // COMMON.showAlert('msgOperationEmpty');
COMMON.avwScreenMove('index.html'); // COMMON.avwScreenMove('index.html');
}, // },
); // );
} else { // } else {
COMMON.showAlert('error'); // COMMON.showAlert('error');
COMMON.avwScreenMove('index.html'); // COMMON.avwScreenMove('index.html');
} // }
}; // };
/** /**
* init task report list * init task report list
...@@ -124,7 +126,7 @@ ...@@ -124,7 +126,7 @@
//add dashboard setting item //add dashboard setting item
if (RL.isQuickReport) { if (RL.isQuickReport) {
var elmA = $('<div id="btnPdfPrint" onclick="RL.goPdfPrint();">'); var elmA = $('<div id="btnPdfPrint" onclick="RL.goPdfPrint();">');
let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdf出力">'); let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdfPrint">');
elmImg.attr('title', I18N.i18nText('reportList')); elmImg.attr('title', I18N.i18nText('reportList'));
elmA.append(elmImg); elmA.append(elmImg);
$('#mainTitleHeader').after(elmA); $('#mainTitleHeader').after(elmA);
......
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