import { getApiLoading } from '@/common/libraries/apiLoading'
import { Apis } from '@/gen/Apis'
import useModel from './model'

const getHouseBills = () => {
  getApiLoading(Apis.Bill.HouseBills.List, {
    ...useModel?.formData?.value,
    type: 2
  }).then(res => {
    useModel.listData.value = [...useModel.listData.value, ...res?.data]
    useModel.metaData.value = res?.meta
  })
}

export default {
  getHouseBills,
  loadMore(page: number) {
    useModel.formData.value.page = page
    getHouseBills()
  }
}
