Skip to content

Commit

Permalink
feat:op系统客户端管理新增每页大小,可调整 TencentBlueKing#2429
Browse files Browse the repository at this point in the history
* feat:op系统客户端管理新增每页大小,可调整 TencentBlueKing#2429

* feat:op系统客户端管理新增每页大小,可调整 TencentBlueKing#2429
  • Loading branch information
lannoy0523 committed Jul 25, 2024
1 parent 6b72ef7 commit 696acf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/frontend/devops-op/src/api/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function queryFileSystemClient(body) {
method: 'get',
params: {
pageNumber: body.pageNumber,
pageSize: DEFAULT_PAGE_SIZE,
pageSize: body.pageSize,
projectId: body.projectId === '' ? null : body.projectId,
repoName: body.repoName === '' ? null : body.repoName,
online: body.online === '' ? null : body.online,
Expand Down
11 changes: 10 additions & 1 deletion src/frontend/devops-op/src/views/node/FileSystem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@
v-if="total>0"
:current-page="clientQuery.pageNumber"
:page-size="clientQuery.pageSize"
layout="total, prev, pager, next, jumper"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
<file-system-status-record-dialog :visible.sync="showDialog" :param="param" />
Expand All @@ -131,6 +133,7 @@ export default {
projectId: '',
repoName: '',
pageNumber: 1,
pageSize: 10,
online: '',
ip: '',
version: '',
Expand Down Expand Up @@ -191,6 +194,10 @@ export default {
this.currentPage = val
this.changeRouteQueryParams(val)
},
handleSizeChange(val) {
this.clientQuery.pageSize = val
this.changeRouteQueryParams(1)
},
changeRouteQueryParams(pageNum) {
const query = {
page: String(pageNum)
Expand All @@ -200,6 +207,7 @@ export default {
query.online = this.clientQuery.online
query.ip = this.clientQuery.ip
query.version = this.clientQuery.version
query.pageSize = this.clientQuery.pageSize
this.$router.push({ path: '/nodes/FileSystem', query: query })
},
onRouteUpdate(route) {
Expand All @@ -208,6 +216,7 @@ export default {
clientQuery.projectId = query.projectId ? query.projectId : ''
clientQuery.repoName = query.repoName ? query.repoName : ''
clientQuery.pageNumber = query.page ? Number(query.page) : 1
clientQuery.pageSize = query.pageSize ? Number(query.pageSize) : 10
clientQuery.online = query.online ? query.online : ''
clientQuery.ip = query.ip ? query.ip : ''
clientQuery.version = query.version ? query.version : ''
Expand Down

0 comments on commit 696acf8

Please sign in to comment.