Browse Source

协同标绘 修复圆形半径不统一问题

Hwf 4 months ago
parent
commit
efc88a43bd

+ 1 - 1
src/hooks/AMap/useAMap.ts

@@ -477,7 +477,7 @@ export function useAMap(options) {
       } else if (item.type === 'circle') {
         graphic = new AMap.Circle({
           center: item.center,
-          radius: item.radius,
+          radius: item.radius * 100000,
           strokeColor: item.strokeColor,
           strokeOpacity: item.strokeOpacity,
           strokeWeight: item.strokeWeight,

+ 1 - 1
src/views/globalMap/RightMenu/OnlinePlotting/EditClassDialog.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog custom-show :title="!id ? '新增分类' : '修改分类'" @close="handleCancel" @confirm="submitForm(classFormRef)">
+  <Dialog custom-show draggable :title="!id ? '新增分类' : '修改分类'" @close="handleCancel" @confirm="submitForm(classFormRef)">
     <el-form ref="classFormRef" :model="form" :rules="rules">
       <el-form-item label="分类名称:" label-width="200px" prop="name">
         <el-input v-model="form.name" class="custom-input2" placeholder="请输入分类名称" />

+ 14 - 8
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -501,7 +501,7 @@ const initDrawMethod = (options) => {
       } else {
         if (options.type == 'circle') {
           data.center = [obj.getCenter().lng, obj.getCenter().lat];
-          data.radius = obj.getRadius();
+          data.radius = obj.getRadius() / 100000;
         } else {
           const path = obj.getPath();
           // 将AMap.LngLat对象数组转换为经纬度数组
@@ -902,15 +902,15 @@ const handleSendForm = () => {
   if (!form.value.pattern_name) {
     return proxy?.$modal.msgWarning('请填写预案名称');
   }
-  // webSock = createWebSocket('uhvw60vX7MpeWSWcXqK8S', getWebSocketData);
-  // patternId.value = 'uhvw60vX7MpeWSWcXqK8S';
-  createCollaboration(form.value).then(() => {
-    patternId.value = form.value.pattern_id;
-    webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
+  webSock = createWebSocket('uhvw60vX7MpeWSWcXqK8S', getWebSocketData);
+  patternId.value = 'uhvw60vX7MpeWSWcXqK8S';
+  // createCollaboration(form.value).then(() => {
+  //   patternId.value = form.value.pattern_id;
+  //   webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
     showForm.value = false;
     collaboration.value = true;
     proxy?.$modal.msgSuccess('开启协同标绘成功');
-  });
+  // });
 };
 const handleShowDialog = () => {
   editData.value = {
@@ -955,7 +955,13 @@ const handleSendData = (data) => {
 let dataURL = ref('');
 // 页面元素转图片
 const handleScreenshot = () => {
-  const canvasBox = getMap().Iv;
+  let map = getMap();
+  let canvasBox;
+  if (AMapType.includes(props.activeMap)) {
+    canvasBox = map.Iv;
+  } else {
+    canvasBox = map.targetElement_;
+  }
   // 手动创建一个 canvas 标签
   const canvas = document.createElement('canvas');
   if (canvasBox) {