tree api
parent
07448e135e
commit
b92f61c9fb
|
@ -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 treeKey是id
|
||||
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({
|
||||
|
|
|
@ -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),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue