|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="map-layout">
|
|
|
+ <div class="map-layout" v-loading="!loaded || captureing">
|
|
|
<div class="custom_bar">
|
|
|
<div class="back_container" v-if="!queryMode">
|
|
|
<el-button :icon="Back" circle type="primary" @click="router.back()" />
|
|
@@ -26,6 +26,8 @@
|
|
|
<div class="map-container" :ref="setMapContainer">
|
|
|
<div class="board" :ref="setBoardContainer"></div>
|
|
|
<div class="map-top-out-pano">
|
|
|
+ <el-button @click="capture" v-if="loaded"> 屏幕截图 </el-button>
|
|
|
+
|
|
|
<el-button @click="showPoints = !showPoints">
|
|
|
<el-checkbox :modelValue="showPoints" label="点位" size="large" />
|
|
|
</el-button>
|
|
@@ -86,11 +88,12 @@ import {
|
|
|
defaultCenter,
|
|
|
tileType,
|
|
|
} from "./install";
|
|
|
-import { ref, watch } from "vue";
|
|
|
+import { nextTick, ref, watch } from "vue";
|
|
|
import { initRelics, relics } from "@/store/relics";
|
|
|
import { queryMode } from "./install";
|
|
|
import { PoPoint } from "drawing-board";
|
|
|
import { boardData } from "@/store/scene";
|
|
|
+import saveAs from "@/util/file-serve";
|
|
|
|
|
|
const menus = [
|
|
|
{
|
|
@@ -147,6 +150,18 @@ watch(
|
|
|
},
|
|
|
{ immediate: true, flush: "post" }
|
|
|
);
|
|
|
+
|
|
|
+const captureing = ref(false);
|
|
|
+const capture = async () => {
|
|
|
+ captureing.value = true;
|
|
|
+ await nextTick();
|
|
|
+ try {
|
|
|
+ const dataURL = await board.toDataURL(2);
|
|
|
+ await saveAs(dataURL, "map.png");
|
|
|
+ } finally {
|
|
|
+ captureing.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|