Skip to content

Commit 67221e7

Browse files
zhengkunwang223wanghe-fit2cloud
authored andcommitted
feat: 应用商店增加分页 (#1447)
1 parent c76cc07 commit 67221e7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

frontend/src/views/app-store/apps/index.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@
9999
</div>
100100
</el-col>
101101
</el-row>
102+
<div class="page-button">
103+
<fu-table-pagination
104+
v-model:current-page="paginationConfig.currentPage"
105+
v-model:page-size="paginationConfig.pageSize"
106+
v-bind="paginationConfig"
107+
@change="search(req)"
108+
:layout="'total, sizes, prev, pager, next, jumper'"
109+
/>
110+
</div>
102111
</template>
103112
</LayoutContent>
104113
<Detail v-if="showDetail" :id="appId"></Detail>
@@ -116,6 +125,12 @@ import { useI18n } from 'vue-i18n';
116125
117126
const language = useI18n().locale.value;
118127
128+
const paginationConfig = reactive({
129+
currentPage: 1,
130+
pageSize: 50,
131+
total: 0,
132+
});
133+
119134
const req = reactive({
120135
name: '',
121136
tags: [],
@@ -138,9 +153,12 @@ const getColor = (index: number) => {
138153
139154
const search = async (req: App.AppReq) => {
140155
loading.value = true;
156+
req.pageSize = paginationConfig.pageSize;
157+
req.page = paginationConfig.currentPage;
141158
await SearchApp(req)
142159
.then((res) => {
143160
apps.value = res.data.items;
161+
paginationConfig.total = res.data.total;
144162
})
145163
.finally(() => {
146164
loading.value = false;
@@ -260,4 +278,10 @@ onMounted(() => {
260278
border: none;
261279
}
262280
}
281+
282+
.page-button {
283+
float: right;
284+
margin-bottom: 10px;
285+
margin-top: 10px;
286+
}
263287
</style>

0 commit comments

Comments
 (0)