Ver código fonte

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

MaiXinRong 5 anos atrás
pai
commit
b9aef2fbba

+ 2 - 1
app/public/report/js/jpc_output.js

@@ -279,7 +279,8 @@ let JpcCanvasOutput = {
                     } else if (control[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] === 'bottom') {
                         restBottomH = restH;
                     } else {
-                        restTopH = restH;
+                        // restTopH = restH;
+                        restTopH = JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP];
                     }
                 }
                 for (let i = 0; i < values.length; i++) {

+ 2 - 1
app/public/report/js/rpt_jspdf.js

@@ -267,7 +267,8 @@ let JpcJsPDFHelper = {
                     } else if (control[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] === 'bottom') {
                         restBottomH = restH;
                     } else {
-                        restTopH = restH;
+                        // restTopH = restH;
+                        restTopH = JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP];
                     }
                 }
                 let spaceIdxArr = [];

+ 2 - 1
app/public/report/js/rpt_print.js

@@ -407,7 +407,8 @@ function buildText(destRst, cell, font, control, offsetX, offsetY, adjustY, canv
         } else if (control[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] === 'bottom') {
             restBottomH = restH;
         } else {
-            restTopH = restH;
+            // restTopH = restH;
+            restTopH = JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP] + 8; // 备注:打印比别的方式多加些空隙
         }
     }
     for (let vidx = 0; vidx < values.length; vidx++) {

+ 7 - 0
app/reports/rpt_component/helper/jpc_helper_common_output.js

@@ -2,6 +2,10 @@
 
 const JV = require('../jpc_value_define');
 const JpcFieldHelper = require('./jpc_helper_field');
+const REG1 = new RegExp('\n\r', 'g');
+const REG2 = new RegExp('\r\n', 'g');
+const REG3 = new RegExp('\n', 'g');
+const REG4 = new RegExp('\r', 'g');
 
 const JpcCommonOutputHelper = {
     createCommonOutputWithoutDecorate: function(node, value, forceCombine) {
@@ -12,6 +16,9 @@ const JpcCommonOutputHelper = {
         rst[JV.PROP_CONTROL] = node[[JV.PROP_CONTROL]];
         rst[JV.PROP_STYLE] = node[[JV.PROP_STYLE]];
         // 2. value
+        if (typeof value === 'string') {
+            value = value.replace(REG1, '|').replace(REG2, '|').replace(REG3, '|').replace(REG4, '|');
+        }
         rst[JV.PROP_VALUE] = value;
         me.formatCell(node[JV.PROP_FORMAT], rst);
         // innerFormat(node[JV.PROP_FORMAT], rst);

+ 7 - 1
app/reports/rpt_component/helper/jpc_helper_discrete.js

@@ -84,6 +84,12 @@ const JpcDiscreteHelper = {
                                     const param = JE.P(df[JV.PROP_PARAM_ID], $CURRENT_RPT);
                                     value = param[JV.PROP_DFT_VALUE];
                                 }
+                                // console.log(value);
+                                // if (typeof value === 'string') {
+                                //     if (value.indexOf('清单1101-1') >= 0) {
+                                //         console.log('before: ' + value);
+                                //     }
+                                // }
                                 const item = JpcCommonOutputHelper.createCommonOutputWithoutDecorate(df, value, true);
                                 // position
                                 item[JV.PROP_AREA] = JpcAreaHelper.outputArea(df[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, multiCols, multiColIdx, false, false);
@@ -92,7 +98,7 @@ const JpcDiscreteHelper = {
                                         if (item[JV.PROP_VALUE][0] !== '/') {
                                             item[JV.PROP_VALUE] = '/' + item[JV.PROP_VALUE];
                                         }
-                                        const signatureItem = { signature_name: JV.SIGNATURE_NAME_DUMMY, path: null, pic: item[JV.PROP_VALUE] }; // 这里的pic数据在指标中里已经处理过了
+                                        const signatureItem = { signature_name: JV.SIGNATURE_NAME_DUMMY, path: item[JV.PROP_VALUE], pic: null }; // 这里的pic数据在指标中里已经处理过了
                                         signatureItem[JV.PROP_CONTROL] = item[[JV.PROP_CONTROL]];
                                         signatureItem[JV.PROP_STYLE] = item[[JV.PROP_STYLE]];
                                         signatureItem[JV.PROP_AREA] = item[JV.PROP_AREA];

+ 7 - 0
app/reports/rpt_component/helper/jpc_helper_field.js

@@ -2,6 +2,10 @@
 
 const JV = require('../jpc_value_define');
 const strUtil = require('../../public/stringUtil');
+const REG1 = new RegExp('\n\r', 'g');
+const REG2 = new RegExp('\r\n', 'g');
+const REG3 = new RegExp('\n', 'g');
+const REG4 = new RegExp('\r', 'g');
 
 const JpcFieldHelper = {
     getValue: function(dataField, valueIdx) {
@@ -9,6 +13,9 @@ const JpcFieldHelper = {
         if (dataField && (dataField.length > valueIdx) && (valueIdx >= 0)) {
             rst = dataField[valueIdx];
         }
+        // if (typeof rst === 'string') {
+        //     rst = rst.replace(REG1, '|').replace(REG2, '|').replace(REG3, '|').replace(REG4, '|');
+        // }
         return rst;
     },
     setValue: function(dataField, valueIdx, newValue) {