diff --git a/.vscode/settings.json b/.vscode/settings.json index 23c39da..93525eb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "vscode.json-language-features" }, "i18n-ally.localesPaths": [ "src/renderer/src/assets/i18n", diff --git a/src/renderer/src/views/components/tree/components/hooks/rightOperate.ts b/src/renderer/src/views/components/tree/components/hooks/rightOperate.ts index 076586c..960152f 100644 --- a/src/renderer/src/views/components/tree/components/hooks/rightOperate.ts +++ b/src/renderer/src/views/components/tree/components/hooks/rightOperate.ts @@ -550,6 +550,119 @@ export const useRightOperate = () => { cusAddNodes(window.treeObj, parentId, res.data) } } + + // function renderVector(node, ifFly = true) { + // // if (node.detail != "") node.detail.field = node.detail.fieldName || "id"; + // let head_tables; + // if (node.head_tables) { + // head_tables == "" ? node.head_tables : JSON.parse(node.head_tables); + // } + // let vectorParams = { + // id: node.source_id, + // path: node.source_path, + // fileName: node.source_name, + // head_tables, + // ...node.detail, + // }; + // console.log("node", node); + // console.log("vectorParams", vectorParams); + // let Vector = new YJ.Obj.Vector((window as any).Earth1, vectorParams); + // console.log("Vector", Vector); + // Vector.on().then((res) => { + // (window as any)._entityMap.set(node.source_id, Vector); + // let treeObj = $.fn.zTree.getZTreeObj("treeDemo"); + // Vector.load(() => { + // let newnodes = Vector.getAllNode(); + // console.log("newnodes1111", newnodes); + // if (newnodes) { + // if (newnodes.list.length) { + // newnodes.list.forEach((it) => { + // let arrt = node.detail.hasOwnProperty("fieldName") + // ? node.detail.fieldName + // : Vector.field; + // let zijiNodes:any = []; + // if (it.features && it.features.length) { + // it.features.forEach((item) => { + // let ziNode = { + // source_id: item.id, + // source_type: item.type, + // source_name: + // item.properties[arrt] || Object.keys(item.properties)[0] || '未知', + // detail: { + // ...item, + // info: { type: "richText" }, + // }, + // is_show: 1, + // fid: node.source_id, + // }; + // zijiNodes.push(ziNode); + // }); + // } + // let fuNode = { + // source_id: + // it.id || md5(new Date().getTime().toString() + Math.random()), + // source_type: it.type, + // source_name: it.name || '未知', + // detail: { + // defaultfieldName: Vector.field, + // ...node.detail, + // }, + // is_show: 1, + // fid: node.source_id, + // children: zijiNodes.length > 0 ? zijiNodes : [], // 关键:把子节点挂到父节点 + // }; + // let parentNode = treeObj.getNodeByParam( + // "source_id", + // node.source_id, + // null + // ); + // if (parentNode) { + // treeObj.addNodes(parentNode, [fuNode], true); + // } + // }); + // } else { + // let arrt = node.detail.hasOwnProperty("fieldName") + // ? node.detail.fieldName + // : Vector.field; + // newnodes.list.forEach((it) => { + // let zijiNodes = []; + // let childNode = treeObj.getNodeByParam( + // "source_id", + // node.source_id, + // null + // ); + // console.log("1111111111111111111111111111", it); + // if (it.features && it.features.length) { + // it.features.forEach((item) => { + // let ziNode = { + // source_id: item.id, + // source_type: item.type, + // source_name: item.properties[arrt] || "", + // detail: { + // ...item, + // info: { type: "richText" }, + // }, + // is_show: 1, + // fid: node.source_id, + // }; + // zijiNodes.push(ziNode); + // }); + // } + // console.log("zijiNodes", "childNode", childNode, zijiNodes); + // if (childNode) { + // treeObj.addNodes(childNode, zijiNodes, true); + // } + // }); + // } + // } + // if (ifFly) Vector.flyTo(); + // Vector.onClick = shpTotal; + // //鼠标右键点击事件 + // Vector.onRightClick = shpSelect; + // }); + // }); + // } + return { rightMenus }