creatMap.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <el-dialog
  3. v-model="visible"
  4. title="选择地图位置"
  5. width="1200px"
  6. :before-close="handleClose"
  7. destroy-on-close
  8. class="map-fire-dialog"
  9. >
  10. <div class="map-dialog-content">
  11. <!-- 搜索框 -->
  12. <div id="panel" class="scrollbar1">
  13. <div id="searchBar">
  14. <el-select class="search-select" v-model="selectedSearchAdress" placeholder="地址">
  15. <el-option label="地址" value="1"></el-option>
  16. <el-option label="经纬度" value="2"></el-option>
  17. </el-select>
  18. <input class="search-input-latlng" v-if="selectedSearchAdress === '2'" @input="handleSearch" autocomplete="off" @keydown="handleKeyDown" placeholder="输入经纬度搜索,如23.117661,113.281272" />
  19. <input class="search-input-address" v-else id="searchInput" @input="handleSearch" autocomplete="off" placeholder="输入地址搜索" />
  20. <!-- <input id="searchInput" @input="handleSearch" autocomplete="off" @keydown="handleKeyDown" :placeholder="selectedSearchAdress === '1' ? '输入地址' : '输入经纬度'" /> -->
  21. </div>
  22. <div id="searchResults">暂无数据</div>
  23. </div>
  24. <!-- 地图容器 -->
  25. <div class="map-container" v-if="visible">
  26. <div id="container" class="map" style="width: 800px; height: 600px" tabindex="0"></div>
  27. </div>
  28. </div>
  29. <template #footer>
  30. <div class="dialog-footer">
  31. <el-button @click="handleClose">取消</el-button>
  32. <el-button type="primary" @click="handleConfirm">
  33. 确定
  34. </el-button>
  35. </div>
  36. </template>
  37. </el-dialog>
  38. </template>
  39. <script setup lang="ts">
  40. import { ref, watch, nextTick, onUnmounted, onMounted } from 'vue'
  41. import { ElDialog, ElInput, ElButton, ElDescriptions, ElDescriptionsItem, ElIcon, ElMessage } from 'element-plus'
  42. import { Search } from '@element-plus/icons-vue'
  43. import AMapLoader from '@amap/amap-jsapi-loader'
  44. import html2canvas from 'html2canvas'
  45. import { uploadFileToServer, canvasToBlob, blobToFile } from '@/util/upload-utils'
  46. import { axios } from '@/request'
  47. import { addOrUpdateCaseTabulation } from '@/request/urls'
  48. import { user } from "@/store/user";
  49. // 添加高德地图类型声明
  50. declare const AMap: any
  51. declare const AMapUI: any
  52. // 定义组件props和emits
  53. interface Props {
  54. modelValue: boolean
  55. caseId?: string | number
  56. }
  57. interface LocationInfo {
  58. name?: string
  59. address?: string
  60. lat?: number
  61. lng?: number
  62. adcode?: string
  63. citycode?: string
  64. district?: string
  65. screenshotUrl?: string
  66. screenshotFileName?: string
  67. }
  68. const props = defineProps<Props>()
  69. const mapInput = ref('')
  70. const emit = defineEmits<{
  71. 'update:modelValue': [value: boolean]
  72. 'confirm': [location: LocationInfo]
  73. }>()
  74. // 响应式变量
  75. const visible = ref(false)
  76. const keyword = ref('')
  77. const selectedLocation = ref<LocationInfo | null>(null)
  78. const mapContainer = ref<HTMLDivElement>()
  79. // 高德地图相关变量
  80. let map: any = null
  81. let placeSearch: any = null
  82. let geocoder: any = null
  83. let currentMarker: any = null
  84. let poiPicker: any = null
  85. // 高德地图配置
  86. const AMAP_KEY = '2ae5a7713612a8d5a65cfd54c989c969'
  87. const selectedSearchAdress = ref('1')
  88. const searchInputValue = ref('')
  89. // 根基app打开不同地址
  90. const appId = import.meta.env.VITE_APP_APP || 'fire'
  91. const url = 'http://test-mix3d.4dkankan.com'
  92. // 防抖定时器
  93. let searchDebounceTimer: number | null = null
  94. // 监听visible变化
  95. watch(() => props.modelValue, (newVal) => {
  96. visible.value = newVal
  97. if (newVal) {
  98. nextTick(() => {
  99. initMap()
  100. })
  101. }
  102. }, { immediate: true })
  103. watch(visible, (newVal) => {
  104. selectedSearchAdress.value = '1'
  105. emit('update:modelValue', newVal)
  106. })
  107. // 监听搜索类型变化,切换时清空输入框和重置搜索
  108. watch(selectedSearchAdress, (newVal, oldVal) => {
  109. if (newVal !== oldVal) {
  110. // 清空输入框
  111. searchInputValue.value = ''
  112. const searchInput = document.getElementById('searchInput') as HTMLInputElement
  113. if (searchInput) {
  114. searchInput.value = ''
  115. }
  116. // 重置搜索结果
  117. const searchResults = document.getElementById('searchResults')
  118. if (searchResults) {
  119. searchResults.innerHTML = '暂无数据'
  120. }
  121. // 清空地图标记
  122. if (map) {
  123. map.clearMap()
  124. }
  125. // 根据搜索类型调整POI选择器的显示
  126. if (poiPicker) {
  127. if (newVal === '2') {
  128. // 经纬度搜索模式,隐藏选择列表
  129. poiPicker.hideSearchResults()
  130. } else {
  131. // 地址搜索模式,可以显示选择列表
  132. poiPicker.searchByKeyword('')
  133. }
  134. }
  135. }
  136. })
  137. // 初始化地图
  138. const initMap = async () => {
  139. map = new AMap.Map('container', {
  140. zoom: 11,
  141. key: AMAP_KEY, // 替换为你的API密钥
  142. center: [116.397513, 39.908739],
  143. WebGLParams: {
  144. preserveDrawingBuffer: true
  145. }
  146. });
  147. AMapUI.loadUI(['misc/PoiPicker'], function(PoiPicker) {
  148. poiPicker = new PoiPicker({
  149. input: 'searchInput',
  150. placeSearchOptions: {
  151. map: map,
  152. pageSize: 7,
  153. pageIndex: 1,
  154. },
  155. searchResultsContainer: 'searchResults'
  156. });
  157. poiPicker.on('poiPicked', function(poiResult) {
  158. poiPicker.hideSearchResults();
  159. map.clearMap();
  160. var source = poiResult.source, poi = poiResult.item;
  161. if (source !== 'search') {
  162. //suggest来源的,同样调用搜索
  163. poiPicker.searchByKeyword(poi.name);
  164. } else {
  165. // 舒琪说不需要marker
  166. // addMarker(poi.location.lng, poi.location.lat)
  167. // console.log(poi);
  168. }
  169. });
  170. poiPicker.onCityReady(function() {
  171. poiPicker.searchByKeyword('');
  172. });
  173. });
  174. }
  175. const handleKeyDown = (e: KeyboardEvent) => {
  176. if (e.key === 'Enter') {
  177. if(selectedSearchAdress.value === '2'){
  178. console.log(11111)
  179. e.preventDefault()
  180. e.stopPropagation()
  181. return
  182. }
  183. }
  184. }
  185. // 验证经纬度格式的函数
  186. const validateCoordinates = (input: string): { isValid: boolean; lat?: number; lng?: number } => {
  187. // 移除空格
  188. const trimmed = input.trim()
  189. // 检查是否包含逗号
  190. if (!trimmed.includes(',')) {
  191. return { isValid: false }
  192. }
  193. // 分割经纬度
  194. const parts = trimmed.split(',')
  195. if (parts.length !== 2) {
  196. return { isValid: false }
  197. }
  198. // 转换为数字并验证
  199. const lat = parseFloat(parts[0].trim())
  200. const lng = parseFloat(parts[1].trim())
  201. // 验证是否为有效数字
  202. if (isNaN(lat) || isNaN(lng)) {
  203. return { isValid: false }
  204. }
  205. // 验证纬度范围 (-90 到 90)
  206. if (lat < -90 || lat > 90) {
  207. return { isValid: false }
  208. }
  209. // 验证经度范围 (-180 到 180)
  210. if (lng < -180 || lng > 180) {
  211. return { isValid: false }
  212. }
  213. return { isValid: true, lat, lng }
  214. }
  215. // 根据经纬度定位地图
  216. const locateByCoordinates = (lat: number, lng: number) => {
  217. if (!map) {
  218. ElMessage.error('地图未初始化')
  219. return
  220. }
  221. try {
  222. // 创建经纬度点
  223. const lngLat = new AMap.LngLat(lng, lat)
  224. // 设置地图中心点并调整缩放级别
  225. map.setZoomAndCenter(15, lngLat)
  226. // 清除之前的标记
  227. map.clearMap()
  228. // 添加标记
  229. const marker = new AMap.Marker({
  230. position: lngLat,
  231. content: '<div class="amap_lib_placeSearch_poi"></div>',
  232. offset: new AMap.Pixel(-10, -31)
  233. })
  234. map.add(marker)
  235. // 清空搜索结果显示
  236. const searchResults = document.getElementById('searchResults')
  237. if (searchResults) {
  238. searchResults.innerHTML = `
  239. <div style="padding: 16px; text-align: center; color: #606266;width:345px;height: 106px;border: 1px solid #D9D9D9;">
  240. <div style="font-weight: 500; margin-bottom: 8px;color:#67C23A;">经纬度定位成功</div>
  241. <div style="font-size: 14px;color: #A7A7A7;">
  242. 纬度: ${lat}<br/>
  243. 经度: ${lng}
  244. </div>
  245. </div>
  246. `
  247. }
  248. ElMessage.success('经纬度定位成功')
  249. } catch (error) {
  250. console.error('经纬度定位失败:', error)
  251. ElMessage.error('经纬度定位失败')
  252. }
  253. }
  254. // 清除防抖定时器
  255. const clearSearchDebounce = () => {
  256. if (searchDebounceTimer) {
  257. clearTimeout(searchDebounceTimer)
  258. searchDebounceTimer = null
  259. }
  260. }
  261. // 防抖搜索函数
  262. const debouncedSearch = (inputValue: string, searchType: string) => {
  263. clearSearchDebounce()
  264. searchDebounceTimer = setTimeout(() => {
  265. if (searchType === '2') {
  266. // 经纬度搜索
  267. if (!inputValue.trim()) {
  268. // 输入为空时,清空搜索结果
  269. const searchResults = document.getElementById('searchResults')
  270. if (searchResults) {
  271. searchResults.innerHTML = '暂无数据'
  272. }
  273. return
  274. }
  275. const validation = validateCoordinates(inputValue)
  276. if (validation.isValid && validation.lat !== undefined && validation.lng !== undefined) {
  277. // 经纬度格式正确,进行定位
  278. locateByCoordinates(validation.lat, validation.lng)
  279. } else {
  280. // 经纬度格式错误,只在搜索结果区域显示提示,不弹窗
  281. const searchResults = document.getElementById('searchResults')
  282. if (searchResults) {
  283. searchResults.innerHTML = `
  284. <div style="padding: 16px; text-align: center; width:345px;height: 106px;border: 1px solid #D9D9D9;">
  285. <div style="font-weight: 600; margin-bottom: 8px;color: #B3261E;">经纬度格式错误</div>
  286. <div style="font-size: 12px; line-height: 1.5;color:#A7A7A7;">
  287. 请输入正确的经纬度格式:<br/>
  288. 纬度,经度(例如:23.11766,113.28122)<br/>
  289. 纬度范围:-90 到 90<br/>
  290. 经度范围:-180 到 180
  291. </div>
  292. </div>
  293. `
  294. }
  295. }
  296. } else {
  297. console.log(22222)
  298. // 地址搜索,保持原有逻辑
  299. if (poiPicker) {
  300. poiPicker.placeSearch.opt.pageIndex = 1;
  301. poiPicker.searchByKeyword(inputValue)
  302. }
  303. }
  304. }, 500) // 500ms防抖延迟
  305. }
  306. const handleSearch = (e) => {
  307. console.log('handleSearch', e.target.value)
  308. const inputValue = e.target.value
  309. searchInputValue.value = inputValue
  310. // 对于经纬度搜索,强制隐藏POI选择列表
  311. if (selectedSearchAdress.value === '2' && poiPicker) {
  312. poiPicker.hideSearchResults()
  313. }
  314. // 使用防抖搜索
  315. debouncedSearch(inputValue, selectedSearchAdress.value)
  316. }
  317. // 添加标记
  318. const addMarker = (lng: number, lat: number) => {
  319. // 添加新标记
  320. var marker = new AMap.Marker({
  321. position: new AMap.LngLat(lng, lat),
  322. content: '<div class="amap_lib_placeSearch_poi"></div>',
  323. offset: new AMap.Pixel(-10, -31)
  324. });
  325. map.add(marker)
  326. }
  327. // 处理弹窗关闭
  328. const handleClose = () => {
  329. visible.value = false
  330. selectedLocation.value = null
  331. keyword.value = ''
  332. // 清理地图
  333. if (map) {
  334. map.destroy()
  335. map = null
  336. }
  337. }
  338. const getMapSize = () => {
  339. if (!map) {
  340. ElMessage.error('地图未初始化')
  341. return
  342. }
  343. try {
  344. // 获取当前地图的可视区域边界
  345. const bounds = map.getBounds()
  346. const southwest = bounds.getSouthWest() // 西南角
  347. const northeast = bounds.getNorthEast() // 东北角
  348. const northwest = new (window as any).AMap.LngLat(southwest.lng, northeast.lat) // 西北角
  349. const southeast = new (window as any).AMap.LngLat(northeast.lng, southwest.lat) // 东南角
  350. // 使用高德地图的几何工具计算距离(单位:米)
  351. const AMap = (window as any).AMap
  352. // 计算宽度(东西方向距离)
  353. const width = AMap.GeometryUtil.distance(southwest, southeast)
  354. // 计算高度(南北方向距离)
  355. const height = AMap.GeometryUtil.distance(southwest, northwest)
  356. // 计算面积(平方米)
  357. const area = width * height
  358. // 获取当前缩放级别
  359. const zoom = map.getZoom()
  360. // 获取地图中心点
  361. const center = map.getCenter()
  362. const viewportInfo = {
  363. width: width, // 宽度(米)
  364. height: height, // 高度(米)
  365. area: Math.round(area), // 面积(平方米)
  366. zoom: zoom, // 缩放级别
  367. center: {
  368. lat: center.lat,
  369. lng: center.lng
  370. },
  371. bounds: {
  372. southwest: { lat: southwest.lat, lng: southwest.lng },
  373. northeast: { lat: northeast.lat, lng: northeast.lng }
  374. }
  375. }
  376. console.log('当前可视区域信息:', viewportInfo)
  377. // ElMessage.success(`
  378. // 可视区域信息:
  379. // 宽度:${viewportInfo.width.toLocaleString()} 米
  380. // 高度:${viewportInfo.height.toLocaleString()} 米
  381. // 面积:${viewportInfo.area.toLocaleString()} 平方米
  382. // 缩放级别:${viewportInfo.zoom.toFixed(2)}
  383. // `)
  384. return {
  385. width: viewportInfo.width,
  386. height: viewportInfo.height,
  387. }
  388. } catch (error) {
  389. console.error('计算可视区域失败:', error)
  390. ElMessage.error('计算可视区域失败')
  391. }
  392. }
  393. const getCanvasImage = async (): Promise<{url: string, fileName: string} | null> => {
  394. try {
  395. // 使用html2canvas截图高德地图可视化区域
  396. const mapElement = document.getElementById('container')
  397. if (!mapElement) {
  398. ElMessage.error('地图容器未找到')
  399. return null
  400. }
  401. // ElMessage.info('正在生成地图截图...')
  402. // 配置html2canvas选项
  403. const canvas = await html2canvas(mapElement, {
  404. useCORS: true,
  405. allowTaint: true,
  406. scale: 1,
  407. logging: false,
  408. imageTimeout: 15000,
  409. // 忽略某些元素(比如控件)
  410. ignoreElements: (element) => {
  411. return element.classList.contains('amap-logo') ||
  412. element.classList.contains('amap-copyright') ||
  413. element.classList.contains('amap-controls')
  414. }
  415. })
  416. // 将canvas转换为Blob
  417. const blob = await canvasToBlob(canvas, 0.8, 'image/jpeg')
  418. // 生成文件名
  419. const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
  420. const fileName = `map-screenshot-${timestamp}.jpg`
  421. // 转换为File对象
  422. const file = blobToFile(blob, fileName)
  423. // 上传文件
  424. const uploadResult = await uploadFileToServer(file, (progressEvent) => {
  425. // 可选:显示上传进度
  426. if (progressEvent.lengthComputable) {
  427. const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
  428. console.log(`上传进度: ${percentCompleted}%`)
  429. }
  430. })
  431. console.log('上传成功:', uploadResult)
  432. return uploadResult
  433. } catch (error) {
  434. console.error('截图或上传失败:', error)
  435. ElMessage.error('截图或上传失败,请重试')
  436. return null
  437. }
  438. }
  439. // 处理确认选择
  440. const handleConfirm = async () => {
  441. try {
  442. if (!props.caseId) {
  443. ElMessage.error('缺少案件ID参数')
  444. return
  445. }
  446. // 获取地图尺寸信息
  447. const mapSizeInfo = getMapSize()
  448. if (!mapSizeInfo) {
  449. ElMessage.error('获取地图尺寸失败')
  450. return
  451. }
  452. // 获取截图并上传
  453. const uploadResult = await getCanvasImage()
  454. if (!uploadResult) {
  455. ElMessage.error('截图上传失败')
  456. return
  457. }
  458. // ElMessage.info('正在保存方位图信息...')
  459. // 调用案件制表接口
  460. const response = await axios({
  461. url: addOrUpdateCaseTabulation,
  462. method: 'POST',
  463. data: {
  464. caseId: props.caseId,
  465. width: mapSizeInfo.width,
  466. high: mapSizeInfo.height,
  467. listCover: '', // 封面图不传,等那边确定才会有
  468. mapUrl: uploadResult.url, // 地图URL
  469. title: '方位图'
  470. }
  471. })
  472. console.log('方位图保存成功:', response)
  473. if(appId === 'fire'){
  474. window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
  475. } else if(appId === 'criminal'){
  476. window.open(`${url}/draw/criminal/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
  477. } else if(appId === 'cjzfire'){
  478. window.open(`${url}/draw/cjzfire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
  479. } else if(appId === 'xmfire'){
  480. window.open(`${url}/draw/xmfire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
  481. } else{
  482. window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
  483. }
  484. // console.log(`http://test-mix3d.4dkankan.com/draw/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`)
  485. handleClose()
  486. } catch (error) {
  487. console.error('保存方位图失败:', error)
  488. // ElMessage.error('保存方位图失败,请重试')
  489. }
  490. }
  491. // 组件卸载时清理
  492. onUnmounted(() => {
  493. if (map) {
  494. map.destroy()
  495. }
  496. // 清除防抖定时器
  497. clearSearchDebounce()
  498. })
  499. </script>
  500. <style lang="scss">
  501. .map-fire-dialog{
  502. .el-dialog__header{
  503. text-align: left;
  504. border-bottom: 1px solid #dcdfe6;
  505. margin-bottom: 16px;
  506. }
  507. // https://a.amap.com/jsapi/static/image/plugin/marker_red.png
  508. .amap-marker{
  509. display: none!important;
  510. }
  511. .amap-info-contentContainer{
  512. display: none!important;
  513. }
  514. }
  515. </style>
  516. <style scoped lang="scss">
  517. .map-dialog-content {
  518. height: 600px;
  519. display: flex;
  520. // flex-direction: column;
  521. }
  522. #panel {
  523. // position: absolute;
  524. // top: 24px;
  525. // left: 24px;
  526. height: 100%;
  527. overflow: auto;
  528. width: 400px;
  529. padding-right: 16px;
  530. // z-index: 999;
  531. background: #fff;
  532. :deep(.amap-ui-poi-picker-sugg-container) {
  533. display: none;
  534. }
  535. #searchBar{
  536. display: flex;
  537. width: 380px;
  538. text-align: left;
  539. margin-bottom: 16px;
  540. }
  541. .search-select{
  542. width: 100px;
  543. height: 40px!important;
  544. :deep(.el-select__wrapper){
  545. border-radius: 4px 0 0 4px;
  546. height: 40px;
  547. }
  548. }
  549. .search-input-latlng{
  550. width: 260px;
  551. height: 38px;
  552. border-radius: 0 4px 4px 0;
  553. border: 1px solid #dcdfe6;
  554. border-left: 0;
  555. padding: 0 10px;
  556. font-size: 14px;
  557. color: #303133;
  558. background: #fff;
  559. outline: none;
  560. }
  561. :deep(#searchInput) {
  562. width: 260px;
  563. height: 38px;
  564. border-radius: 0 4px 4px 0;
  565. border: 1px solid #dcdfe6;
  566. border-left: 0;
  567. padding: 0 10px;
  568. font-size: 14px;
  569. color: #303133;
  570. background: #fff;
  571. outline: none;
  572. }
  573. }
  574. #searchResults {
  575. width: 100%;
  576. height: 540px;
  577. overflow: auto;
  578. }
  579. .search-section {
  580. position: relative;
  581. margin-bottom: 16px;
  582. z-index: 1000;
  583. }
  584. .search-results {
  585. position: absolute;
  586. top: 100%;
  587. left: 0;
  588. right: 0;
  589. background: white;
  590. border: 1px solid #dcdfe6;
  591. border-top: none;
  592. border-radius: 0 0 4px 4px;
  593. max-height: 200px;
  594. overflow-y: auto;
  595. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  596. }
  597. .search-item {
  598. padding: 12px 16px;
  599. cursor: pointer;
  600. border-bottom: 1px solid #f0f0f0;
  601. transition: background-color 0.2s;
  602. &:hover {
  603. background-color: #f5f7fa;
  604. }
  605. &:last-child {
  606. border-bottom: none;
  607. }
  608. }
  609. .item-name {
  610. font-weight: 500;
  611. color: #303133;
  612. margin-bottom: 4px;
  613. }
  614. .item-address {
  615. font-size: 12px;
  616. color: #909399;
  617. }
  618. .map-container {
  619. width: 800px;
  620. height: 600px;
  621. position: relative;
  622. border: 1px solid #dcdfe6;
  623. border-radius: 4px;
  624. overflow: hidden;
  625. }
  626. .amap-wrapper {
  627. width: 100%;
  628. height: 100%;
  629. }
  630. .location-info {
  631. margin-top: 16px;
  632. }
  633. .dialog-footer {
  634. display: flex;
  635. justify-content: flex-end;
  636. gap: 12px;
  637. }
  638. // 覆盖高德地图控件样式
  639. :deep(.amap-logo) {
  640. display: none !important;
  641. }
  642. :deep(.amap-copyright) {
  643. display: none !important;
  644. }
  645. </style>