<template>
    <z-paging ref="paging" v-model="list" bg-color="#F6F8FA" @query="handleQuery">
        <view class="p-24 flex flex-col gap-24">
            <holland-list-item v-for="item in list" :key="item.id" :item="item"/>
        </view>
    </z-paging>
</template>

<script setup lang="ts">
import {hollRecord} from "@/api/modules/test-center";
import {HollandRecord} from "@/types/test-center";
import HollandListItem from "@/pagesOther/pages/test-center/list/components/holland-list-item.vue";

const list = ref<HollandRecord[]>([])
const paging = ref<ZPagingInstance>()

const handleQuery = (pageNum: number, pageSize: number) => {
    hollRecord({pageNum, pageSize})
        .then(res => paging.value?.completeByTotal(res.rows, res.total))
        .catch(e => paging.value?.complete(false))
}
</script>

<style scoped>

</style>