diff --git a/src/renderer/src/views/components/bottomSide/bottomSide.vue b/src/renderer/src/views/components/bottomSide/bottomSide.vue index 7f9de3d..25707d9 100644 --- a/src/renderer/src/views/components/bottomSide/bottomSide.vue +++ b/src/renderer/src/views/components/bottomSide/bottomSide.vue @@ -196,6 +196,32 @@ const bottomMenuList = ref([ key: 'DrawCircle', sourceType: 'circle', className: 'public', + fun: () => { + let Draw = new YJ.Draw.DrawCircle(window.earth) + Draw.start(async (a, opt) => { + // let id = new YJ.Tools().randomString() + let id = 'aaa' + let name = '圆' + let options: any = await initMapData('circle', { + id: id, + name: name, + center: opt.center, radius: opt.radius + }) + + let selectedNodes = window.treeObj.getSelectedNodes() + let params = { + "id": id, + "sourceName": name, + "sourceType": "circle", + "parentId": (selectedNodes && selectedNodes[selectedNodes.length - 1]) ? selectedNodes[selectedNodes.length - 1].id : undefined, + // "treeIndex": 0, + "params": options + } + console.log(params) + // eventBus.emit("openDialog", 'circle'); + TreeApi.addOtherSource(params) + }) + } }, { sourceName: '矩形', diff --git a/src/renderer/src/views/components/propertyBox/CircleObject.vue b/src/renderer/src/views/components/propertyBox/CircleObject.vue new file mode 100644 index 0000000..00d6d0e --- /dev/null +++ b/src/renderer/src/views/components/propertyBox/CircleObject.vue @@ -0,0 +1,336 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/src/views/home/index.vue b/src/renderer/src/views/home/index.vue index 3f8cca8..39df918 100644 --- a/src/renderer/src/views/home/index.vue +++ b/src/renderer/src/views/home/index.vue @@ -84,6 +84,9 @@ eventBus.on("openDialog", async (sourceType: any, id: any) => { dynamicComponentRef.value?.open(id) break; case 'circle': + currentComponent.value = polygonObject + await nextTick() + dynamicComponentRef.value?.open(id, 'circle') break; case 'rectangle': currentComponent.value = polygonObject @@ -96,12 +99,12 @@ eventBus.on("openDialog", async (sourceType: any, id: any) => { dynamicComponentRef.value?.open(id, 'rendezvous') break; case 'attackArrow': - currentComponent.value = attackArrow + currentComponent.value = attackArrow await nextTick() dynamicComponentRef.value?.open(id, 'attackArrow') break; case 'pincerArrow': - currentComponent.value = attackArrow + currentComponent.value = attackArrow await nextTick() dynamicComponentRef.value?.open(id, 'pincerArrow') break;