1、单元
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7m16s

2、房间
This commit is contained in:
2025-06-26 18:04:51 +08:00
parent e06f8861cc
commit 6f2e0be983
15 changed files with 2079 additions and 4 deletions

View File

@@ -0,0 +1,61 @@
import type { RoomVO, RoomForm, RoomQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询房间信息列表
* @param params
* @returns 房间信息列表
*/
export function roomList(params?: RoomQuery) {
return requestClient.get<PageResult<RoomVO>>('/property/room/list', { params });
}
/**
* 导出房间信息列表
* @param params
* @returns 房间信息列表
*/
export function roomExport(params?: RoomQuery) {
return commonExport('/property/room/export', params ?? {});
}
/**
* 查询房间信息详情
* @param id id
* @returns 房间信息详情
*/
export function roomInfo(id: ID) {
return requestClient.get<RoomVO>(`/property/room/${id}`);
}
/**
* 新增房间信息
* @param data
* @returns void
*/
export function roomAdd(data: RoomForm) {
return requestClient.postWithMsg<void>('/property/room', data);
}
/**
* 更新房间信息
* @param data
* @returns void
*/
export function roomUpdate(data: RoomForm) {
return requestClient.putWithMsg<void>('/property/room', data);
}
/**
* 删除房间信息
* @param id id
* @returns void
*/
export function roomRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/room/${id}`);
}

View File

@@ -0,0 +1,159 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RoomVO {
/**
* 主键
*/
id: string | number;
/**
* 所属楼层ID
*/
floorCode: string;
/**
* 房间编码
*/
roomCode: string;
/**
* 房间号(如101,202)
*/
roomNumber: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType: number;
/**
* 面积(平方米)
*/
area: number;
/**
* 户型(如2室1厅1卫)
*/
layout: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation: number;
/**
* 是否可售
*/
isForSale: number;
/**
* 状态('空置','已售','已租','自用'
*/
status: number;
}
export interface RoomForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 所属楼层ID
*/
floorCode?: string;
/**
* 房间编码
*/
roomCode?: string;
/**
* 房间号(如101,202)
*/
roomNumber?: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType?: number;
/**
* 面积(平方米)
*/
area?: number;
/**
* 户型(如2室1厅1卫)
*/
layout?: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation?: number;
/**
* 是否可售
*/
isForSale?: number;
/**
* 状态('空置','已售','已租','自用'
*/
status?: number;
}
export interface RoomQuery extends PageQuery {
/**
* 所属楼层ID
*/
floorCode?: string;
/**
* 房间编码
*/
roomCode?: string;
/**
* 房间号(如101,202)
*/
roomNumber?: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType?: number;
/**
* 面积(平方米)
*/
area?: number;
/**
* 户型(如2室1厅1卫)
*/
layout?: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation?: number;
/**
* 是否可售
*/
isForSale?: number;
/**
* 状态('空置','已售','已租','自用'
*/
status?: number;
/**
* 日期范围参数
*/
params?: any;
}