Преглед изворни кода

修复检测档案翻页bug

cfort пре 2 година
родитељ
комит
82d6ed074a

+ 8 - 5
src/views/platform/bpmn/bpmInstHis/record/component/testingRecord.vue

@@ -132,7 +132,7 @@
                 @current-change="handleCurrentChange"
                 :current-page.sync="currentPage"
                 :page-sizes="[10, 20, 50, 100]"
-                :page-size="20"
+                :page-size="pageSize"
                 layout="total, sizes, prev, pager, next, jumper"
                 :total="total"
             >
@@ -268,6 +268,7 @@
                 fileUrl: '',
                 fileType: '',
                 zIndex: 2000,
+                pageSize: 20,
                 fileOption: {
                     user: {}
                 }
@@ -278,7 +279,7 @@
             const args = this.info.type ? ` and bao_gao_lei_bie_ = '${this.info.type}'` : ''
             this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放')${args}`
             // this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.info.type}'`
-            const sql = `${this.globalSql} order by create_time_ desc limit 0,20`
+            const sql = `${this.globalSql} order by create_time_ desc limit 0,${this.pageSize}`
             this.loadData(sql)
             const sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放')${args}`
             curdPost('sql', sumsql).then((response) => {
@@ -297,7 +298,6 @@
                     if (!data || !data.length) {
                         return
                     }
-
                     this.tableData = data
                     let ids = {
                         contract: [],
@@ -387,17 +387,20 @@
                         params += paramsList[item]
                     }
                 })
-                const sql = `${this.globalSql}${params} order by create_time_ desc limit 0,20`
+                this.currentPage = 1
+                const sql = `${this.globalSql}${params} order by create_time_ desc limit 0,${this.pageSize}`
                 // console.log(sql)
                 this.loadData(sql)
             },
             handleSizeChange (value) {
                 this.currentPage = 1
+                this.pageSize = value
                 const sql = `${this.globalSql} order by create_time_ desc limit 0,${value}`
                 this.loadData(sql)
             },
             handleCurrentChange (value) {
-                const sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
+                this.currentPage = value
+                const sql = `${this.globalSql} order by create_time_ desc limit ${(this.currentPage - 1) * this.pageSize},${this.pageSize}`
                 this.loadData(sql)
             },
             alertReport (path, id) {