房屋详情待完善

This commit is contained in:
Zy
2026-05-14 17:57:09 +08:00
parent 0d3bb25e86
commit 9645412534
16 changed files with 562 additions and 185 deletions

View File

@@ -66,17 +66,11 @@
<div :title="`${weather_icon.title} ${weather_icon.wind_direction} ${weather_icon.wind_power} 温度${weather_icon.temperature}°C`">
{{ getWeatherIcon(weather_icon.iconvalue) }}
</div>
<!-- <el-image :src="summicon"></el-image> -->
<!-- <svg xmlns="http://www.w3.org/2000/svg" color="white" width="70" height="70" fill="currentColor" class="qi-100" viewBox="0 0 16 16">
<path
d="M7.655 2.357a.5.5 0 0 0 .854-.353v-1.5a.5.5 0 0 0-1 0v1.5a.5.5 0 0 0 .146.353Zm-4.08 1.861c.06.026.126.039.191.039l.001-.001a.5.5 0 0 0 .355-.855l-1.064-1.06a.5.5 0 0 0-.707.708l1.062 1.06a.498.498 0 0 0 .162.11ZM.503 8.496h1.5a.5.5 0 1 0 0-1h-1.5a.5.5 0 0 0 0 1Zm1.914 5.221a.501.501 0 0 0 .631-.063l1.063-1.06a.5.5 0 0 0-.708-.707l-1.062 1.06a.5.5 0 0 0 .076.77Zm5.225 2.14a.5.5 0 0 0 .854-.354v-1.5a.5.5 0 0 0-1 0v1.5a.5.5 0 0 0 .146.354Zm5.467-2.084a.5.5 0 0 0 .544-.816l-1.06-1.06a.498.498 0 0 0-.832.152.5.5 0 0 0 .126.555l1.06 1.06a.496.496 0 0 0 .162.109Zm.893-5.263h1.5a.5.5 0 1 0 0-1h-1.5a.5.5 0 0 0 0 1Zm-2.031-4.327a.5.5 0 0 0 .633-.063l1.06-1.06a.5.5 0 1 0-.708-.708l-1.06 1.06a.5.5 0 0 0 .075.77Zm-6.466.075a4.5 4.5 0 1 1 5 7.484 4.5 4.5 0 0 1-5-7.484Zm4.445.832a3.5 3.5 0 1 0-3.89 5.82 3.5 3.5 0 0 0 3.89-5.82Z"
/>
</svg> -->
</div>
<div class="villageinfo">
<div class="villagename">{{ villageinfo.villageName }}</div>
<div class="week">
<span>{{ new Date().toLocaleDateString().replaceAll('/', '-') }}</span>
<span style="padding-right: 10px">{{ new Date().toLocaleDateString().replaceAll('/', '-') }}</span>
<span>{{ numToWeek2(new Date().getDay()) }}</span>
</div>
</div>
@@ -115,9 +109,13 @@
<div class="body flex-1">
<div class="quicly_box" v-if="Sideactive === 1">
<div class="quickly_item" v-for="(item, index) in quickBox" :key="index" @click="handleRouter(item.url)">
<div class="quickly_item_icon">
<div class="quickly_item_icon" v-if="item.img">
<el-image :src="item.img"></el-image>
</div>
<div class="quickly_item_icon" v-else-if="item.svg">
<svg-icon :icon-class="item.svg" />
</div>
<div class="quickly_item_content">{{ item.name }}</div>
</div>
<div @click="addQuieckDialog" class="quickly_item add">
@@ -232,31 +230,27 @@
<!-- 添加快捷入口 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="repairProjectFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="name">
<!-- <el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
</el-form-item> -->
<!-- <el-form-item label="图标" prop="icon">
<el-input v-model="form.icon" placeholder="请输入" />
</el-form-item> -->
<el-form-item label="页面" prop="path">
<el-input v-model="form.path" placeholder="请输入" />
<el-tree
ref="menuRef"
class="tree-border"
:data="menuOptions"
show-checkbox
node-key="id"
:check-strictly="false"
empty-text="加载中请稍候"
:props="{ label: 'label', children: 'children' }"
>
</el-tree>
<el-form-item label="展示页面" prop="path">
<!-- <el-input v-model="form.path" placeholder="请输入" /> -->
<el-cascader
@change="handleCascader"
clearable
:props="{ value: 'path', label: 'name', children: 'children' }"
v-model="form.path"
:options="quicklylist"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<!-- <el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> -->
<el-button type="primary"> </el-button>
<el-button> </el-button>
</div>
</template>
</el-dialog>
@@ -264,7 +258,6 @@
</template>
<script lang="ts" setup>
import summicon from '@/assets/images/index/summer.png';
import repairEcharts from './components/repairEcharts.vue';
import { delResident, listResident } from '@/api/system/resident';
import { useHouseStore } from '@/store/modules/house';
@@ -291,14 +284,13 @@ import info from './assets/info.png';
import profile from './assets/profile.png';
import star from './assets/star.png';
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
import { UploadUserFile } from 'element-plus';
import { getVillageByIdAPI } from '@/api/system/community';
import { getLast7Days, numToWeek2 } from '@/utils/time';
import { EChartsOption } from 'echarts';
import { workSpaceIncomeTrendListApi, workSpaceTotalListApi, workSpaceWeatherApi } from '@/api/workflow';
import { getWeatherIcon } from '@/utils/weather';
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
import { MenuTreeOption } from '@/api/system/menu/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
@@ -501,7 +493,14 @@ function handleSelect(val: number) {
}
// ! 侧边栏
// ! 快捷入口
const quickBox = ref([
const quickBox = ref<
{
name: string;
url: string;
img: string;
svg?: string;
}[]
>([
{
name: '新建用户',
url: '/house/resident',
@@ -554,6 +553,7 @@ const rules = {
name: [{ required: true, trigger: 'blur', message: '请输入快捷入口名称' }],
path: [{ required: true, trigger: 'blur', message: '请选择快捷入口页面' }]
};
const quicklylist = ref([]);
function addQuieckDialog() {
form.value = {
name: '',
@@ -562,54 +562,76 @@ function addQuieckDialog() {
};
const permissionStore = usePermissionStore();
const routes = permissionStore.getDefaultRoutes();
console.log(routes);
handleroutestoshowlist(routes);
dialog.visible = true;
}
function handleroutestoshowlist(rotues) {
function _hanle(parentRoute, currentroute, level) {
console.log(currentroute, level);
let obj: {
name: string;
icon: string;
path: string;
level: number;
children: unknown[];
} = {};
// 非页面路由和 二级路由
if (currentroute.hidden || level === 2) {
// 1. 输入校验:确保 routes 是数组
if (!Array.isArray(rotues)) {
return [];
}
const arr = rotues.map((ele) => _hanle(null, ele, 1)).filter((item) => item);
console.log(arr);
quicklylist.value = arr;
}
function _hanle(parentRoute, currentRoute, level) {
// 非页面路由
if (currentRoute.hidden && level === 1) {
return null;
}
// 2. 辅助判断:排除常见的非列表/首页关键词(根据业务需求调整)
// 使用正则边界匹配,避免误伤 (如 'main' 不匹配 'domain')
const excludeKeywords = /(edit|main|Main|view)/i;
if (excludeKeywords.test(currentRoute.path)) {
return null;
}
if (!currentRoute.meta) {
if (currentRoute.children && currentRoute.children.length > 0) {
return null;
}
if (currentroute.meta) {
obj = {
name: currentroute.meta.title,
icon: currentroute.meta.icon,
path: currentroute.path,
level: level,
children: []
};
} else if (currentroute.path === '/') {
obj = {
name: '',
icon: currentroute.meta.icon,
path: currentroute.path,
level: level,
children: []
};
}
// 传过来父级path 拼接
if (parentRoute) {
obj.path = parentRoute.path + '/' + currentroute.path;
}
// 没有按钮第三级 普遍是 删除按钮操作
if (level < 2) {
obj.children = currentroute.children.map((item) => _hanle(obj, item, level + 1)).filter((item) => item);
}
return obj;
return null;
}
const obj = {
name: currentRoute.meta.title || '',
icon: currentRoute.meta.icon || '',
path: currentRoute.path,
level: level,
children: []
};
// 3. 路径拼接
if (parentRoute) {
if (currentRoute.path.startsWith('/')) {
obj.path = currentRoute.path;
} else {
const parentPath = parentRoute.path.endsWith('/') ? parentRoute.path.slice(0, -1) : parentRoute.path;
const childPath = currentRoute.path.startsWith('/') ? currentRoute.path : '/' + currentRoute.path;
obj.path = parentPath + childPath;
}
}
// 4. 递归处理子节点
if (level < 2 && currentRoute.children && Array.isArray(currentRoute.children)) {
obj.children = currentRoute.children.map((item) => _hanle(obj, item, level + 1)).filter((item) => item !== null); // 过滤掉 null 值
}
return obj;
}
function handleCascader(val) {
const parentpath = val[0];
const childrenpath = val[1];
const find = quicklylist.value.find((item) => item.path === parentpath);
if (find) {
const find2 = find.children.find((item) => item.path === childrenpath);
if (find2) {
console.log('>>> find2 <<<', find2);
quickBox.value.push({
name: find2.name,
img: null,
svg: find2.icon,
url: find2.path
});
}
}
// const arr = rotues.map((ele) => _hanle(null, ele, 1)).filter((item) => item);
// console.log(arr);
}
// ! 快捷入口
@@ -866,11 +888,13 @@ async function deleteFun(row) {
.iconbox {
width: 70px;
height: 70px;
font-size: 70px;
text-align: center;
margin-right: 20px;
font-size: 60px;
line-height: 70px;
position: relative;
cursor: default;
z-index: 2;
cursor: default;
}
.villageinfo {
margin-left: 20px;
@@ -982,12 +1006,20 @@ async function deleteFun(row) {
background-repeat: no-repeat;
background-size: 100% 100%;
.quicly_box {
max-height: 410px;
overflow-y: auto;
padding-top: 20px;
display: grid;
grid-template-columns: repeat(3, 1fr);
@media (max-width: 1750px) {
grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 1600px) {
max-height: 550px;
}
@media (max-width: 1200px) {
max-height: 550px;
}
gap: 10px;
.quickly_item {
@@ -1009,9 +1041,9 @@ async function deleteFun(row) {
.quickly_item_icon {
width: 25px;
height: 25px;
margin-right: 8px;
}
.quickly_item_content {
margin-left: 8px;
font-weight: 500;
color: #222222;
}