Browse Source

修改bug

liling 1 năm trước cách đây
mục cha
commit
1fd4be3fef

+ 1 - 1
public/config.js

@@ -4,7 +4,7 @@ STATIC_CONFIG.lowpowerUrl = 'http://192.168.1.224:9910/#/detection'
 STATIC_CONFIG.golang = 'http://127.0.0.1:8006'
 // 后台服务接口地址
 //STATIC_CONFIG.proxyUrl = 'http://192.168.1.236:8080'
-STATIC_CONFIG.proxyUrl = 'http://192.168.1.51:8080'
+STATIC_CONFIG.proxyUrl = 'http://192.168.1.236:7070'
 // 添加配置代理ip
 // 首页资源
 // STATIC_CONFIG.logo = ''

+ 1 - 1
src/views/dashboard/index.vue

@@ -175,7 +175,7 @@ export default {
       this.common.ApplyElementPurviewByRef(this.$refs)
       // 读取最近检测完设备
       // /test/project/search?page=0&size=4&state=TERMINATED
-      const getUrl = `/test/project/search?page=0&size=6`
+      const getUrl = `/test/project/search?page=0&size=6&sort=createdDate,desc`
       await httpGet(getUrl).then(res => {
         if (res == null || res.content == null) return
         this.tableData = res.content

+ 34 - 2
src/views/device/components/ModelFormFileTransferOpt104.vue

@@ -97,6 +97,20 @@
                 </div>
               </el-col>
             </el-row>
+            <el-row>
+              <!-- 分页 -->
+              <div class="page-bar">
+                <pagination
+                  background
+                  layout="pager"
+                  :limit="pageLimit"
+                  :total="paginationTotalElements"
+                  :current-page.sync="paginationNumber"
+                  :page="paginationNumber"
+                  @pagination="getList"
+                />
+              </div>
+            </el-row>
           </el-tab-pane>
         </el-tabs>
         <el-tabs v-if="false" v-model="fileSendTabname" type="border-card" style="margin-top: 20px;">
@@ -161,8 +175,10 @@ import {
   delRecord
 } from '@/api/common-action'
 import { getToken } from '@/utils/auth'
+import Pagination from '@/components/Pagination'
 export default {
   name: 'ModelFormSample',
+  components: { Pagination },
   // model-parames 模态框参数
   props: {
     modelParames: {
@@ -184,6 +200,10 @@ export default {
         modelTitle: '加载中...',
         dialogVisible: true
       },
+      pageLimit: 20,
+      paginationNumber: 1,
+      // 一共多少条
+      paginationTotalElements: 0,
       isLoading: false,
       isLoading2: false,
       getFileDir: '/', // 拉取文件的目录名称
@@ -260,12 +280,22 @@ export default {
         this.isLoading = false
       })
     },
-    getList() {
+    getList(pageObj) {
       if (this.isLoading2) {
         return
       }
+      // 翻页时pageObj对象才会有值,属性分别为page和limit
+      if (pageObj == null) {
+        pageObj = {
+          page: 0,
+          limit: this.pageLimit
+        }
+        this.paginationNumber = 0
+      } else {
+        this.pageLimit = pageObj.limit
+      }
       this.isLoading2 = true
-      httpGet('/test/file/search?runnerId=' + this.modelParames.curPlanId).then(res => {
+      httpGet('/test/file/search?page=' + pageObj.page + '&size=' + pageObj.limit + '&runnerId=' + this.modelParames.curPlanId).then(res => {
         this.isLoading2 = false
         const resLst = res.content
         if (resLst != null && resLst.length > 0) {
@@ -279,6 +309,8 @@ export default {
           }
         }
         this.dbFileList = resLst
+        this.paginationTotalElements = res.totalElements * 1
+        this.paginationNumber = res.number * 1 + 1
       }).catch(res => {
         this.isLoading2 = false
         this.$message({