zhongzewei пре 6 година
родитељ
комит
cd8b2edd8d

+ 1 - 3
public/web/sheet/sheet_common.js

@@ -196,9 +196,7 @@ var sheetCommonObj = {
         });
     },
     appendData: function (sheet, index, rowIndex, setting, data) {
-        /*const curRowCount = sheet.getRowCount();
-        const curColCount = sheet.getColumnCount();
-        const viewport = GC.Spread.Sheets.SheetArea.viewport;
+        /*const viewport = GC.Spread.Sheets.SheetArea.viewport;
         const rowHeader = GC.Spread.Sheets.SheetArea.rowHeader;*/
         if (!index) {
             sheet.setRowCount(0);

+ 2 - 0
web/building_saas/main/js/models/ration_glj.js

@@ -498,6 +498,7 @@ let ration_glj = {
            return node
         };
         ration_glj.prototype.getGLJDataPaging = function (condition, cb) {
+            gljOprObj.loadingPagination = true;
             let property = projectObj.project.projectInfo.property;
             let engineerID = property.engineering_id;
             CommonAjax.post('/rationGlj/getGLJDataPaging', {engineerID, condition}, function (data) {
@@ -532,6 +533,7 @@ let ration_glj = {
                     }
                 }
                 cb(data[gljType]);
+                gljOprObj.loadingPagination = false;
             }, function () {
                 if ($.bootstrapLoading.isLoading()) {
                     $.bootstrapLoading.end();

+ 19 - 10
web/building_saas/main/js/views/glj_view.js

@@ -68,8 +68,9 @@ var gljOprObj = {
                     let me = gljOprObj, gljTypeId = treeNode.ID;
                     if (treeNode.ID) {
                         me.gljCurTypeId = treeNode.ID;
-                        me.filterLibGLJSheetData();
-                        me.showLibGLJSheetData();
+                        /* me.filterLibGLJSheetData();
+                         me.showLibGLJSheetData();*/
+                        me.loadPageData(gljOprObj.gljLibSheet, 0);
                         gljOprObj.initSelection({row: me.gljLibSheet.getActiveRowIndex()});
                     }
                 } else {
@@ -81,7 +82,6 @@ var gljOprObj = {
                         $('#selected_class').val(treeNode.ID);
                     }
                 }
-
             }
         }
     },
@@ -327,16 +327,19 @@ var gljOprObj = {
         if (curRecord.length >= me.curPageTotal && me.loadingPagination) {
             return;
         }
+        debugger;
         if (curRecord.length -1 === bottomRow) {
-            me.loadingPagination = true;
-            let condition = me.getPagingCondition(false, curRecord.length);
-            projectObj.project.ration_glj.getGLJDataPaging(condition, function (data) {
-                sheetCommonObj.appendData(args.sheet, condition.index, 0, me.gljLibSheetSetting, data);
-                me.loadingPagination = false;
-            });
+            // 获取第curRecord.length行开始的数据
+            me.loadPageData(args.sheet, curRecord.length);
         }
 
     },
+    loadPageData: function (sheet, index) {
+        let condition = this.getPagingCondition(false, index);
+        projectObj.project.ration_glj.getGLJDataPaging(condition, function (data) {
+            sheetCommonObj.appendData(sheet, condition.index, 0, gljOprObj.gljLibSheetSetting, data);
+        });
+    },
     getSelStyle: function (selected,settingStyle) {
         let style = new GC.Spread.Sheets.Style();
         if(settingStyle){
@@ -399,6 +402,10 @@ var gljOprObj = {
         }  else if (args.sheetName == 'quantity_detail') {
             projectObj.project.quantity_detail.isSummationUpdate(args, gljOprObj.detailData, newval);
         } else if (args.sheetName == 'glj_lib') {
+            if (gljOprObj.gljLibSheetSetting.header[args.col].readOnly) {
+                args.sheet.getCell(args.row, args.col).value(checkboxValue);
+                return;
+            }
             if(gljOprObj.gljLibSheetSetting.header[args.col].dataCode === 'select'){
                 gljOprObj.setGLJSelection(args, newval);
             }
@@ -1048,7 +1055,8 @@ var gljOprObj = {
             let selNode = this.treeObj.getNodeByParam('ID', this.gljCurTypeId);
             // 不为最顶层节点时,才赋值给withinClass
             if (selNode && selNode.ParentID !== -1) {
-                condition.classList = this.parentNodeIds['_pNodeId_' + this.gljCurTypeId];
+                const classList = this.parentNodeIds['_pNodeId_' + this.gljCurTypeId];
+                condition.classList = classList ? classList : [this.gljCurTypeId];
             }
         }
         // 搜索文本
@@ -1102,6 +1110,7 @@ var gljOprObj = {
         var con_key = this.getIndex(this.gljLibSheetData[args.row], gljLibKeyArray);
         if (newVal == 1) {
             this.GLJSelection.push(con_key);
+            console.log(this.gljLibSheetData);
             this.gljLibSheetData[args.row].select = 1;
         } else if (newVal == 0) {
             _.pull(this.GLJSelection, con_key);