| | |
| | | import { getList } from "@/api/emergencySupplies/emergencySupplies" |
| | | import { reactive } from "vue" |
| | | |
| | | const { VITE_APP_BASE } = import.meta.env |
| | | |
| | | let image = ref(VITE_APP_BASE + 'img/mapicon/yjwz.png') |
| | | |
| | | |
| | | const loading = ref(false) |
| | | |
| | | const tableData = ref([]) |
| | |
| | | let addTileLayers = {} |
| | | // 行点击 |
| | | function rowClick(row) { |
| | | // window.$viewer.flyToPosition(new DC.Position(row.lng, row.lat, 600, 0, -90, 0)) |
| | | |
| | | // return |
| | | // 销毁之前的 |
| | | destroy() |
| | | if (!addTileLayers[row.name]) { |
| | | addTileLayers[row.name] = new DC.HtmlLayer(row.name) |
| | | window.$viewer.addLayer(addTileLayers[row.name]) |
| | |
| | | |
| | | // if ('showPanel' in item && item.showPanel == false) { |
| | | // if (item.backgroundIcon) { |
| | | // iconEl = ` |
| | | // <div class="map-name">${i[item.showParams] || i.name}</div> |
| | | // <div class="map-icon"> |
| | | // <img src="${item.backgroundIcon}"> |
| | | // </div> |
| | | // ` |
| | | iconEl = ` |
| | | <div class="map-name">${row.name}</div> |
| | | <div class="map-icon"> |
| | | <img src="${image.value}"> |
| | | </div> |
| | | ` |
| | | // } |
| | | // } else |
| | | { |
| | | iconEl = `<div class="marsBlueGradientPnl"> |
| | | <div>${row.name}</div> |
| | | </div>` |
| | | } |
| | | // { |
| | | // iconEl = `<div class="marsBlueGradientPnl"> |
| | | // <div>${row.name}</div> |
| | | // </div>` |
| | | // } |
| | | |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(row.lng, row.lat, 64), |
| | | `<div class="public-map-popup ${'sk-box'}"> |
| | | `<div class="public-map-popup ${'qyfb-box'}"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | |
| | | } |
| | | } |
| | | |
| | | onUnmounted(() => { |
| | | console.log('销毁***************************') |
| | | // 销毁 |
| | | function destroy() { |
| | | let arr = Object.keys(addTileLayers) |
| | | arr.forEach(i => { |
| | | addTileLayers[i] && window.$viewer.removeLayer(addTileLayers[i]) |
| | | }) |
| | | } |
| | | |
| | | onUnmounted(() => { |
| | | console.log('销毁***************************') |
| | | destroy() |
| | | }) |
| | | </script> |
| | | |
| | |
| | | <div class="table-box"> |
| | | <el-table :data="tableData" empty-text="" style="width: 100%" :header-cell-style="headerCellStyle" |
| | | :cell-style="tableCellStyle" element-loading-background="rgba(122, 122, 122, 0.1)"> |
| | | <el-table-column prop="name" label="名称" width="160" /> |
| | | <el-table-column prop="name" label="名称" width="200" /> |
| | | <el-table-column prop="numUnit" label="数量" /> |
| | | <el-table-column prop="personInCha" label="负责人" /> |
| | | <el-table-column fixed="right" label="操作" width="80"> |
| | | <el-table-column label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :disabled="scope.row.lng == ''" |
| | | @click="rowClick(scope.row)">定位</el-button> |