Browse Source

调整表单内容展示判断机制

laiguoran 2 years ago
parent
commit
03a43434bd
3 changed files with 11 additions and 11 deletions
  1. 6 6
      app/const/payment.js
  2. 1 1
      app/controller/login_controller.js
  3. 4 4
      app/controller/payment_controller.js

+ 6 - 6
app/const/payment.js

@@ -58,13 +58,13 @@ const rpt_dataType = {
     intact_type_multitext: 'textarea',
 };
 
-const rpt_control_name = ['Title', 'Header', 'Footer'];
+// const rpt_band_name = ['TitleBand', 'HeaderBand', 'FooterBand'];
 
-const rpt_control = {
-    Title: '标题',
-    Header: '表头',
+const rpt_band_name = {
+    TitleBand: '标题',
+    HeaderBand: '表头',
     content: '表单',
-    Footer: '表尾',
+    FooterBand: '表尾',
 };
 
 const signature_msg = {
@@ -83,7 +83,7 @@ module.exports = {
     permission_value_array,
     const_rpt_list,
     rpt_dataType,
-    rpt_control,
+    rpt_band_name,
     signature_msg,
     setting_modes,
     modes_value,

+ 1 - 1
app/controller/login_controller.js

@@ -207,7 +207,7 @@ module.exports = app => {
          */
         async logout(ctx) {
             // 删除session并跳转
-            const code = ctx.session.sessionProject.code ? ctx.session.sessionProject.code : null;
+            const code = ctx.session.sessionProject && ctx.session.sessionProject.code ? ctx.session.sessionProject.code : null;
             ctx.session = null;
             if (code) {
                 ctx.redirect('/login/' + code);

+ 4 - 4
app/controller/payment_controller.js

@@ -390,14 +390,14 @@ module.exports = app => {
                             label: cell.Label,
                             index: i,
                         };
-                        const thisControl = paymentConst.rpt_control[cell.control] ? cell.control : 'content';
-                        const oneShowContent = ctx.helper._.find(content, { control: thisControl });
+                        const thisBandName = paymentConst.rpt_band_name[cell.BandName] ? cell.BandName : 'content';
+                        const oneShowContent = ctx.helper._.find(content, { BandName: thisBandName });
                         if (oneShowContent) {
                             oneShowContent.items.push(push_item);
                         } else {
                             content.push({
-                                control: thisControl,
-                                title: paymentConst.rpt_control[thisControl],
+                                BandName: thisBandName,
+                                title: paymentConst.rpt_band_name[thisBandName],
                                 items: [push_item],
                             });
                         }