Browse Source

fix: 导出excel的特殊字符处理顺序问题

Tony Kang 6 months atrás
parent
commit
93151e2852
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/reports/util/rpt_excel_util.js

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

@@ -293,7 +293,7 @@ function writeSharedString(sharedStrList){
         for (let i = 0; i < sharedStrList.length; i++) {
             if (typeof sharedStrList[i] === 'string') {
                 //转换特殊字符,如 < , 则需要转义一下
-                sharedStrList[i] = sharedStrList[i].replace(regExp, "&lt;").replace(regExp1, '&gt;').replace(regExp2, '&amp;');
+                sharedStrList[i] = sharedStrList[i].replace(regExp2, '&amp;').replace(regExp, "&lt;").replace(regExp1, '&gt;');
                 if (sharedStrList[i].indexOf('|') >= 0) {
                     //rst.push('<si><t>' + sharedStrList[i].split('|').join('\r\n') + '</t></si>');
                     // rst.push('<si><t>' + sharedStrList[i].split('|').join('\n') + '</t></si>');