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

View File

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