From 1ef3d9a4e18748ebce79e036a938dcb2c348aa70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyu=E2=80=9D?= <“winebunny@163.com”> Date: Sun, 14 Jul 2024 23:48:41 +0800 Subject: [PATCH] u --- .../pages/CapacityAdjustmentPage/index.vue | 8 +++++--- src/views/pages/pvPage/index.vue | 4 +++- src/views/pages/pvPage/rateLine.vue | 18 +++++++++--------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/views/pages/CapacityAdjustmentPage/index.vue b/src/views/pages/CapacityAdjustmentPage/index.vue index 2ba5a48..d57ee40 100644 --- a/src/views/pages/CapacityAdjustmentPage/index.vue +++ b/src/views/pages/CapacityAdjustmentPage/index.vue @@ -123,7 +123,7 @@
@@ -462,7 +462,7 @@ interface RateDateInfo { let key2 = 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=========="); @@ -476,14 +476,16 @@ const getRateDate = (treeAreaId: string) => { if (res.data.result.length>0) { rateDate_cur = res?.data.result; + rateDate_curFlag.value=true // console.log(res, "res"); } else { // ElMessage({ - + // message: "", // type: "success", // plain: true, // }); + // alert(1) console.log('暂无数据负载率'); } diff --git a/src/views/pages/pvPage/index.vue b/src/views/pages/pvPage/index.vue index 75ce116..84e8895 100644 --- a/src/views/pages/pvPage/index.vue +++ b/src/views/pages/pvPage/index.vue @@ -153,7 +153,7 @@ {{ item.bname }}
--> - + @@ -268,6 +268,8 @@ const getpv = () => { pvApi({ mrid: '03DKX-24289' }).then(res => { console.log(res, 'respv') pvArr = res.data + console.log(pvArr, 'pvArr'); + if (pvArr.length > 0) { pvArrFlag.value = true } diff --git a/src/views/pages/pvPage/rateLine.vue b/src/views/pages/pvPage/rateLine.vue index 0682bc5..ffcb824 100644 --- a/src/views/pages/pvPage/rateLine.vue +++ b/src/views/pages/pvPage/rateLine.vue @@ -14,11 +14,11 @@ import { import transformFontSize from "@/hooks/transFormSize.ts"; import "echarts/lib/component/dataZoom"; onMounted(() => { - drawOneLine(); + drawOneLine(props.pvArr); }); -// const props = defineProps<{ -// cur_pvArr: any; -// }>(); +const props = defineProps<{ + pvArr: any; +}>(); // 获取echart挂载的DOM节点 const ThreeLine: any = ref(); @@ -26,7 +26,7 @@ const ThreeLine: any = ref(); // 获取当前组件实例 const { proxy }: any = getCurrentInstance(); -const drawOneLine = () => { +const drawOneLine = (arr:any) => { let myChart = proxy.$echarts.init(ThreeLine.value); myChart.clear(); @@ -100,8 +100,8 @@ const drawOneLine = () => { // return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1] // }, }, - data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"], - // data: (arr.map((rtime) => rtime?.timeStamp.slice(-8))), + // data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"], + data: (arr.map((rtime) => rtime?.timeStamp.slice(-5))), // data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"], @@ -157,9 +157,9 @@ const drawOneLine = () => { ]), }, }, - data: [20, 42, 41, 24, 40, 30, 10], + // data: [20, 42, 41, 24, 40, 30, 10], // data: arr.map((pvdata) => pvdata.p), - + data: arr.map((rload) => rload.p), }, // { // name: "短期预测功率",