master
“yu” 2024-07-14 02:18:34 +08:00
parent e8fa52b780
commit 496b68f337
1 changed files with 20 additions and 13 deletions

View File

@ -115,8 +115,7 @@ const loadNode = async (node: any, resolve: any) => {
console.log(node, node.level, "4------"); console.log(node, node.level, "4------");
// //
// --------- // ---------
//4 id
emits("update-node-key", node.key); //id,
// --------- // ---------
// //
let res = await treeSecond({ let res = await treeSecond({
@ -126,7 +125,8 @@ const loadNode = async (node: any, resolve: any) => {
if ( if (
res.data.photoVoltaicUnit.length || res.data.photoVoltaicUnit.length ||
res.data.energySupplyStation.length || res.data.energySupplyStation.length ||
res.data.batteryUnit.length res.data.batteryUnit.length ||
res.data.dwellerPile.length
) { ) {
let datanames = []; let datanames = [];
if (res.data.photoVoltaicUnit.length) { if (res.data.photoVoltaicUnit.length) {
@ -146,15 +146,12 @@ const loadNode = async (node: any, resolve: any) => {
name: `储能(${res.data.batteryUnit.length})`, name: `储能(${res.data.batteryUnit.length})`,
id: "chuneng", id: "chuneng",
}); });
if (res.data.dwellerPile.length) { }
datanames.push({ if (res.data.dwellerPile.length) {
name: `居民充电桩(${res.data.dwellerPile.length})`, datanames.push({
id: "chongdianzhuang", name: `居民充电桩(${res.data.dwellerPile.length})`,
}); id: "chongdianzhuang",
} });
// ----------
// id
} }
resolve(datanames); resolve(datanames);
} else { } else {
@ -229,9 +226,19 @@ const emits = defineEmits(["update-node-key"]); ////接收父组件的事件,
// //
// target // target
const handleTargetInfo = (data: TreeData, e: any) => { const handleTargetInfo = (data: TreeData, e: any, node: any) => {
// targetInfo.resultArr = []; // targetInfo.resultArr = [];
// handleTarget(e); // handleTarget(e);
console.log("zheshishaya111",node.level,data);
if (node.level === 4) {
console.log(node.level,'0000',node.key);
console.log("zheshishaya");
//4 id
emits("update-node-key", node.key); //id,
}
}; };
const handleTarget = (node: any) => { const handleTarget = (node: any) => {
// target // target