Token修改
commit
27804036dd
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<div class="mapContainer" :id="'mapContainer' + mapRandom">
|
||||||
<div class="mapContainer" :id="'mapContainer'+mapRandom">
|
|
||||||
<div class="refresh-button">
|
<div class="refresh-button">
|
||||||
<ReloadOutlined @click="onrefresh"/>
|
<ReloadOutlined @click="onrefresh" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -11,11 +10,11 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import mapboxgl, { Map, Popup } from 'mapbox-gl';
|
import mapboxgl, { Map, Popup } from 'mapbox-gl';
|
||||||
import { ref, toRefs, watch,onMounted } from 'vue';
|
import { ref, toRefs, watch, onMounted } from 'vue';
|
||||||
import { ReloadOutlined } from '@ant-design/icons-vue';
|
import { ReloadOutlined } from '@ant-design/icons-vue';
|
||||||
import type { UploadFile, UploadProps } from 'ant-design-vue';
|
import type { UploadFile, UploadProps } from 'ant-design-vue';
|
||||||
import { Modal, Upload } from 'ant-design-vue';
|
import { Modal, Upload } from 'ant-design-vue';
|
||||||
import { on } from '@/utils/domUtils';
|
import { on } from '@/utils/domUtils';
|
||||||
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
import { isArray, isFunction, isObject, isString } from '@/utils/is';
|
import { isArray, isFunction, isObject, isString } from '@/utils/is';
|
||||||
|
|
@ -28,7 +27,7 @@ import { on } from '@/utils/domUtils';
|
||||||
import { parse } from 'path';
|
import { parse } from 'path';
|
||||||
|
|
||||||
defineOptions({ name: 'ImageUpload' });
|
defineOptions({ name: 'ImageUpload' });
|
||||||
const mapRandom = ref(parseInt(Math.random()*100000).toString())
|
const mapRandom = ref(parseInt(Math.random() * 100000).toString());
|
||||||
|
|
||||||
const emit = defineEmits(['change', 'update:value', 'delete']);
|
const emit = defineEmits(['change', 'update:value', 'delete']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -52,16 +51,15 @@ import { on } from '@/utils/domUtils';
|
||||||
const isLtMsg = ref<boolean>(true);
|
const isLtMsg = ref<boolean>(true);
|
||||||
const isActMsg = ref<boolean>(true);
|
const isActMsg = ref<boolean>(true);
|
||||||
|
|
||||||
let map:Map;
|
let map: Map;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// mapboxgl.accessToken = "pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg"
|
mapboxgl.accessToken = "pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg"
|
||||||
mapboxgl.accessToken = "123"
|
|
||||||
map = initMap();
|
map = initMap();
|
||||||
map.on("load",function(){
|
map.on('load', function () {
|
||||||
refreshLocation();
|
refreshLocation();
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
|
|
@ -96,74 +94,73 @@ import { on } from '@/utils/domUtils';
|
||||||
);
|
);
|
||||||
|
|
||||||
const initMap = () => {
|
const initMap = () => {
|
||||||
return new mapboxgl.Map({
|
return new mapboxgl.Map({
|
||||||
container: 'mapContainer'+mapRandom.value,
|
container: 'mapContainer' + mapRandom.value,
|
||||||
language: 'zh-cmn',
|
language: 'zh-cmn',
|
||||||
projection: 'equirectangular', // wgs84参考系
|
projection: 'equirectangular', // wgs84参考系
|
||||||
style: {
|
style: {
|
||||||
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
|
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
|
||||||
version: 8,
|
version: 8,
|
||||||
sources: {
|
sources: {
|
||||||
'raster-tiles': {
|
'raster-tiles': {
|
||||||
type: 'raster',
|
type: 'raster',
|
||||||
tiles: [
|
tiles: [
|
||||||
`https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=b6585bc41ee16251dbe6b1af64f375d9`,
|
`https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=b6585bc41ee16251dbe6b1af64f375d9`,
|
||||||
],
|
],
|
||||||
tileSize: 256,
|
tileSize: 256,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
layers: [
|
|
||||||
{
|
|
||||||
id: 'tdt-img-tiles',
|
|
||||||
type: 'raster',
|
|
||||||
source: 'raster-tiles',
|
|
||||||
minzoom: 0,
|
|
||||||
maxzoom: 18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
maxZoom: 22,
|
layers: [
|
||||||
minZoom: 6,
|
{
|
||||||
zoom: 15,
|
id: 'tdt-img-tiles',
|
||||||
center: [118.298906,35.135013],
|
type: 'raster',
|
||||||
});
|
source: 'raster-tiles',
|
||||||
|
minzoom: 0,
|
||||||
|
maxzoom: 18,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
maxZoom: 22,
|
||||||
|
minZoom: 6,
|
||||||
|
zoom: 15,
|
||||||
|
center: [118.298906, 35.135013],
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const refreshLocation = () => {
|
const refreshLocation = () => {
|
||||||
map.addSource('points', {
|
map.addSource('points', {
|
||||||
'type': 'geojson',
|
type: 'geojson',
|
||||||
'data': {
|
data: {
|
||||||
'type': 'FeatureCollection',
|
type: 'FeatureCollection',
|
||||||
'features': [
|
features: [
|
||||||
{
|
{
|
||||||
'type': 'Feature',
|
type: 'Feature',
|
||||||
'properties': {},
|
properties: {},
|
||||||
'geometry': {
|
geometry: {
|
||||||
'type': 'Point',
|
type: 'Point',
|
||||||
'coordinates': [118.298906,35.135013]
|
coordinates: [118.298906, 35.135013],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
// Add a circle layer
|
// Add a circle layer
|
||||||
map.addLayer({
|
map.addLayer({
|
||||||
'id': 'circle',
|
id: 'circle',
|
||||||
'type': 'circle',
|
type: 'circle',
|
||||||
'source': 'points',
|
source: 'points',
|
||||||
'paint': {
|
paint: {
|
||||||
'circle-color': '#409EFF',
|
'circle-color': '#409EFF',
|
||||||
'circle-radius': 6,
|
'circle-radius': 6,
|
||||||
'circle-stroke-width': 3,
|
'circle-stroke-width': 3,
|
||||||
'circle-stroke-color': '#ffffff'
|
'circle-stroke-color': '#ffffff',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onrefresh = () => {
|
const onrefresh = () => {
|
||||||
|
|
||||||
createMessage.success(t('component.map.refreshSuccess'));
|
createMessage.success(t('component.map.refreshSuccess'));
|
||||||
}
|
};
|
||||||
|
|
||||||
function getBase64<T extends string | ArrayBuffer | null>(file: File) {
|
function getBase64<T extends string | ArrayBuffer | null>(file: File) {
|
||||||
return new Promise<T>((resolve, reject) => {
|
return new Promise<T>((resolve, reject) => {
|
||||||
|
|
@ -177,7 +174,7 @@ import { on } from '@/utils/domUtils';
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePreview = async (file: UploadFile) => {
|
const handlePreview = async (file: UploadFile) => {
|
||||||
console.log("fileEEEEE",file);
|
console.log('fileEEEEE', file);
|
||||||
if (!file.url && !file.preview) {
|
if (!file.url && !file.preview) {
|
||||||
file.preview = await getBase64<string>(file.originFileObj!);
|
file.preview = await getBase64<string>(file.originFileObj!);
|
||||||
}
|
}
|
||||||
|
|
@ -255,7 +252,6 @@ import { on } from '@/utils/domUtils';
|
||||||
});
|
});
|
||||||
return props.multiple ? list : list.length > 0 ? list[0] : '';
|
return props.multiple ? list : list.length > 0 ? list[0] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|
@ -269,22 +265,22 @@ import { on } from '@/utils/domUtils';
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mapContainer{
|
.mapContainer {
|
||||||
width:100%;
|
width: 100%;
|
||||||
height:280px;
|
height: 280px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.refresh-button{
|
.refresh-button {
|
||||||
position:absolute;
|
position: absolute;
|
||||||
top:6px;
|
top: 6px;
|
||||||
right:6px;
|
right: 6px;
|
||||||
width:30px;
|
width: 30px;
|
||||||
height:30px;
|
height: 30px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background:#fff;
|
background: #fff;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index:999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1821,7 +1821,7 @@
|
||||||
AddDroneTask({ geomid: geomidStr, caseno: props.caseno }).then((res) => {
|
AddDroneTask({ geomid: geomidStr, caseno: props.caseno }).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
message.success('成功提交云查询');
|
message.success('成功提交云查询');
|
||||||
// useCloudQuery.setIdentification(true);
|
useCloudQuery.setIdentification(true);
|
||||||
} else {
|
} else {
|
||||||
message.error('提交云查询失败');
|
message.error('提交云查询失败');
|
||||||
useCloudQuery.setIdentification(false);
|
useCloudQuery.setIdentification(false);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
export enum MapboxConfig {
|
export enum MapboxConfig {
|
||||||
ACCESS_TOKEN = 'pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg',
|
ACCESS_TOKEN = 'pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg',
|
||||||
// ACCESS_TOKEN = 'pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg'
|
|
||||||
// ACCESS_TOKEN = "1234",
|
// ACCESS_TOKEN = "1234",
|
||||||
TDT_TOKEN = 'b6585bc41ee16251dbe6b1af64f375d9',
|
TDT_TOKEN = 'b6585bc41ee16251dbe6b1af64f375d9',
|
||||||
// add more config options here
|
// add more config options here
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,6 @@
|
||||||
...querys,
|
...querys,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(283, res);
|
|
||||||
if (res.items.length > 0) {
|
if (res.items.length > 0) {
|
||||||
handlerUpdateTaskLayerData(res.items);
|
handlerUpdateTaskLayerData(res.items);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -256,11 +256,10 @@
|
||||||
let filter_yingxiang: any = [];
|
let filter_yingxiang: any = [];
|
||||||
let filter_hangfei: any = [];
|
let filter_hangfei: any = [];
|
||||||
|
|
||||||
console.log(243, checkedKeys);
|
// console.log(243, checkedKeys);
|
||||||
|
|
||||||
if (checkedKeys_now.length == 0) {
|
if (checkedKeys_now.length == 0) {
|
||||||
// 清除全部图层
|
// 清除全部图层
|
||||||
mapboxComponentRef.value.clearTaskLayer('GeoserverManagementRaster');
|
|
||||||
tableData1?.forEach((data) => {
|
tableData1?.forEach((data) => {
|
||||||
mapboxComponentRef.value.clearTaskLayer(data.dataTable);
|
mapboxComponentRef.value.clearTaskLayer(data.dataTable);
|
||||||
});
|
});
|
||||||
|
|
@ -268,6 +267,10 @@
|
||||||
mapboxComponentRef.value.clearTaskLayer(data.layerName);
|
mapboxComponentRef.value.clearTaskLayer(data.layerName);
|
||||||
});
|
});
|
||||||
mapboxComponentRef.value.clearTaskLayer('AchievementManageRaster');
|
mapboxComponentRef.value.clearTaskLayer('AchievementManageRaster');
|
||||||
|
// 历史记录清零
|
||||||
|
filter_tuceng_old = [];
|
||||||
|
filter_yingxiang_old = [];
|
||||||
|
filter_hangfei_old = [];
|
||||||
} else {
|
} else {
|
||||||
let checkedKeys_move = checkedKeys_now.filter(
|
let checkedKeys_move = checkedKeys_now.filter(
|
||||||
(item) => !uniqueKeysArray.concat(['1', '2', '3']).includes(item),
|
(item) => !uniqueKeysArray.concat(['1', '2', '3']).includes(item),
|
||||||
|
|
@ -293,7 +296,9 @@
|
||||||
if (checkedKey == data.id) {
|
if (checkedKey == data.id) {
|
||||||
// 时间轴筛选数据
|
// 时间轴筛选数据
|
||||||
// console.log(endTime, data);
|
// console.log(endTime, data);
|
||||||
if (
|
if (dayjs(startTime).format('YYYY-MM-DD') == dayjs(endTime).format('YYYY-MM-DD')) {
|
||||||
|
filter_yingxiang.push(data);
|
||||||
|
} else if (
|
||||||
// dayjs(startTime).isBefore(data.createTime) &&
|
// dayjs(startTime).isBefore(data.createTime) &&
|
||||||
dayjs(endTime).isAfter(dayjs(data.dateDir))
|
dayjs(endTime).isAfter(dayjs(data.dateDir))
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ export const items_excel = [
|
||||||
export const servicesColumns: BasicColumn[] = [
|
export const servicesColumns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
title: '地址',
|
title: '地址',
|
||||||
dataIndex: 'serverUrl',
|
dataIndex: 'url',
|
||||||
width: 220,
|
width: 220,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -162,294 +162,92 @@ export const MAPBOX_TOKEN = "pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdi
|
||||||
|
|
||||||
export const TINADITU_TOKEN = "b6585bc41ee16251dbe6b1af64f375d9";
|
export const TINADITU_TOKEN = "b6585bc41ee16251dbe6b1af64f375d9";
|
||||||
|
|
||||||
export const defaultData ={
|
export const defaultPaint =
|
||||||
'serverName': '土地分类800M',
|
{
|
||||||
'spatialRef': 'EPSG:4326',
|
'fill-opacity': 1,
|
||||||
'dataSourceType': 'shp',
|
'fill-color': [
|
||||||
'dataType': '面',
|
'case',
|
||||||
'dataTable': 'tudifenlei_1',
|
['==', ['get', 'dlmc'], '采矿用地'],
|
||||||
'shpPath': '20240912\\2024091208530044090088.zip',
|
'#30123b',
|
||||||
'appendPath': '20240912\\2024091208565311250121.sld',
|
['==', ['get', 'dlmc'], '城镇村道路用地'],
|
||||||
'headers': [
|
'#38266a',
|
||||||
{
|
['==', ['get', 'dlmc'], '城镇住宅用地'],
|
||||||
'name': 'Geometry',
|
'#3e3892',
|
||||||
'type': 'geometry(GEOMETRY, 4326)',
|
['==', ['get', 'dlmc'], '干渠'],
|
||||||
'length': 0,
|
'#424ab4',
|
||||||
'refName': 'geometry',
|
['==', ['get', 'dlmc'], '高教用地'],
|
||||||
'initName': null,
|
'#455dd0',
|
||||||
'key': '9ba30ab8fe474468ad40bf409395d9ec'
|
['==', ['get', 'dlmc'], '工业用地'],
|
||||||
},
|
'#476de5',
|
||||||
{
|
['==', ['get', 'dlmc'], '公路用地'],
|
||||||
'name':'OBJECTID',
|
'#448ffe',
|
||||||
'type':'numeric',
|
['==', ['get', 'dlmc'], '公用设施用地'],
|
||||||
'length': 10,
|
'#3e3892',
|
||||||
'refName':'objectid',
|
['==', ['get', 'dlmc'], '公园与绿地'],
|
||||||
'initName': null,
|
'#3c9ffd',
|
||||||
'key':'a65e2754879c405b9e65009378c20a3a'
|
['==', ['get', 'dlmc'], '沟渠'],
|
||||||
},
|
'#31aff5',
|
||||||
{
|
['==', ['get', 'dlmc'], '灌木林地'],
|
||||||
'name':'BSM',
|
'#26bfe8',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '广场用地'],
|
||||||
'length': 18,
|
'#1cced7',
|
||||||
'refName':'bsm',
|
['==', ['get', 'dlmc'], '果园'],
|
||||||
'initName': null,
|
'#18dbc6',
|
||||||
'key':'98d31727112842bd9cbf0cfbfc1573be'
|
['==', ['get', 'dlmc'], '旱地'],
|
||||||
},
|
'#1be5b5',
|
||||||
{
|
['==', ['get', 'dlmc'], '河流水面'],
|
||||||
'name':'YSDM',
|
'#27eea4',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '机场用地'],
|
||||||
'length': 10,
|
'#3af490',
|
||||||
'refName':'ysdm',
|
['==', ['get', 'dlmc'], '机关团体新闻出版用地'],
|
||||||
'initName': null,
|
'#52fa7a',
|
||||||
'key':'e02a883fe14e44e49421a6153e698837'
|
['==', ['get', 'dlmc'], '交通服务场站用地'],
|
||||||
},
|
'#6bfe64',
|
||||||
{
|
['==', ['get', 'dlmc'], '科教文卫用地'],
|
||||||
'name':'TBYBH',
|
'#85ff51',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '坑塘水面'],
|
||||||
'length': 18,
|
'#9bfe41',
|
||||||
'refName':'tbybh',
|
['==', ['get', 'dlmc'], '裸土地'],
|
||||||
'initName': null,
|
'#adfb38',
|
||||||
'key':'8f3ac30c0f4d4fe4ac8bce7f66b0763e'
|
['==', ['get', 'dlmc'], '内陆滩涂'],
|
||||||
},
|
'#bef434',
|
||||||
{
|
['==', ['get', 'dlmc'], '农村道路'],
|
||||||
'name':'TBBH',
|
'#ceeb34',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '农村宅基地'],
|
||||||
'length': 8,
|
'#dde037',
|
||||||
'refName':'tbbh',
|
['==', ['get', 'dlmc'], '其他草地'],
|
||||||
'initName': null,
|
'#ead439',
|
||||||
'key':'ba628a5432024ee2a38551da35505623'
|
['==', ['get', 'dlmc'], '其他林地'],
|
||||||
},
|
'#f4c73a',
|
||||||
{
|
['==', ['get', 'dlmc'], '其他园地'],
|
||||||
'name':'DLBM',
|
'#fbb938',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '乔木林地'],
|
||||||
'length': 5,
|
'#fea933',
|
||||||
'refName':'dlbm',
|
['==', ['get', 'dlmc'], '商业服务业设施用地'],
|
||||||
'initName': null,
|
'#fe972b',
|
||||||
'key':'e4c7a3b02a614060a0e179bc7b853267'
|
['==', ['get', 'dlmc'], '设施农用地'],
|
||||||
},
|
'#fc8323',
|
||||||
{
|
['==', ['get', 'dlmc'], '水工建筑用地'],
|
||||||
'name':'DLMC',
|
'#f76f1a',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '水浇地'],
|
||||||
'length': 60,
|
'#f15c13',
|
||||||
'refName':'dlmc',
|
['==', ['get', 'dlmc'], '水库水面'],
|
||||||
'initName': null,
|
'#e84b0c',
|
||||||
'key':'d6eecd9f2820426c9197c522b7a492a5'
|
['==', ['get', 'dlmc'], '水田'],
|
||||||
},
|
'#de3e08',
|
||||||
{
|
['==', ['get', 'dlmc'], '特殊用地'],
|
||||||
'name':'QSXZ',
|
'#d23105',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], '铁路用地'],
|
||||||
'length': 2,
|
'#c42503',
|
||||||
'refName':'qsxz',
|
['==', ['get', 'dlmc'], '物流仓储用地'],
|
||||||
'initName': null,
|
'#b31b01',
|
||||||
'key':'bb0b777486d247fd8f058b2ffe9941e3'
|
['==', ['get', 'dlmc'], '养殖坑塘'],
|
||||||
},
|
'#a11201',
|
||||||
{
|
['==', ['get', 'dlmc'], '竹林地'],
|
||||||
'name':'QSDWDM',
|
'#8d0a01',
|
||||||
'type':'varchar',
|
['==', ['get', 'dlmc'], ''],
|
||||||
'length': 19,
|
'#7a0403',
|
||||||
'refName':'qsdwdm',
|
'#7a0403',
|
||||||
'initName': null,
|
],
|
||||||
'key':'68b917da21b24cd6b9b0689c00d37cc8'
|
'fill-outline-color': '#232323',
|
||||||
},
|
};
|
||||||
{
|
|
||||||
'name':'QSDWMC',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 254,
|
|
||||||
'refName':'qsdwmc',
|
|
||||||
'initName': null,
|
|
||||||
'key':'d6bd11baa76d40cfb77d79537fcdce87'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'ZLDWDM',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'zldwdm',
|
|
||||||
'initName': null,
|
|
||||||
'key':'607da001aff34e018e696e25871e3b3d'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'ZLDWMC',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 254,
|
|
||||||
'refName':'zldwmc',
|
|
||||||
'initName': null,
|
|
||||||
'key':'4f281fa729d942ae93312452b108419f'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'TBMJ',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'tbmj',
|
|
||||||
'initName': null,
|
|
||||||
'key':'2d57075e983443d6a1543da9eea5f6ad'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'KCDLBM',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 5,
|
|
||||||
'refName':'kcdlbm',
|
|
||||||
'initName': null,
|
|
||||||
'key':'f796b47b06bc47329c5608657a4f1b56'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'KCXS',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'kcxs',
|
|
||||||
'initName': null,
|
|
||||||
'key':'a6450d82d6844fba94c6fad7abecc65f'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'KCMJ',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'kcmj',
|
|
||||||
'initName': null,
|
|
||||||
'key':'1dc2d316e76744b39f2c30113a20f41e'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'TBDLMJ',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'tbdlmj',
|
|
||||||
'initName': null,
|
|
||||||
'key':'b4883bae1f4a4d05b8051a21c564da4d'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'GDLX',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 2,
|
|
||||||
'refName':'gdlx',
|
|
||||||
'initName': null,
|
|
||||||
'key':'3ce8d0c33ae34841895e8858ae12cdd5'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'XZDWKD',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'xzdwkd',
|
|
||||||
'initName': null,
|
|
||||||
'key':'50da80fe782c491db587f7c90a72fd5a'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'TBXHDM',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 10,
|
|
||||||
'refName':'tbxhdm',
|
|
||||||
'initName': null,
|
|
||||||
'key':'e6827e45e0f84ce2ac86987c12418b4d'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'TBXHMC',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 20,
|
|
||||||
'refName':'tbxhmc',
|
|
||||||
'initName': null,
|
|
||||||
'key':'4bf92ecfc5c940ae9932b23935804409'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'ZZSXDM',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 6,
|
|
||||||
'refName':'zzsxdm',
|
|
||||||
'initName': null,
|
|
||||||
'key':'bf5e0882becb44e28cf7298a43b6d228'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'ZZSXMC',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 20,
|
|
||||||
'refName':'zzsxmc',
|
|
||||||
'initName': null,
|
|
||||||
'key':'c9a8c18c6c224b5395ef093486828e7f'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'GDDB',
|
|
||||||
'type':'numeric',
|
|
||||||
'length': 10,
|
|
||||||
'refName':'gddb',
|
|
||||||
'initName': null,
|
|
||||||
'key':'d0a1369f55174189b27e229568418655'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'CZCSXM',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 4,
|
|
||||||
'refName':'czcsxm',
|
|
||||||
'initName': null,
|
|
||||||
'key':'feabd673566b45189c1175cc8d797291'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'SJNF',
|
|
||||||
'type':'numeric',
|
|
||||||
'length': 10,
|
|
||||||
'refName':'sjnf',
|
|
||||||
'initName': null,
|
|
||||||
'key':'d2aac801f5d14c608d77595fc776824e'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'MSSM',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 2,
|
|
||||||
'refName':'mssm',
|
|
||||||
'initName': null,
|
|
||||||
'key':'5b21cdfc6abf4accb47890e36a17d7d5'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'GDPDJB',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 2,
|
|
||||||
'refName':'gdpdjb',
|
|
||||||
'initName': null,
|
|
||||||
'key':'50f885d39abe46f68ba97e1f4a013f85'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'FRDBS',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 1,
|
|
||||||
'refName':'frdbs',
|
|
||||||
'initName': null,
|
|
||||||
'key':'ce963ef7e22046bcb43ad4ce0fb644f0'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'HDMC',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 100,
|
|
||||||
'refName':'hdmc',
|
|
||||||
'initName': null,
|
|
||||||
'key':'bd58262d73b54b94b97306d76510af79'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'BZ',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 254,
|
|
||||||
'refName':'bz',
|
|
||||||
'initName': null,
|
|
||||||
'key':'e2a0a24cb5874af6a1f198195f24c9c3'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'乡镇',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 50,
|
|
||||||
'refName':'乡镇',
|
|
||||||
'initName': null,
|
|
||||||
'key':'a61a833703e7487c9b76219da5518ab7'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'Shape_Leng',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'shape_leng',
|
|
||||||
'initName': null,
|
|
||||||
'key':'73bfa4144db64bf299c0d10d9870d8cc'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name':'Shape_Area',
|
|
||||||
'type':'varchar',
|
|
||||||
'length': 19,
|
|
||||||
'refName':'shape_area',
|
|
||||||
'initName': null,
|
|
||||||
'key':'f5be14198b3d4e959cee958f59d3fceb'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
import { WktToGeojson } from '@/components/MapboxMaps/src/WktGeojsonTransform';
|
import { WktToGeojson } from '@/components/MapboxMaps/src/WktGeojsonTransform';
|
||||||
import mapboxgl, { Map, Popup } from 'mapbox-gl';
|
import mapboxgl, { Map, Popup } from 'mapbox-gl';
|
||||||
import { getGeomData } from '@/api/demo/system';
|
import { getGeomData } from '@/api/demo/system';
|
||||||
import { MAPBOX_TOKEN, TINADITU_TOKEN } from './clound.data';
|
import { MAPBOX_TOKEN, TINADITU_TOKEN, defaultPaint } from './clound.data';
|
||||||
import { getAppEnvConfig } from '@/utils/env';
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
|
@ -119,11 +119,6 @@
|
||||||
}
|
}
|
||||||
if (layerName && map.getLayer(layerName)) {
|
if (layerName && map.getLayer(layerName)) {
|
||||||
map.moveLayer(layerName, '');
|
map.moveLayer(layerName, '');
|
||||||
if (layerName == 'GeoserverManagementRaster') {
|
|
||||||
if (map.getLayer('countyLayer')) {
|
|
||||||
map.moveLayer('countyLayer', 'GeoserverManagementRaster');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (layerName == 'AchievementManageRaster') {
|
if (layerName == 'AchievementManageRaster') {
|
||||||
if (map.getLayer('clusters')) {
|
if (map.getLayer('clusters')) {
|
||||||
map.moveLayer('AchievementManageRaster', 'clusters');
|
map.moveLayer('AchievementManageRaster', 'clusters');
|
||||||
|
|
@ -191,11 +186,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layerName && map.getLayer(layerName)) {
|
if (layerName && map.getLayer(layerName)) {
|
||||||
if (layerName == 'GeoserverManagementRaster') {
|
if (layerName == 'AchievementManageRaster') {
|
||||||
if (map.getLayer('streetLayer')) {
|
|
||||||
map.moveLayer('streetLayer', 'GeoserverManagementRaster');
|
|
||||||
}
|
|
||||||
} else if (layerName == 'AchievementManageRaster') {
|
|
||||||
if (map.getLayer('clusters')) {
|
if (map.getLayer('clusters')) {
|
||||||
map.moveLayer('AchievementManageRaster', 'clusters');
|
map.moveLayer('AchievementManageRaster', 'clusters');
|
||||||
}
|
}
|
||||||
|
|
@ -214,50 +205,16 @@
|
||||||
|
|
||||||
// 图层管理-图层
|
// 图层管理-图层
|
||||||
function GeoserverManagementRaster(chooseRows, lngLat, zoom, isMove) {
|
function GeoserverManagementRaster(chooseRows, lngLat, zoom, isMove) {
|
||||||
// 清除图层
|
|
||||||
// clearTaskLayer('GeoserverManagementRaster');
|
|
||||||
// if (isMove) {
|
|
||||||
// handlerLocation(lngLat, zoom);
|
|
||||||
// }
|
|
||||||
// let tiles: any = [];
|
|
||||||
// chooseRows.forEach((chooseRow) => {
|
|
||||||
// let tile =
|
|
||||||
// 'http://192.168.10.131:8080/geoserver/my_workspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=my_workspace:' +
|
|
||||||
// chooseRow.dataTable +
|
|
||||||
// '&styles=&bbox={bbox-epsg-3857}&width=256&height=256&srs=EPSG:3857' +
|
|
||||||
// '&format=image/png&TRANSPARENT=TRUE';
|
|
||||||
// tiles.push(tile);
|
|
||||||
// });
|
|
||||||
// map.addSource('GeoserverManagementRaster' , {
|
|
||||||
// type: 'raster',
|
|
||||||
// tiles: tiles,
|
|
||||||
// tileSize: 256,
|
|
||||||
// });
|
|
||||||
// map.addLayer({
|
|
||||||
// id: 'GeoserverManagementRaster',
|
|
||||||
// type: 'raster',
|
|
||||||
// source: 'GeoserverManagementRaster' ,
|
|
||||||
// layout: {
|
|
||||||
// visibility: 'visible',
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// map.on('click', 'GeoserverManagementRaster', (e) => {
|
|
||||||
// console.log(e);
|
|
||||||
// });
|
|
||||||
// if (map.getLayer('streetLayer')) {
|
|
||||||
// map.moveLayer('GeoserverManagementRaster', 'streetLayer');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// console.log(chooseRows);
|
// console.log(chooseRows);
|
||||||
if (isMove) {
|
if (isMove) {
|
||||||
handlerLocation(lngLat, zoom);
|
handlerLocation(lngLat, zoom);
|
||||||
}
|
}
|
||||||
chooseRows?.forEach((chooseRow) => {
|
chooseRows?.forEach((chooseRow) => {
|
||||||
// chooseRow.dataTable = 'pingyi304086660120221229';
|
|
||||||
map.addSource(chooseRow.dataTable, {
|
map.addSource(chooseRow.dataTable, {
|
||||||
type: 'vector',
|
type: 'vector',
|
||||||
tiles: [
|
tiles: [
|
||||||
VITE_GLOB_API_URL_VAR.value + '/api/ShpGeoLayer/QueryVectorTileByTable?z={z}&x={x}&y={y}&table=' +
|
VITE_GLOB_API_URL_VAR.value +
|
||||||
|
'/api/ShpGeoLayer/QueryVectorTileByTable?z={z}&x={x}&y={y}&table=' +
|
||||||
chooseRow.dataTable,
|
chooseRow.dataTable,
|
||||||
// '&field=id,',
|
// '&field=id,',
|
||||||
],
|
],
|
||||||
|
|
@ -272,94 +229,7 @@
|
||||||
type: 'fill',
|
type: 'fill',
|
||||||
source: chooseRow.dataTable,
|
source: chooseRow.dataTable,
|
||||||
'source-layer': chooseRow.dataTable,
|
'source-layer': chooseRow.dataTable,
|
||||||
paint: {
|
paint: chooseRow.style ? JSON.parse(chooseRow.style) : defaultPaint,
|
||||||
'fill-opacity': 1,
|
|
||||||
'fill-color': [
|
|
||||||
'case',
|
|
||||||
['==', ['get', 'dlmc'], '采矿用地'],
|
|
||||||
'#30123b',
|
|
||||||
['==', ['get', 'dlmc'], '城镇村道路用地'],
|
|
||||||
'#38266a',
|
|
||||||
['==', ['get', 'dlmc'], '城镇住宅用地'],
|
|
||||||
'#3e3892',
|
|
||||||
['==', ['get', 'dlmc'], '干渠'],
|
|
||||||
'#424ab4',
|
|
||||||
['==', ['get', 'dlmc'], '高教用地'],
|
|
||||||
'#455dd0',
|
|
||||||
['==', ['get', 'dlmc'], '工业用地'],
|
|
||||||
'#476de5',
|
|
||||||
['==', ['get', 'dlmc'], '公路用地'],
|
|
||||||
'#448ffe',
|
|
||||||
['==', ['get', 'dlmc'], '公用设施用地'],
|
|
||||||
'#3e3892',
|
|
||||||
['==', ['get', 'dlmc'], '公园与绿地'],
|
|
||||||
'#3c9ffd',
|
|
||||||
['==', ['get', 'dlmc'], '沟渠'],
|
|
||||||
'#31aff5',
|
|
||||||
['==', ['get', 'dlmc'], '灌木林地'],
|
|
||||||
'#26bfe8',
|
|
||||||
['==', ['get', 'dlmc'], '广场用地'],
|
|
||||||
'#1cced7',
|
|
||||||
['==', ['get', 'dlmc'], '果园'],
|
|
||||||
'#18dbc6',
|
|
||||||
['==', ['get', 'dlmc'], '旱地'],
|
|
||||||
'#1be5b5',
|
|
||||||
['==', ['get', 'dlmc'], '河流水面'],
|
|
||||||
'#27eea4',
|
|
||||||
['==', ['get', 'dlmc'], '机场用地'],
|
|
||||||
'#3af490',
|
|
||||||
['==', ['get', 'dlmc'], '机关团体新闻出版用地'],
|
|
||||||
'#52fa7a',
|
|
||||||
['==', ['get', 'dlmc'], '交通服务场站用地'],
|
|
||||||
'#6bfe64',
|
|
||||||
['==', ['get', 'dlmc'], '科教文卫用地'],
|
|
||||||
'#85ff51',
|
|
||||||
['==', ['get', 'dlmc'], '坑塘水面'],
|
|
||||||
'#9bfe41',
|
|
||||||
['==', ['get', 'dlmc'], '裸土地'],
|
|
||||||
'#adfb38',
|
|
||||||
['==', ['get', 'dlmc'], '内陆滩涂'],
|
|
||||||
'#bef434',
|
|
||||||
['==', ['get', 'dlmc'], '农村道路'],
|
|
||||||
'#ceeb34',
|
|
||||||
['==', ['get', 'dlmc'], '农村宅基地'],
|
|
||||||
'#dde037',
|
|
||||||
['==', ['get', 'dlmc'], '其他草地'],
|
|
||||||
'#ead439',
|
|
||||||
['==', ['get', 'dlmc'], '其他林地'],
|
|
||||||
'#f4c73a',
|
|
||||||
['==', ['get', 'dlmc'], '其他园地'],
|
|
||||||
'#fbb938',
|
|
||||||
['==', ['get', 'dlmc'], '乔木林地'],
|
|
||||||
'#fea933',
|
|
||||||
['==', ['get', 'dlmc'], '商业服务业设施用地'],
|
|
||||||
'#fe972b',
|
|
||||||
['==', ['get', 'dlmc'], '设施农用地'],
|
|
||||||
'#fc8323',
|
|
||||||
['==', ['get', 'dlmc'], '水工建筑用地'],
|
|
||||||
'#f76f1a',
|
|
||||||
['==', ['get', 'dlmc'], '水浇地'],
|
|
||||||
'#f15c13',
|
|
||||||
['==', ['get', 'dlmc'], '水库水面'],
|
|
||||||
'#e84b0c',
|
|
||||||
['==', ['get', 'dlmc'], '水田'],
|
|
||||||
'#de3e08',
|
|
||||||
['==', ['get', 'dlmc'], '特殊用地'],
|
|
||||||
'#d23105',
|
|
||||||
['==', ['get', 'dlmc'], '铁路用地'],
|
|
||||||
'#c42503',
|
|
||||||
['==', ['get', 'dlmc'], '物流仓储用地'],
|
|
||||||
'#b31b01',
|
|
||||||
['==', ['get', 'dlmc'], '养殖坑塘'],
|
|
||||||
'#a11201',
|
|
||||||
['==', ['get', 'dlmc'], '竹林地'],
|
|
||||||
'#8d0a01',
|
|
||||||
['==', ['get', 'dlmc'], ''],
|
|
||||||
'#7a0403',
|
|
||||||
'#7a0403',
|
|
||||||
],
|
|
||||||
'fill-outline-color': '#232323',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
map.on('click', chooseRow.dataTable, function (e) {
|
map.on('click', chooseRow.dataTable, function (e) {
|
||||||
// 显示弹窗
|
// 显示弹窗
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
<div>
|
<div>
|
||||||
<BasicTable @register="servicesTable">
|
<BasicTable @register="servicesTable">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'serverUrl'">
|
<template v-if="column.key === 'url'">
|
||||||
<span class="content-full">{{ record.serverUrl }}</span>
|
<span class="content-full">{{ record.url }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<TableAction
|
<TableAction
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
// 复制到剪贴板
|
// 复制到剪贴板
|
||||||
const copyToClipboard = async (record) => {
|
const copyToClipboard = async (record) => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(record.serverUrl);
|
await navigator.clipboard.writeText(record.url);
|
||||||
createMessage.success('文本已复制到剪贴板');
|
createMessage.success('文本已复制到剪贴板');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
createMessage.error('无法复制文本');
|
createMessage.error('无法复制文本');
|
||||||
|
|
@ -71,16 +71,15 @@
|
||||||
|
|
||||||
// 设置表格值
|
// 设置表格值
|
||||||
function setServerUrl(chooseRow) {
|
function setServerUrl(chooseRow) {
|
||||||
if (chooseRow.value) {
|
let data: any = [];
|
||||||
setTableData(chooseRow.value);
|
if (chooseRow.serverUrl) {
|
||||||
} else if (chooseRow.serverUrl) {
|
data.push({ url: chooseRow.serverUrl });
|
||||||
let data: any = [];
|
|
||||||
data.push({ serverUrl: chooseRow.serverUrl });
|
|
||||||
services.value = data;
|
|
||||||
setTableData(services.value);
|
|
||||||
} else {
|
|
||||||
setTableData([]);
|
|
||||||
}
|
}
|
||||||
|
if (chooseRow.pbfUrl) {
|
||||||
|
data.push({ url: chooseRow.pbfUrl });
|
||||||
|
}
|
||||||
|
services.value = data;
|
||||||
|
setTableData(services.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, h } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
// vben
|
// vben
|
||||||
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
|
|
@ -92,10 +92,10 @@
|
||||||
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
||||||
import { ShpGeoLayerParseShpInfo } from '@/api/demo/system';
|
import { ShpGeoLayerParseShpInfo } from '@/api/demo/system';
|
||||||
import { CheckTableExist } from '@/api/database/index';
|
import { CheckTableExist } from '@/api/database/index';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { getAppEnvConfig } from '@/utils/env';
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||||
|
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
|
|
@ -112,6 +112,15 @@
|
||||||
'setSldUploadType',
|
'setSldUploadType',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.uploadForm,
|
||||||
|
() => {
|
||||||
|
if (props.isEdit) {
|
||||||
|
uploadFrom.value = props.uploadForm;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const uploadFormRules = reactive({
|
const uploadFormRules = reactive({
|
||||||
serverName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }],
|
serverName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }],
|
||||||
spatialRef: [{ required: true, message: '请选择空间参考', trigger: 'blur' }],
|
spatialRef: [{ required: true, message: '请选择空间参考', trigger: 'blur' }],
|
||||||
|
|
@ -251,6 +260,7 @@
|
||||||
const tucengCustomRequest = (options) => {
|
const tucengCustomRequest = (options) => {
|
||||||
if (isSldUpload) {
|
if (isSldUpload) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
readAndParseSLDFile(options.file);
|
||||||
formData.append('files', options.file);
|
formData.append('files', options.file);
|
||||||
// 假设 Token 存储在 localStorage 中
|
// 假设 Token 存储在 localStorage 中
|
||||||
const token = localStorage.getItem('X-Token');
|
const token = localStorage.getItem('X-Token');
|
||||||
|
|
@ -258,6 +268,7 @@
|
||||||
const headers = {
|
const headers = {
|
||||||
'X-Token': token,
|
'X-Token': token,
|
||||||
};
|
};
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post(VITE_GLOB_API_URL + '/api/Files/Upload', formData, { headers })
|
.post(VITE_GLOB_API_URL + '/api/Files/Upload', formData, { headers })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|
@ -270,6 +281,7 @@
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
options.onError(error);
|
options.onError(error);
|
||||||
});
|
});
|
||||||
|
console.log(uploadFrom.value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 步骤1-删除图层样式
|
// 步骤1-删除图层样式
|
||||||
|
|
@ -285,6 +297,140 @@
|
||||||
tucengFileName.value = '';
|
tucengFileName.value = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 读取文件内容
|
||||||
|
const readAndParseSLDFile = async (file) => {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = (e) => {
|
||||||
|
const sldContent = e.target.result;
|
||||||
|
const styles = parseSLD(sldContent);
|
||||||
|
assemblyPaint(styles);
|
||||||
|
// uploadFrom.value.style = styles;
|
||||||
|
};
|
||||||
|
reader.onerror = (error) => {
|
||||||
|
console.error('Error reading the file:', error);
|
||||||
|
};
|
||||||
|
reader.readAsText(file);
|
||||||
|
};
|
||||||
|
// 解析sld文件
|
||||||
|
const parseSLD = (sldFileContent) => {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const xmlDoc = parser.parseFromString(sldFileContent, 'application/xml');
|
||||||
|
const namedLayers = xmlDoc.querySelectorAll('NamedLayer');
|
||||||
|
const styles: any = [];
|
||||||
|
|
||||||
|
namedLayers.forEach((namedLayer) => {
|
||||||
|
const userStyles = namedLayer.querySelectorAll('UserStyle');
|
||||||
|
userStyles.forEach((userStyle) => {
|
||||||
|
userStyle.children?.forEach((element) => {
|
||||||
|
if (element && element.nodeName == 'se:FeatureTypeStyle') {
|
||||||
|
element.children.forEach((featureTypeStyle) => {
|
||||||
|
let style: any = {};
|
||||||
|
const rules = featureTypeStyle.children;
|
||||||
|
rules.forEach((rule) => {
|
||||||
|
// se:Name
|
||||||
|
if (rule.nodeName == 'se:Name') {
|
||||||
|
style.ruleName = rule.textContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ogc:Filter
|
||||||
|
if (rule.nodeName == 'ogc:Filter') {
|
||||||
|
const ogcFilter = rule.children;
|
||||||
|
if (ogcFilter[0].nodeName == 'ogc:PropertyIsEqualTo') {
|
||||||
|
ogcFilter[0].children.forEach((item) => {
|
||||||
|
if (item.nodeName == 'ogc:PropertyName') {
|
||||||
|
style.ogcPropertyName = item.textContent.toLowerCase();
|
||||||
|
}
|
||||||
|
if (item.nodeName == 'ogc:Literal') {
|
||||||
|
style.ogcLiteral = item.textContent;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// se:PolygonSymbolizer
|
||||||
|
if (rule.nodeName == 'se:PolygonSymbolizer') {
|
||||||
|
const sePolygonSymbolizers = rule.children;
|
||||||
|
const fillParams: any = [];
|
||||||
|
const strokeParams: any = [];
|
||||||
|
sePolygonSymbolizers.forEach((sePolygonSymbolizer) => {
|
||||||
|
if (sePolygonSymbolizer.nodeName == 'se:Fill') {
|
||||||
|
const fills = sePolygonSymbolizer.children;
|
||||||
|
fills.forEach((fill) => {
|
||||||
|
if (fill.nodeName == 'se:SvgParameter') {
|
||||||
|
fillParams[fill.getAttribute('name')] = fill.textContent;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (sePolygonSymbolizer.nodeName == 'se:Stroke') {
|
||||||
|
const fills = sePolygonSymbolizer.children;
|
||||||
|
fills.forEach((fill) => {
|
||||||
|
if (fill.nodeName == 'se:SvgParameter') {
|
||||||
|
strokeParams[fill.getAttribute('name')] = fill.textContent;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
style.seFill = fillParams;
|
||||||
|
style.seStroke = strokeParams;
|
||||||
|
styles.push(style);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return styles;
|
||||||
|
};
|
||||||
|
// 生成paint
|
||||||
|
const assemblyPaint = (styles) => {
|
||||||
|
let result: any = {};
|
||||||
|
// fill-opacity
|
||||||
|
result['fill-opacity'] = styles[0].seFill['fill-opacity']
|
||||||
|
? parseFloat(styles[0].seFill['fill-opacity'])
|
||||||
|
: 1;
|
||||||
|
|
||||||
|
// fill-color
|
||||||
|
let onlyFillColor: any = [];
|
||||||
|
const fillColor = styles.map((style) => {
|
||||||
|
const { ruleName, ogcPropertyName, ogcLiteral, seFill, seStroke } = style;
|
||||||
|
onlyFillColor.push(seFill['fill']);
|
||||||
|
if (ogcLiteral) {
|
||||||
|
return [['==', ['get', ogcPropertyName], ogcLiteral], seFill['fill']];
|
||||||
|
} else {
|
||||||
|
return seFill['fill'];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result['fill-color'] = ['case', ...fillColor.flat()];
|
||||||
|
|
||||||
|
onlyFillColor = [...new Set(onlyFillColor)];
|
||||||
|
if (onlyFillColor.length == 1) {
|
||||||
|
result['fill-color'] = onlyFillColor[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// fill-outline-color
|
||||||
|
let onlyFillOutlineColor: any = [];
|
||||||
|
const fillOutlineColor = styles.map((style) => {
|
||||||
|
const { ruleName, ogcPropertyName, ogcLiteral, seFill, seStroke } = style;
|
||||||
|
onlyFillOutlineColor.push(seStroke['stroke']);
|
||||||
|
if (ogcLiteral) {
|
||||||
|
return [['==', ['get', ogcPropertyName], ogcLiteral], seStroke['stroke']];
|
||||||
|
} else {
|
||||||
|
return seStroke['stroke'];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result['fill-outline-color'] = ['case', ...fillOutlineColor.flat()];
|
||||||
|
|
||||||
|
onlyFillOutlineColor = [...new Set(onlyFillOutlineColor)];
|
||||||
|
if (onlyFillOutlineColor.length == 1) {
|
||||||
|
result['fill-outline-color'] = onlyFillOutlineColor[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// style
|
||||||
|
uploadFrom.value.style = JSON.stringify(result);
|
||||||
|
console.log(uploadFrom.value.style);
|
||||||
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
submit1,
|
submit1,
|
||||||
clearValidation,
|
clearValidation,
|
||||||
|
|
|
||||||
|
|
@ -97,13 +97,7 @@
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="
|
@click="jiexi_loading ? createMessage.info('文件解析中,不能回到上一步') : (current = 0)"
|
||||||
if (jiexi_loading) {
|
|
||||||
createMessage.info('文件解析中,不能回到上一步');
|
|
||||||
} else {
|
|
||||||
current = 0;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
v-if="uploadFrom.dataSourceType == 'shp' && current == 1"
|
v-if="uploadFrom.dataSourceType == 'shp' && current == 1"
|
||||||
>
|
>
|
||||||
上一步
|
上一步
|
||||||
|
|
@ -234,7 +228,7 @@
|
||||||
st = st.split(' ');
|
st = st.split(' ');
|
||||||
let chooseRows: any = [];
|
let chooseRows: any = [];
|
||||||
chooseRows.push(nowChooseRow);
|
chooseRows.push(nowChooseRow);
|
||||||
mapboxComponentRef.value.GeoserverManagementRaster(chooseRows, [st[0], st[1]], 10, true);
|
mapboxComponentRef.value.GeoserverManagementRaster(chooseRows, [st[0], st[1]], 9, true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
@ -283,6 +277,7 @@
|
||||||
appendPath: '',
|
appendPath: '',
|
||||||
// appendFileName: '',
|
// appendFileName: '',
|
||||||
headers: [] as any,
|
headers: [] as any,
|
||||||
|
style: '',
|
||||||
};
|
};
|
||||||
const uploadFrom = ref(uploadFromAdd);
|
const uploadFrom = ref(uploadFromAdd);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
||||||
<BasicTable class="w-4/4 xl:w-5/5" @register="registerTable">
|
<BasicTable class="w-4/4 xl:w-5/5" @register="registerTable">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
|
<a-button type="primary" @click="downloadTemplate">模板下载</a-button>
|
||||||
<a-upload
|
<a-upload
|
||||||
:accept="'.xlsx,.csv,.xls'"
|
:accept="'.xlsx,.csv,.xls,.shp'"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
:custom-request="customRequest"
|
:custom-request="customRequest"
|
||||||
>
|
>
|
||||||
|
|
@ -206,6 +207,9 @@ const customRequest = (file) => {
|
||||||
// });
|
// });
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
const downloadTemplate = () => {
|
||||||
|
window.open('http://www.baidu.com')
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
<a-modal width="75%" v-model:open="openModal" title="线索审核" :destroyOnClose="true" :footer="null">
|
||||||
<InfoModal :infoData="infoData.info" @handleOk="handleOk" :control="false"/>
|
<InfoModal :infoData="infoData.info" @handleOk="handleOk" @closeModal="closeModal" :control="false"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,4 +75,7 @@ function handleAudit(record) {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log('infoData',infoData.value)
|
console.log('infoData',infoData.value)
|
||||||
}
|
}
|
||||||
|
const closeModal = () => {
|
||||||
|
openModal.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue