diff --git a/src/api/business.ts b/src/api/business.ts index 7a070c6..0effb32 100644 --- a/src/api/business.ts +++ b/src/api/business.ts @@ -5,7 +5,11 @@ import { CreateProjectParam, ProjectDetailRes, } from '@/types/business'; -import { ProjectPaginationParams, CommonCityRes } from '@/types/comm'; +import { + ProjectPaginationParams, + CommonCityRes, + PaginationParams, +} from '@/types/comm'; import { HttpResponse } from './interceptor'; // import type { RouteRecordNormalized } from 'vue-router'; // import { UserState } from '@/store/modules/user/types'; @@ -46,3 +50,43 @@ export function updateProject( export function getProjectCityList(): Promise { return axios.get(`project/getCityList`); } + +// ------------- 空间管理 ------------- +// 创建房源 +export function createRoom(params: any): Promise { + return axios.post('rooms/createRoom', params); +} +// 房源列表(分页) +export function getRoomList(params: PaginationParams): Promise { + return axios.post('rooms/getRoomList', params); +} +// 更新房源 +export function updateRoom(params: any): Promise { + return axios.post('rooms/updateRoom', params); +} +// 删除房源 +export function delRoom(id: number): Promise { + return axios.get(`rooms/delRoom?id=${id}`); +} +// 房源详情 +export function getRoom(id: number): Promise { + return axios.get(`rooms/getRoom?id=${id}`); +} +// 修改房源状态 status:1招商 2保留 3下架 4在租 +export function changeRoomStatus(params: any): Promise { + return axios.post('rooms/changeRoomStatus', params); +} +// 房源获取头部楼栋tags +export function getTopBuildingTagsByProjectId( + id: number +): Promise { + return axios.get(`roomOver/getTopBuildingTags?project_id=${id}`); +} +// 房源剖视-数据统计 +export function getStatisticsData(params: any): Promise { + return axios.post('roomOver/getStatisticsData', params); +} +// 房源剖视-房源列表 +export function getRoomOverList(params: any): Promise { + return axios.post('roomOver/getRoomList', params); +} diff --git a/src/constants/index.ts b/src/constants/index.ts index 8391055..87ec08e 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -42,3 +42,30 @@ export const VALIDATION_RULES = { ID_CARD: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, } as const; + +// 房源状态 +//状态:1招商 2保留 3下架 4在租 +export const HOUSE_STATUS = [ + { id: 1, text: '招商' }, + { id: 2, text: '保留' }, + { id: 3, text: '下架' }, + { id: 4, text: '在租' }, +]; + +// 价格单位选项 +export const PRICE_UNITS = [ + { value: 1, text: '元/㎡*月' }, + { value: 2, text: '元/㎡*天' }, + { value: 3, text: '元/天' }, + { value: 4, text: '元/月' }, + { value: 5, text: '元/年' }, +] as const; + +// 价格单位映射表 +export const PRICE_UNIT_MAP = new Map([ + [1, '元/㎡*月'], + [2, '元/㎡*天'], + [3, '元/天'], + [4, '元/月'], + [5, '元/年'], +]); diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index fa7049e..0527698 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -41,6 +41,7 @@ export default { 'content': '内容', 'table.filter': '筛选', 'table.export': '导出', + 'table.import': '导入', 'watch-detail': '查看详情', 'menu.business.project': '项目管理', 'menu.business.space': '空间管理', @@ -54,6 +55,7 @@ export default { 'menu.business.tenant-list': '租客列表', 'menu.business.tenant.contacts': '租客联系人', 'add-project': '新建项目', + 'edit-project': '编辑项目', 'menu.setting.user': '用户设置', 'menu.setting.user-list': '用户列表', 'menu.setting.role': '角色权限', @@ -123,6 +125,8 @@ export default { 'setting.contract': '合同设置', 'setting.finance': '财务设置', 'setting.data-dictionary': '数据字典', + 'add-house': '新建房源', + 'edit-house': '编辑房源', ...localeSettings, ...localeMessageBox, diff --git a/src/router/routes/modules/business.ts b/src/router/routes/modules/business.ts index c116721..75ad318 100644 --- a/src/router/routes/modules/business.ts +++ b/src/router/routes/modules/business.ts @@ -55,7 +55,7 @@ const BUSINESS: AppRouteRecordRaw = { component: () => import( /* webpackChunkName: "business-space" */ - '@/views/business/space/house-view.vue' + '@/views/business/space/house-view/index.vue' ), meta: { locale: 'menu.business.house-view', @@ -71,7 +71,7 @@ const BUSINESS: AppRouteRecordRaw = { component: () => import( /* webpackChunkName: "business-space" */ - '@/views/business/space/house-list.vue' + '@/views/business/space/house-list/index.vue' ), meta: { locale: 'menu.business.house-list', diff --git a/src/types/business.ts b/src/types/business.ts index b5b2c13..9e0dfc4 100644 --- a/src/types/business.ts +++ b/src/types/business.ts @@ -114,3 +114,20 @@ export interface ProjectInfo extends BaseEntity { export type ProjectDetailRes = HttpResponse<{ project: ProjectItem; }>; + +// 创建房源参数 +export interface CreateHouseParam { + id?: number; // 编辑时需要 + projectId: number; // 项目id + buildingId: number; // 楼栋id + floorId: number; // 楼层id + name: string; // 房源名称 + rentArea: number | string; // 计租面积 + price: number | string; // 价格 + priceType: number; // 价格类型 + area: number | string; // 面积 + useArea: number | string; // 使用面积 + status: number; // 状态 + objectKeys: string[]; // 图片数组 + tags: number[]; // 标签数组 +} diff --git a/src/views/business/project/drawer/project-form-drawer.vue b/src/views/business/project/drawer/project-form-drawer.vue index 53dfbeb..221a786 100644 --- a/src/views/business/project/drawer/project-form-drawer.vue +++ b/src/views/business/project/drawer/project-form-drawer.vue @@ -2,7 +2,7 @@ { - console.log('handleDragEnd'); + // 拖拽结束处理 }; onMounted(() => { getProvinceListData(); diff --git a/src/views/business/project/index.vue b/src/views/business/project/index.vue index 82d1e9f..311c7b8 100644 --- a/src/views/business/project/index.vue +++ b/src/views/business/project/index.vue @@ -21,7 +21,7 @@ {{ t('table.export') }} @@ -184,7 +184,11 @@ !edit ) return; - edit ? (isLoadingEdit.value = true) : (isLoadingDetail.value = true); + if (edit) { + isLoadingEdit.value = true; + } else { + isLoadingDetail.value = true; + } const { code, data } = await getProjectDetail(id); if (code === 200 && data) { currentProjectInfo.value = data.project; @@ -194,7 +198,7 @@ }; const handleWatchHouse = async (id: number) => { try { - console.log(id, 'is id'); + // TODO: 实现查看房源功能 } catch (error) { // 处理错误 } @@ -207,7 +211,7 @@ getProjectListData(); }; const handleDel = (id: number) => { - console.log(id, 'iiii'); + // TODO: 实现删除功能 }; // 分页事件处理 const onPageChange = (page: number) => { diff --git a/src/views/business/space/drawer/house-form-drawer.vue b/src/views/business/space/drawer/house-form-drawer.vue new file mode 100644 index 0000000..d869b0c --- /dev/null +++ b/src/views/business/space/drawer/house-form-drawer.vue @@ -0,0 +1,409 @@ + + + + + diff --git a/src/views/business/space/drawer/house-info-drawer.vue b/src/views/business/space/drawer/house-info-drawer.vue new file mode 100644 index 0000000..434b112 --- /dev/null +++ b/src/views/business/space/drawer/house-info-drawer.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/business/space/drawer/house-list-filter-drawer.vue b/src/views/business/space/drawer/house-list-filter-drawer.vue new file mode 100644 index 0000000..de20bee --- /dev/null +++ b/src/views/business/space/drawer/house-list-filter-drawer.vue @@ -0,0 +1,624 @@ + + + + + diff --git a/src/views/business/space/house-list.vue b/src/views/business/space/house-list.vue deleted file mode 100644 index 15fe0a3..0000000 --- a/src/views/business/space/house-list.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/views/business/space/house-list/index.vue b/src/views/business/space/house-list/index.vue new file mode 100644 index 0000000..0c00f54 --- /dev/null +++ b/src/views/business/space/house-list/index.vue @@ -0,0 +1,338 @@ + + + diff --git a/src/views/business/space/house-view.vue b/src/views/business/space/house-view/index.vue similarity index 100% rename from src/views/business/space/house-view.vue rename to src/views/business/space/house-view/index.vue diff --git a/src/views/setting/system/contract-settings/drawer/rent-setting-drawer.vue b/src/views/setting/system/contract-settings/drawer/rent-setting-drawer.vue index 5af6160..cb27cd2 100644 --- a/src/views/setting/system/contract-settings/drawer/rent-setting-drawer.vue +++ b/src/views/setting/system/contract-settings/drawer/rent-setting-drawer.vue @@ -199,20 +199,10 @@