Quellcode durchsuchen

fix;调整因子表数据变更,页码传值错误导致数据不显示问题;

liujiayin vor 2 Jahren
Ursprung
Commit
1327b80fca

+ 19 - 7
src/business/platform/form/formrender/dynamic-form/dynamic-form-table.vue

@@ -403,7 +403,7 @@ export default {
         pageOperation (val, oldVal) {
         pageOperation (val, oldVal) {
             let page = this.currentPage * 10 - 10
             let page = this.currentPage * 10 - 10
             const size = val.length
             const size = val.length
-            if (this.editFromType === 'add' && val.length > this.oldList.length && this.oldList.length > 0) {
+            if (val.length > this.oldList.length && this.oldList.length >= 0) {
                 const valBai = size % 10
                 const valBai = size % 10
                 const valChu = parseInt(size / 10)
                 const valChu = parseInt(size / 10)
                 if (valBai === 0) {
                 if (valBai === 0) {
@@ -411,15 +411,27 @@ export default {
                 } else {
                 } else {
                     this.currentPage = valChu + 1
                     this.currentPage = valChu + 1
                 }
                 }
-
                 page = this.currentPage * 10 - 10
                 page = this.currentPage * 10 - 10
             }
             }
-
-            if (this.dataModel < this.oldList && size >= 10 && this.pageSize % 10 === 0) {
-                // 删除了一个参数 ,如果当前总条数小于页数,则退一页。
-                if (this.currentPage > 1) this.currentPage = this.currentPage - 1
+            if (this.dataModel.length < this.oldList.length  ) {
+                const valBai = size % 10
+                const valChu = parseInt(size / 10)
+                if(this.editFromType =='remove' && this.multipleSelection.length !==0){
+                    // 指定页删除数满10条:
+                        // 删完之后,如果下一页还有数据,则页码继续不变,如果下一页没有数据那么页码减1,直至页码=0
+                        // 除去本页剩余个数 
+                        let yuShu = this.oldList.length - this.currentPage*10
+                        if(yuShu < this.multipleSelection.length &&  yuShu<0 ){
+                            this.currentPage  =this.currentPage -1
+                        }  
+                }else{
+                      if (valBai === 0) {
+                        this.currentPage = valChu
+                    } else {
+                        this.currentPage = valChu + 1
+                    }
+                }
                 page = this.currentPage * 10 - 10
                 page = this.currentPage * 10 - 10
-                if (page !== 0) page - 10
             }
             }
             this.pageSize = size
             this.pageSize = size
             this.oldList = JSON.parse(JSON.stringify(this.dataModel))
             this.oldList = JSON.parse(JSON.stringify(this.dataModel))