|
@@ -3,7 +3,7 @@
|
|
|
<div class="gradient-text common-dialog-title2">实时标绘</div>
|
|
|
<div v-show="collaboration" style="display: flex; align-items: center; justify-content: flex-end">
|
|
|
<div class="btn2" style="margin-left: 10px" @click="handleCloseCollaboration">关闭协同</div>
|
|
|
- <div class="btn2" style="margin-left: 10px">保存</div>
|
|
|
+<!-- <div class="btn2" style="margin-left: 10px">保存</div>-->
|
|
|
</div>
|
|
|
<div class="line">
|
|
|
<div class="tabs1">
|
|
@@ -16,7 +16,7 @@
|
|
|
<div class="icon1" />
|
|
|
当前地图截图导出
|
|
|
</div>
|
|
|
- <div v-show="!collaboration" class="btn2" @click="handleShare('1')">协同标绘</div>
|
|
|
+ <div v-show="!collaboration" class="btn2" @click="handlePlotting()">协同标绘</div>
|
|
|
<div v-show="collaboration" class="btn2" @click="handleShowLayer">查看图层</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -169,7 +169,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--添加修改分类弹窗-->
|
|
|
- <EditClassDialog v-if="showAddDialog" v-model="showAddDialog" :id="selectEditId" :templateId="selectTemplateId" @updateData="getTemplateTreeData" />
|
|
|
+ <EditClassDialog
|
|
|
+ v-if="showAddDialog"
|
|
|
+ :id="selectEditId"
|
|
|
+ v-model="showAddDialog"
|
|
|
+ :template-id="selectTemplateId"
|
|
|
+ @update-data="getTemplateTreeData"
|
|
|
+ />
|
|
|
<!--添加文字-->
|
|
|
<TextEdit v-if="showTextEdit" v-model="showTextEdit" @add-text="addText" />
|
|
|
<!--绘制提示信息-->
|
|
@@ -177,13 +183,15 @@
|
|
|
<!--保存修改弹窗-->
|
|
|
<EditDialog v-if="showEdit" v-model="showEdit" :edit-data="editData" @submit="handleSubmit" />
|
|
|
<Contact v-if="shareState.showShare" v-model="shareState.showShare" @close="handleCloseShare" @confirm="handleShareConfirm" />
|
|
|
- <Dialog v-if="showForm" v-model="showForm" customShow title="协同标绘" type="xs" @close="showForm = false" @confirm="handleSendForm">
|
|
|
+ <Dialog v-if="showForm" v-model="showForm" custom-show title="协同标绘" type="xs" @close="showForm = false" @confirm="handleSendForm">
|
|
|
<div style="display: flex; align-items: center">
|
|
|
<div style="font-size: 16px">预案名称:</div>
|
|
|
<el-input v-model="form.pattern_name" class="custom-input" placeholder="请输入" style="flex: 1" />
|
|
|
</div>
|
|
|
</Dialog>
|
|
|
- <LayerDetail v-if="showLayer" v-model="showLayer" :patternId="patternId" />
|
|
|
+ <LayerDetail v-if="showLayer" v-model="showLayer" :pattern-id="patternId" />
|
|
|
+ <!--协同标绘选择弹窗-->
|
|
|
+ <SelectPoltting v-if="showOnlinePlotting" v-model="showOnlinePlotting" @confirm="handleOpenPlotting" />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="OnlinePlotting">
|
|
@@ -201,7 +209,7 @@ import {
|
|
|
deleteClassificationCreate,
|
|
|
deletePatternById,
|
|
|
getPatternInfo,
|
|
|
- getPatternList,
|
|
|
+ getPatternList, getPatternList2,
|
|
|
getTemplateTree
|
|
|
} from '@/api/globalMap/onlinePlotting';
|
|
|
import { Search } from '@element-plus/icons-vue';
|
|
@@ -212,6 +220,7 @@ import * as turf from '@turf/turf';
|
|
|
import Style from 'ol/style/Style';
|
|
|
import Icon from 'ol/style/Icon';
|
|
|
import useMapStore from '@/store/modules/map';
|
|
|
+import SelectPoltting from '@/views/globalMap/RightMenu/OnlinePlotting/SelectPoltting.vue';
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const mapStore = useMapStore();
|
|
@@ -264,6 +273,7 @@ let shareId = ref('');
|
|
|
let overlays = [];
|
|
|
let overlaysData = [];
|
|
|
let map, mapUtils;
|
|
|
+
|
|
|
watch(
|
|
|
() => mapStore.mapLoaded,
|
|
|
(loaded) => {
|
|
@@ -307,7 +317,7 @@ const tipTitle = computed(() => {
|
|
|
|
|
|
// 获取模板分类树
|
|
|
const getTemplateTreeData = () => {
|
|
|
- getTemplateTree({ visible: showSetting.value ? '' : '1'}).then((res) => {
|
|
|
+ getTemplateTree({ visible: showSetting.value ? '' : '1' }).then((res) => {
|
|
|
menu.value[0].children = res.data;
|
|
|
});
|
|
|
};
|
|
@@ -568,7 +578,7 @@ const initDrawMethod = (options) => {
|
|
|
anchorYUnits: 'fraction',
|
|
|
size: [width, height],
|
|
|
scale: !!options.size[0] ? options.size[0] / width : 1
|
|
|
- }),
|
|
|
+ })
|
|
|
// text: new Text({
|
|
|
// text: data.title, // 使用属性中的值作为文本
|
|
|
// font: '14px sans-serif',
|
|
@@ -832,6 +842,13 @@ const handleEdit = (id) => {
|
|
|
});
|
|
|
showEdit.value = true;
|
|
|
};
|
|
|
+// 实时标绘
|
|
|
+let showOnlinePlotting = ref(false);
|
|
|
+
|
|
|
+// 协同标绘选择
|
|
|
+const handlePlotting = () => {
|
|
|
+ showOnlinePlotting.value = true;
|
|
|
+};
|
|
|
const handleShare = (type, id?: string) => {
|
|
|
shareState.type = type;
|
|
|
shareState.id = id;
|
|
@@ -842,9 +859,10 @@ const handleCloseShare = () => {
|
|
|
shareState.id = '';
|
|
|
};
|
|
|
const handleCloseCollaboration = () => {
|
|
|
- closeCollaboration({ pattern_id: patternId.value }).then(() => {
|
|
|
- collaboration.value = false;
|
|
|
- });
|
|
|
+ // closeCollaboration({ pattern_id: patternId.value }).then(() => {
|
|
|
+ patternId.value = false;
|
|
|
+ collaboration.value = false;
|
|
|
+ // });
|
|
|
};
|
|
|
let showForm = ref(false);
|
|
|
let form = ref({
|
|
@@ -907,6 +925,16 @@ const getWebSocketData = (data) => {
|
|
|
}
|
|
|
console.log('接收数据', data);
|
|
|
};
|
|
|
+// 加入协同
|
|
|
+const handleOpenPlotting = (id) => {
|
|
|
+ patternId.value = id;
|
|
|
+ nextTick(() => {
|
|
|
+ webSock = createWebSocket(patternId.value, getWebSocketData);
|
|
|
+ showOnlinePlotting.value = false;
|
|
|
+ collaboration.value = true;
|
|
|
+ proxy?.$modal.msgSuccess('开启协同标绘成功');
|
|
|
+ });
|
|
|
+};
|
|
|
const handleSendForm = () => {
|
|
|
if (!form.value.pattern_name) {
|
|
|
return proxy?.$modal.msgWarning('请填写预案名称');
|