<template>
  <div>
    <div v-if="items.length">
      <LongCompany :list="items"></LongCompany>
      <CtPagination
        :total="total"
        :page="page.pageNo"
        :limit="page.pageSize"
        @handleChange="handleChangePage"
      ></CtPagination>
    </div>
    <Empty v-else></Empty>
  </div>
</template>

<script setup>
// 感兴趣-公司收藏
defineOptions({ name: 'company-collection' })
import { ref } from 'vue'
import { dealDictArrayData } from '@/utils/position'
import { getSubscribeEnterprise } from '@/api/position'

const total = ref(0)
const items = ref([])
const page = ref({
  pageNo: 1,
  pageSize: 10
})


// 获取公司收藏列表
const getPositionList = async () => {
  const { list, total: number } = await getSubscribeEnterprise(page.value)
  items.value = dealDictArrayData([], list)
  total.value = number
}
getPositionList()

const handleChangePage = (index) => {
  page.value.pageNo = index
  getPositionList()
}
</script>

<style scoped lang="scss">

</style>
