Parcourir la source

修复变更'号bug

laiguoran il y a 4 ans
Parent
commit
e419e78b19
1 fichiers modifiés avec 13 ajouts et 12 suppressions
  1. 13 12
      app/view/change/information.ejs

+ 13 - 12
app/view/change/information.ejs

@@ -419,24 +419,25 @@
     const changesUid = <%- change.uid %>;
 
     let back_changeInfo = {
-        code: JSON.parse(unescape('<%- escape(JSON.stringify(change.code)) %>')),
-        name: JSON.parse(unescape('<%- escape(JSON.stringify(change.name)) %>')),
-        peg: JSON.parse(unescape('<%- escape(JSON.stringify(change.peg)) %>')),
-        org_name: JSON.parse(unescape('<%- escape(JSON.stringify(change.org_name)) %>')),
-        org_code: JSON.parse(unescape('<%- escape(JSON.stringify(change.org_code)) %>')),
-        new_name: JSON.parse(unescape('<%- escape(JSON.stringify(change.new_name)) %>')),
-        new_code: JSON.parse(unescape('<%- escape(JSON.stringify(change.new_code)) %>')),
-        content: JSON.parse(unescape('<%- escape(JSON.stringify(ctx.helper.replaceRntoBr(change.content))) %>')),
-        basis: JSON.parse(unescape('<%- escape(JSON.stringify(ctx.helper.replaceRntoBr(change.basis))) %>')),
-        expr: JSON.parse(unescape('<%- escape(JSON.stringify(ctx.helper.replaceRntoBr(change.expr))) %>')),
-        memo: JSON.parse(unescape('<%- escape(JSON.stringify(ctx.helper.replaceRntoBr(change.memo))) %>')),
+        code: JSON.parse(unescape('<%- escape(JSON.stringify(change.code ? change.code : '')) %>')),
+        name: JSON.parse(unescape('<%- escape(JSON.stringify(change.name ? change.name : '')) %>')),
+        peg: JSON.parse(unescape('<%- escape(JSON.stringify(change.peg ? change.peg : '')) %>')),
+        org_name: JSON.parse(unescape('<%- escape(JSON.stringify(change.org_name ? change.org_name: '')) %>')),
+        org_code: JSON.parse(unescape('<%- escape(JSON.stringify(change.org_code ? change.org_code : '')) %>')),
+        new_name: JSON.parse(unescape('<%- escape(JSON.stringify(change.new_name ? change.new_name : '')) %>')),
+        new_code: JSON.parse(unescape('<%- escape(JSON.stringify(change.new_code ? change.new_code : '')) %>')),
+        content: JSON.parse(unescape('<%- escape(JSON.stringify(change.content ? ctx.helper.replaceRntoBr(change.content) : '')) %>')),
+        basis: JSON.parse(unescape('<%- escape(JSON.stringify(change.basis ? ctx.helper.replaceRntoBr(change.basis) : '')) %>')),
+        expr: JSON.parse(unescape('<%- escape(JSON.stringify(change.expr ? ctx.helper.replaceRntoBr(change.expr) : '')) %>')),
+        memo: JSON.parse(unescape('<%- escape(JSON.stringify(change.memo ? ctx.helper.replaceRntoBr(change.memo) : '')) %>')),
         type: '<%- change.type %>',
         class: '<%- change.class %>',
         quality: '<%- change.quality %>',
         company: JSON.parse(unescape('<%- escape(JSON.stringify((change.company ? change.company : (companyList && companyList[0] ? companyList[0].name : '')))) %>')),
         charge: '<%- change.charge %>',
-        w_code: JSON.parse(unescape('<%- escape(JSON.stringify(change.w_code)) %>')),
+        w_code: JSON.parse(unescape('<%- escape(JSON.stringify(change.w_code ? change.w_code : '')) %>')),
     };
+    console.log(back_changeInfo);
     let changeInfo = Object.assign({}, back_changeInfo);
     let changeUsedData = JSON.parse(unescape('<%- escape(JSON.stringify(changeUsedData)) %>'));
 </script>