“yu” 2024-07-14 23:48:41 +08:00
parent be606ff614
commit 1ef3d9a4e1
3 changed files with 17 additions and 13 deletions

View File

@ -123,7 +123,7 @@
<rateLine <rateLine
:rateDate="rateDate_cur" :rateDate="rateDate_cur"
:keysv="key2" :keysv="key2"
v-if="rateDate_cur" v-if="rateDate_curFlag"
></rateLine> ></rateLine>
</div> </div>
<div class="infotitle_box"> <div class="infotitle_box">
@ -462,7 +462,7 @@ interface RateDateInfo {
let key2 = ref<number>(2); let key2 = ref<number>(2);
let rateDate_cur = reactive<RateDateInfo[]>([]); // let rateDate_cur = reactive<RateDateInfo[]>([]); //
let rateDate_will = reactive<RateDateInfo[]>([]); // let rateDate_will = reactive<RateDateInfo[]>([]); //
let rateDate_curFlag=ref(false)
const getRateDate = (treeAreaId: string) => { const getRateDate = (treeAreaId: string) => {
// 15 // 15
// console.log(treeAreaId, treeAreaId.value,"treeAreaId=========="); // console.log(treeAreaId, treeAreaId.value,"treeAreaId==========");
@ -476,6 +476,7 @@ const getRateDate = (treeAreaId: string) => {
if (res.data.result.length>0) { if (res.data.result.length>0) {
rateDate_cur = res?.data.result; rateDate_cur = res?.data.result;
rateDate_curFlag.value=true
// console.log(res, "res"); // console.log(res, "res");
} else { } else {
// ElMessage({ // ElMessage({
@ -484,6 +485,7 @@ const getRateDate = (treeAreaId: string) => {
// type: "success", // type: "success",
// plain: true, // plain: true,
// }); // });
// alert(1)
console.log('暂无数据负载率'); console.log('暂无数据负载率');
} }

View File

@ -153,7 +153,7 @@
{{ item.bname }} {{ item.bname }}
</div> </div>
</div> --> </div> -->
<rateLine></rateLine> <rateLine :pvArr="pvArr" v-if="pvArrFlag"></rateLine>
</div> </div>
</div> </div>
</div> </div>
@ -268,6 +268,8 @@ const getpv = () => {
pvApi({ mrid: '03DKX-24289' }).then(res => { pvApi({ mrid: '03DKX-24289' }).then(res => {
console.log(res, 'respv') console.log(res, 'respv')
pvArr = res.data pvArr = res.data
console.log(pvArr, 'pvArr');
if (pvArr.length > 0) { if (pvArr.length > 0) {
pvArrFlag.value = true pvArrFlag.value = true
} }

View File

@ -14,11 +14,11 @@ import {
import transformFontSize from "@/hooks/transFormSize.ts"; import transformFontSize from "@/hooks/transFormSize.ts";
import "echarts/lib/component/dataZoom"; import "echarts/lib/component/dataZoom";
onMounted(() => { onMounted(() => {
drawOneLine(); drawOneLine(props.pvArr);
}); });
// const props = defineProps<{ const props = defineProps<{
// cur_pvArr: any; pvArr: any;
// }>(); }>();
// echartDOM // echartDOM
const ThreeLine: any = ref(); const ThreeLine: any = ref();
@ -26,7 +26,7 @@ const ThreeLine: any = ref();
// //
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
const drawOneLine = () => { const drawOneLine = (arr:any) => {
let myChart = proxy.$echarts.init(ThreeLine.value); let myChart = proxy.$echarts.init(ThreeLine.value);
myChart.clear(); myChart.clear();
@ -100,8 +100,8 @@ const drawOneLine = () => {
// return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1] // 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: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
// data: (arr.map((rtime) => rtime?.timeStamp.slice(-8))), data: (arr.map((rtime) => rtime?.timeStamp.slice(-5))),
// data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"], // 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((pvdata) => pvdata.p),
data: arr.map((rload) => rload.p),
}, },
// { // {
// name: "", // name: "",