ellisran 2 недель назад
Родитель
Сommit
d138a101ef
4 измененных файлов с 7 добавлено и 5 удалено
  1. 2 2
      app/public/js/file_detail.js
  2. 3 3
      app/public/js/filesjs.js
  3. 1 0
      app/view/file/file.ejs
  4. 1 0
      app/view/file/filesjs.ejs

+ 2 - 2
app/public/js/file_detail.js

@@ -1118,7 +1118,7 @@ $(document).ready(function() {
         refreshTenderFileType() {
             const html= [];
             for (const tft of this.tenderFileType) {
-                html.push(`<option value="${tft.value}">${tft.text}</option>`);
+                html.push(`<option value="${tft.value}">${_.escape(tft.text)}</option>`);
             }
             $('#tf-type').html(html.join(''));
         }
@@ -1162,7 +1162,7 @@ $(document).ready(function() {
                 tender.change_plan.forEach(x => {
                     selects.push({ value: x.id, text: x.code })
                 });
-                this.tenderFileType.push({ value: 'change_plan', text: '变更方案', select: selects });
+                this.tenderFileType.push({ value: 'change_plan', text: planName, select: selects });
             }
             if (tender.change_apply && tender.change_apply.length > 0) {
                 const selects = [];

+ 3 - 3
app/public/js/filesjs.js

@@ -1609,7 +1609,7 @@ $(document).ready(function() {
         }
         refreshTenderFileType() {
             const html = [];
-            for (const tft of this.tenderFileType) html.push(`<option value="${tft.value}">${tft.text}</option>`);
+            for (const tft of this.tenderFileType) html.push(`<option value="${tft.value}">${_.escape(tft.text)}</option>`);
             $('#tf-type').html(html.join(''));
         }
         refreshSelects(tender) {
@@ -1639,7 +1639,7 @@ $(document).ready(function() {
                 this.tenderFileType.push({ value: 'change', text: '变更令', select: tender.change.map(x => ({ value: x.cid, text: x.code })) });
             }
             if (tender.change_plan && tender.change_plan.length > 0) {
-                this.tenderFileType.push({ value: 'change_plan', text: '变更方案', select: tender.change_plan.map(x => ({ value: x.id, text: x.code })) });
+                this.tenderFileType.push({ value: 'change_plan', text: planName, select: tender.change_plan.map(x => ({ value: x.id, text: x.code })) });
             }
             if (tender.change_apply && tender.change_apply.length > 0) {
                 this.tenderFileType.push({ value: 'change_apply', text: '变更申请', select: tender.change_apply.map(x => ({ value: x.id, text: x.code })) });
@@ -1666,7 +1666,7 @@ $(document).ready(function() {
                 const checked = f.checked ? 'checked' : '';
                 html.push(`<td><input type="checkbox" name="rf-check" rfid="${f.rf_id}" ${checked}></td>`);
                 html.push(`<td>${f.filename}${f.fileext}</td>`);
-                html.push(`<td>${typeStr.join(' - ')}</td>`);
+                html.push(`<td>${_.escape(typeStr.join(' - '))}</td>`);
                 html.push('</tr>');
             }
             $('#rf-files').html(html.join(''));

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

@@ -112,6 +112,7 @@
     </div>
 </div>
 <script>
+    const planName = decodeURIComponent('<%- encodeURIComponent(ctx.subProject.fun_set.change_plan_name || '变更方案').replace(/'/g, '%27') %>');
     const canFiling = <%- canFiling %>;
     const filing = JSON.parse(unescape('<%- escape(JSON.stringify(filing)) %>'));
     const category = JSON.parse(unescape('<%- escape(JSON.stringify(categoryData)) %>'));

+ 1 - 0
app/view/file/filesjs.ejs

@@ -209,6 +209,7 @@
 </div>
 <% } %>
 <script>
+    const planName = decodeURIComponent('<%- encodeURIComponent(ctx.subProject.fun_set.change_plan_name || '变更方案').replace(/'/g, '%27') %>');
     let canFiling = false;
     let canUpload = false;
     const filing = JSON.parse(unescape('<%- escape(JSON.stringify(filing)) %>'));