From c5cf44a650b4351006ba1672619dcc02c9c28b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyu=E2=80=9D?= <“winebunny@163.com”> Date: Mon, 15 Jul 2024 21:22:06 +0800 Subject: [PATCH] u --- src/views/commonPage/pvTree.vue | 9 +- src/views/commonPage/tree.vue | 6 +- .../pages/CapacityAdjustmentPage/index.vue | 153 ++++++++++++++++-- src/views/pages/homePage/index.vue | 28 +--- 4 files changed, 152 insertions(+), 44 deletions(-) diff --git a/src/views/commonPage/pvTree.vue b/src/views/commonPage/pvTree.vue index acae0d2..ca8c76c 100644 --- a/src/views/commonPage/pvTree.vue +++ b/src/views/commonPage/pvTree.vue @@ -175,13 +175,16 @@ const emits = defineEmits(["update-node-key"]); ////接收父组件的事件, // 点击树节点 // 处理选中target数据,最终得到由高层到底层的数组 -const handleTargetInfo = (data: TreeData, e: any) => { +const handleTargetInfo = (data: TreeData, node: any) => { // targetInfo.resultArr = []; // handleTarget(e); // 利用设备中的信息调用接口 // --------- - //点中第4层 为台区时 去返回id到父组件 并让父组件获取可调资源的相关信息和表格 - // emits("update-node-key", node.key); //获取id,用于二级接口服务返回接口给可调资源列表 + if (node.level === 5) { + //点中第5层 为单个光伏时 去返回id到父组件 并让父组件获取可调资源的相关信息和表格 + emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表 + } + // --------- }; const handleTarget = (node: any) => { diff --git a/src/views/commonPage/tree.vue b/src/views/commonPage/tree.vue index 098f863..fae5da3 100644 --- a/src/views/commonPage/tree.vue +++ b/src/views/commonPage/tree.vue @@ -238,12 +238,14 @@ const handleTargetInfo = (data: TreeData, node: any) => { console.log("点击的节点",node); - if (node.level === 4) { + if (node.level === 4||node.level===3) { console.log(node.level,'0000',node.key); console.log("zheshishaya"); //点中第4层 为台区时 去返回id到父组件 并让父组件获取可调资源的相关信息和表格 - emits("update-node-key", node.key); //获取id,用于二级接口服务返回接口给可调资源列表 + // emits("update-node-key", node.key); //获取id,用于二级接口服务返回接口给可调资源列表 + emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表 + } }; const handleTarget = (node: any) => { diff --git a/src/views/pages/CapacityAdjustmentPage/index.vue b/src/views/pages/CapacityAdjustmentPage/index.vue index eb9246c..f044280 100644 --- a/src/views/pages/CapacityAdjustmentPage/index.vue +++ b/src/views/pages/CapacityAdjustmentPage/index.vue @@ -67,7 +67,99 @@ />能量调节 -
+ +
可调资源
@@ -122,9 +214,16 @@
+
@@ -166,10 +265,11 @@
+
@@ -379,6 +479,7 @@ import Ajust_strategy from "@/assets/json/Ajust_strategy.json"; import { sourcInfoApi } from "@/api/ajust/ajust.ts"; import { getSourceMapRange } from "typescript"; import { ITEM_RENDER_EVT } from "element-plus/es/components/virtual-list/src/defaults.mjs"; + // onMounted(async () => { // getRateDate(); //获取负载率 @@ -392,32 +493,53 @@ onMounted(() => { // console.log(result, "负载率"); getAllSourceAjust(); //可调资源 }); -// 统计获取可调资源信息 +let allFlag = ref(true); //全部接口才触发 +// 统计获取可调资源信息 参数只有orgID const getAllSourceAjust = () => { let datainput = { orgID: "8af8470a47aad8e20147aad92e400335", //默认城南地区得可调资源 }; sourcInfoApi(datainput).then((res) => { - // console.log(res, "可调资源"); - handelSourceTable(res.data); // tablepvData.value=res?.data }); }; +// 获取线路的可调资源 参数是orgID 和mrid +const getAllSourceAjust_Line = (mrid: string) => { + let datainput = { + orgID: "8af8470a47aad8e20147aad92e400335", //线路的可调资源 + mrid: mrid, + }; + + sourcInfoApi(datainput).then((res) => { + handelSourceTable(res.data); + // tablepvData.value=res?.data + }); +}; + let treeAreaId = ref(""); //点击设备树二级服务获取的台区id去获取台区负载率 -// 设备树传来的设备树节点id treeKey是id -const getTreeKey = (treeKey: any) => { - getTreeSourceList(treeKey); //可调资源 先从设备树获取到id 再调用二级服务去获取可调资源列表 - treeAreaId = treeKey; //台区的id +// 设备树传来的设备树节点id treeNode是节点数据 +const getTreeKey = (treeNode: any) => { + allFlag.value = false; + if (treeNode.level === 3) { + console.log(treeNode.level, "3"); + getAllSourceAjust_Line(treeNode.key); + getRateDate(treeNode.key); //获取负载率 点击设备树二级服务获取的台区id去获取台区负载率 + } else { + console.log(treeNode.level, "4"); //台区 + getTreeSourceList(treeNode.key); //可调资源 先从设备树获取到id 再调用二级服务去获取可调资源列表 + // treeAreaId = treeNode.key; //台区的id + getRateDate(treeNode.key); //获取负载率 点击设备树二级服务获取的台区id去获取台区负载率 + } // console.log(treeAreaId,'treeAreaId----------------------'); - getRateDate(treeKey); //获取负载率 点击设备树二级服务获取的台区id去获取台区负载率 }; // 可调资源数量以及是否可调 功能--- let pht = ref(0); //光伏 let cdz = ref(0); //充电桩 let batteryUnit = ref(0); //储能 + // 再次调用二级服务 去获取资源信息 const getTreeSourceList = async (id: string) => { // 调用接口 @@ -437,7 +559,6 @@ const getTreeSourceList = async (id: string) => { }; // 处理可调资源数量 功能--- const handelSourceTable = (sourceAjustObj: any) => { - sourceLArr.forEach((item) => { // 将返回数据的length赋值给数组对象 item.number = sourceAjustObj[item.type]?.length || 0; @@ -463,7 +584,6 @@ let sourceLArr = reactive([ ]); const handelSource = (type: string) => { - // 根据type类型获取表格数据 tablepvData.value = []; for (let i in sourceAjustObj[type]) { @@ -477,11 +597,14 @@ interface RateDateInfo { measValue?: string; dateTime?: string; } -let key2 = ref(2); +let keyechart = ref(2); let rateDate_cur = reactive([]); //当前的负载率 let rateDate_will = reactive([]); //预测负载率 let rateDate_curFlag = ref(false); const getRateDate = (treeAreaId: string) => { + + + // 定时15分钟获取接口数据 // console.log(treeAreaId, treeAreaId.value,"treeAreaId=========="); @@ -494,6 +617,7 @@ const getRateDate = (treeAreaId: string) => { if (res.data.result.length > 0) { rateDate_cur = res?.data.result; + keyechart.value++; rateDate_curFlag.value = true; // console.log(res, "res"); } else { @@ -1521,6 +1645,7 @@ const styleVar = computed(() => { font-size: changeHeight(32); } } + .source_list { height: changeHeight(421); // border: 1px solid red; diff --git a/src/views/pages/homePage/index.vue b/src/views/pages/homePage/index.vue index a954c3e..56bc5b3 100644 --- a/src/views/pages/homePage/index.vue +++ b/src/views/pages/homePage/index.vue @@ -393,36 +393,14 @@ alt="" />
+
-
35kV
- - -
-
-
- {{ Number(networkFeer35RatedS).toFixed(2) }} - km -
-
- {{ networkFeer35Count }} -
-
-
-
-
- -
10kV及以下
+
10kV
-
380V及以下
+
380V