Browse Source

特殊符号影响功能问题

laiguoran 4 years ago
parent
commit
d14be61ee0

+ 2 - 2
app/view/material/audit_modal.ejs

@@ -682,8 +682,8 @@
 <% } %>
 <% if (ctx.session.sessionUser.accountId === ctx.material.user_id && (ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo)) { %>
     <script>
-        const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup) %>');
-        const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
+        const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
+        const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
         const shenpi_status = <%- ctx.tender.info.shenpi.material %>;
         const shenpiConst =  JSON.parse('<%- JSON.stringify(shenpiConst) %>');
     </script>

+ 1 - 1
app/view/material/file.ejs

@@ -118,6 +118,6 @@
   const tid = '<%- ctx.tender.id %>';
   const mid = '<%- ctx.material.id %>';
   const order = '<%- ctx.material.order %>';
-  const fileList = JSON.parse('<%- JSON.stringify(fileList) %>');
+  const fileList = JSON.parse(unescape('<%- escape(JSON.stringify(fileList)) %>'));
   const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
 </script>

+ 2 - 2
app/view/report/index.ejs

@@ -226,8 +226,8 @@
     });
 </script>
 <script>
-    const tenders = JSON.parse('<%- JSON.stringify(tenderList) %>');
-    const category = JSON.parse('<%- JSON.stringify(categoryData) %>');
+    const tenders = JSON.parse(unescape('<%- escape(JSON.stringify(tenderList)) %>'));
+    const category = JSON.parse(unescape('<%- escape(JSON.stringify(categoryData)) %>'));
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
     const ledgerAuditConst = JSON.parse('<%- JSON.stringify(ledgerAuditConst) %>');
     $(document).ready(() => {

+ 2 - 2
app/view/revise/info_modal.ejs

@@ -724,8 +724,8 @@
     <% if(ctx.session.sessionUser.accountId === revise.uid && (revise.status === auditConst.status.uncheck || revise.status === auditConst.status.checkNo)) { %>
     <script>
         const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
-        const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
-        const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup ) %>');
+        const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
+        const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup )) %>'));
         const shenpi_status = <%- ctx.tender.info.shenpi.revise %>;
         const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
         let timer = null;

+ 1 - 1
app/view/setting/category.ejs

@@ -30,7 +30,7 @@
 <script>
     let cData = JSON.parse('<%- JSON.stringify(categoryData) %>');
     const cType = JSON.parse('<%- JSON.stringify(categoryType) %>');
-    let tenders = JSON.parse('<%- JSON.stringify(tenderData) %>');
+    let tenders = JSON.parse(unescape('<%- escape(JSON.stringify(tenderData)) %>'));
 </script>
 <script src="/public/js/category.js"></script>
 <script>autoFlashHeight();</script>

+ 1 - 1
app/view/setting/user.ejs

@@ -72,7 +72,7 @@
     </div>
 </div>
 <script>
-    const accountList = JSON.parse('<%- JSON.stringify(accountData) %>');
+    const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountData)) %>'));
 </script>
 <script src="/public/js/setting.js"></script>
 <script>autoFlashHeight();</script>

+ 2 - 2
app/view/stage/audit_modal.ejs

@@ -798,8 +798,8 @@
 </script>
 <% if (ctx.stage && (ctx.session.sessionUser.accountId === ctx.stage.user_id && (ctx.stage.status === auditConst.status.uncheck || ctx.stage.status === auditConst.status.checkNo))) { %>
 <script>
-    const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup) %>');
-    const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
+    const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
+    const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
     const shenpi_status = <%- ctx.tender.info.shenpi.stage %>;
     const shenpiConst =  JSON.parse('<%- JSON.stringify(shenpiConst) %>');
 </script>

+ 2 - 2
app/view/stage/compare.ejs

@@ -67,7 +67,7 @@
 </div>
 <script>
     //const auditors = JSON.parse(<%- JSON.stringify(ctx.stage.auditors) %>);
-    const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
+    const stage = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.stage)) %>'));
     const ledgerSpreadSetting = JSON.parse('<%- JSON.stringify(ledgerSpread) %>');
     ledgerSpreadSetting.localCache = {
         key: 'stage-compare-bills',
@@ -82,4 +82,4 @@
     let scRoles = getLocalCache(scCacheKey);
     scRoles = scRoles ? scRoles.split(',') : [0];
     const thousandth = <%- ctx.tender.info.display.thousandth %>;
-</script>
+</script>

+ 1 - 1
app/view/stage/gather.ejs

@@ -90,7 +90,7 @@
     </div>
 </div>
 <script>
-    const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
+    const stage = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.stage)) %>'));
     const gclSpreadSetting = JSON.parse('<%- JSON.stringify(gclSpread) %>');
     gclSpreadSetting.localCache = {
         key: 'stage-gather-gcl',

+ 3 - 3
app/view/stage/index.ejs

@@ -593,14 +593,14 @@
         key: 'stage-pos',
         colWidth: true,
     }
-    const tender = JSON.parse('<%- JSON.stringify(tender) %>');
+    const tender = JSON.parse(unescape('<%- escape(JSON.stringify(tender)) %>'));
     const tenderInfo = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.tender.info)) %>'));
     const thousandth = <%- ctx.tender.info.display.thousandth %>;
     const measureType = JSON.parse('<%- JSON.stringify(measureType) %>');
-    const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
+    const stage = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.stage)) %>'));
     const imType = JSON.parse('<%- JSON.stringify(imType) %>');
     const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
-    let attData = JSON.parse('<%- JSON.stringify(attData) %>');
+    let attData = JSON.parse(unescape('<%- escape(JSON.stringify(attData)) %>'));
     const ckColSetting = 'stage-col-visible-1.0.3-<%- tender.id %>';
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
     // const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');