|
@@ -33,17 +33,18 @@
|
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
|
import { Search } from "@element-plus/icons-vue";
|
|
import { Search } from "@element-plus/icons-vue";
|
|
import { wgs84_to_gcj02 } from "./map"
|
|
import { wgs84_to_gcj02 } from "./map"
|
|
-import { getTipsList, getTipsNames, } from "@/store/case";
|
|
|
|
-import { ref, watchEffect, onMounted } from "vue";
|
|
|
|
|
|
+import { getTipsList, getTipsNames, getCaseInfo } from "@/store/case";
|
|
|
|
+import { ref, watchEffect, onMounted, computed } from "vue";
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
import { debounce } from "@/util";
|
|
import { debounce } from "@/util";
|
|
import html2canvas from "html2canvas"
|
|
import html2canvas from "html2canvas"
|
|
import L from 'leaflet'
|
|
import L from 'leaflet'
|
|
import 'leaflet/dist/leaflet.css'
|
|
import 'leaflet/dist/leaflet.css'
|
|
|
|
+import { router } from "@/router";
|
|
export type MapImage = { blob: Blob | null; search: MapInfo | null };
|
|
export type MapImage = { blob: Blob | null; search: MapInfo | null };
|
|
type MapInfo = { lat: number; lng: number; zoom: number; text: string; address: string; id: string };
|
|
type MapInfo = { lat: number; lng: number; zoom: number; text: string; address: string; id: string };
|
|
-// const layer = L.tileLayer('http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}')
|
|
|
|
-const layer = L.tileLayer('http://a.map.jms.gd/tile/osm/{z}/{x}/{y}.png')
|
|
|
|
|
|
+const layer = L.tileLayer('http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}')
|
|
|
|
+//const layer = L.tileLayer('http://a.map.jms.gd/tile/osm/{z}/{x}/{y}.png')
|
|
// const layer = L.tileLayer('http://wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=6&x={x}&y={y}&z={z}&token=YOUR_API_KEY')
|
|
// const layer = L.tileLayer('http://wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=6&x={x}&y={y}&z={z}&token=YOUR_API_KEY')
|
|
|
|
|
|
|
|
|
|
@@ -52,6 +53,7 @@ let clickMarker;
|
|
const keyword = ref("");
|
|
const keyword = ref("");
|
|
const showSearch = ref(true);
|
|
const showSearch = ref(true);
|
|
const info = ref<MapInfo>();
|
|
const info = ref<MapInfo>();
|
|
|
|
+const caseInfoData = ref<any>(null);
|
|
const searchInfo = ref<MapInfo>();
|
|
const searchInfo = ref<MapInfo>();
|
|
const mapEl = ref<HTMLDivElement>();
|
|
const mapEl = ref<HTMLDivElement>();
|
|
const keywordList = ref([]);
|
|
const keywordList = ref([]);
|
|
@@ -60,11 +62,23 @@ watchEffect(() => {
|
|
showSearch.value = true;
|
|
showSearch.value = true;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+const caseId = computed(() => {
|
|
|
|
+ const caseId = router.currentRoute.value.params.caseId;
|
|
|
|
+ if (caseId) {
|
|
|
|
+ return Number(caseId);
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+onMounted(async () => {
|
|
|
|
+ caseInfoData.value = await getCaseInfo(caseId.value);
|
|
|
|
+ let center = [22.61, 113.05];
|
|
|
|
+ if(caseInfoData.value.latAndLong){
|
|
|
|
+ center = caseInfoData.value.latAndLong.split(",")
|
|
|
|
+ }
|
|
|
|
+ console.log("caseInfoData", caseInfoData.value.latAndLong, center);
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
// 'map'为HTML节点id
|
|
// 'map'为HTML节点id
|
|
map = L.map(mapEl.value, {
|
|
map = L.map(mapEl.value, {
|
|
- center: [22.61, 113.05],//中心坐标
|
|
|
|
|
|
+ center: center,//中心坐标
|
|
zoom: 10,//缩放级别
|
|
zoom: 10,//缩放级别
|
|
zoomControl: true, //缩放组件
|
|
zoomControl: true, //缩放组件
|
|
attributionControl: false, //去掉右下角logol
|
|
attributionControl: false, //去掉右下角logol
|