diff --git a/src/components/earthMap/Toolbar.vue b/src/components/earthMap/Toolbar.vue index 23706df..1cb3b8a 100644 --- a/src/components/earthMap/Toolbar.vue +++ b/src/components/earthMap/Toolbar.vue @@ -95,7 +95,7 @@ - + @@ -131,6 +131,7 @@ import { defHttp } from '/@/utils/http/axios'; import $ from 'jquery'; import { useUserStore } from '/@/store/modules/user'; + import { useMessage } from '/@/hooks/web/useMessage'; import TestCom from './TestCom.vue'; @@ -154,6 +155,7 @@ const { proxy }: any = getCurrentInstance(); // const { userInfo } = useUserStore(); const userStore = useUserStore(); + const { createMessage } = useMessage(); let _viewer = ref(); let show = ref(true); let modalVisible = ref(false); @@ -179,6 +181,7 @@ const notificationModelShow = ref(false); const WarnListShow = ref(false); const drawShapeShow = ref(false); + const drawShapePackage = ref(null); const drawShapeMilitaryShow = ref(false); //计算属性 @@ -235,6 +238,11 @@ $mitt.on('warnInfoMan', function () { warnInfoMan(); }); + //调用绘画组件,res.show为展示状态,res为传递数据 + $mitt.on('drawShapeShow', function (res:any) { + drawShapeShow.value = res.show; + drawShapePackage.value = res + }); } //数据绑定 //disposers 用来收集资源销毁函数,并在析构时自动调用! @@ -946,6 +954,8 @@ //绘画图形 function drawShape() { + //清空数据 + drawShapePackage.value = null drawShapeShow.value = !drawShapeShow.value; } //绘画图形-军事态势 @@ -1019,7 +1029,6 @@ // $mitt.emit('windowCancel') // com = addModelWin // console.log("proxy"); - addModelWinShow.value = true; break; case 'roamPathList': @@ -1138,6 +1147,7 @@ notificationModelShow, WarnListShow, drawShapeShow, + drawShapePackage, drawShapeMilitaryShow, drawShapeMilitaryIMG, test, diff --git a/src/components/earthMap/toolbar/AddModelWin.vue b/src/components/earthMap/toolbar/AddModelWin.vue index 6f29ecd..ff825dd 100644 --- a/src/components/earthMap/toolbar/AddModelWin.vue +++ b/src/components/earthMap/toolbar/AddModelWin.vue @@ -1,18 +1,7 @@ diff --git a/src/components/earthMap/toolbar/DrawShape.vue b/src/components/earthMap/toolbar/DrawShape.vue index 62d9f37..82ab617 100644 --- a/src/components/earthMap/toolbar/DrawShape.vue +++ b/src/components/earthMap/toolbar/DrawShape.vue @@ -15,6 +15,9 @@
+

+ 实线 +

圆弧

@@ -30,9 +33,7 @@ -

- 实线 -

+
@@ -227,6 +228,10 @@ const props = defineProps({ type: Boolean, default: false, }, + drawShapePackage: { + type: Object, + default: null, + }, }); const { proxy }: any = getCurrentInstance(); @@ -237,6 +242,19 @@ const activeKey = ref(['1', '2']); const customStyle = 'background: rgb(255 255 255 / 0%);border-radius: 4px;border: 0;overflow: hidden'; const earthUI = window.$uia // 获取地图ui对象 +let title = ref(props.title) +onMounted(() => { + //处理选取区域操作 + if (props.drawShapePackage != null) { + console.log("绘画组件正在调用", props.drawShapePackage); + if (props.drawShapePackage.title != null) + //赋值标题title + title.value = props.drawShapePackage.title + } +}) + + + function draw(type: String = '') { let t = null switch (type) { @@ -304,7 +322,15 @@ function draw(type: String = '') { console.log("错误"); break; } - return editUI(t) + //判断是否被创建区域组件调用,有则返回实体 t,交给调用组件处理 + if (props.drawShapePackage && + props.drawShapePackage.from && + props.drawShapePackage.from == 'addArea') { + $mitt.emit('addAreaFinished', t) + return + } + else + return editUI(t) } function cancel() { diff --git a/src/components/earthMap/toolbar/DrawShapeMilitary.vue b/src/components/earthMap/toolbar/DrawShapeMilitary.vue index 228f5ad..84fc258 100644 --- a/src/components/earthMap/toolbar/DrawShapeMilitary.vue +++ b/src/components/earthMap/toolbar/DrawShapeMilitary.vue @@ -40,9 +40,14 @@

曲线箭头

-

+ +

平尾箭头

@@ -59,7 +64,7 @@

三角旗帜

- + @@ -394,8 +399,10 @@ function saveInStore(obj: any) { function editUI(obj: any, objConfig: any = null) { console.log("obj", obj); obj.creating = true; + // if (obj.showType == "forkedTail") return earthUI.showPropertyWindow(obj) nextTick(() => { + // 主要ui窗口 const mainUI = earthUI._vm.$refs.mainUI // 所有打开的ui窗口Ref值