master
“yu” 2024-07-14 11:08:45 +08:00
parent 07448e135e
commit b92f61c9fb
2 changed files with 22 additions and 15 deletions

View File

@ -120,7 +120,7 @@
</div>
<div class="infotitle"><span>当前负载率</span></div>
<div class="info2">
<rateLine :rateDate="rateDate_cur" :keysv="key2"></rateLine>
<rateLine :rateDate="rateDate_cur" :keysv="key2" v-if="treeAreaId"></rateLine>
</div>
<div class="infotitle_box">
<div class="infotitle_short">
@ -368,7 +368,7 @@ import { ITEM_RENDER_EVT } from "element-plus/es/components/virtual-list/src/def
// });
onMounted(() => {
getRateDate(); //
// getstrategyDate() //
// let result = await loadRateApi({});
// console.log(result, "");
@ -376,8 +376,11 @@ onMounted(() => {
let treeAreaId=ref('')//id
// id treeKeyid
const getTreeKey = (treeKey: any) => {
getTreeSourceList(treeKey); // id
treeAreaId=treeKey//id
// console.log(treeAreaId,'treeAreaId----------------------');
getRateDate(treeKey); // id
};
// ---
@ -435,20 +438,24 @@ const handelSource = (type: string) => {
// ------------
interface RateDateInfo {
loadRate?: string;
dataTime?: string;
measValue?: string;
dateTime?: string;
}
let key2 = ref<number>(2);
let rateDate_cur = reactive<RateDateInfo[]>([]); //
let rateDate_will = reactive<RateDateInfo[]>([]); //
const getRateDate = () => {
const getRateDate = (treeAreaId:string) => {
// 15
// console.log(treeAreaId, treeAreaId.value,"treeAreaId==========");
// setInterval(() => {
loadRateApi({mrid:treeAreaId}).then((res)=>{
if(res?.result.length){
// rateDate_cur=res.result
console.log(res, "res");
loadRateApi({mrid:treeAreaId,orgID:"8af8470a47aad8e20147aad92e400335",}).then((res)=>{
console.log(res, "res");
if(res?.data.result.length){
rateDate_cur=res?.data.result
// console.log(res, "res");
}else{
ElMessage({

View File

@ -15,8 +15,8 @@ import {
import transformFontSize from "@/hooks/transFormSize.ts";
import "echarts/lib/component/dataZoom";
interface RateDateInfo {
loadRate?: string;
dataTime?: string;
measValue?: string;
datetime?: string;
}
const props = defineProps<{
rateDate: RateDateInfo[];
@ -112,8 +112,8 @@ const drawOneLine = (rateArr: RateDateInfo[]) => {
// return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1]
// },
},
// data: (rateArr.map((rtime) => rtime?.dataTime.slice(-8))),
data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
data: (rateArr.map((rtime) => rtime?.datetime.slice(-8))),
// data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
},
yAxis: {
splitLine: {
@ -169,8 +169,8 @@ const drawOneLine = (rateArr: RateDateInfo[]) => {
]),
},
},
data: [20, 32, 41, 28, 45, 30, 24],
// data: rateArr.map((rload) => rload.loadRate),
// data: [20, 32, 41, 28, 45, 30, 24],
data: rateArr.map((rload) => rload.measValue),
},
],
};