可调资源
@@ -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