master
zhaoqiang 2024-07-15 14:15:02 +08:00
parent 259d0ef796
commit f5735f6038
3 changed files with 57 additions and 87 deletions

View File

@ -16,9 +16,9 @@ export function treeT(data: idInfo) {
}
interface treeInfo{
orgID:string;
transformId:string;
interface treeInfo {
orgID: string;
transformId: string;
}
// 设备树 1 二级服务
export function treeSecond(data: treeInfo) {
@ -29,6 +29,16 @@ export function treeSecond(data: treeInfo) {
})
}
// 设备树 充电站
export function carTree_api(data: idInfo) {
return request({
url: '/api/wwpm/biz/v1/car_tree',
method: 'POST',
data
})
}
// 负载率
export function loadRateApi(data: any) {

View File

@ -17,7 +17,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, carTree_api } from '@/api/ajust/tree'
// defineProps<{
// elec_list: EList[]
@ -91,14 +91,12 @@ let treeData = ref<any>([])
const loadNode = async (node: any, resolve: any) => {
//
if (node.level === 0) {
// let res= await treeT({
// orgID: "8af8470a47aad8e20147aad92e400335",
// });
treeT({
let treeData = []
let result = await carTree_api({
orgID: '8af8470a47aad8e20147aad92e400335'
}).then(res => {
resolve(res.data) //1
})
treeData = result.data
resolve(treeData)
} else if (node.level > 0 && node.level < 4) {
//,.
resolve(node.data.children)
@ -179,10 +177,7 @@ const emits = defineEmits(['update-node-key']) ////接收父组件的事件,
//
// target
const handleTargetInfo = (data: TreeData, node: any) => {
if (node.level === 4 || node.level === 6 ) {
//4 id
emits('update-node-key', node) //id,
}
emits('update-node-key', node)
}
const handleTarget = (node: any) => {
// target

View File

@ -276,11 +276,20 @@ onMounted(() => {
getRunning_api()
})
//
let currentData = reactive<any>({})
//
const getTreeKey = (treeKey: any) => {
console.log(treeKey, '---')
// 6
if (treeKey.level === 6) {
// pipe station
currentData = treeKey.data
console.log(currentData, 'currentData')
if (currentData.type === 'station' || currentData.type === 'pipe') {
//
getPowerCurve_api()
//
getRunning_api()
}
}
@ -299,70 +308,6 @@ let carleftContentFlag = ref(true)
//
let carrightFlag = ref(true)
//
let loadtabDateFlag = ref(1)
const loadEchart = reactive([
{
id: 1,
name: '高速充电桩群'
},
{
id: 2,
name: '谊景村'
}
])
const loadhandleTabDate = (val: any) => {
loadtabDateFlag.value = val.id
}
// load_echart
let eName1 = ref('负载率')
let eName2 = ref('负载情况')
//
let lengendDate = reactive([
{
id: 1,
lengendName: '充电桩分布热力图',
checkFlag: false
},
{
id: 2,
lengendName: '新能源车辆热力图',
checkFlag: false
}
])
let handleSelectCheck = (datas: any) => {
//
datas.checkFlag = !datas.checkFlag
// if (data.lengendName === "" || data.lengendName === "" || data.lengendName === "" || data.lengendName === "") {
// // bottomconterListtest.includes(props.gettreeprovidecityname)
// bottomconterListtest.forEach(item => {
// if (item.name === props.gettreeprovidecityname) {
// let _list = {
// type: data.value,
// status: data.checkFlag ? '2' : '0',//
// CityID: item.id,
// };
// api_send("showCityElement", _list, () => {
// console.log("showCityElement", "Switchstationstatus");
// });
// }
// })
// } else {
// let _list = {
// type: "BD", // BD: PD: KG:
// Voltage_Level: data.value, //:0: 22:10KV 24:20kV 32:110kV 33:220kV 35:500kV
// region: "315800", //id:ID()315000: 315001:() 315800: 315100: 315500: 315700: //315600: 315400:315300:
// status: data.checkFlag ? '1' : '0',// 0:1:
// };
// api_send("SwitchStationstatus", _list, () => {
// console.log("SwitchStationstatus", "Switchstationstatus");
// });
// }
}
//
//
const adjustInfoFlag = ref(false)
//
@ -465,9 +410,20 @@ let transformerOverloadCount = ref<number>(0)
// 线
let getPowerCurve_api = () => {
powerCurve_api({
mrid: '1200330077182'
}).then((res: any) => {
let setData: any = {}
if (currentData.type === '') {
//
setData.orgID = '1200330077182'
} else if (currentData.type === 'station') {
//
setData.stationId = '1200330077182'
} else if (currentData.type === 'pipe') {
//
setData.mrid = '1200330077182'
}
console.log(currentData.type, setData, 'currentType.value')
powerCurve_api(setData).then((res: any) => {
res?.data.forEach((item: any) => {
item.datetime = item.dateTime
})
@ -486,9 +442,18 @@ let getTransformerOverloadCount_api = () => {
}
//
let getRunning_api = () => {
running_api({
orgID: '8af8470a47aad8e20147aad92e400335'
}).then((res: any) => {
let setData: any = {}
if (currentData.type === '') {
//
setData.orgID = '1200330077182'
} else if (currentData.type === 'station') {
//
setData.stationId = '1200330077182'
} else if (currentData.type === 'pipe') {
//
setData.mrid = '1200330077182'
}
running_api(setData).then((res: any) => {
carRightData.chargingList = res.data.data
carRightData.chargingListRunning = res.data.running
carRightData.chargingListTotal = res.data.total