|
@@ -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({
|