diff --git a/hx-ai-intelligent/public/asset/file/carbonAssets.xlsx b/hx-ai-intelligent/public/asset/file/carbonAssets.xlsx index 200c364..7094ee0 100644 Binary files a/hx-ai-intelligent/public/asset/file/carbonAssets.xlsx and b/hx-ai-intelligent/public/asset/file/carbonAssets.xlsx differ diff --git a/hx-ai-intelligent/public/asset/file/energyConsumption.xlsx b/hx-ai-intelligent/public/asset/file/energyConsumption.xlsx index 2687e05..a9eae6e 100644 Binary files a/hx-ai-intelligent/public/asset/file/energyConsumption.xlsx and b/hx-ai-intelligent/public/asset/file/energyConsumption.xlsx differ diff --git a/hx-ai-intelligent/src/api/alarmManagement/energyAlarm.ts b/hx-ai-intelligent/src/api/alarmManagement/energyAlarm.ts index 27c755e..edcc40c 100644 --- a/hx-ai-intelligent/src/api/alarmManagement/energyAlarm.ts +++ b/hx-ai-intelligent/src/api/alarmManagement/energyAlarm.ts @@ -5,4 +5,5 @@ export enum energyAlarmApi { getCodeList = `${BASE_URL}/api/AlarmEnergyConsumptionLog/selectErrorCodeList `, //能碳告警 列表 getSelectAlarmEnergyConsumptionLogStatusProcess = `${BASE_URL}/api/AlarmEnergyConsumptionLogStatusProcess/selectAlarmEnergyConsumptionLogStatusProcess`, //能碳告警 状态 没有创建工单log接口 noCreatOrUpdateLog = `${BASE_URL}/api/AlarmEnergyConsumptionLogStatusProcess/creatOrUpdate`, //能碳告警 状态 没有创建工单 添加 修改状态log + getEnergyGraph = `${BASE_URL}/energy/trigger/getEnergyGraph`, //能碳告警 状态 echarts图 } diff --git a/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts b/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts index 8505e34..93b0130 100644 --- a/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts +++ b/hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts @@ -5,4 +5,5 @@ export enum equipmentAlarmApi { getCodeList = `${BASE_URL}/api/AlarmEquipmentLog/selectErrorCodeList`, //设备告警 列表 getSelectAlarmEquipmentLogStatusProcess = `${BASE_URL}/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess`, //设备告警 状态 没有创建工单log接口 noCreatOrUpdateLog = `${BASE_URL}/api/AlarmEquipmentLogStatusProcess/creatOrUpdate`, //设备告警 状态 没有创建工单 添加 修改状态log + getDeviceGraph = `${BASE_URL}/equipment/trigger/getDeviceGraph`, //设备告警 echats图 } diff --git a/hx-ai-intelligent/src/api/ventilatingSystem.ts b/hx-ai-intelligent/src/api/ventilatingSystem.ts index 153c0fb..1fee033 100644 --- a/hx-ai-intelligent/src/api/ventilatingSystem.ts +++ b/hx-ai-intelligent/src/api/ventilatingSystem.ts @@ -3,7 +3,7 @@ const prefix = '/carbon-smart/api'; // 通风系统相关接口 export enum ventilating { //传感器获取数据 - getSensorData = prefix + '/multiFuncSensorCtrl/getDeviceState', + getSensorData = prefix + '/sensorCtrl/getMultiFuncSensorState', // 排风扇相关 ============================================= // 获得排风扇系统的树形结构 getTree1 = prefix + '/ventilatingFanCtrl/getCtrlPanelTree', diff --git a/hx-ai-intelligent/src/router/equipmentControl.ts b/hx-ai-intelligent/src/router/equipmentControl.ts index 54d21d3..988ddc3 100644 --- a/hx-ai-intelligent/src/router/equipmentControl.ts +++ b/hx-ai-intelligent/src/router/equipmentControl.ts @@ -103,7 +103,7 @@ const equipmentControl = { { path: 'airConditionControlSystem', name: 'airConditionControlSystem', - meta: { title: '空调系统群控', hideChildren: true, icon: 'shebeiqunkong' }, + meta: { title: '空调系统', hideChildren: true, icon: 'shebeiqunkong' }, component: Base, redirect: { name: 'airConditionControlSystemIndex' }, children: [ @@ -112,13 +112,32 @@ const equipmentControl = { name: 'airConditionControlSystemIndex', component: () => import('/@/view/equipmentControl/airConditionControlSystem/index.vue'), meta: { - title: '空调系统群控', + title: '空调系统', keepAlive: false, // backApi: [], }, }, ], }, + // { + // path: 'waterSystem', + // name: 'waterSystem', + // meta: { title: '给排水系统', hideChildren: true, icon: 'shebeiqunkong' }, + // component: Base, + // redirect: { name: 'waternControlSystemIndex' }, + // children: [ + // { + // path: 'index', + // name: 'waternControlSystemIndex', + // component: () => import('/@/view/equipmentControl/waterSystem/index.vue'), + // meta: { + // title: '给排水系统', + // keepAlive: false, + // // backApi: [], + // }, + // }, + // ], + // }, { path: 'planToAdd', name: 'planToAdd', diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue index 819926a..06c603a 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue @@ -70,7 +70,7 @@ import { http } from '/nerv-lib/util'; //搜索存储 拼凑树的搜索类型 - const dataList: TreeProps['treeData'] = []; + let dataList: TreeProps['treeData'] = []; const generateList = (data: TreeProps['treeData']) => { for (let i = 0; i < data.length; i++) { const node = data[i]; @@ -84,19 +84,23 @@ const getParentKey = ( key: string | number, tree: TreeProps['treeData'], - ): string | number | undefined => { - let parentKey; - for (let i = 0; i < tree.length; i++) { - const node = tree[i]; + parents: (string | number)[] = [], + ): (string | number)[] | undefined => { + for (const node of tree) { if (node.children) { if (node.children.some((item) => item.key === key)) { - parentKey = node.key; - } else if (getParentKey(key, node.children)) { - parentKey = getParentKey(key, node.children); + // 找到目标节点的直接父节点 + return [...parents, node.key]; + } + + // 递归检查子节点的子节点 + const result = getParentKey(key, node.children, [...parents, node.key]); + if (result) { + return result; } } } - return parentKey; + return undefined; }; export default defineComponent({ setup(props, { emit }) { @@ -172,6 +176,7 @@ getDepartList({ orgId: orgId.value }).then((res) => { deptTreeData.value = res; selectedKeys.value = [orgId.value]; + dataList = []; generateList(deptTreeData.value); }); }; @@ -304,7 +309,11 @@ return null; }) .filter((item, i, self) => item && self.indexOf(item) === i); - expandedKeys.value = expanded; + let selctky = []; + expanded.forEach((item) => { + selctky.push(...item); + }); + expandedKeys.value = selctky; searchValue.value = value; autoExpandParent.value = true; }); diff --git a/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue b/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue index aba6333..9030fba 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue @@ -33,7 +33,7 @@ }} {{ infoObject.errorCode }} -
{{ infoObject.alarmTitle }}
+
{{ infoObject.alarmTitle }}
{{ infoObject.abnormalDescription }}
@@ -56,6 +56,9 @@ }); import { ref } from 'vue'; import * as echarts from 'echarts'; + import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm'; + import { http } from '/nerv-lib/util'; + import { message } from 'ant-design-vue'; let chartInstance: echarts.ECharts | null = null; const graphChart = ref(null); @@ -94,19 +97,21 @@ const toggle = (data: any) => { infoObject.value = data; visible.value = true; - setTimeout(() => { - getChatr(); - }, 500); + // setTimeout(() => { + // getChatr(); + // }, 500); + http.get(energyAlarmApi.getEnergyGraph, { logId: infoObject.value.id }).then((res: any) => { + if (res.msg === 'success') { + const data = res.data; + if (data.length > 0) { + getChatr(data[0]); + } + } else { + message.error(res.msg); + } + }); }; - const getChatr = () => { - let dayData = []; - let energyAlarm: any = []; - - // Extend data for 30 days - for (let i = 1; i < 30; i++) { - dayData.push(`3/${i}`); - energyAlarm.push(Math.floor(Math.random() * 250)); - } + const getChatr = (data) => { if (chartInstance) { chartInstance.dispose(); } @@ -182,7 +187,7 @@ return value; }, }, - data: dayData, + data: data.dateList, }, ], yAxis: [ @@ -342,7 +347,7 @@ shadowBlur: 20, }, }, - data: energyAlarm, + data: data.data, }, ], }; diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue index d2e9539..ec0de07 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue @@ -54,6 +54,9 @@ }); import { ref } from 'vue'; import * as echarts from 'echarts'; + import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm'; + import { http } from '/nerv-lib/util'; + import { message } from 'ant-design-vue'; let chartInstance: echarts.ECharts | null = null; const graphChart = ref(null); @@ -92,20 +95,23 @@ const toggle = (data: any) => { infoObject.value = data; visible.value = true; - setTimeout(() => { - //获取数据 echarts图展示 - getChatr(); - }, 500); + // setTimeout(() => { + // //获取数据 echarts图展示 + // getChatr(); + // }, 500); + http.get(equipmentAlarmApi.getDeviceGraph, { logId: infoObject.value.id }).then((res: any) => { + if (res.msg === 'success') { + console.log(res.data, '数据'); + const data = res.data; + if (data.length > 0) { + getChatr(data[0]); + } + } else { + message.error(res.msg); + } + }); }; - const getChatr = () => { - let dayData = []; - let energyAlarm: any = []; - - // Extend data for 30 days - for (let i = 1; i < 30; i++) { - dayData.push(`3/${i}`); - energyAlarm.push(Math.floor(Math.random() * 250)); - } + const getChatr = (data: any) => { if (chartInstance) { chartInstance.dispose(); } @@ -128,7 +134,7 @@ }, formatter: function (params: any) { let res = - params[0].marker + ' ' + params[0].seriesName + ' : ' + params[0].data + 'V'; + params[0].marker + ' ' + params[0].seriesName + ' : ' + params[0].data + 'V'; return res; }, }, @@ -182,7 +188,7 @@ return value; }, }, - data: dayData, + data: data.dateList, }, ], yAxis: [ @@ -342,7 +348,7 @@ shadowBlur: 20, }, }, - data: energyAlarm, + data: data.data, }, ], }; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue index d2c5c2e..0862a76 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue @@ -73,9 +73,10 @@