71 lines
2.1 KiB
TypeScript
71 lines
2.1 KiB
TypeScript
import request from '@/config/axios'
|
|
|
|
/** 房屋信息主信息 */
|
|
export interface House {
|
|
id: number; // 主键ID
|
|
communityId?: number; // 小区ID
|
|
communityName?: string; // 小区名称
|
|
buildingNo?: string; // 楼号
|
|
unitNo?: string; // 单元号
|
|
roomNo?: string; // 门牌号
|
|
propertyArea: number; // 产权面积(㎡)
|
|
memberId: number; // 业主ID
|
|
ownerName: string; // 业主姓名
|
|
ownerPhone: string; // 业主手机号
|
|
}
|
|
|
|
/** 房屋树节点 */
|
|
export interface HouseTreeNode {
|
|
value: string
|
|
label: string
|
|
children?: HouseTreeNode[]
|
|
}
|
|
|
|
// 房屋信息主 API
|
|
export const HouseApi = {
|
|
// 查询房屋信息主分页
|
|
getHousePage: async (params: any) => {
|
|
return await request.get({ url: `/community/house/page`, params })
|
|
},
|
|
|
|
// 查询房屋信息主详情
|
|
getHouse: async (id: number) => {
|
|
return await request.get({ url: `/community/house/get?id=` + id })
|
|
},
|
|
|
|
// 新增房屋信息主
|
|
createHouse: async (data: House) => {
|
|
return await request.post({ url: `/community/house/create`, data })
|
|
},
|
|
|
|
// 修改房屋信息主
|
|
updateHouse: async (data: House) => {
|
|
return await request.put({ url: `/community/house/update`, data })
|
|
},
|
|
|
|
// 删除房屋信息主
|
|
deleteHouse: async (id: number) => {
|
|
return await request.delete({ url: `/community/house/delete?id=` + id })
|
|
},
|
|
|
|
/** 批量删除房屋信息主 */
|
|
deleteHouseList: async (ids: number[]) => {
|
|
return await request.delete({ url: `/community/house/delete-list?ids=${ids.join(',')}` })
|
|
},
|
|
|
|
// 导出房屋信息主 Excel
|
|
exportHouse: async (params) => {
|
|
return await request.download({ url: `/community/house/export-excel`, params })
|
|
},
|
|
|
|
// 下载房屋导入模板
|
|
importHouseTemplate: async () => {
|
|
return await request.download({ url: `/community/house/get-import-template` })
|
|
},
|
|
|
|
// 获取小区房屋级联树(楼号-单元-房号)
|
|
getHouseTree: async (communityId: number) => {
|
|
return await request.get({ url: `/community/house/tree`, params: { communityId } })
|
|
}
|
|
}
|