|
@@ -29,6 +29,7 @@ let zTreeOprObj = {
|
|
|
checkedRptTplNodes: null,
|
|
|
currentRptPageRst: null,
|
|
|
reportPageCfg: null,
|
|
|
+ defReportPageCfg: null,
|
|
|
currentPage: 1,
|
|
|
maxPages: 0,
|
|
|
countChkedRptTpl: function () {
|
|
@@ -90,40 +91,45 @@ let zTreeOprObj = {
|
|
|
params.engineerId = projectInfoObj.projectInfo.property.engineering;
|
|
|
CommonAjax.postEx("report_tpl_api/getCustomizeCfg", params, 20000, true, function(result){
|
|
|
if (result) {
|
|
|
- me.reportPageCfg = result;
|
|
|
- $("#elementMargin_Left").get(0).value = result.margins.Left;
|
|
|
- $("#elementMargin_Right").get(0).value = result.margins.Right;
|
|
|
- $("#elementMargin_Top").get(0).value = result.margins.Top;
|
|
|
- $("#elementMargin_Bottom").get(0).value = result.margins.Bottom;
|
|
|
-
|
|
|
- for (let font of result.fonts) {
|
|
|
- let fontPropSuffix = "title";
|
|
|
- if (font.CfgDispName === "表标题") {
|
|
|
- fontPropSuffix = "title";
|
|
|
- } else if (font.CfgDispName === "列标题") {
|
|
|
- fontPropSuffix = "column";
|
|
|
- } else if (font.CfgDispName === "正文内容") {
|
|
|
- fontPropSuffix = "content";
|
|
|
- } else if (font.CfgDispName === "合计") {
|
|
|
- fontPropSuffix = "summary";
|
|
|
- } else if (font.CfgDispName === "表眉/表脚") {
|
|
|
- fontPropSuffix = "header_footer";
|
|
|
- }
|
|
|
- document.getElementById("fontName_" + fontPropSuffix).value = font.Name;
|
|
|
- document.getElementById("fontHeight_" + fontPropSuffix).value = font.FontHeight;
|
|
|
- document.getElementById("font_bold_" + fontPropSuffix).className = (font.FontBold === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
|
|
|
- document.getElementById("font_italic_" + fontPropSuffix).className = (font.FontItalic === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
|
|
|
- document.getElementById("font_underline_" + fontPropSuffix).className = (font.FontUnderline === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
|
|
|
- }
|
|
|
- document.getElementById("rpt_vertical_line").checked = result.showVerticalLine;
|
|
|
- document.getElementById("rpt_narrow").checked = result.isNarrow;
|
|
|
- document.getElementById("rpt_fill_zero").checked = result.fillZero;
|
|
|
+ me.defReportPageCfg = result[0];
|
|
|
+ me.reportPageCfg = result[1];
|
|
|
+ me.renderRptCfg(result[1]);
|
|
|
} else {
|
|
|
me.reportPageCfg = null;
|
|
|
+ me.defReportPageCfg = null;
|
|
|
}
|
|
|
}, null, null
|
|
|
);
|
|
|
},
|
|
|
+ renderRptCfg: function (cfg) {
|
|
|
+ $("#elementMargin_Left").get(0).value = cfg.margins.Left;
|
|
|
+ $("#elementMargin_Right").get(0).value = cfg.margins.Right;
|
|
|
+ $("#elementMargin_Top").get(0).value = cfg.margins.Top;
|
|
|
+ $("#elementMargin_Bottom").get(0).value = cfg.margins.Bottom;
|
|
|
+
|
|
|
+ for (let font of cfg.fonts) {
|
|
|
+ let fontPropSuffix = "title";
|
|
|
+ if (font.CfgDispName === "表标题") {
|
|
|
+ fontPropSuffix = "title";
|
|
|
+ } else if (font.CfgDispName === "列标题") {
|
|
|
+ fontPropSuffix = "column";
|
|
|
+ } else if (font.CfgDispName === "正文内容") {
|
|
|
+ fontPropSuffix = "content";
|
|
|
+ } else if (font.CfgDispName === "合计") {
|
|
|
+ fontPropSuffix = "summary";
|
|
|
+ } else if (font.CfgDispName === "表眉/表脚") {
|
|
|
+ fontPropSuffix = "header_footer";
|
|
|
+ }
|
|
|
+ document.getElementById("fontName_" + fontPropSuffix).value = font.Name;
|
|
|
+ document.getElementById("fontHeight_" + fontPropSuffix).value = font.FontHeight;
|
|
|
+ document.getElementById("font_bold_" + fontPropSuffix).className = (font.FontBold === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
|
|
|
+ document.getElementById("font_italic_" + fontPropSuffix).className = (font.FontItalic === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
|
|
|
+ document.getElementById("font_underline_" + fontPropSuffix).className = (font.FontUnderline === "T")?"btn btn-sm btn-outline-secondary active":"btn btn-sm btn-outline-secondary";
|
|
|
+ }
|
|
|
+ document.getElementById("rpt_vertical_line").checked = cfg.showVerticalLine;
|
|
|
+ document.getElementById("rpt_narrow").checked = cfg.isNarrow;
|
|
|
+ document.getElementById("rpt_fill_zero").checked = cfg.fillZero;
|
|
|
+ },
|
|
|
refreshNodes: function() {
|
|
|
let me = this;
|
|
|
let private_setupIsParent = function(node){
|
|
@@ -431,8 +437,19 @@ let rptControlObj = {
|
|
|
let params = {};
|
|
|
params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
CommonAjax.postEx("report_tpl_api/saveCustomerCfg", params, 20000, true, function(result){
|
|
|
- alert("Save successfully!");
|
|
|
- }, null, null
|
|
|
+ // alert("Save successfully!");
|
|
|
+ $("#update_msg_response")[0].style.color = "green";
|
|
|
+ $("#update_msg_response")[0].innerHTML = " (保存成功!)";
|
|
|
+ setTimeout(function(){
|
|
|
+ $("#update_msg_response")[0].innerHTML = "";
|
|
|
+ }, 1000);
|
|
|
+ }, function (failRst) {
|
|
|
+ $("#update_msg_response")[0].style.color = "red";
|
|
|
+ $("#update_msg_response")[0].innerHTML = " (保存失败!)";
|
|
|
+ setTimeout(function(){
|
|
|
+ $("#update_msg_response")[0].innerHTML = "";
|
|
|
+ }, 1000);
|
|
|
+ }, null
|
|
|
);
|
|
|
},
|
|
|
confirmCfgChange: function() {
|