临时添加
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VITE_APP_TITLE = RuoYi-Vue-Plus多租户管理系统
|
VITE_APP_TITLE = 智慧物业后台管理系统
|
||||||
VITE_APP_LOGO_TITLE = RuoYi-Vue-Plus
|
|
||||||
|
|
||||||
|
VITE_APP_LOGO_TITLE = 智慧物业后台管理系统
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
VITE_APP_ENV = 'production'
|
VITE_APP_ENV = 'production'
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
|
|||||||
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
||||||
|
|
||||||
# 生产环境
|
# 生产环境
|
||||||
VITE_APP_BASE_API = '/prod-api'
|
VITE_APP_BASE_API = 'http://wuyeadmin.bugtc.com/'
|
||||||
|
|
||||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||||
VITE_BUILD_COMPRESS = gzip
|
VITE_BUILD_COMPRESS = gzip
|
||||||
|
|||||||
@@ -60,6 +60,6 @@ export interface FloorsType {
|
|||||||
}
|
}
|
||||||
// 房间
|
// 房间
|
||||||
export interface HouseType {
|
export interface HouseType {
|
||||||
houseId: number;
|
houseId: string;
|
||||||
houseNo: string;
|
houseNo: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,19 @@ import { communitylist_rows_type } from '@/api/system/community/type';
|
|||||||
import { getBuildinglistAPI, getHouselistAPI } from '@/api/system/house';
|
import { getBuildinglistAPI, getHouselistAPI } from '@/api/system/house';
|
||||||
import { BuildingUnit, BuildingVo } from '@/api/system/house/type';
|
import { BuildingUnit, BuildingVo } from '@/api/system/house/type';
|
||||||
import { defineStore } from 'pinia';
|
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', () => {
|
export const useHouseStore = defineStore('house', () => {
|
||||||
// 当前小区信息
|
// 当前小区信息
|
||||||
const currentVilageInfo = ref<communitylist_rows_type>();
|
const currentVilageInfo = ref<communitylist_rows_type>();
|
||||||
@@ -11,13 +23,32 @@ export const useHouseStore = defineStore('house', () => {
|
|||||||
// 当前小区 所有楼栋信息
|
// 当前小区 所有楼栋信息
|
||||||
const currentBuildingInfoList = ref<BuildingVo[]>([]);
|
const currentBuildingInfoList = ref<BuildingVo[]>([]);
|
||||||
// 当前楼栋信息
|
// 当前楼栋信息
|
||||||
const currentBuildingInfo = ref<BuildingVo>();
|
const currentBuildingInfo = ref<BuildingVo>({
|
||||||
|
'id': null,
|
||||||
|
'villageId': null,
|
||||||
|
'villageName': '',
|
||||||
|
'buildingName': '',
|
||||||
|
'buildingUse': null,
|
||||||
|
'buildToward': '',
|
||||||
|
'buildTall': '',
|
||||||
|
'buildStructure': '',
|
||||||
|
'unitCount': null,
|
||||||
|
'floorCount': null,
|
||||||
|
'remark': ''
|
||||||
|
});
|
||||||
|
|
||||||
// 当前楼栋 所有房屋信息
|
// 当前楼栋 所有房屋信息
|
||||||
const currentHouseInfoList = ref<BuildingUnit[]>([]);
|
const currentHouseInfoList = ref<BuildingUnit[]>([]);
|
||||||
|
|
||||||
|
// 当前楼栋 所有楼层数据
|
||||||
|
const currentFloorInfoList = ref<string[]>([]);
|
||||||
|
// 最大楼层
|
||||||
|
const maxFloors = ref(0);
|
||||||
|
// 楼层列表 set
|
||||||
|
const floorslist = ref<Set<string>>(new Set());
|
||||||
// 初始化
|
// 初始化
|
||||||
const initHouse = async (buildingtype: number) => {
|
const initHouse = async (buildingtype: number) => {
|
||||||
|
// 查找当前小区
|
||||||
const res = await getCommunitylistAPI();
|
const res = await getCommunitylistAPI();
|
||||||
const currentVilage = res.rows.find((item) => item.choiceStatus === 0);
|
const currentVilage = res.rows.find((item) => item.choiceStatus === 0);
|
||||||
currentVilageInfo.value = currentVilage;
|
currentVilageInfo.value = currentVilage;
|
||||||
@@ -26,9 +57,20 @@ export const useHouseStore = defineStore('house', () => {
|
|||||||
currentBuildingInfoList.value = res2.data;
|
currentBuildingInfoList.value = res2.data;
|
||||||
// 获取当前小区 楼栋信息
|
// 获取当前小区 楼栋信息
|
||||||
currentBuildingInfo.value = res2.data[0];
|
currentBuildingInfo.value = res2.data[0];
|
||||||
|
console.log(currentBuildingInfo.value);
|
||||||
|
|
||||||
// 获取当前楼栋 所有房屋信息
|
// 获取当前楼栋 所有房屋信息
|
||||||
const res3 = await getHouselistAPI(currentBuildingInfo.value.id);
|
const res3 = await getHouselistAPI(currentBuildingInfo.value.id);
|
||||||
currentHouseInfoList.value = res3.data;
|
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,
|
currentBuildingInfoList,
|
||||||
currentBuildingInfo,
|
currentBuildingInfo,
|
||||||
currentHouseInfoList,
|
currentHouseInfoList,
|
||||||
|
currentFloorInfoList,
|
||||||
initHouse,
|
initHouse,
|
||||||
switchHouseType,
|
switchHouseType,
|
||||||
switchBuilding
|
switchBuilding
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const loginForm = ref<LoginData>({
|
const loginForm = ref<LoginData>({
|
||||||
tenantId: '000000',
|
tenantId: '000000',
|
||||||
username: 'admin',
|
username: '',
|
||||||
password: 'admin123',
|
password: '',
|
||||||
rememberMe: false,
|
rememberMe: false,
|
||||||
code: '',
|
code: '',
|
||||||
uuid: ''
|
uuid: ''
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="house-list">
|
<div class="house-list">
|
||||||
<div class="house flex align-center" @contextmenu="contextMenu.open($event, house.id)" v-for="house in unit" :key="house.id">
|
<div class="house flex align-center" @contextmenu="contextMenu.open($event, house.houseId)" v-for="house in list.houses" :key="house.houseId">
|
||||||
<el-checkbox @click="handleClick(house)" :label="house.id" :value="house.id" />
|
<el-checkbox @click="handleClick(house)" :label="house.houseNo" :value="house.houseId" />
|
||||||
</div>
|
</div>
|
||||||
<!-- 右键菜单组件 -->
|
<!-- 右键菜单组件 -->
|
||||||
<ContextMenu ref="contextMenu" :menu="menuList" @select="handleSelect" />
|
<ContextMenu ref="contextMenu" :menu="menuList" @select="handleSelect" />
|
||||||
@@ -11,45 +11,33 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ContextMenu from '@/components/ContextMenu/index.vue';
|
import ContextMenu from '@/components/ContextMenu/index.vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import type { FloorsType, HouseType } from '@/api/system/house/type';
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
unit: any;
|
unit: FloorsType[];
|
||||||
fIdx: number;
|
fIdx: string;
|
||||||
|
menuList: {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
}[];
|
||||||
}>();
|
}>();
|
||||||
const houstlist = ref([]);
|
const list = props.unit.find((item) => item.floorNo === props.fIdx);
|
||||||
props.unit;
|
const checked = ref<string[]>([]);
|
||||||
const router = useRouter();
|
|
||||||
const checked = ref([]);
|
|
||||||
// 菜单
|
|
||||||
const menuList = ref([
|
|
||||||
{ label: '编辑', value: 'edit' },
|
|
||||||
{ label: '收费标准', value: 'money' },
|
|
||||||
{ label: '详情', value: 'main' },
|
|
||||||
{ label: '删除', value: 'delete' }
|
|
||||||
]);
|
|
||||||
// 菜单ref
|
// 菜单ref
|
||||||
const contextMenu = ref();
|
const contextMenu = ref();
|
||||||
// 点击事件
|
// 点击事件
|
||||||
const handleSelect = (val) => {
|
const handleSelect = (val: string) => {
|
||||||
switch (val) {
|
emit('contextmenufun', val);
|
||||||
case 'edit':
|
|
||||||
break;
|
|
||||||
case 'money':
|
|
||||||
break;
|
|
||||||
case 'main':
|
|
||||||
router.push({
|
|
||||||
path: '/house/houseDetails'
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function handleClick(house: any) {
|
function handleClick(house: HouseType) {
|
||||||
checked.value = checked.value.includes(house.id) ? checked.value.filter((item) => item !== house.id) : checked.value.concat(house.id);
|
checked.value = checked.value.includes(house.houseId)
|
||||||
|
? checked.value.filter((item) => item !== house.houseId)
|
||||||
|
: checked.value.concat(house.houseId);
|
||||||
|
emit('change', checked.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
change: string[];
|
change: [value: string[]];
|
||||||
|
contextmenufun: [value: string];
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="TableBox p-5 h-full">
|
<div class="TableBox p-5 h-full">
|
||||||
<el-table border :data="floorsSortList">
|
<el-table border :data="currentFloorInfoList">
|
||||||
<el-table-column align="center" fixed label="楼层\单元" width="85">
|
<el-table-column align="center" fixed label="楼层\单元" width="85">
|
||||||
<template #default="{ $index, row }">
|
<template #default="{ row }">
|
||||||
<span>{{ row }}楼</span>
|
<span>{{ row }}楼</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -10,12 +10,12 @@
|
|||||||
min-width="160"
|
min-width="160"
|
||||||
class="column"
|
class="column"
|
||||||
align="center"
|
align="center"
|
||||||
:label="units.buildingName"
|
:label="`${units.unitNo}单元`"
|
||||||
v-for="(units, index) in currentHouseInfoList"
|
v-for="(units, index) in currentHouseInfoList"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<template #default="{ $index, row }">
|
<template #default="{ row }">
|
||||||
<houseItem :unit="units.floors_Json" :f-idx="row"></houseItem>
|
<houseItem :menu-list="menutlist" :unit="units.floors_Json" :f-idx="row"></houseItem>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -23,40 +23,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
|
||||||
import houseItem from './houseItem.vue';
|
import houseItem from './houseItem.vue';
|
||||||
import { useHouseStore } from '@/store/modules/house';
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
const houseStore = useHouseStore();
|
const houseStore = useHouseStore();
|
||||||
const { currentHouseInfoList } = storeToRefs(houseStore); // 数据
|
const { currentHouseInfoList, currentFloorInfoList } = storeToRefs(houseStore); // 数据
|
||||||
console.log(currentHouseInfoList);
|
const menutlist = [
|
||||||
const maxFloors = ref(0);
|
{ label: '编辑', value: 'edit' },
|
||||||
const maxUnits = ref(currentHouseInfoList.value.length);
|
{ label: '收费标准', value: 'money' },
|
||||||
const floorslist = ref(new Set());
|
{ label: '详情', value: 'main' },
|
||||||
const floorsSortList = computed(() => {
|
{ label: '删除', value: 'delete' }
|
||||||
const list = Array.from(floorslist.value) as string[];
|
];
|
||||||
return list.sort(sortNumberStr);
|
|
||||||
});
|
|
||||||
function sortNumberStr(a, b) {
|
|
||||||
const numA = parseFloat(a);
|
|
||||||
const numB = parseFloat(b);
|
|
||||||
|
|
||||||
// 如果都是有效数字 → 按数字大小排(支持负数、小数)
|
|
||||||
if (!isNaN(numA) && !isNaN(numB)) {
|
|
||||||
return numA - numB;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 否则按自然语言排
|
|
||||||
return a.localeCompare(b, 'zh-CN', { numeric: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
currentHouseInfoList.value.forEach((item) => {
|
|
||||||
maxFloors.value = Math.max(maxFloors.value, item.actualFloorCount);
|
|
||||||
item.floors_Json = JSON.parse(`[${item.floors.replaceAll('\\', '')}]`);
|
|
||||||
console.log(item.floors_Json);
|
|
||||||
item.floors_Json.forEach((floor) => {
|
|
||||||
floorslist.value.add(floor.floorNo);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<div class="Unit_top flex align-center justify-between">
|
<div class="Unit_top flex align-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<span class="text-size-16px text-color-black text-widget-bold mr-30px">
|
<span class="text-size-16px text-color-black text-widget-bold mr-30px">
|
||||||
<strong>B栋</strong>
|
<strong>{{ houseStore.currentBuildingInfo.buildingName }}</strong>
|
||||||
</span>
|
</span>
|
||||||
<span class="mr-30px">楼栋朝向:西南</span>
|
<span class="mr-30px">楼栋朝向:{{ houseStore.currentBuildingInfo.buildToward }}</span>
|
||||||
<span class="mr-30px">楼高:30米</span>
|
<span class="mr-30px">楼高:{{ houseStore.currentBuildingInfo.buildTall }}</span>
|
||||||
<span class="mr-30px">楼栋结构:框架 </span>
|
<span class="mr-30px">楼栋结构:{{ houseStore.currentBuildingInfo.buildStructure }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rightActions">
|
<div class="rightActions">
|
||||||
<span class="mr-20px" @click="handleAddHouse">+增加房屋</span>
|
<span class="mr-20px" @click="handleAddHouse">+增加房屋</span>
|
||||||
@@ -24,6 +24,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import TableUnit from './components/table.vue';
|
import TableUnit from './components/table.vue';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
const houseStore = useHouseStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
function handleAddHouse() {
|
function handleAddHouse() {
|
||||||
router.push({
|
router.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user