refactor: 优化工具箱分页和推荐列表逻辑
This commit is contained in:
@ -37,20 +37,18 @@
|
|||||||
<!-- <div class="text-16px text-[#999999] font-normal">暂无数据</div> -->
|
<!-- <div class="text-16px text-[#999999] font-normal">暂无数据</div> -->
|
||||||
<el-empty v-if="!pageRes.list.length" :image="emptyImg"></el-empty>
|
<el-empty v-if="!pageRes.list.length" :image="emptyImg"></el-empty>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[20px] text-right">
|
|
||||||
<el-pagination
|
<el-pagination
|
||||||
|
v-if="pageRes?.list.length"
|
||||||
v-model:current-page="pageReq.pageNum"
|
v-model:current-page="pageReq.pageNum"
|
||||||
:page-size="pageReq.pageSize"
|
:page-size="pageReq.pageSize"
|
||||||
layout="total, prev, pager, next"
|
layout="total, prev, pager, next"
|
||||||
:total="pageRes?.total"
|
:total="pageRes?.total"
|
||||||
:page-sizes="[10, 20, 30]"
|
:page-sizes="[10, 20, 30]"
|
||||||
class="justify-center!"
|
class="mt-[20px]"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
@size-change="handleSizeChange"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="right w-[398px]">
|
<div class="right w-[398px]">
|
||||||
<div class="box-border border border-[#EEEEEE] rounded-[10px] border-solid bg-[#FFFFFF] pa-[20px]">
|
<div class="box-border border border-[#EEEEEE] rounded-[10px] border-solid bg-[#FFFFFF] pa-[20px]">
|
||||||
<div class="flex items-center text-[16px] text-[#333333] font-normal">
|
<div class="flex items-center text-[16px] text-[#333333] font-normal">
|
||||||
@ -115,10 +113,16 @@
|
|||||||
// total: 0,
|
// total: 0,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
const {data: pageRes, refresh: getPage } = await useAsyncData(`draw-page-list-${Date.now()}`, async () => {
|
const { data: pageRes, refresh: getPage } = await useAsyncData(
|
||||||
|
`draw-page-toobox-list`,
|
||||||
|
async () => {
|
||||||
const res = await page(pageReq)
|
const res = await page(pageReq)
|
||||||
return res.data
|
return res.data
|
||||||
})
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
// const getPage = () => {
|
// const getPage = () => {
|
||||||
@ -153,7 +157,7 @@
|
|||||||
getPage()
|
getPage()
|
||||||
}
|
}
|
||||||
|
|
||||||
const {data: recommendList} = await useAsyncData(`draw-recommend-list-${Date.now()}`, async () => {
|
const { data: recommendList } = await useAsyncData(`draw-recommend-list-getRelationRecommend`, async () => {
|
||||||
const res = await getRelationRecommend({
|
const res = await getRelationRecommend({
|
||||||
type: 4,
|
type: 4,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user