diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index 708c970..edae9fa 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -35,4 +35,11 @@ export enum quickCalculation { // 碳排管理-碳排统计接口 export enum carbonEmission { carbonEmissionStatistics = '/carbon-smart/api/carbon/energy/correlation/carbonEmissionStatistics', +} +// 碳盘查接口 +export enum carbonInventoryCheck { + carbonInventoryList = '/carbon-smart/api/carbon/report/carbonInventoryList', + createOrUpdate = '/carbon-smart/api/carbon/report/createOrUpdate', + findById = '/carbon-smart/api/carbon/report/findById', + delete = '/carbon-smart/api/carbon/report/delete', } \ No newline at end of file diff --git a/hx-ai-intelligent/src/components/ns-steps.vue b/hx-ai-intelligent/src/components/ns-steps.vue index d55f6fd..9903135 100644 --- a/hx-ai-intelligent/src/components/ns-steps.vue +++ b/hx-ai-intelligent/src/components/ns-steps.vue @@ -3,40 +3,17 @@ diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/notificationManagementMock.json b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/notificationManagementMock.json new file mode 100644 index 0000000..6f442ed --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/notificationManagementMock.json @@ -0,0 +1,108 @@ +{ + "listData":[ + { + "id": "d4", + "isDel": "0", + "officesId": "84", + "deviceCode": "37430200143", + "deviceName": "地听测试电表", + "category": "1", + "type": "1001", + "energyCount": "1", + "serialNumber": "69", + "pidCode": null, + "brand": "", + "types": "", + "manufacturer": "elit non in", + "contacts": "ad reprehenderit", + "phonenumber": "34", + "position": "in esse commodo1", + "activeState": "1", + "measurementDirection": "1", + "deviceMagnification": 62, + "deviceAccuracy": "89", + "frequency": "anim consequat irure", + "standardFrequency": "ut elit", + "deviceHead": "pariatur ex velit", + "constructor": "84566", + "voltageType": "cillum aliquip reprehenderit", + "pt": 61, + "ct": 64, + "communicationProtocol": "cupidatat nisi ea ad", + "ip": "", + "port": "", + "com": "", + "slaveAddress": "", + "dlt": "", + "conversionIdentifier": "48", + "multiplicationAdjustment": "1", + "accessMethod": "1", + "replacementFrequency": "0", + "dataDetail": "sit", + "insertTime": null, + "children": null, + "devicePointList": null, + "insertUser": null, + "priority": "1", + "alarmTitle": "电压异常告警", + "errorCode": "A001", + "monitorTime":"1", + "repetitions":"1", + "monitorTimeUnit": "分", + "enableRules": "1", + "isUse":true + } , { + "id": "d5", + "isDel": "0", + "officesId": "84", + "deviceCode": "37430200143", + "deviceName": "地听测试电表", + "category": "1", + "type": "1001", + "energyCount": "1", + "serialNumber": "69", + "pidCode": null, + "brand": "", + "types": "", + "manufacturer": "elit non in", + "contacts": "ad reprehenderit", + "phonenumber": "34", + "position": "in esse commodo2", + "activeState": "1", + "measurementDirection": "1", + "deviceMagnification": 62, + "deviceAccuracy": "89", + "frequency": "anim consequat irure", + "standardFrequency": "ut elit", + "deviceHead": "pariatur ex velit", + "constructor": "84566", + "voltageType": "cillum aliquip reprehenderit", + "pt": 61, + "ct": 64, + "communicationProtocol": "cupidatat nisi ea ad", + "ip": "", + "port": "", + "com": "", + "slaveAddress": "", + "dlt": "", + "conversionIdentifier": "48", + "multiplicationAdjustment": "1", + "accessMethod": "1", + "replacementFrequency": "0", + "dataDetail": "sit", + "insertTime": null, + "children": null, + "devicePointList": null, + "insertUser": null, + "priority": "1", + "alarmTitle": "电压异常告警", + "errorCode": "A001", + "monitorTime":"1", + "repetitions":"1", + "monitorTimeUnit": "分", + "enableRules": "0", + "isUse":true + } + ] + +} \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue new file mode 100644 index 0000000..c6e1687 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue @@ -0,0 +1,124 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts new file mode 100644 index 0000000..03ca249 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts @@ -0,0 +1,158 @@ +import { dateUtil } from '/nerv-lib/util/date-util'; +import data from '../notificationManagementMock.json'; +import { http } from '/nerv-lib/util'; +import { ref } from 'vue'; +const tableKeyMap = [ + { + title: '序号', + dataIndex: 'address', + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '告警编号', + dataIndex: 'id', + }, + { + title: '告警描述', + dataIndex: 'deviceCode', + }, + { + title: '优先级', + dataIndex: 'deviceName', + }, + { + title: '状态', + dataIndex: 'position', + }, + { + title: '错误码', + dataIndex: 'position', + textEllipsis: true, + }, + { + title: '设备信息', + dataIndex: 'position', + }, + { + title: '更新时间', + dataIndex: 'enableRules', + }, + { + title: '断网时长', + dataIndex: 'enableRules', + }, +]; +const mockData = ref(data.listData); +export const notificationtableConfig = (look: any, status: any) => { + return { + title: '告警记录', + // api: '/carbon_emission/device/getDeviceList', + value: mockData.value, + headerActions: [{}], + columns: tableKeyMap, + // rowSelection: null, 选择按钮 + columnActions: { + title: '操作', + actions: [ + { + label: '详情', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + console.log(look.value); + look.value.toggle(data); + }, + }, + { + label: '状态', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + status.value.toggle(data); + }, + }, + ], + }, + + formConfig: { + schemas: [ + { + field: 'name', + label: '告警类型', + component: 'NsSelect', + defaultValue: '2', + componentProps: { + placeholder: '请选择告警优先级', + disabled: true, + options: [ + { + label: '紧急', + value: '1', + }, + { + label: '重要', + value: '2', + }, + { + label: '一般', + value: '3', + }, + ], + }, + }, + { + field: 'provider', + label: '状态', + component: 'NsSelect', + componentProps: { + placeholder: '请选择状态', + options: [ + { + label: '待处理', + value: '1', + }, + { + label: '处理中', + value: '2', + }, + { + label: '已完成', + value: '3', + }, + { + label: '超时', + value: '4', + }, + { + label: '关闭', + value: '5', + }, + ], + }, + }, + { + field: 'provider', + label: '错误码', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警错误码', + }, + }, + { + field: 'createTime', + label: '生产日期', + component: 'NsRangePicker', + fieldMap: ['manufactureBeginDate', 'manufactureEndDate'], + componentProps: { + valueFormat: 'YYYY-MM-DD', + placeholder: ['开始日期', '结束日期'], + }, + }, + ], + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'id', + }; +}; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index 3bb69b9..8925bca 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -5,7 +5,7 @@
-
排放分类
+
排放分类
@@ -562,6 +562,7 @@ }); opMap.value.fuc = (formData: any) => { formData.emissionType = formData.emissionType[formData.emissionType.length - 1] + debugger return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => { mainRef.value?.nsTableRef.reload(); visible.value = false; @@ -665,14 +666,22 @@ handle: (record: any) => { userAuthList.value.splice(0); setTimeout(() => { - console.log(record.id); - - http.post(carbonEmissionFactorLibrary.findById,{ id: record.id } ).then((res) => { - formData.value = res.data; + const measurementUnit = ref([]) + http.post(carbonEmissionFactorLibrary.getCarbonFactorTree,{}).then((res) => { + measurementUnit.value = res.data + http.post(carbonEmissionFactorLibrary.findById,{ id: record.id } ).then((res) => { + if (res.data.emissionType) { + let selectDevice = ref([Number(res.data.emissionType)]); + findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value); + res.data.emissionType = selectDevice + } + formData.value = res.data; + }); }); }, 10); opMap.value.type = 'edit'; opMap.value.fuc = (formData: any) => { + formData.emissionType = formData.emissionType[formData.emissionType.length - 1] return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => { mainRef.value?.nsTableRef.reload(); visible.value = false; @@ -790,6 +799,27 @@ // pagination: { defaultPageSize: 10 }, rowKey: 'id', }); + function findParentIds(tree: any, targetId: number, result: any) { + for (let item of tree) { + if (item.children && item.children.length > 0) { + if (item.children.some((child: any) => child.id === Number(targetId))) { + result.unshift(item.id); // 将当前节点的id添加到结果数组的最前面 + findParentIds(tree, item.id, result); // 递归查找父级节点的id + break; // 找到后可以退出循环 + }else{ + for(let childsItem of item.children){ + if(childsItem.children && childsItem.children.length > 0){ + if (childsItem.children.some((child: any) => child.id === Number(targetId))) { + result.unshift(childsItem.id); // 将当前节点的id添加到结果数组的最前面 + findParentIds(tree, childsItem.id, result); // 递归查找父级节点的id + break; // 找到后可以退出循环 + } + } + } + } + } + } + } // 单位管理 const unitExpandedKeys = ref(); @@ -977,6 +1007,26 @@ padding-bottom: 10px; border-bottom: 1px solid #e9e9e9; } + .title{ + text-align: left; + height: 32px; + line-height: 32px; + font-weight: bold; + user-select: text; + position: relative; + padding-left: 9px; + } + .title::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: 13px; + width: 3px; + border-radius: 1px; + background-color: #2778FF; + } .treeRow { display: flex; justify-content: space-between; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue index c4a1582..4978f78 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue @@ -363,9 +363,11 @@ getDictList() visible.value = true fetch(energyConsumption.findById , {id : record.id }).then((res) => { - // if(res.data.unit){ - // res.data.unit = res.data.unit.split(',') - // } + if (res.data.unit) { + let selectDevice = ref([Number(res.data.unit)]); + findParentIds(measurementUnit.value, res.data.unit, selectDevice.value); + res.data.unit = selectDevice + } formState.value = res.data }); }, @@ -398,6 +400,18 @@ }, rowKey: 'id', }); + // 定义一个递归函数来查找每一级的id 设备类型回显 层级方法 + function findParentIds(tree: any, targetId: number, result: any) { + for (let item of tree) { + if (item.children && item.children.length > 0) { + if (item.children.some((child: any) => child.value === targetId)) { + result.unshift(item.value); // 将当前节点的id添加到结果数组的最前面 + findParentIds(tree, item.value, result); // 递归查找父级节点的id + break; // 找到后可以退出循环 + } + } + } + } // 获取表格数据 const getTableList = () => { fetch(energyConsumption.pageList , queryParams.value).then((res) => { @@ -473,6 +487,7 @@ label: child.cnValue })) : [] })); + debugger }); // 获取自动采集节点的数据 fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE',orgId: orgId.value }).then((res) => { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue index 602471f..a43aa27 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue @@ -3,7 +3,7 @@
-
因子分类
+
因子分类
@@ -507,6 +507,26 @@ padding-bottom: 10px; border-bottom: 1px solid #e9e9e9; } + .title{ + text-align: left; + height: 32px; + line-height: 32px; + font-weight: bold; + user-select: text; + position: relative; + padding-left: 9px; + } + .title::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: 13px; + width: 3px; + border-radius: 1px; + background-color: #2778FF; + } ::v-deep .ant-table-title{ display: flex; height: 100%; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue index eb62cd7..33f731f 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue @@ -1,10 +1,406 @@ \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue index 89ff479..807cb39 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue @@ -5,7 +5,7 @@
- +
- - + + - - + + - - + + - - - - {{ item.cnValue }} - + + + 年度 + 月度 - - + +