Commit df379163 by Kang Donghun

add function that display pdfprint button on reportForm

parent 296597ca
......@@ -1111,6 +1111,33 @@ COMMON.checkLogin = function (option) {
return true;
}
/**
* check quick report
*/
COMMON.checkQuickReport = function (operationId, callback) {
if (operationId) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = 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 ]
*/
......
......@@ -35,10 +35,6 @@
<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 -->
<div class="mb-5" id="report-form"></div>
......
......@@ -5,13 +5,18 @@
var RF = {};
RF.isQuickReport;
/**
* init
*/
RF.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
const operationId = sessionStorage.getItem("operationId");
COMMON.checkQuickReport(operationId, function (result) {
RF.isQuickReport = result.isQuickReport;
})
RF.loadCommon();
RF.initFormView();
};
......@@ -106,10 +111,24 @@ 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">');
elmImg.attr('title', I18N.i18nText('reportForm'));
elmA.append(elmImg);
$('#mainTitleHeader').after(elmA);
}
};
/**
* iinit form view
*/
RF.initFormView = function () {
......
......@@ -14,6 +14,10 @@ RL.init = function () {
COMMON.showLoading();
COMMON.checkAuth(false);
console.log('ReportList init start');
const operationId = sessionStorage.getItem("operationId");
COMMON.checkQuickReport(operationId, function (result) {
RL.isQuickReport = result.isQuickReport;
})
RL.checkQuickReport();
RL.loadCommon();
RL.initTaskReportList();
......@@ -117,7 +121,7 @@ RL.loadMainTitleCallback = function () {
//add dashboard setting item
if (RL.isQuickReport) {
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'));
elmA.append(elmImg);
$('#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