This commit is contained in:
2025-08-22 10:33:34 +08:00
parent 8765bffbac
commit 1484bd44fc
75 changed files with 15129 additions and 185 deletions

View File

@ -62,6 +62,8 @@ import tree from "./treeSetting";
import rightMenu from "./components/rightMenu.vue";
import AMapLoader from "@amap/amap-jsapi-loader";
import rightMenuOption from "../Tree/components/rightMenuOption";
import { findParentId } from "@/components/Tree/treeNode";
import { renderTextBox } from "./renderNode";
import {
get_source_list,
queryPOI,
@ -302,7 +304,7 @@ export default {
let p_id = getKeyOfSelectedNode(this.$parent.treeObj, "source_id");
filePaths.forEach((item) => {
console.log('item', item);
let name = this.getLastPathComponent(item,['clt','json','pak','kml','kmz','shp','geojson','geoJson', 'czml','jct','mif','tab','csv']);
let name = this.getLastPathComponent(item, ['clt', 'json', 'pak', 'kml', 'kmz', 'shp', 'geojson', 'geoJson', 'czml', 'jct', 'mif', 'tab', 'csv']);
console.log("name", name);
let source_type = "layer";
if (item.endsWith(".clt") || item.endsWith(".json")) {
@ -713,6 +715,8 @@ export default {
);
window.treeObj = this.treeObj;
window.AllNodes = this.treeObj.getNodes()
console.log('window.AllNodes', window.AllNodes);
window.newFuzzySearch(
`treeDemo`,
"#keyword",
@ -732,6 +736,9 @@ export default {
(text, object) => {
switch (text) {
case "textBox":
this.addTextBox(object.position);
break;
case "rotateAround":
YJ.Global.rotateAround(window.Earth1, object.position);
break;
@ -756,6 +763,37 @@ export default {
});
});
},
// 添加文本框
addTextBox(position) {
this.$sendChanel("textTetlie", "标注");
this.$changeComponentShow(".textModelBox", true);
this.$recvChanel("textModelContent", (data) => {
console.log(data.text);
let that = this;
let source_id = that.$md5(new Date().getTime() + "文本框");
let textBox = {
id: source_id,
position: position,
text: data.text,
show: true,
};
let DbOption = {
source_id,
source_name: data.text,
source_type: "textBox",
p_id: findParentId(that.treeObj),
};
let detailOption = JSON.parse(JSON.stringify(textBox));
let node = getNodeData(DbOption, detailOption);
renderTextBox(node);
addSource(node).then((res) => {
if ([0, 200].includes(res.code)) {
cusAddNodes(that.$parent.treeObj, DbOption.p_id, [node]);
}
});
})
},
// 获取当前得node
getNode(source_id) {
if (!source_id) {
@ -804,6 +842,7 @@ export default {
animate();
},
},
};
</script>