“yu” 2024-07-15 23:21:29 +08:00
parent c5cf44a650
commit cc39495425
4 changed files with 60 additions and 27 deletions

View File

@ -37,6 +37,14 @@ export function carTree_api(data: idInfo) {
data
})
}
// 设备树 充电站
export function pvTree_api(data: idInfo) {
return request({
url: '/api/wwpm/biz/v1/pv_tree',
method: 'POST',
data
})
}

View File

@ -28,7 +28,7 @@
import { onMounted, ref, watch } from "vue";
import { ElTree } from "element-plus";
import treeDatas from "@/assets/json/tree-right2.json";
import { treeT, treeSecond } from "@/api/ajust/tree";
import { treeT, treeSecond,pvTree_api } from "@/api/ajust/tree";
// defineProps<{
// elec_list: EList[]
@ -105,7 +105,7 @@ const loadNode = async (node: any, resolve: any) => {
// let res= await treeT({
// orgID: "8af8470a47aad8e20147aad92e400335",
// });
treeT({
pvTree_api({
orgID: "8af8470a47aad8e20147aad92e400335",
}).then((res) => {
resolve(res.data); //1
@ -176,12 +176,16 @@ const emits = defineEmits(["update-node-key"]); ////接收父组件的事件,
//
// target
const handleTargetInfo = (data: TreeData, node: any) => {
// console.log(1111111,node);
// targetInfo.resultArr = [];
// handleTarget(e);
//
// ---------
if (node.level === 5) {
//5 id
// emits("update-node-key", node); //id,
if (node.level === 6) {
//4 id
emits("update-node-key", node); //id,
}

View File

@ -27,7 +27,11 @@
</div>
</div>
<div class="tree_box content_bg">
<tree @update:nodeValue="updatePvechart" v-mode="tree_node"></tree>
<tree
@update:nodeValue="updatePvechart"
v-mode="tree_node"
@update-node-key="getTreeNode"
></tree>
</div>
</div>
</div>
@ -140,7 +144,11 @@
</div>
<div class="infotitle"><span>实时发电量曲线</span></div>
<div class="info2">
<powerLine :cur_pvArr="cur_pvArr" v-if="cur_pvArrFlag"></powerLine>
<powerLine
:cur_pvArr="cur_pvArr"
v-if="cur_pvArrFlag"
:key="refreshkey"
></powerLine>
</div>
<div class="infotitle"><span>实时功率曲线</span></div>
<div class="info3">
@ -153,7 +161,7 @@
{{ item.bname }}
</div>
</div> -->
<rateLine :pvArr="pvArr" v-if="pvArrFlag"></rateLine>
<rateLine :pvArr="pvArr" v-if="pvArrFlag" :key="refreshkey"></rateLine>
</div>
</div>
</div>
@ -217,19 +225,31 @@ import timePvLine from "./timePvLine.vue";
import { useNow, useDateFormat } from "@vueuse/core";
import { id } from "element-plus/es/locale/index.mjs";
import { curpower_api } from "@/api/pvPage/pvApi";
import { pvApi } from '@/api/Osp/svgApi'
import { pvApi } from "@/api/Osp/svgApi";
onMounted(() => {
let Objinput = { orgID: "8af8470a47aad8e20147aad92e400335" }; //
getCurves(Objinput); //{orgID}
getpv() //线
let inputdata={ mrid: "03DKX-24289" }
getpv(inputdata); //线
});
const getTreeNode = (treeNode: any) => {
let Objinput = {
orgID: "8af8470a47aad8e20147aad92e400335",
mrid: treeNode.key,
}; //
getCurves(Objinput); //
let inputdata={ mrid: treeNode.key }
getpv(inputdata);
};
//
let total_cur = ref("0");
let power35kv = ref("0");
let power10kv = ref("0");
let power380V = ref("0");
let cur_pvArrFlag=ref(false)
let cur_pvArrFlag = ref(false);
let cur_pvArr = reactive([]);
//
const getCurves = (datares: any) => {
@ -253,7 +273,7 @@ const getCurves = (datares: any) => {
}
// 线
if (res.data.data) {
cur_pvArrFlag.value=true
cur_pvArrFlag.value = true;
cur_pvArr = res.data.data;
}
})
@ -261,20 +281,21 @@ const getCurves = (datares: any) => {
console.log(error);
});
};
let pvArr = reactive([]) //
let pvArrFlag = ref<boolean>(false)
let pvArr = reactive([]); //
let pvArrFlag = ref<boolean>(false);
// 线
const getpv = () => {
pvApi({ mrid: '03DKX-24289' }).then(res => {
console.log(res, 'respv')
pvArr = res.data
console.log(pvArr, 'pvArr');
// let refreshkey=ref(1)
const getpv = (inputdata:any) => {
pvApi(inputdata).then((res) => {
console.log(res, "respv");
pvArr = res.data;
console.log(pvArr, "pvArr");
refreshkey.value+=1
if (pvArr.length > 0) {
pvArrFlag.value = true
}
})
pvArrFlag.value = true;
}
});
};
const HMS = useDateFormat(useNow(), "HH:mm:ss"); //
const YMD = useDateFormat(useNow(), "YYYY-MM-DD"); //

View File

@ -66,8 +66,8 @@ const drawOneLine = (arr: any) => {
},
legend: {
top: "5%",
// right: "5%",
// orient: "vertical",
right: "5%",
orient: "vertical",
// data: ["", "", ""],
data: ["实时发电量"],