Compare commits
2 Commits
ffa2fbf108
...
c4829a63ff
| Author | SHA1 | Date |
|---|---|---|
|
|
c4829a63ff | |
|
|
407564d621 |
|
|
@ -150,7 +150,6 @@
|
||||||
</style>
|
</style>
|
||||||
<div class="app-loading">
|
<div class="app-loading">
|
||||||
<div class="app-loading-wrap">
|
<div class="app-loading-wrap">
|
||||||
<img src="<%= VITE_GLOB_APP_LOGO %>" class="app-loading-logo" alt="Logo" />
|
|
||||||
<div class="app-loading-dots">
|
<div class="app-loading-dots">
|
||||||
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- -->
|
<!-- 坐标输入框 -->
|
||||||
<div class="to-location-input" v-if="LocationShow">
|
<div class="to-location-input" v-if="LocationShow">
|
||||||
<div class="location-operation">
|
<div class="location-operation">
|
||||||
<a-button type="default" size="small" @click="handlerPushLocationItem"><PlusOutlined />添加</a-button>
|
<a-button type="default" size="small" @click="handlerPushLocationItem"><PlusOutlined />添加</a-button>
|
||||||
|
|
@ -87,6 +87,7 @@
|
||||||
|
|
||||||
import U from 'mapbox-gl-utils';
|
import U from 'mapbox-gl-utils';
|
||||||
import 'mapbox-gl/dist/mapbox-gl.css';
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
||||||
|
|
||||||
import './src/index.less';
|
import './src/index.less';
|
||||||
import { MapboxConfig, MapboxDefaultStyle, MapControlConfig } from './src/config';
|
import { MapboxConfig, MapboxDefaultStyle, MapControlConfig } from './src/config';
|
||||||
import { MP } from './src/MP';
|
import { MP } from './src/MP';
|
||||||
|
|
@ -182,11 +183,12 @@
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
mapboxgl.accessToken = MapboxConfig.ACCESS_TOKEN;
|
mapboxgl.accessToken = MapboxConfig.ACCESS_TOKEN;
|
||||||
map = initMap();
|
map = initMap();
|
||||||
|
|
||||||
map.on('load', () => {
|
map.on('load', () => {
|
||||||
|
|
||||||
// 根据地图配置信息加载地形数据
|
// 根据地图配置信息加载地形数据
|
||||||
if(props.mapConfig.mode == "3D"){
|
if(props.mapConfig.mode == "3D"){
|
||||||
handlerLoadTerrain();
|
// handlerLoadTerrain();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化绘图空间
|
// 初始化绘图空间
|
||||||
|
|
@ -200,6 +202,7 @@
|
||||||
map.on('draw.selectionchange', (e) => {
|
map.on('draw.selectionchange', (e) => {
|
||||||
// handlerCopyToTargetLayer(e);
|
// handlerCopyToTargetLayer(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
emit('mapOnLoad', map);
|
emit('mapOnLoad', map);
|
||||||
|
|
||||||
// 设置绘图监听事件
|
// 设置绘图监听事件
|
||||||
|
|
@ -274,6 +277,8 @@
|
||||||
}
|
}
|
||||||
baseLayers.push(layers)
|
baseLayers.push(layers)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 图层管理工具
|
||||||
map.addControl(new SwitchLayerControl({
|
map.addControl(new SwitchLayerControl({
|
||||||
name:"图层管理" ,
|
name:"图层管理" ,
|
||||||
position:"top-left",
|
position:"top-left",
|
||||||
|
|
@ -296,8 +301,7 @@
|
||||||
layers:baseLayers
|
layers:baseLayers
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}),"top-left");
|
}),"top-left");
|
||||||
|
|
||||||
|
|
||||||
// 应用图层绑定点击事件
|
// 应用图层绑定点击事件
|
||||||
applicationLayers.forEach((item,index)=>{
|
applicationLayers.forEach((item,index)=>{
|
||||||
|
|
@ -398,8 +402,6 @@
|
||||||
zoom: props.mapConfig.zoom ? props.mapConfig.zoom:10,
|
zoom: props.mapConfig.zoom ? props.mapConfig.zoom:10,
|
||||||
pitch:props.mapConfig.angle ? props.mapConfig.angle:0,
|
pitch:props.mapConfig.angle ? props.mapConfig.angle:0,
|
||||||
center: props.mapConfig.center?.split(",") ? props.mapConfig.center?.split(",") : [117.984425,35.270654],
|
center: props.mapConfig.center?.split(",") ? props.mapConfig.center?.split(",") : [117.984425,35.270654],
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
export enum MapboxConfig {
|
export enum MapboxConfig {
|
||||||
// ACCESS_TOKEN = 'pk.eyJ1Ijoic2hpY2hhbzEyMyIsImEiOiJja3FobnI1aDEwNGF6Mm9vOXVhNnBzZmFhIn0.2fZKiMqCQHxVY74QShMEGQ',
|
ACCESS_TOKEN = 'pk.eyJ1Ijoic2hpY2hhbzEyMyIsImEiOiJja3FobnI1aDEwNGF6Mm9vOXVhNnBzZmFhIn0.2fZKiMqCQHxVY74QShMEGQ',
|
||||||
ACCESS_TOKEN = "1234",
|
// ACCESS_TOKEN = "1234",
|
||||||
TDT_TOKEN = 'b6585bc41ee16251dbe6b1af64f375d9',
|
TDT_TOKEN = 'b6585bc41ee16251dbe6b1af64f375d9',
|
||||||
// add more config options here
|
// add more config options here
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
<template>
|
||||||
|
<div class="image-container">
|
||||||
|
<img :src="base64Url" alt="">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
|
||||||
|
import {ref,defineProps} from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
url:String
|
||||||
|
})
|
||||||
|
|
||||||
|
const base64Url = ref<String>("")
|
||||||
|
|
||||||
|
|
||||||
|
function ImageToBase64(url){
|
||||||
|
return new Promise(function(resolve,reject){
|
||||||
|
let img = new Image();
|
||||||
|
img.crossOrigin = 'Anonymous';
|
||||||
|
img.src=url;
|
||||||
|
try{
|
||||||
|
img.onload = function(){
|
||||||
|
let canvas = document.createElement('canvas');
|
||||||
|
canvas.width = img.width;
|
||||||
|
canvas.height = img.height;
|
||||||
|
let ctx = canvas.getContext('2d');
|
||||||
|
ctx?.drawImage(img, 0, 0);
|
||||||
|
let dataURL = canvas.toDataURL('image/jpeg'); // 或者使用 'image/jpeg' 来获得 JPEG 格式的 base64 字符串
|
||||||
|
resolve(dataURL);
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
reject("NO");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageToBase64(props.url).then(res=>{
|
||||||
|
base64Url.value = res.toString();
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="less" scoped>
|
||||||
|
.image-container{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
img {
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
<div class="data-list-div">
|
<div class="data-list-div">
|
||||||
<div v-for="(item, index) in props.infoDataList" :key="index" class="data-list-item">
|
<div v-for="(item, index) in props.infoDataList" :key="index" class="data-list-item">
|
||||||
<div class="select-mark"></div>
|
<div class="select-mark"></div>
|
||||||
<Icon style="font-size: 30px; color: #bf0000" icon="gis:poi-alt" />
|
<Icon style="font-size: 30px; color: #bf0000" icon="gis:poi-alt" @click="locationFun(item)" />
|
||||||
<div class="data-list-item-content">
|
<div class="data-list-item-content">
|
||||||
<div class="item-info-div">
|
<div class="item-info-div">
|
||||||
|
|
||||||
|
|
@ -188,7 +188,8 @@ const emits = defineEmits([
|
||||||
"closeShowInfo",
|
"closeShowInfo",
|
||||||
"mapListScreenChange",
|
"mapListScreenChange",
|
||||||
"changeInfoPage",
|
"changeInfoPage",
|
||||||
"getInfoList"
|
"getInfoList",
|
||||||
|
"changeTask"
|
||||||
])
|
])
|
||||||
const props = defineProps([
|
const props = defineProps([
|
||||||
"infoScreenData",
|
"infoScreenData",
|
||||||
|
|
@ -200,9 +201,16 @@ const props = defineProps([
|
||||||
"total",
|
"total",
|
||||||
"infoDataList"
|
"infoDataList"
|
||||||
])
|
])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('onMounted')
|
console.log('onMounted')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function locationFun(record) {
|
||||||
|
console.log(record);
|
||||||
|
emits('changeTask', record.geomid);
|
||||||
|
}
|
||||||
|
|
||||||
const changePage = (page, pageSize) => {
|
const changePage = (page, pageSize) => {
|
||||||
console.log(page,pageSize)
|
console.log(page,pageSize)
|
||||||
emits('changeInfoPage',page,pageSize)
|
emits('changeInfoPage',page,pageSize)
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,22 @@
|
||||||
@changeInfoPage="changeInfoPage"
|
@changeInfoPage="changeInfoPage"
|
||||||
@getInfoList="getInfoList"
|
@getInfoList="getInfoList"
|
||||||
@mapListScreenChange="mapListScreenChange"
|
@mapListScreenChange="mapListScreenChange"
|
||||||
@closeShowInfo="changeShowInfo"/>
|
@closeShowInfo="changeShowInfo"
|
||||||
|
@changeTask="changeTask"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="showMap" class="map"></div>
|
<!-- <div id="showMap" class="map"></div> -->
|
||||||
|
<MapboxMap
|
||||||
|
:mapConfig="mapConfig"
|
||||||
|
@handlerDrawComplete="handlerDrawComplete"
|
||||||
|
@mapOnLoad="onMapboxLoad"
|
||||||
|
ref="MapboxComponent"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onUnmounted, watch } from "vue"
|
import { ref, onMounted, onUnmounted, watch,defineAsyncComponent } from "vue"
|
||||||
import mapboxgl, { Map } from 'mapbox-gl';
|
import mapboxgl, { Map } from 'mapbox-gl';
|
||||||
import { MapboxConfig, MapboxDefaultStyle } from '@/components/MapboxMaps/src/config.ts'
|
import { MapboxConfig, MapboxDefaultStyle } from '@/components/MapboxMaps/src/config.ts'
|
||||||
import AuditProgress from './AuditProgress/index.vue'
|
import AuditProgress from './AuditProgress/index.vue'
|
||||||
|
|
@ -39,6 +47,11 @@ import MapList from './MapList/index.vue'
|
||||||
import { getLoadDroneCaseInfoCount, getLoadDroneCaseInfoDetail } from '@/api/bootstraps/index.ts'
|
import { getLoadDroneCaseInfoCount, getLoadDroneCaseInfoDetail } from '@/api/bootstraps/index.ts'
|
||||||
import { batchOptions, yearOptions} from '@/views/demo/bootstraps/curbspotcity/util.ts'
|
import { batchOptions, yearOptions} from '@/views/demo/bootstraps/curbspotcity/util.ts'
|
||||||
import { getChildrenTree } from '@/api/demo/system.ts'
|
import { getChildrenTree } from '@/api/demo/system.ts'
|
||||||
|
import { getGeom } from '@/api/sys/layerManagement';
|
||||||
|
|
||||||
|
const MapboxMap = defineAsyncComponent(() => import('@/components/MapboxMaps/MapComponent.vue'));
|
||||||
|
const MapboxComponent = ref();
|
||||||
|
const mapConfig = ref({ isShowMap: false });
|
||||||
|
|
||||||
const showInfo = ref(false)
|
const showInfo = ref(false)
|
||||||
const year = ref<number>()
|
const year = ref<number>()
|
||||||
|
|
@ -178,7 +191,7 @@ watch(() => batch.value, (newVal) => {
|
||||||
let map: Map;
|
let map: Map;
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
mapboxgl.accessToken = MapboxConfig.ACCESS_TOKEN;
|
mapboxgl.accessToken = MapboxConfig.ACCESS_TOKEN;
|
||||||
map = initMap();
|
// map = initMap();
|
||||||
getLoadDroneCaseInfoCount().then(res => {
|
getLoadDroneCaseInfoCount().then(res => {
|
||||||
dataList.value = res
|
dataList.value = res
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
@ -212,6 +225,41 @@ const changeInfoPage = (page, limit) => {
|
||||||
pageSize.value = limit
|
pageSize.value = limit
|
||||||
getInfoList()
|
getInfoList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeTask(val) {
|
||||||
|
console.log(val);
|
||||||
|
let getGeomPrams = {
|
||||||
|
TableName: 'drone_shp_data ',
|
||||||
|
FieldName: 'gid',
|
||||||
|
FieldValue: val,
|
||||||
|
page: 1,
|
||||||
|
limit: 999,
|
||||||
|
key: null,
|
||||||
|
};
|
||||||
|
if (val) {
|
||||||
|
getGeom(getGeomPrams).then((res) => {
|
||||||
|
let geoms = [];
|
||||||
|
if (res) {
|
||||||
|
if (res.items?.length > 0) {
|
||||||
|
res.items.forEach((item, index) => {
|
||||||
|
let geom = {
|
||||||
|
key: item.gid,
|
||||||
|
mapgeom: item.geometry,
|
||||||
|
};
|
||||||
|
geoms.push(geom);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// MapboxComponent.value.handlerDraw(status,mapgemoList.value, false);
|
||||||
|
MapboxComponent.value.handlerDraw('Details', geoms, false);
|
||||||
|
} else {
|
||||||
|
createMessage.error('当前数据没有图斑!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createMessage.error('当前数据没有图斑!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
visibility: "visible",
|
visibility: "visible",
|
||||||
|
"z-index":1,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
|
|
@ -258,6 +259,7 @@
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
visibility: "visible",
|
visibility: "visible",
|
||||||
|
"z-index":0,
|
||||||
},
|
},
|
||||||
paint: {},
|
paint: {},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -514,7 +514,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片预览
|
// 图片预览
|
||||||
const isShowImagePreview = ref<Boolean>(false);
|
const isShowImagePreview = ref<Boolean>(false);
|
||||||
const closeImagePreview = ()=>{
|
const closeImagePreview = ()=>{
|
||||||
isShowImagePreview.value = false;
|
isShowImagePreview.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue