From 9cf89cea89ab7457ecda67e648a18eb21ae8041e Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Wed, 27 Aug 2025 17:47:37 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/property/costManagement/costMeterWater/data.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/web-antd/src/views/property/costManagement/costMeterWater/data.ts b/apps/web-antd/src/views/property/costManagement/costMeterWater/data.ts index d0a52f2c..a73e049e 100644 --- a/apps/web-antd/src/views/property/costManagement/costMeterWater/data.ts +++ b/apps/web-antd/src/views/property/costManagement/costMeterWater/data.ts @@ -5,9 +5,12 @@ import {renderDict} from "#/utils/render"; export const querySchema: FormSchemaGetter = () => [ { - component: 'Input', - fieldName: 'searchValue', - label: '搜索值', + label: '费用类型', + fieldName: 'costType', + component: 'Select', + componentProps: () => ({ + options: getDictOptions('wy_cbfylx'), + }), }, ]; From f951aeb5204d39f305d924b84debf54240d26af2 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 31 Aug 2025 00:40:02 +0800 Subject: [PATCH 02/30] =?UTF-8?q?refactor(web-antd):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=94=B5=E5=8A=9B=E6=83=85=E5=86=B5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elctricitySituation/index.vue | 641 +++++------------- 1 file changed, 164 insertions(+), 477 deletions(-) diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue index 37f7653e..d3cfa605 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue @@ -1,516 +1,203 @@ From 55e57eb219a2512c39d85d17f67fa8ee5b307482 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 31 Aug 2025 12:48:27 +0800 Subject: [PATCH 03/30] =?UTF-8?q?feat(property):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B0=B4=E7=94=B5=E6=B0=94=E8=A1=A8=E5=BD=93=E5=89=8D=E8=AF=BB?= =?UTF-8?q?=E6=95=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 currentReading 函数获取水电气表当前读数和状态 - 更新 floor-tree 组件,增加 isMeter 属性控制是否显示电表数据 - 重构 electricitySituation 页面,展示电表当前读数和状态信息 - 优化 waterSituation 页面,引入 floor-tree 组件 --- .../energyManagement/meterInfo/index.ts | 13 +- .../electricEnergy/components/floor-tree.vue | 78 ++++++---- .../elctricitySituation/index.vue | 140 ++++++++++++------ .../waterPower/waterSituation/index.vue | 2 +- 4 files changed, 155 insertions(+), 78 deletions(-) diff --git a/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts b/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts index b3c505df..bf722395 100644 --- a/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts +++ b/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts @@ -1,6 +1,6 @@ import type { MeterInfoVO, MeterInfoForm, MeterInfoQuery } from './model' -import type { ID, IDS, PageResult, TreeNode } from '#/api/common'; +import type { ID, IDS, PageResult, TreeNode } from '#/api/common' import { commonExport } from '#/api/helper' import { requestClient } from '#/api/request' @@ -64,6 +64,13 @@ export function meterInfoRemove(id: ID | IDS) { * @param level * @returns 水电气树 */ -export function queryTree(meterType: number | string) { - return requestClient.get[]>(`/property/meterInfo/tree/${meterType}`) +export function queryTree(params?: any) { + return requestClient.get[]>(`/property/meterInfo/tree`, { params }) +} + +/** + * 获取水/电/气表当前读数/状态 + */ +export function currentReading(params?: any) { + return requestClient.get(`/property/meterInfo/currentReading`, { params }) } \ No newline at end of file diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/components/floor-tree.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/components/floor-tree.vue index 7b99045b..1aedde12 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/components/floor-tree.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/components/floor-tree.vue @@ -1,14 +1,19 @@ @@ -67,7 +108,7 @@ async function handleSelectFloor(selectedKeys, info) {} gap: 20px; /* 使用gap替代margin控制间距 */ } -.plan-card { +.meterInfo-card { background: #fff; width: 15rem; padding-left: 2rem; @@ -78,18 +119,18 @@ async function handleSelectFloor(selectedKeys, info) {} border-bottom: 4px solid #87ceeb; box-shadow: 0 6px 30px rgba(173, 216, 230, 0.3); font-family: 'Poppins', sans-serif; - height: 306px; + height: 290px; margin: 0 5px 20px 5px; } -.plan-card h2 { +.meterInfo-card h2 { margin-bottom: 15px; font-size: 27px; color: #5faee3; font-weight: 600; } -.plan-card h2 span { +.meterInfo-card h2 span { display: block; margin-top: -4px; color: #7eb8da; @@ -97,7 +138,7 @@ async function handleSelectFloor(selectedKeys, info) {} font-weight: 400; } -.etiquet-price { +.meterInfo-reading { position: relative; background: #f0f8ff; width: 14.46rem; @@ -106,7 +147,7 @@ async function handleSelectFloor(selectedKeys, info) {} border-radius: 5px 0 0 5px; } -.etiquet-price p { +.meterInfo-reading p { margin: 0; padding-top: 0.4rem; display: flex; @@ -115,21 +156,21 @@ async function handleSelectFloor(selectedKeys, info) {} color: #4a8cbb; } -.etiquet-price p:before { +.meterInfo-reading p:before { content: ''; margin-right: 5px; font-size: 15px; font-weight: 300; } -.etiquet-price p:after { +.meterInfo-reading p:after { content: '/ KW.H'; margin-left: 5px; font-size: 15px; font-weight: 300; } -.etiquet-price div { +.meterInfo-reading div { position: absolute; bottom: -23px; right: 0px; @@ -141,16 +182,16 @@ async function handleSelectFloor(selectedKeys, info) {} z-index: 1; } -.benefits-list { +.meterInfo-list { margin-top: 16px; } -.benefits-list ul { +.meterInfo-list ul { padding: 0; font-size: 14px; } -.benefits-list ul li { +.meterInfo-list ul li { color: #5a7d9a; list-style: none; margin-bottom: 0.2rem; @@ -159,12 +200,12 @@ async function handleSelectFloor(selectedKeys, info) {} gap: 0.5rem; } -.benefits-list ul li svg { +.meterInfo-list ul li svg { width: 0.9rem; fill: currentColor; } -.benefits-list ul li span { +.meterInfo-list ul li span { font-weight: 300; } @@ -178,7 +219,7 @@ async function handleSelectFloor(selectedKeys, info) {} display: flex; justify-content: center; align-items: center; - background: #6bb1e3; + color: #fff; padding: 10px 15px; border-radius: 5px; @@ -200,4 +241,15 @@ async function handleSelectFloor(selectedKeys, info) {} width: 0.9rem; fill: currentColor; } + +.back-to-top { + width: 50px; + height: 50px; +} + +/* 返回顶部按钮 */ +.back-to-top:hover { + background-color: #6bb1e3; + transform: translateY(-5px); +} diff --git a/apps/web-antd/src/views/property/energyManagement/waterPower/waterSituation/index.vue b/apps/web-antd/src/views/property/energyManagement/waterPower/waterSituation/index.vue index 76cfbcc9..463db550 100644 --- a/apps/web-antd/src/views/property/energyManagement/waterPower/waterSituation/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/waterPower/waterSituation/index.vue @@ -81,7 +81,7 @@ import { Page } from '@vben/common-ui' import { ref, onMounted, onBeforeUnmount, reactive } from 'vue' import * as echarts from 'echarts' import type { ECharts, EChartsOption } from 'echarts' -import FloorTree from "../../electricEnergy/components/floor-tree.vue" +import FloorTree from "../components/floor-tree.vue" const chainData = reactive({ currentMonthEnergy: '9', From ee6aa163d973f9fdd500c748b9b4538d7feeba2d Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 31 Aug 2025 16:16:19 +0800 Subject: [PATCH 04/30] =?UTF-8?q?refactor(web-antd):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=94=B5=E8=A1=A8=E4=BF=A1=E6=81=AF=E5=8D=A1=E7=89=87=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../electricEnergy/elctricitySituation/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue index a66b513b..c4a2fef2 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue @@ -51,7 +51,7 @@ function targetFn() {

- {{ item.meterName }}{{ item.installLocation }} + {{ item.meterName }}

{{ item.initReading }}

@@ -60,24 +60,23 @@ function targetFn() {
  • - 时间: + 采集时间: {{ readingTime }}
  • - 采集器IP: - {{ item.hostIp }} + 设备位置: + {{ item.installLocation }}
@@ -119,7 +118,7 @@ function targetFn() { border-bottom: 4px solid #87ceeb; box-shadow: 0 6px 30px rgba(173, 216, 230, 0.3); font-family: 'Poppins', sans-serif; - height: 290px; + height: 270px; margin: 0 5px 20px 5px; } @@ -207,6 +206,7 @@ function targetFn() { .meterInfo-list ul li span { font-weight: 300; + white-space: nowrap; } .button-get-plan { From b91d073b8dd25b1cea6f75add8a0b8d8d12b67dd Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Mon, 1 Sep 2025 18:09:56 +0800 Subject: [PATCH 05/30] =?UTF-8?q?feat(web-antd):=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=94=B5=E8=A1=A8=E6=95=B0=E6=8D=AE=E5=AE=9E=E6=97=B6=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E5=8A=9F=E8=83=BD=20-=20=E6=96=B0=E5=A2=9E=20WebSocke?= =?UTF-8?q?t=20=E6=9C=8D=E5=8A=A1=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E5=AE=9E=E6=97=B6=E6=8E=A8=E9=80=81=E7=9A=84=E7=94=B5?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/.env.development | 2 + apps/web-antd/.env.production | 2 + .../energyManagement/meterInfo/index.ts | 2 +- apps/web-antd/src/api/websocket.ts | 162 ++++++++++++++++++ apps/web-antd/src/bootstrap.ts | 71 ++++---- .../elctricitySituation/index.vue | 61 +++++-- 6 files changed, 251 insertions(+), 49 deletions(-) create mode 100644 apps/web-antd/src/api/websocket.ts diff --git a/apps/web-antd/.env.development b/apps/web-antd/.env.development index d522a706..aa18ed97 100644 --- a/apps/web-antd/.env.development +++ b/apps/web-antd/.env.development @@ -20,6 +20,8 @@ VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj6 VITE_GLOB_RSA_PRIVATE_KEY=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE= # 客户端id VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e +# 开启WEBSOCKET +VITE_APP_WEBSOCKET=true # 开启SSE VITE_GLOB_SSE_ENABLE=true diff --git a/apps/web-antd/.env.production b/apps/web-antd/.env.production index d228ac48..a26175cd 100644 --- a/apps/web-antd/.env.production +++ b/apps/web-antd/.env.production @@ -26,6 +26,8 @@ VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj6 VITE_GLOB_RSA_PRIVATE_KEY=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE= # 客户端id VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e +# 开启WEBSOCKET +VITE_APP_WEBSOCKET=true # 开启SSE VITE_GLOB_SSE_ENABLE=true diff --git a/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts b/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts index bf722395..b6af3266 100644 --- a/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts +++ b/apps/web-antd/src/api/property/energyManagement/meterInfo/index.ts @@ -72,5 +72,5 @@ export function queryTree(params?: any) { * 获取水/电/气表当前读数/状态 */ export function currentReading(params?: any) { - return requestClient.get(`/property/meterInfo/currentReading`, { params }) + return requestClient.get(`/property/meterInfo/currentReading`, { params }) } \ No newline at end of file diff --git a/apps/web-antd/src/api/websocket.ts b/apps/web-antd/src/api/websocket.ts new file mode 100644 index 00000000..8a136fbb --- /dev/null +++ b/apps/web-antd/src/api/websocket.ts @@ -0,0 +1,162 @@ +import { useAccessStore } from '@vben/stores'; + +interface WebSocketCallbacks { + onOpen?: (event: Event) => void; + onMessage?: (event: MessageEvent) => void; + onError?: (error: Event) => void; + onClose?: (event: CloseEvent) => void; +} + +export default class WebSocketService { + private webSocket: WebSocket | null = null; + private webSocketURL: string = ''; + + // 默认回调函数 + private onOpenCallback: (event: Event) => void; + private onMessageCallback: (event: MessageEvent) => void; + private onErrorCallback: (error: Event) => void; + private onCloseCallback: (event: CloseEvent) => void; + + constructor(callbacks?: WebSocketCallbacks) { + // 设置回调函数,使用自定义回调或默认回调 + this.onOpenCallback = callbacks?.onOpen || this.defaultOnOpen; + this.onMessageCallback = callbacks?.onMessage || this.defaultOnMessage; + this.onErrorCallback = callbacks?.onError || this.defaultOnError; + this.onCloseCallback = callbacks?.onClose || this.defaultOnClose; + } + + // 初始化WebSocket连接 + initWebSocket(webSocketURL: string): void { + this.webSocketURL = webSocketURL; + try { + this.webSocket = new WebSocket(webSocketURL); + + this.webSocket.onopen = this.onOpenCallback; + this.webSocket.onmessage = this.onMessageCallback; + this.webSocket.onerror = this.onErrorCallback; + this.webSocket.onclose = this.onCloseCallback; + } catch (error) { + console.error('Failed to initialize WebSocket:', error); + } + } + + // 设置onOpen回调并更新WebSocket事件处理器 + setOnOpenCallback(callback: (event: Event) => void): void { + this.onOpenCallback = callback; + if (this.webSocket) { + this.webSocket.onopen = this.onOpenCallback; + } + } + + // 设置onMessage回调并更新WebSocket事件处理器 + setOnMessageCallback(callback: (event: MessageEvent) => void): void { + this.onMessageCallback = callback; + if (this.webSocket) { + this.webSocket.onmessage = this.onMessageCallback; + } + } + + // 设置onError回调并更新WebSocket事件处理器 + setOnErrorCallback(callback: (error: Event) => void): void { + this.onErrorCallback = callback; + if (this.webSocket) { + this.webSocket.onerror = this.onErrorCallback; + } + } + + // 设置onClose回调并更新WebSocket事件处理器 + setOnCloseCallback(callback: (event: CloseEvent) => void): void { + this.onCloseCallback = callback; + if (this.webSocket) { + this.webSocket.onclose = this.onCloseCallback; + } + } + + // 默认连接建立成功的回调 + private defaultOnOpen(event: Event): void { + console.log('WebSocket连接建立成功', event); + } + + // 默认收到服务器消息的回调 + private defaultOnMessage(event: MessageEvent): void { + console.log('收到服务器消息', event.data); + // 通常这里会解析数据并更新页面 + // const data = JSON.parse(event.data); + // 根据消息类型处理不同业务... + } + + // 默认发生错误的回调 + private defaultOnError(error: Event): void { + console.error('WebSocket连接错误', error); + } + + // 默认连接关闭的回调 + private defaultOnClose(event: CloseEvent): void { + console.log('WebSocket连接关闭', event); + } + + // 关闭连接 + close(): void { + if (this.webSocket) { + this.webSocket.close(); + this.webSocket = null; + } + } + + // 发送消息 + sendMessage(message: string | object): void { + if (this.webSocket && this.webSocket.readyState === WebSocket.OPEN) { + const dataToSend = typeof message === 'string' ? message : JSON.stringify(message); + this.webSocket.send(dataToSend); + } else { + console.error('WebSocket连接未就绪'); + } + } + + // 获取当前WebSocket状态 + getReadyState(): number | null { + return this.webSocket ? this.webSocket.readyState : null; + } + + // 获取WebSocket URL + getWebSocketURL(): string { + return this.webSocketURL; + } + + // 重新连接 + reconnect(): void { + if (this.webSocketURL) { + this.close(); + this.initWebSocket(this.webSocketURL); + } + } +} + +// 创建一个可导出的WebSocket实例 +let globalWebSocketService: WebSocketService | null = null; + +/** + * 初始化WebSocket连接的可导出方法 + * @param url WebSocket服务器地址 + * @param callbacks 回调函数对象(可选) + * @returns WebSocketService实例 + */ +export function initWebSocket(callbacks?: WebSocketCallbacks): void { + if (!globalWebSocketService) { + globalWebSocketService = new WebSocketService(callbacks); + } + const accessStore = useAccessStore(); + const clinetId = import.meta.env.VITE_GLOB_APP_CLIENT_ID; + const api = import.meta.env.VITE_GLOB_API_URL; + const host = window.location.host; + const url = `ws://${host}${api}/resource/websocket?clientid=${clinetId}&Authorization=Bearer ${accessStore.accessToken}`; + globalWebSocketService.initWebSocket(url); +} + +/** + * 获取全局WebSocket服务实例 + * @returns WebSocketService实例或null + */ +export function getWebSocketService(): WebSocketService | null { + return globalWebSocketService; +} \ No newline at end of file diff --git a/apps/web-antd/src/bootstrap.ts b/apps/web-antd/src/bootstrap.ts index 45d2df24..e1c883d1 100644 --- a/apps/web-antd/src/bootstrap.ts +++ b/apps/web-antd/src/bootstrap.ts @@ -1,30 +1,31 @@ -import { createApp, watchEffect } from 'vue'; +import { createApp, watchEffect } from 'vue' -import { registerAccessDirective } from '@vben/access'; -import { registerLoadingDirective } from '@vben/common-ui/es/loading'; -import { preferences } from '@vben/preferences'; -import { initStores } from '@vben/stores'; -import '@vben/styles'; -import '@vben/styles/antd'; +import { registerAccessDirective } from '@vben/access' +import { registerLoadingDirective } from '@vben/common-ui/es/loading' +import { preferences } from '@vben/preferences' +import { initStores } from '@vben/stores' +import '@vben/styles' +import '@vben/styles/antd' -import { useTitle } from '@vueuse/core'; +import { useTitle } from '@vueuse/core' -import { setupGlobalComponent } from '#/components/global'; -import { $t, setupI18n } from '#/locales'; +import { setupGlobalComponent } from '#/components/global' +import { $t, setupI18n } from '#/locales' -import { initComponentAdapter } from './adapter/component'; -import { initSetupVbenForm } from './adapter/form'; -import App from './app.vue'; -import { router } from './router'; +import { initComponentAdapter } from './adapter/component' +import { initSetupVbenForm } from './adapter/form' +import App from './app.vue' +import { router } from './router' +import { initWebSocket } from '#/api/websocket' async function bootstrap(namespace: string) { // 初始化组件适配器 - await initComponentAdapter(); + await initComponentAdapter() // 初始化表单组件 - await initSetupVbenForm(); + await initSetupVbenForm() // // 设置弹窗的默认配置 // setDefaultModalProps({ @@ -35,49 +36,53 @@ async function bootstrap(namespace: string) { // zIndex: 1020, // }); - const app = createApp(App); + + const app = createApp(App) // 全局组件 - setupGlobalComponent(app); + setupGlobalComponent(app) // 注册v-loading指令 registerLoadingDirective(app, { loading: 'loading', // 在这里可以自定义指令名称,也可以明确提供false表示不注册这个指令 spinning: 'spinning', - }); + }) // 国际化 i18n 配置 - await setupI18n(app); + await setupI18n(app) // 配置 pinia-tore - await initStores(app, { namespace }); + await initStores(app, { namespace }) + + // 初始化WebSocket + initWebSocket() // 安装权限指令 - registerAccessDirective(app); + registerAccessDirective(app) // 初始化 tippy - const { initTippy } = await import('@vben/common-ui/es/tippy'); - initTippy(app); + const { initTippy } = await import('@vben/common-ui/es/tippy') + initTippy(app) // 配置路由及路由守卫 - app.use(router); + app.use(router) // 配置Motion插件 - const { MotionPlugin } = await import('@vben/plugins/motion'); - app.use(MotionPlugin); + const { MotionPlugin } = await import('@vben/plugins/motion') + app.use(MotionPlugin) // 动态更新标题 watchEffect(() => { if (preferences.app.dynamicTitle) { - const routeTitle = router.currentRoute.value.meta?.title; + const routeTitle = router.currentRoute.value.meta?.title const pageTitle = - (routeTitle ? `${$t(routeTitle)} - ` : '') + preferences.app.name; - useTitle(pageTitle); + (routeTitle ? `${$t(routeTitle)} - ` : '') + preferences.app.name + useTitle(pageTitle) } - }); + }) - app.mount('#app'); + app.mount('#app') } -export { bootstrap }; +export { bootstrap } diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue index c4a2fef2..4b6b1c7d 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue @@ -1,13 +1,44 @@ - -
+
+ +
- + + diff --git a/apps/web-antd/src/views/sis/video/index.vue b/apps/web-antd/src/views/sis/video/index.vue index 57206b85..71e99079 100644 --- a/apps/web-antd/src/views/sis/video/index.vue +++ b/apps/web-antd/src/views/sis/video/index.vue @@ -1,9 +1,15 @@ diff --git a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/data.ts b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/data.ts index d9a81d28..b6513a58 100644 --- a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/data.ts +++ b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/data.ts @@ -22,7 +22,7 @@ export const querySchema: FormSchemaGetter = () => [ options: getDictOptions(DictEnum.alarm_level, true), }, fieldName: 'level', - label: '级别', + label: '预警级别', }, /*{ component: 'Select', @@ -46,7 +46,7 @@ export const columns: VxeGridProps['columns'] = [ field: 'reportTime', }, { - title: '设备ip', + title: '设备IP', field: 'deviceIp', }, { @@ -54,7 +54,7 @@ export const columns: VxeGridProps['columns'] = [ field: 'deviceName', }, { - title: '级别', + title: '预警级别', field: 'level', slots: { default: ({ row }: any) => { @@ -139,7 +139,7 @@ export const modalSchema: FormSchemaGetter = () => [ disabled: true, }, { - label: '设备名称', + label: '设备IP', fieldName: 'deviceIp', component: 'Input', disabled: true, @@ -153,7 +153,7 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'required', }, { - label: '重要级别', + label: '预警级别', fieldName: 'level', component: 'Select', disabled: true, @@ -186,7 +186,7 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'selectRequired', }, { - label: '描述', + label: '预警描述', disabled: true, fieldName: 'description', component: 'Textarea', @@ -196,6 +196,19 @@ export const modalSchema: FormSchemaGetter = () => [ }, }, + + // 插入分割线 + { + component: 'Divider', + fieldName: '_divider', + formItemClass: 'col-span-2', + hideLabel: true, + renderComponentContent: () => { + return { + default: () => h('div', '处理'), + }; + }, + }, { label: '处理人', fieldName: 'solveName', @@ -212,19 +225,6 @@ export const modalSchema: FormSchemaGetter = () => [ fieldName: 'solveEmail', component: 'Input', }, - // 插入分割线 - { - component: 'Divider', - fieldName: '_divider', - formItemClass: 'col-span-2', - hideLabel: true, - renderComponentContent: () => { - return { - default: () => h('div', '处理'), - }; - }, - }, - { label: '备注', fieldName: 'remark', diff --git a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/warning-detail.vue b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/warning-detail.vue index dc0fa3eb..112bd749 100644 --- a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/warning-detail.vue +++ b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningToDone/warning-detail.vue @@ -70,15 +70,23 @@ function loadProcessList() { :labelStyle="{ width: '120px' }" style="margin-bottom: 30px" > - + {{ warningDetail.id }} - - - {{ warningDetail.reportTime }} + + {{ warningDetail.bigTypeName + ' - ' + warningDetail.smallTypeName }} + + {{ warningDetail.deviceIp }} - + {{ warningDetail.deviceName }} + + + {{ warningDetail.deviceName }} + + - {{ warningDetail.bigTypeName + ' - ' + warningDetail.smallTypeName }} + + {{ warningDetail.reportTime }} - - {{ warningDetail.deviceIp }} - - - {{ warningDetail.deviceName }} - - - + {{ warningDetail.description }} - - - {{ warningDetail.deviceName }} - - - +
Date: Thu, 4 Sep 2025 17:02:24 +0800 Subject: [PATCH 15/30] feat --- .../property/building/building-modal.vue | 2 +- .../src/views/property/building/data.tsx | 46 ++++++++ .../web-antd/src/views/property/floor/data.ts | 50 ++++++++ .../src/views/property/floor/floor-modal.vue | 6 +- .../src/views/property/room/floor-tree.vue | 4 +- .../src/views/property/room/index.vue | 108 +++++++++--------- 6 files changed, 154 insertions(+), 62 deletions(-) diff --git a/apps/web-antd/src/views/property/building/building-modal.vue b/apps/web-antd/src/views/property/building/building-modal.vue index 0f56dc1a..366bd7c5 100644 --- a/apps/web-antd/src/views/property/building/building-modal.vue +++ b/apps/web-antd/src/views/property/building/building-modal.vue @@ -23,7 +23,7 @@ const [BasicForm, formApi] = useVbenForm({ // 默认占满两列 formItemClass: 'col-span-1', // 默认label宽度 px - labelWidth: 80, + labelWidth: 90, // 通用配置项 会影响到所有表单项 componentProps: { class: 'w-full', diff --git a/apps/web-antd/src/views/property/building/data.tsx b/apps/web-antd/src/views/property/building/data.tsx index 289e1d1b..cd610bad 100644 --- a/apps/web-antd/src/views/property/building/data.tsx +++ b/apps/web-antd/src/views/property/building/data.tsx @@ -49,6 +49,10 @@ export const columns: VxeGridProps['columns'] = [ title: '建筑名称', field: 'buildingName', }, + { + title: '社区', + field: 'communityText', + }, { title: '总层数', field: 'floorCount', @@ -73,6 +77,18 @@ export const columns: VxeGridProps['columns'] = [ title: '地址', field: 'addr', }, + { + title: '建筑面积(㎡)', + field: 'area', + }, + { + title: '套内面积(㎡)', + field: 'insideInArea', + }, + { + title: '公摊面积(㎡)', + field: 'sharedArea', + }, { field: 'action', fixed: 'right', @@ -153,4 +169,34 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Input', rules: 'required', }, + { + label: '建筑面积(㎡)', + fieldName: 'area', + component: 'InputNumber', + componentProps: { + min:0, + precision:2, + }, + rules: 'required', + }, + { + label: '套内面积(㎡)', + fieldName: 'insideInArea', + component: 'InputNumber', + componentProps: { + min:0, + precision:2, + }, + rules: 'required', + }, + { + label: '公摊面积(㎡)', + fieldName: 'sharedArea', + component: 'InputNumber', + componentProps: { + min:0, + precision:2, + }, + rules: 'required', + }, ]; diff --git a/apps/web-antd/src/views/property/floor/data.ts b/apps/web-antd/src/views/property/floor/data.ts index 59ba46b7..aa09282a 100644 --- a/apps/web-antd/src/views/property/floor/data.ts +++ b/apps/web-antd/src/views/property/floor/data.ts @@ -13,6 +13,14 @@ export const querySchema: FormSchemaGetter = () => [ // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, + { + title: '社区', + field: 'communityText', + }, + { + title: '建筑', + field: 'buildingText', + }, { title: '楼层名称', field: 'floorName', @@ -33,6 +41,18 @@ export const columns: VxeGridProps['columns'] = [ title: '层高', field: 'floorHeight', }, + { + title: '建筑面积(㎡)', + field: 'area', + }, + { + title: '套内面积(㎡)', + field: 'insideInArea', + }, + { + title: '公摊面积(㎡)', + field: 'sharedArea', + }, { field: 'action', fixed: 'right', @@ -95,4 +115,34 @@ export const modalSchema: FormSchemaGetter = () => [ precision:0, }, }, + { + label: '建筑面积(㎡)', + fieldName: 'area', + component: 'InputNumber', + componentProps: { + min:0, + precision:2, + }, + rules: 'required', + }, + { + label: '套内面积(㎡)', + fieldName: 'insideInArea', + component: 'InputNumber', + componentProps: { + min:0, + precision:2, + }, + rules: 'required', + }, + { + label: '公摊面积(㎡)', + fieldName: 'sharedArea', + component: 'InputNumber', + componentProps: { + min:0, + precision:2, + }, + rules: 'required', + }, ]; diff --git a/apps/web-antd/src/views/property/floor/floor-modal.vue b/apps/web-antd/src/views/property/floor/floor-modal.vue index 5fc17d33..072bec45 100644 --- a/apps/web-antd/src/views/property/floor/floor-modal.vue +++ b/apps/web-antd/src/views/property/floor/floor-modal.vue @@ -22,9 +22,9 @@ const title = computed(() => { const [BasicForm, formApi] = useVbenForm({ commonConfig: { // 默认占满两列 - formItemClass: 'col-span-2', + formItemClass: 'col-span-1', // 默认label宽度 px - labelWidth: 80, + labelWidth: 90, // 通用配置项 会影响到所有表单项 componentProps: { class: 'w-full', @@ -44,7 +44,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff( const [BasicModal, modalApi] = useVbenModal({ // 在这里更改宽度 - class: 'w-[550px]', + class: 'w-[60%]', fullscreenButton: false, onBeforeClose, onClosed: handleClosed, diff --git a/apps/web-antd/src/views/property/room/floor-tree.vue b/apps/web-antd/src/views/property/room/floor-tree.vue index 5eca1902..75982f16 100644 --- a/apps/web-antd/src/views/property/room/floor-tree.vue +++ b/apps/web-antd/src/views/property/room/floor-tree.vue @@ -4,7 +4,7 @@ import type { DeptTree } from '#/api/system/user/model'; import { onMounted, ref } from 'vue'; import { SyncOutlined } from '@ant-design/icons-vue'; import { Empty, InputSearch, Skeleton, Tree } from 'ant-design-vue'; -import { getDeptTree } from '#/api/system/user'; +import { communityTree } from '#/api/property/community'; defineOptions({ inheritAttrs: false }); @@ -41,7 +41,7 @@ async function loadTree() { showTreeSkeleton.value = true; searchValue.value = ''; selectDeptId.value = []; - const ret = await getDeptTree(); + const ret = await communityTree(3); deptTreeArray.value = ret; showTreeSkeleton.value = false; } diff --git a/apps/web-antd/src/views/property/room/index.vue b/apps/web-antd/src/views/property/room/index.vue index 6cf9d254..6d62e994 100644 --- a/apps/web-antd/src/views/property/room/index.vue +++ b/apps/web-antd/src/views/property/room/index.vue @@ -120,65 +120,61 @@ function handleDownloadExcel() { From 6935372fad8df7aa7b6f3cd0f801b2405afc8638 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Thu, 4 Sep 2025 17:14:47 +0800 Subject: [PATCH 16/30] =?UTF-8?q?feat(electricEnergy):=20=E7=94=B5?= =?UTF-8?q?=E8=83=BD=E8=B6=8B=E5=8A=BF=E5=9B=BE=E8=A1=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B9=B3=E5=9D=87=E5=80=BC=E6=A0=87=E8=AE=B0=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../electricEnergy/electricTrend/index.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/electricTrend/index.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/electricTrend/index.vue index 37d2ba4c..50fd77c2 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/electricTrend/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/electricTrend/index.vue @@ -266,6 +266,9 @@ async function handleSelectFloor(selectedKeys, info) { { type: 'min', name: 'Min' }, ], }, + markLine: { + data: [{ type: 'average', name: 'Avg' }], + }, }, { name: '当日', @@ -277,6 +280,9 @@ async function handleSelectFloor(selectedKeys, info) { { type: 'min', name: 'Min' }, ], }, + markLine: { + data: [{ type: 'average', name: 'Avg' }], + }, }, ], }); @@ -297,6 +303,9 @@ async function handleSelectFloor(selectedKeys, info) { { type: 'min', name: 'Min' }, ], }, + markLine: { + data: [{ type: 'average', name: 'Avg' }], + }, }, { name: '当月', @@ -308,6 +317,9 @@ async function handleSelectFloor(selectedKeys, info) { { type: 'min', name: 'Min' }, ], }, + markLine: { + data: [{ type: 'average', name: 'Avg' }], + }, }, ], }); @@ -328,6 +340,9 @@ async function handleSelectFloor(selectedKeys, info) { { type: 'min', name: 'Min' }, ], }, + markLine: { + data: [{ type: 'average', name: 'Avg' }], + }, }, { name: '当年', @@ -339,6 +354,9 @@ async function handleSelectFloor(selectedKeys, info) { { type: 'min', name: 'Min' }, ], }, + markLine: { + data: [{ type: 'average', name: 'Avg' }], + }, }, ], }); From 5c4f2e6588b21b2ddef39f9ad008349f93a67702 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Thu, 4 Sep 2025 17:16:01 +0800 Subject: [PATCH 17/30] build(web-antd): 1 --- apps/web-antd/vite.config.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index ded7ff75..7e884500 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -27,7 +27,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), // mock代理目标地址 - target: 'http://192.168.1.110:8080', + target: 'http://localhost:8080', ws: true, }, }, From 724cb63fc8989a5f147beb064952db0f8874c271 Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Fri, 5 Sep 2025 14:20:28 +0800 Subject: [PATCH 18/30] feat --- .../visitorManagement/visitorInvitation/data.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web-antd/src/views/property/visitorManagement/visitorInvitation/data.ts b/apps/web-antd/src/views/property/visitorManagement/visitorInvitation/data.ts index bd41b8cc..9d223ff3 100644 --- a/apps/web-antd/src/views/property/visitorManagement/visitorInvitation/data.ts +++ b/apps/web-antd/src/views/property/visitorManagement/visitorInvitation/data.ts @@ -2,7 +2,7 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; import {renderDict} from "#/utils/render"; -import {personList} from '#/api/property/resident/person' +import {resident_unitList,} from '#/api/property/resident/unit'; export const querySchema: FormSchemaGetter = () => [ { @@ -138,7 +138,7 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'required', }, { - label: '所属公司', + label: '所属单位', fieldName: 'visitorUnit', component: 'Input', rules: 'required', @@ -160,10 +160,10 @@ export const modalSchema: FormSchemaGetter = () => [ fieldName: 'interviewedUnit', component: 'ApiSelect', componentProps: { - api: personList, + api: resident_unitList, resultField: 'rows', - labelField: 'unitName', - valueField: 'unitName', + labelField: 'name', + valueField: 'name', placeholder: '请选择邀约单位', }, rules: 'required', From c4ff58e6f4d46d4d957e06b9e9afec422bd68f14 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Fri, 5 Sep 2025 14:27:16 +0800 Subject: [PATCH 19/30] =?UTF-8?q?feat:=E4=BC=9A=E8=AE=AE=E5=AE=A4=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=B7=BB=E5=8A=A0=E4=BF=9D=E5=AF=86=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roomBooking/conferenceSettings/model.d.ts | 14 ++++++++----- .../customerService/feedbacks/data.ts | 13 ++++-------- .../feedbacks/feedbacks-modal.vue | 21 +++++++++++++++++++ .../web-antd/src/views/property/floor/data.ts | 9 ++++---- .../conferenceSettings-detail.vue | 7 ++++++- .../roomBooking/conferenceSettings/data.ts | 21 ++++++++++++++++++- 6 files changed, 65 insertions(+), 20 deletions(-) diff --git a/apps/web-antd/src/api/property/roomBooking/conferenceSettings/model.d.ts b/apps/web-antd/src/api/property/roomBooking/conferenceSettings/model.d.ts index 11d1e48a..91d61285 100644 --- a/apps/web-antd/src/api/property/roomBooking/conferenceSettings/model.d.ts +++ b/apps/web-antd/src/api/property/roomBooking/conferenceSettings/model.d.ts @@ -1,4 +1,4 @@ -import type { PageQuery, BaseEntity } from '#/api/common'; +import type {PageQuery, BaseEntity} from '#/api/common'; export interface MeetVO { /** @@ -90,6 +90,10 @@ export interface MeetVO { * 负责人 */ principalsName: string; + /** + * 保密等级 + */ + secrecyGrade: string; } export interface MeetForm extends BaseEntity { @@ -236,8 +240,8 @@ export interface MeetQuery extends PageQuery { searchValue?: string; /** - * 日期范围参数 - */ + * 日期范围参数 + */ params?: any; /** @@ -274,7 +278,7 @@ export interface MeetQuery extends PageQuery { picture: string; } -export interface ConferenceSettingsDetail{ +export interface ConferenceSettingsDetail { /** * 主键 */ @@ -375,7 +379,7 @@ export interface ConferenceSettingsDetail{ } -export interface MeetBo{ +export interface MeetBo { /** * 会议室名称 */ diff --git a/apps/web-antd/src/views/property/customerService/feedbacks/data.ts b/apps/web-antd/src/views/property/customerService/feedbacks/data.ts index 498dafa9..a08554c2 100644 --- a/apps/web-antd/src/views/property/customerService/feedbacks/data.ts +++ b/apps/web-antd/src/views/property/customerService/feedbacks/data.ts @@ -63,11 +63,6 @@ export const columns: VxeGridProps['columns'] = [ }, width:120 }, - { - title: '客服电话', - field: 'serviceName', - width:120 - }, { field: 'action', fixed: 'right', @@ -122,10 +117,10 @@ export const modalSchema: FormSchemaGetter = () => [ }, }, { - label: '客服电话', - fieldName: 'serviceName', - component: 'Input', - rules: 'required', + label: '反馈单位', + fieldName: 'feedbackUnit', + component: 'Select', + rules: 'selectRequired', }, { label: '反馈内容', diff --git a/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue b/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue index 431632c8..42250385 100644 --- a/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue +++ b/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue @@ -18,6 +18,7 @@ import type {FeedbacksVO} from "#/api/property/customerService/feedbacks/model"; import { workOrdersTypeTree } from "#/api/property/businessManagement/workOrdersType"; +import {resident_unitList} from "#/api/property/resident/unit"; const emit = defineEmits<{ reload: [] }>(); @@ -66,6 +67,7 @@ const [BasicModal, modalApi] = useVbenModal({ const {id} = modalApi.getData() as { id?: number | string }; isUpdate.value = !!id; await initWorkOrderTypeOption() + await initUnitOption() if (isUpdate.value && id) { const record = await feedbacksInfo(id); detail.value = record @@ -127,6 +129,25 @@ async function initWorkOrderTypeOption() { ]); } +async function initUnitOption() { + let params = { + pageSize: 1000, + pageNum: 1 + } + const res = await resident_unitList(params) + formApi.updateSchema([{ + componentProps: () => ({ + options: res.rows, + //开启搜索 + showSearch: true, + //数据过滤字段 + optionFilterProp: 'name', + //下拉显示字段 + fieldNames: {label: 'name', value: 'id'}, + }), + fieldName: 'feedbackUnit', + }]) +}