import { Apis } from '@/gen/Apis'
import { getApiLoading } from '@/common/libraries/apiLoading'
import useModel from './model'
const getList = () => {
  getApiLoading(Apis.Archive.HouseOccupants.GetHouseOccupants, useModel?.formData?.value).then(
    res => {
      useModel.listData.value = [...useModel.listData.value, ...(res?.data || [])]
      useModel.metaData.value = res?.meta
      console.log(res)
    }
  )
}
export default {
  handleSearch() {
    useModel.formData.value.page = 1
    useModel.listData.value = []
    getList()
  },
  getList,
  handleLoad(page: number) {
    useModel.formData.value.page = page
    getList()
  }
}
