完成小区相关的接口对接
This commit is contained in:
59
src/api/system/community/index.ts
Normal file
59
src/api/system/community/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { communitylist_rows_type } from './type';
|
||||
|
||||
// 查询小区列表
|
||||
export function getCommunitylistAPI(): AxiosPromise<communitylist_rows_type[]> {
|
||||
return request({
|
||||
url: '/village/list',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 通过小区id获取小区信息 */
|
||||
export function getVillageByIdAPI(id: string): AxiosPromise<communitylist_rows_type> {
|
||||
return request({
|
||||
url: `/village/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 删除小区 */
|
||||
export function deleteVillageByIdAPI(id: number): AxiosPromise<null> {
|
||||
return request({
|
||||
url: `/village/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 上传小区图片 */
|
||||
export function uploadVillageImageAPI(formdata: FormData): AxiosPromise<{ fileName: string; url: string; ossId: string }[]> {
|
||||
return request({
|
||||
url: `/village/uploadImages`,
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: formdata
|
||||
});
|
||||
}
|
||||
/** 添加小区 */
|
||||
export function addVillageAPI<T>(data: T) {
|
||||
return request({
|
||||
url: `/village`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加小区 */
|
||||
export function editVillageAPI<T>(data: T) {
|
||||
return request({
|
||||
url: `/village`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/**切换小区 */
|
||||
export function switchVillageAPI(villageId: number) {
|
||||
return request({
|
||||
url: `/village/switchVillage/${villageId}`,
|
||||
method: 'POST'
|
||||
});
|
||||
}
|
||||
20
src/api/system/community/type.ts
Normal file
20
src/api/system/community/type.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export interface communitylist_rows_type {
|
||||
villageId?: number;
|
||||
villageName: string;
|
||||
villageCode: string;
|
||||
address: string;
|
||||
houseUse: number | null;
|
||||
villageArea: number;
|
||||
remark: string;
|
||||
parkingSpaceCount: number;
|
||||
villageImageUrl: string;
|
||||
city: string | string[];
|
||||
status: '0' | '1';
|
||||
manageName: string;
|
||||
managePhone: string;
|
||||
manageVx: string;
|
||||
manageEmail: string;
|
||||
manageQq: string;
|
||||
completDate: string;
|
||||
choiceStatus: 0 | 1;
|
||||
}
|
||||
24
src/api/system/house/index.ts
Normal file
24
src/api/system/house/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { BuildingUnit, BuildingVo } from './type';
|
||||
|
||||
// 楼栋---------------------------------------------------------------------------------------
|
||||
// 根据 小区id 和 类型 查询楼栋信息
|
||||
export function getBuildinglistAPI(villageId: number, buildingUse: number): AxiosPromise<BuildingVo[]> {
|
||||
return request({
|
||||
url: '/building/byVillage',
|
||||
method: 'get',
|
||||
params: {
|
||||
villageId: villageId,
|
||||
buildingUse: buildingUse
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 房屋----------------------------------------------------------------------------------------------
|
||||
export function getHouselistAPI(buildingId: number): AxiosPromise<BuildingUnit[]> {
|
||||
return request({
|
||||
url: `/house/groupByUnitTree/${buildingId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
65
src/api/system/house/type.ts
Normal file
65
src/api/system/house/type.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
export interface BuildingVo {
|
||||
/**
|
||||
* 楼栋名称/编号
|
||||
*/
|
||||
buildingName: string;
|
||||
/**
|
||||
* 0住宅 1办公 2商用 3公寓
|
||||
*/
|
||||
buildingUse: number;
|
||||
/**
|
||||
* 楼栋结构
|
||||
*/
|
||||
buildStructure?: string;
|
||||
/**
|
||||
* 楼高
|
||||
*/
|
||||
buildTall?: string;
|
||||
/**
|
||||
* 楼栋朝向
|
||||
*/
|
||||
buildToward?: string;
|
||||
/**
|
||||
* 层数
|
||||
*/
|
||||
floorCount?: number;
|
||||
/**
|
||||
* 楼栋ID
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
/**
|
||||
* 单元数
|
||||
*/
|
||||
unitCount?: number;
|
||||
/**
|
||||
* 所属小区ID
|
||||
*/
|
||||
villageId?: number;
|
||||
villageName?: string;
|
||||
}
|
||||
|
||||
// 楼栋
|
||||
export interface BuildingUnit {
|
||||
actualFloorCount: number;
|
||||
buildingFloorCount: number;
|
||||
buildingId: number;
|
||||
buildingName: string;
|
||||
totalHouses: number;
|
||||
unitNo: string;
|
||||
floors: string;
|
||||
floors_Json?: FloorsType[];
|
||||
}
|
||||
// 楼层
|
||||
export interface FloorsType {
|
||||
floorNo: string;
|
||||
houses: HouseType[];
|
||||
}
|
||||
// 房间
|
||||
export interface HouseType {
|
||||
houseId: number;
|
||||
houseNo: string;
|
||||
}
|
||||
Reference in New Issue
Block a user