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

View File

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

View File

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