TonyKang 7 lat temu
rodzic
commit
ed6d4ef620

+ 16 - 0
modules/reports/rpt_component/helper/jpc_helper_field.js

@@ -123,6 +123,22 @@ let JpcFieldHelper = {
                     }
                 }
             }
+            if (!isEx) {
+                let dis_detail_fields = rptTpl[JV.NODE_NO_MAPPING_FIELDS];
+                for (let i = 0; i < tab_fields.length; i++) {
+                    if (tab_fields[i][JV.PROP_IS_AUTO_HEIGHT]) {
+                        for (let j = 0; j < dis_detail_fields.length; j++) {
+                            if (tab_fields[i]["FieldID"] === dis_detail_fields[j]["ID"]) {
+                                let item = [];
+                                item[0] = JV.BLANK_FIELD_INDEX;
+                                item[1] = tab_fields[i];
+                                rstFieldsIdx.push(item);
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
         }
     }
 };

+ 13 - 0
modules/reports/rpt_component/jpc_flow_tab.js

@@ -357,11 +357,24 @@ JpcFlowTabSrv.prototype.createNew = function(){
             let private_get_max_lines_of_the_record = function(theRecIdx) {
                 let rst = 1;
                 for (let loop = 0; loop < me.auto_height_fields_idx.length; loop++) {
+                    /*
                     let data_field = null;
                     let tab_field = me.auto_height_fields_idx[loop][1];
                     if (me.auto_height_fields_idx[loop][0] !== JV.BLANK_FIELD_INDEX) {
                         data_field = data_details[me.auto_height_fields_idx[loop][0]];
                     }
+                    /*/
+                    let tab_field = me.auto_height_fields_idx[loop][1];
+                    let data_field = null,
+                        map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                    if (me.auto_height_fields_idx[loop][0] !== JV.BLANK_FIELD_INDEX && (typeof me.auto_height_fields_idx[loop][0] !== 'object')) {
+                        data_field = data_details[me.auto_height_fields_idx[loop][0]];
+                    } else {
+                        if (map_data_field) {
+                            data_field = map_data_field[JV.PROP_AD_HOC_DATA];
+                        }
+                    }
+                    //*/
                     if (data_field) {
                         let value = JpcFieldHelper.getValue(data_field, theRecIdx);
                         let area = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, 1, 1, 0, 1, 0, 1, 0, false, false);

+ 11 - 4
test/demo/stringTest.js

@@ -31,10 +31,17 @@ let strUtil = require('../../public/stringUtil');
 //     t.end();
 // })
 
-test('string ', function(t){
-    let str = "{abc}";
-    console.log(str);
-    console.log(str.slice(1, -1));
+// test('string ', function(t){
+//     let str = "{abc}";
+//     console.log(str);
+//     console.log(str.slice(1, -1));
+//     t.end();
+// })
+
+test('splice', function(t){
+    let arr = ["a", "b"];
+    arr.splice(2, 0, "c");
+    console.log(arr);
     t.end();
 })