From dc3080db32d386ab3bc57ee14041b84cf85268ae Mon Sep 17 00:00:00 2001 From: Zy <1448159279@qq.com> Date: Wed, 8 Apr 2026 08:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 6 +-- src/api/system/house/type.ts | 2 +- src/store/modules/house.ts | 45 +++++++++++++++- src/views/login.vue | 4 +- .../house/components/components/houseItem.vue | 52 +++++++------------ .../house/components/components/table.vue | 48 +++++------------ src/views/system/house/components/unit.vue | 10 ++-- 7 files changed, 88 insertions(+), 79 deletions(-) diff --git a/.env.production b/.env.production index 883c8f1..040d999 100644 --- a/.env.production +++ b/.env.production @@ -1,7 +1,7 @@ # 页面标题 -VITE_APP_TITLE = RuoYi-Vue-Plus多租户管理系统 -VITE_APP_LOGO_TITLE = RuoYi-Vue-Plus +VITE_APP_TITLE = 智慧物业后台管理系统 +VITE_APP_LOGO_TITLE = 智慧物业后台管理系统 # 生产环境配置 VITE_APP_ENV = 'production' @@ -15,7 +15,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications' VITE_APP_SNAILJOB_ADMIN = '/snail-job' # 生产环境 -VITE_APP_BASE_API = '/prod-api' +VITE_APP_BASE_API = 'http://wuyeadmin.bugtc.com/' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip diff --git a/src/api/system/house/type.ts b/src/api/system/house/type.ts index 58f7ff7..a9cee60 100644 --- a/src/api/system/house/type.ts +++ b/src/api/system/house/type.ts @@ -60,6 +60,6 @@ export interface FloorsType { } // 房间 export interface HouseType { - houseId: number; + houseId: string; houseNo: string; } diff --git a/src/store/modules/house.ts b/src/store/modules/house.ts index 15cfd30..9322195 100644 --- a/src/store/modules/house.ts +++ b/src/store/modules/house.ts @@ -3,7 +3,19 @@ import { communitylist_rows_type } from '@/api/system/community/type'; import { getBuildinglistAPI, getHouselistAPI } from '@/api/system/house'; import { BuildingUnit, BuildingVo } from '@/api/system/house/type'; import { defineStore } from 'pinia'; +// 数字排序 +function sortNumberStr(a: string, b: string) { + const numA = parseFloat(a); + const numB = parseFloat(b); + // 如果都是有效数字 → 按数字大小排(支持负数、小数) + if (!isNaN(numA) && !isNaN(numB)) { + return numA - numB; + } + + // 否则按自然语言排 + return a.localeCompare(b, 'zh-CN', { numeric: true }); +} export const useHouseStore = defineStore('house', () => { // 当前小区信息 const currentVilageInfo = ref(); @@ -11,13 +23,32 @@ export const useHouseStore = defineStore('house', () => { // 当前小区 所有楼栋信息 const currentBuildingInfoList = ref([]); // 当前楼栋信息 - const currentBuildingInfo = ref(); + const currentBuildingInfo = ref({ + 'id': null, + 'villageId': null, + 'villageName': '', + 'buildingName': '', + 'buildingUse': null, + 'buildToward': '', + 'buildTall': '', + 'buildStructure': '', + 'unitCount': null, + 'floorCount': null, + 'remark': '' + }); // 当前楼栋 所有房屋信息 const currentHouseInfoList = ref([]); + // 当前楼栋 所有楼层数据 + const currentFloorInfoList = ref([]); + // 最大楼层 + const maxFloors = ref(0); + // 楼层列表 set + const floorslist = ref>(new Set()); // 初始化 const initHouse = async (buildingtype: number) => { + // 查找当前小区 const res = await getCommunitylistAPI(); const currentVilage = res.rows.find((item) => item.choiceStatus === 0); currentVilageInfo.value = currentVilage; @@ -26,9 +57,20 @@ export const useHouseStore = defineStore('house', () => { currentBuildingInfoList.value = res2.data; // 获取当前小区 楼栋信息 currentBuildingInfo.value = res2.data[0]; + console.log(currentBuildingInfo.value); + // 获取当前楼栋 所有房屋信息 const res3 = await getHouselistAPI(currentBuildingInfo.value.id); currentHouseInfoList.value = res3.data; + currentHouseInfoList.value.forEach((item) => { + maxFloors.value = Math.max(maxFloors.value, item.actualFloorCount); + item.floors_Json = JSON.parse(`[${item.floors.replaceAll('\\', '')}]`); + item.floors_Json.forEach((floor) => { + floorslist.value.add(floor.floorNo); + }); + }); + // 对当前小区的 楼层进行排序 + currentFloorInfoList.value = (Array.from(floorslist.value) as string[]).sort(sortNumberStr); }; // 切换住宅类型 @@ -48,6 +90,7 @@ export const useHouseStore = defineStore('house', () => { currentBuildingInfoList, currentBuildingInfo, currentHouseInfoList, + currentFloorInfoList, initHouse, switchHouseType, switchBuilding diff --git a/src/views/login.vue b/src/views/login.vue index 8f676be..a4fe37b 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -58,8 +58,8 @@ const { t } = useI18n(); const loginForm = ref({ tenantId: '000000', - username: 'admin', - password: 'admin123', + username: '', + password: '', rememberMe: false, code: '', uuid: '' diff --git a/src/views/system/house/components/components/houseItem.vue b/src/views/system/house/components/components/houseItem.vue index fa9b3bd..8559574 100644 --- a/src/views/system/house/components/components/houseItem.vue +++ b/src/views/system/house/components/components/houseItem.vue @@ -1,7 +1,7 @@