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

const getList = () => {
  getApiLoading(Apis.Grid.Grids.GridSelectHouse, useModel?.formData?.value).then(res => {
    useModel.listData.value = res?.data
    console.log(res)
  })
}

export default {
  handleSearch() {
    useModel.formData.value.page = 1
    getList()
  },
  handleSelect(e: { value: string; label: string }) {
    uni.navigateTo({
      url: `/CUSTOMER/house_Identity/index?phone=${useModel?.pageFormData?.value?.phone}&name=${useModel?.pageFormData?.value?.name}&asset_houses_id=${e?.value}&full_name=${e?.label}`
    })
    console.log(e)
  }
}
