Sfoglia il codice sorgente

归档加密信息初始化

TonyKang 3 anni fa
parent
commit
2bf6085bb5

+ 16 - 1
app/controller/report_archive_controller.js

@@ -29,10 +29,12 @@ module.exports = app => {
             //
             // 。。。
             let archiveList = [];
+            let archiveEncryptionList = [];
             // console.log('tender.data.project_id: ' + tender.data.project_id);
             if (stage) {
                 // console.log('ctx.stage.id: ' + ctx.stage.id);
                 const archives = await ctx.service.rptArchive.getPrjStgArchive(tender.data.project_id, ctx.stage.id);
+                const archiveEncryptions = await ctx.service.rptArchiveEncryption.getPrjStgArchiveEncryption(tender.data.project_id, ctx.stage.id);
                 stage_id = stage.id;
                 stage_order = stage.order;
                 stage_times = stage.times;
@@ -40,9 +42,13 @@ module.exports = app => {
                 if (archives.length > 0) {
                     archiveList = JSON.parse(archives[0].content);
                 }
+                if (archiveEncryptions.length > 0) {
+                    archiveEncryptionList = JSON.parse(archiveEncryptions[0].content);
+                }
             } else {
                 // console.log('stageList[0].id: ' + stageList[0].id);
                 const archives = await ctx.service.rptArchive.getPrjStgArchive(tender.data.project_id, stageList[stageList.length - 1].id);
+                const archiveEncryptions = await ctx.service.rptArchiveEncryption.getPrjStgArchiveEncryption(tender.data.project_id, stageList[stageList.length - 1].id);
                 // stage_id = stageList[0].id;
                 // stage_order = stageList[0].order;
                 // stage_times = stageList[0].times;
@@ -50,6 +56,9 @@ module.exports = app => {
                 if (archives && archives.length > 0) {
                     archiveList = JSON.parse(archives[0].content);
                 }
+                if (archiveEncryptions && archiveEncryptions.length > 0) {
+                    archiveEncryptionList = JSON.parse(archiveEncryptions[0].content);
+                }
             }
             let rpt_tpl_items = '{ customize: [], common: [] }';
             if (custTreeNodes.length > 0) {
@@ -73,6 +82,7 @@ module.exports = app => {
                 stages: stageList,
                 auditConst: auditConst.stage,
                 archiveList,
+                archiveEncryptionList,
             };
             await this.layout('report/index_archive.ejs', renderData);
         }
@@ -82,12 +92,17 @@ module.exports = app => {
             // ctx.body = await this._getReport(ctx, params);
 
             const archives = await ctx.service.rptArchive.getPrjStgArchive(params.prjId, params.stgId);
-            let archiveList = [];
+            const archiveEncryptions = await ctx.service.rptArchiveEncryption.getPrjStgArchiveEncryption(params.prjId, params.stgId);
+            let archiveList = [], archiveEncryptionList = [];
             if (archives.length > 0) {
                 archiveList = JSON.parse(archives[0].content);
             }
+            if (archiveEncryptions.length > 0) {
+                archiveEncryptionList = JSON.parse(archiveEncryptions[0].content);
+            }
             ctx.body = {
                 data: archiveList,
+                encryptionData: archiveEncryptionList,
             };
         }
 

+ 2 - 0
app/view/report/index_archive.ejs

@@ -148,6 +148,7 @@
     let current_stage_status = -1;
 
     let ARCHIVE_LIST = JSON.parse('<%- JSON.stringify(archiveList) %>');
+    let ARCHIVE_ENCRYPTION_LIST = JSON.parse('<%- JSON.stringify(archiveEncryptionList) %>');
     let TOP_TREE_NODES = <%- rpt_tpl_data %>;
 
     const CUST_TREE_NODES = <%- cust_tpl_data %>;
@@ -283,6 +284,7 @@
                 $.bootstrapLoading.end();
                 // console.log(result);
                 ARCHIVE_LIST = result.data;
+                ARCHIVE_ENCRYPTION_LIST = result.encryptionData;
                 TOP_TREE_NODES = JSON.parse(JSON.stringify(ORG_TOP_TREE_NODES));
                 rptArchiveObj.iniPage();
             }, function(err){