TonyKang преди 6 години
родител
ревизия
43b7ce3aa6

+ 3 - 1
modules/all_models/rpt_cfg.js

@@ -11,7 +11,9 @@ let FormatSchema = new Schema({
     "ShowZero" : String,
     "Horizon" : String,
     "Vertical" : String,
-    "Wrap" : String
+    "Wrap" : String,
+    "ShrinkFirst" : String,
+    "CloseOutput" : String
 });
 let FontSchema = new Schema({
     "ID" : String,

+ 2 - 0
modules/reports/rpt_component/jpc_flow_tab.js

@@ -1305,6 +1305,8 @@ function setupControl(mergeCell, controls) {
         orgCtrl = controls[mergeCell[JV.PROP_CONTROL]];
         mergeCell[JV.PROP_CONTROL] = {
             "Shrink": "T",
+            "ShrinkFirst": orgCtrl.ShrinkFirst,
+            "CloseOutput": orgCtrl.CloseOutput,
             "ShowZero": orgCtrl.ShowZero,
             "Horizon": orgCtrl.Horizon,
             "Vertical": orgCtrl.Vertical,

+ 2 - 2
modules/reports/util/rpt_excel_util.js

@@ -208,7 +208,7 @@ function writeStyles(stylesObj){
         let textRotation = 0;
         let newHorizontal = excelStyle[JV.CONTROL_PROPS[2]];
         let newVertical = excelStyle[JV.CONTROL_PROPS[3]];
-        if (excelStyle[JV.CONTROL_PROPS[5]]) {
+        if (excelStyle[JV.CONTROL_PROPS[5]] && !strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_CLOSE_OUTPUT]])) {
             newVertical = excelStyle[JV.CONTROL_PROPS[5]];
         }
         if (parseInt(excelStyle.fontAngle) !== 0) {
@@ -255,7 +255,7 @@ function writeStyles(stylesObj){
         if (strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[0]])) {
             alignStr += ' shrinkToFit="1"';
         }
-        if (strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[4]])) {
+        if (strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[4]]) && !strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[6]])) {
             alignStr += ' wrapText="1"';
         }
         if (textRotation !== 0) {

+ 1 - 1
modules/reports/util/rpt_pdf_util.js

@@ -227,7 +227,7 @@ function export_pdf_file (pageData, paperSize, fName, callback) {
             while (true) {
                 //*/
                 let lines = Math.floor((area[JV.IDX_BOTTOM] - area[JV.IDX_TOP]) / (dftFontHeight + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP] + 4));
-                lines = (lines === 0)?1:lines;
+                lines = (lines === 0 || (control.Shrink === 'T' && control.ShrinkFirst === 'T'))?1:lines;
                 let actLines = private_splitString(val, w, doc);
                 if (actLines.length > lines && dftFontHeight >= 6) {
                     dftFontHeight--;

+ 2 - 2
web/maintain/report/html/rpt_tpl_dtl_field_loc.html

@@ -133,11 +133,11 @@
                         </label>
                         <label class="form-check-label"> </label>
                         <label class="form-check-label">
-                            <input type="checkbox" class="form-check-input" id="eleIsShrinkFirst" onchange="">
+                            <input type="checkbox" class="form-check-input" id="eleIsShrinkFirst" onchange="" disabled>
                             缩放优先
                         </label>
                         <label class="form-check-label">
-                            <input type="checkbox" class="form-check-input" id="eleCloseOutput" onchange="">
+                            <input type="checkbox" class="form-check-input" id="eleCloseOutput" onchange="" disabled>
                             紧密输出
                         </label>
                     </div>

+ 5 - 3
web/maintain/report/js/rpt_tpl_cfg_helper.js

@@ -343,9 +343,11 @@ let rpt_tpl_cfg_helper = {
 
             $("#elementAlignmentHorizon").get(0).selectedIndex = JV.OUTPUT_ALIGN.H.indexOf(ctrl[JV.CONTROL_PROPS[2]]);
             $("#elementAlignmentVertical").get(0).selectedIndex = JV.OUTPUT_ALIGN.V.indexOf(ctrl[JV.CONTROL_PROPS[3]]);
-            $("#eleShrink").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[0]]);
-            $("#eleShowZero").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[1]]);
-            $("#eleAutoWrap").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[4]]);
+            $("#eleShrink").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHRINK]]);
+            $("#eleShowZero").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHOW_ZERO]]);
+            $("#eleAutoWrap").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_WRAP]]);
+            $("#eleIsShrinkFirst").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHRINK_FIRST]]);
+            $("#eleCloseOutput").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_CLOSE_OUTPUT]]);
         }
     },
     changeAlignment: function(dom, type) {