From cc39495425b474e9faff17d495ee0752e50dc29c 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 23:21:29 +0800 Subject: [PATCH] u --- src/api/ajust/tree.ts | 8 ++++ src/views/commonPage/pvTree.vue | 12 ++++-- src/views/pages/pvPage/index.vue | 63 ++++++++++++++++++---------- src/views/pages/pvPage/powerLine.vue | 4 +- 4 files changed, 60 insertions(+), 27 deletions(-) diff --git a/src/api/ajust/tree.ts b/src/api/ajust/tree.ts index 6ac63b1..ec076e4 100644 --- a/src/api/ajust/tree.ts +++ b/src/api/ajust/tree.ts @@ -37,6 +37,14 @@ export function carTree_api(data: idInfo) { data }) } +// 设备树 充电站 +export function pvTree_api(data: idInfo) { + return request({ + url: '/api/wwpm/biz/v1/pv_tree', + method: 'POST', + data + }) +} diff --git a/src/views/commonPage/pvTree.vue b/src/views/commonPage/pvTree.vue index ca8c76c..10f564b 100644 --- a/src/views/commonPage/pvTree.vue +++ b/src/views/commonPage/pvTree.vue @@ -28,7 +28,7 @@ import { onMounted, ref, watch } from "vue"; import { ElTree } from "element-plus"; import treeDatas from "@/assets/json/tree-right2.json"; -import { treeT, treeSecond } from "@/api/ajust/tree"; +import { treeT, treeSecond,pvTree_api } from "@/api/ajust/tree"; // defineProps<{ // elec_list: EList[] @@ -105,7 +105,7 @@ const loadNode = async (node: any, resolve: any) => { // let res= await treeT({ // orgID: "8af8470a47aad8e20147aad92e400335", // }); - treeT({ + pvTree_api({ orgID: "8af8470a47aad8e20147aad92e400335", }).then((res) => { resolve(res.data); //默认加载第1层 @@ -176,12 +176,16 @@ const emits = defineEmits(["update-node-key"]); ////接收父组件的事件, // 点击树节点 // 处理选中target数据,最终得到由高层到底层的数组 const handleTargetInfo = (data: TreeData, node: any) => { + // console.log(1111111,node); + // targetInfo.resultArr = []; // handleTarget(e); // 利用设备中的信息调用接口 // --------- - if (node.level === 5) { - //点中第5层 为单个光伏时 去返回id到父组件 并让父组件获取可调资源的相关信息和表格 + // emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表 + + if (node.level === 6) { + //点中第4层 为单个光伏时 去返回id到父组件 并让父组件获取可调资源的相关信息和表格 emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表 } diff --git a/src/views/pages/pvPage/index.vue b/src/views/pages/pvPage/index.vue index 84e8895..1c1e503 100644 --- a/src/views/pages/pvPage/index.vue +++ b/src/views/pages/pvPage/index.vue @@ -27,7 +27,11 @@
- +
@@ -140,7 +144,11 @@
实时发电量曲线
- +
实时功率曲线
@@ -153,7 +161,7 @@ {{ item.bname }}
--> - + @@ -217,20 +225,32 @@ import timePvLine from "./timePvLine.vue"; import { useNow, useDateFormat } from "@vueuse/core"; import { id } from "element-plus/es/locale/index.mjs"; import { curpower_api } from "@/api/pvPage/pvApi"; -import { pvApi } from '@/api/Osp/svgApi' +import { pvApi } from "@/api/Osp/svgApi"; onMounted(() => { let Objinput = { orgID: "8af8470a47aad8e20147aad92e400335" }; //全部 获取光伏实时发电量 getCurves(Objinput); //获取城南的接口{orgID} - getpv() //光伏功率曲线 + let inputdata={ mrid: "03DKX-24289" } + getpv(inputdata); //光伏功率曲线 }); + +const getTreeNode = (treeNode: any) => { + let Objinput = { + orgID: "8af8470a47aad8e20147aad92e400335", + mrid: treeNode.key, + }; //全部 获取光伏实时发电量 + + getCurves(Objinput); //获取光伏的接口发电量 + let inputdata={ mrid: treeNode.key } + getpv(inputdata); +}; // 当日累计发电量 let total_cur = ref("0"); let power35kv = ref("0"); let power10kv = ref("0"); let power380V = ref("0"); -let cur_pvArrFlag=ref(false) -let cur_pvArr=reactive([]); +let cur_pvArrFlag = ref(false); +let cur_pvArr = reactive([]); // 获取光伏实时发电量 const getCurves = (datares: any) => { curpower_api(datares) @@ -252,29 +272,30 @@ const getCurves = (datares: any) => { } } // 发电量曲线 - if(res.data.data){ - cur_pvArrFlag.value=true - cur_pvArr=res.data.data; + if (res.data.data) { + cur_pvArrFlag.value = true; + cur_pvArr = res.data.data; } }) .catch((error) => { console.log(error); }); }; -let pvArr = reactive([]) //光伏 -let pvArrFlag = ref(false) +let pvArr = reactive([]); //光伏 +let pvArrFlag = ref(false); // 获取光伏功率曲线 -const getpv = () => { - pvApi({ mrid: '03DKX-24289' }).then(res => { - console.log(res, 'respv') - pvArr = res.data - console.log(pvArr, 'pvArr'); - +// let refreshkey=ref(1) +const getpv = (inputdata:any) => { + pvApi(inputdata).then((res) => { + console.log(res, "respv"); + pvArr = res.data; + console.log(pvArr, "pvArr"); + refreshkey.value+=1 if (pvArr.length > 0) { - pvArrFlag.value = true + pvArrFlag.value = true; } - }) -} + }); +}; const HMS = useDateFormat(useNow(), "HH:mm:ss"); //当前时间 const YMD = useDateFormat(useNow(), "YYYY-MM-DD"); //当前日期 diff --git a/src/views/pages/pvPage/powerLine.vue b/src/views/pages/pvPage/powerLine.vue index c0d76d7..adc0ebf 100644 --- a/src/views/pages/pvPage/powerLine.vue +++ b/src/views/pages/pvPage/powerLine.vue @@ -66,8 +66,8 @@ const drawOneLine = (arr: any) => { }, legend: { top: "5%", - // right: "5%", - // orient: "vertical", + right: "5%", + orient: "vertical", // data: ["实时发电量", "短期预测发电量", "超短期预测发电量"], data: ["实时发电量"],