Browse Source

替换\t符号

TonyKang 5 năm trước cách đây
mục cha
commit
a50201a30a

+ 1 - 1
app/controller/report_controller.js

@@ -494,7 +494,7 @@ async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDi
         } else {
             pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
         }
-        // fsUtil.writeObjToFile(pageRst, 'D:/GitHome/temp/testBuiltPageResult.jsp');
+        // fsUtil.writeObjToFile(pageRst, 'D:/GitHome/temp/计量testBuiltPageResult.jsp');
         // console.log(pageRst);
         return pageRst;
     } catch (ex) {

+ 2 - 1
app/reports/rpt_component/helper/jpc_helper_common_output.js

@@ -6,6 +6,7 @@ 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 REG5 = new RegExp('\t', 'g');
 
 const JpcCommonOutputHelper = {
     createCommonOutputWithoutDecorate: function(node, value, forceCombine) {
@@ -17,7 +18,7 @@ const JpcCommonOutputHelper = {
         rst[JV.PROP_STYLE] = node[[JV.PROP_STYLE]];
         // 2. value
         if (typeof value === 'string') {
-            value = value.replace(REG1, '|').replace(REG2, '|').replace(REG3, '|').replace(REG4, '|');
+            value = value.replace(REG1, '|').replace(REG2, '|').replace(REG3, '|').replace(REG4, '|').replace(REG5, '');
         }
         rst[JV.PROP_VALUE] = value;
         me.formatCell(node[JV.PROP_FORMAT], rst);

+ 3 - 2
app/reports/rpt_component/jpc_flow_tab.js

@@ -376,6 +376,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
             const reg2 = new RegExp('\r\n', 'g');
             const reg3 = new RegExp('\n', 'g');
             const reg4 = new RegExp('\r', 'g');
+            const reg5 = new RegExp('\t', 'g');
             const fonts = defProperties.fonts;
             const fontCache = {};
             const private_get_font = function(fontKey) {
@@ -418,8 +419,8 @@ JpcFlowTabSrv.prototype.createNew = function() {
                         let value = JpcFieldHelper.getValue(data_field, theRecIdx);
                         const area = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, 1, 1, 0, 1, 0, 1, 0, false, false);
                         if (value !== null && value !== undefined) {
-                            value = value.replace('\t', '');
-                            value = value.replace(reg1, '|').replace(reg2, '|').replace(reg3, '|').replace(reg4, '|');
+                            // value = value.replace('\t', '');
+                            value = value.replace(reg1, '|').replace(reg2, '|').replace(reg3, '|').replace(reg4, '|').replace(reg5, '');
                         } else {
                             value = '';
                         }