Merge branch 'main' of http://123.132.248.154:10000/gitY/LinYeFangHuo
commit
99f7e02b3c
|
|
@ -85,6 +85,7 @@
|
|||
"@microsoft/signalr": "^8.0.0",
|
||||
"@shikijs/monaco": "^1.1.6",
|
||||
"@turf/turf": "^7.1.0",
|
||||
"@terraformer/wkt": "2.1.2",
|
||||
"@vben/hooks": "workspace:*",
|
||||
"@volar/cdn": "~1.11.1",
|
||||
"@volar/monaco": "~1.11.1",
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ onMounted(()=>{
|
|||
}else{
|
||||
props.chartConfig.option.dataset.imgArr = [VITE_GLOB_API_URL+"/"+resData[0].image]
|
||||
}
|
||||
|
||||
|
||||
props.chartConfig.option.dataset.data = data;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any) => {
|
||||
// console.log('resData', resData);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -56,7 +57,6 @@
|
|||
EventBus.on(props.chartConfig.id + 'dataupdate', (data) => {
|
||||
const keys = Object.keys(data);
|
||||
|
||||
|
||||
let interactConfigEvents = props.chartConfig.events.interactConfigEvents;
|
||||
interactConfigEvents.forEach((item, index) => {
|
||||
item?.movementList.forEach((m, mindex) => {
|
||||
|
|
|
|||
|
|
@ -122,13 +122,13 @@
|
|||
>
|
||||
<div class="timeLineVideoDivTitle">{{ videoItem.title }}</div>
|
||||
<img
|
||||
v-if="isEdit || !videoItem.videourl"
|
||||
v-if="isEdit || option.status.hide"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
:height="`${option.dataStyle.videoHeight - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||
/>
|
||||
<MonitorHK
|
||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '海康'"
|
||||
v-if="!isEdit && !option.status.hide && videoItem.manufacturer == '海康'"
|
||||
:index="index + '-' + videoIndex"
|
||||
:serialNumberValue="videoItem.videourl"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
:timestamp="option.dataStyle.timestamp"
|
||||
/>
|
||||
<MonitorLC
|
||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '乐橙'"
|
||||
v-if="!isEdit && !option.status.hide && videoItem.manufacturer == '乐橙'"
|
||||
:deviceId="videoItem.videourl"
|
||||
:channelId="0"
|
||||
:index="index + '-' + videoIndex"
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
:videoMuted="option.dataStyle.videoMuted"
|
||||
/>
|
||||
<MonitorTX
|
||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '腾讯'"
|
||||
v-if="!isEdit && !option.status.hide && videoItem.manufacturer == '腾讯'"
|
||||
:videourl="videoItem.videourl"
|
||||
:index="index + '-' + videoIndex"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -166,13 +166,13 @@
|
|||
<div class="timeLineVideoDiv">
|
||||
<div class="timeLineVideoDivTitle">{{ item.videos.title }}</div>
|
||||
<img
|
||||
v-if="isEdit || !item.videos.videourl"
|
||||
v-if="isEdit || option.status.hide"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
:height="`${option.dataStyle.videoHeight - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||
/>
|
||||
<MonitorHK
|
||||
v-if="!isEdit && item.videos.videourl && item.videos.manufacturer == '海康'"
|
||||
v-if="!isEdit && !option.status.hide && item.videos.manufacturer == '海康'"
|
||||
:index="index + '-' + videoIndex"
|
||||
:serialNumberValue="item.videos.videourl"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
:timestamp="option.dataStyle.timestamp"
|
||||
/>
|
||||
<MonitorLC
|
||||
v-if="!isEdit && item.videos.videourl && item.videos.manufacturer == '乐橙'"
|
||||
v-if="!isEdit && !option.status.hide && item.videos.manufacturer == '乐橙'"
|
||||
:deviceId="item.videos.videourl"
|
||||
:channelId="0"
|
||||
:index="index"
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
:videoMuted="option.dataStyle.videoMuted"
|
||||
/>
|
||||
<MonitorTX
|
||||
v-if="!isEdit && item.videos.videourl && item.videos.manufacturer == '腾讯'"
|
||||
v-if="!isEdit && !option.status.hide && item.videos.manufacturer == '腾讯'"
|
||||
:videourl="item.videos.videourl"
|
||||
:index="index + '-0'"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@
|
|||
<!-- 编辑状态 -->
|
||||
<!-- 无视频url的情况 -->
|
||||
<img
|
||||
v-if="isEdit"
|
||||
v-if="isEdit || option.status.hide"
|
||||
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
:height="`${h - option.dataStyle.modalTitleHeight - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||
/>
|
||||
<MonitorHK
|
||||
ref="MonitorHKRef"
|
||||
v-if="!isEdit && manufacturer == '海康'"
|
||||
v-if="!isEdit && !option.status.hide && manufacturer == '海康'"
|
||||
:serialNumberValue="option.dataStyle.serialNumberValue"
|
||||
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
:height="`${h - option.dataStyle.modalTitleHeight - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
/>
|
||||
<MonitorLC
|
||||
ref="MonitorLCRef"
|
||||
v-if="!isEdit && manufacturer == '乐橙'"
|
||||
v-if="!isEdit && !option.status.hide && manufacturer == '乐橙'"
|
||||
:deviceId="option.dataStyle.serialNumberValue"
|
||||
:channelId="0"
|
||||
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
/>
|
||||
<MonitorTX
|
||||
ref="MonitorTXRef"
|
||||
v-if="!isEdit && manufacturer == '腾讯'"
|
||||
v-if="!isEdit && !option.status.hide && manufacturer == '腾讯'"
|
||||
:serialNumberValue="option.dataStyle.serialNumberValue"
|
||||
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
:height="`${h - option.dataStyle.modalTitleHeight - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||
|
|
@ -104,34 +104,12 @@
|
|||
status: props.chartConfig.status,
|
||||
});
|
||||
|
||||
// 海康
|
||||
const MonitorHKRef = ref();
|
||||
// 乐橙
|
||||
const MonitorLCRef = ref();
|
||||
// 腾讯
|
||||
const MonitorTXRef = ref();
|
||||
|
||||
// 是否是编辑状态
|
||||
const isEdit = window.location.href.includes('/chart/home/');
|
||||
// 标题
|
||||
const titleName = ref('');
|
||||
const manufacturer = ref('');
|
||||
|
||||
// 状态隐藏、显示
|
||||
watch(
|
||||
() => option.status.hide,
|
||||
(newValue) => {
|
||||
if (!isEdit) {
|
||||
if (!newValue) {
|
||||
let data = getDataBySerialNumberValue(option.dataStyle.serialNumberValue);
|
||||
if (data.manufacturer == '海康') {
|
||||
MonitorHKRef.value.initPlugin();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// 切换视频
|
||||
watch(
|
||||
() => option.dataStyle.serialNumberValue,
|
||||
|
|
|
|||
|
|
@ -52,13 +52,13 @@
|
|||
<!-- 编辑状态 -->
|
||||
<div class="videoDiv">
|
||||
<img
|
||||
v-if="isEdit"
|
||||
v-if="isEdit || option.status.hide"
|
||||
:width="`${option.dataStyle.videowidth - 2 * option.dataStyle.borderWidth - 2 * option.dataStyle.padding}`"
|
||||
:height="`${option.dataStyle.videoheight - 2 * option.dataStyle.borderWidth - 2 * option.dataStyle.padding}`"
|
||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||
/>
|
||||
<MonitorHK
|
||||
v-if="!isEdit && item.manufacturer == '海康'"
|
||||
v-if="!isEdit && !option.status.hide && item.manufacturer == '海康'"
|
||||
:index="index"
|
||||
:serialNumberValue="item.videourl"
|
||||
:width="`${option.dataStyle.videowidth - 2 * option.dataStyle.borderWidth - 2 * option.dataStyle.padding}`"
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
:timestamp="option.dataStyle.timestamp"
|
||||
/>
|
||||
<MonitorLC
|
||||
v-if="!isEdit && item.manufacturer == '乐橙'"
|
||||
v-if="!isEdit && !option.status.hide && item.manufacturer == '乐橙'"
|
||||
:deviceId="item.videourl"
|
||||
:channelId="0"
|
||||
:index="index"
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
:videoMuted="option.dataStyle.videoMuted"
|
||||
/>
|
||||
<MonitorTX
|
||||
v-if="!isEdit && item.manufacturer == '腾讯'"
|
||||
v-if="!isEdit && !option.status.hide && item.manufacturer == '腾讯'"
|
||||
:videourl="item.videourl"
|
||||
:index="index"
|
||||
:width="`${option.dataStyle.videowidth - 2 * option.dataStyle.borderWidth - 2 * option.dataStyle.padding}`"
|
||||
|
|
@ -159,14 +159,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => option.status.hide,
|
||||
() => {
|
||||
if (!option.status.hide) {
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// 初始化视频控件
|
||||
onMounted(() => {
|
||||
// 用于规避视频id重复
|
||||
|
|
|
|||
|
|
@ -122,13 +122,13 @@
|
|||
>
|
||||
<div class="timeLineVideoDivTitle">{{ videoItem.title }}</div>
|
||||
<img
|
||||
v-if="isEdit || !videoItem.videourl"
|
||||
v-if="isEdit || option.status.hide"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
:height="`${option.dataStyle.videoHeight - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||
/>
|
||||
<MonitorHK
|
||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '海康'"
|
||||
v-if="!isEdit && !option.status.hide && videoItem.manufacturer == '海康'"
|
||||
:index="index + '-' + videoIndex"
|
||||
:serialNumberValue="videoItem.videourl"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
:timestamp="option.dataStyle.timestamp"
|
||||
/>
|
||||
<MonitorLC
|
||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '乐橙'"
|
||||
v-if="!isEdit && !option.status.hide && videoItem.manufacturer == '乐橙'"
|
||||
:deviceId="videoItem.videourl"
|
||||
:channelId="0"
|
||||
:index="index + '-' + videoIndex"
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
:videoMuted="option.dataStyle.videoMuted"
|
||||
/>
|
||||
<MonitorTX
|
||||
v-if="!isEdit && videoItem.videourl && videoItem.manufacturer == '腾讯'"
|
||||
v-if="!isEdit && !option.status.hide && videoItem.manufacturer == '腾讯'"
|
||||
:videourl="videoItem.videourl"
|
||||
:index="index + '-' + videoIndex"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -166,13 +166,13 @@
|
|||
<div class="timeLineVideoDiv">
|
||||
<div class="timeLineVideoDivTitle">{{ item.videos.title }}</div>
|
||||
<img
|
||||
v-if="isEdit || !item.videos.videourl"
|
||||
v-if="isEdit || option.status.hide"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
:height="`${option.dataStyle.videoHeight - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||
/>
|
||||
<MonitorHK
|
||||
v-if="!isEdit && item.videos.videourl && item.videos.manufacturer == '海康'"
|
||||
v-if="!isEdit && !option.status.hide && item.videos.manufacturer == '海康'"
|
||||
:index="index + '-' + videoIndex"
|
||||
:serialNumberValue="item.videos.videourl"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
:timestamp="option.dataStyle.timestamp"
|
||||
/>
|
||||
<MonitorLC
|
||||
v-if="!isEdit && item.videos.videourl && item.videos.manufacturer == '乐橙'"
|
||||
v-if="!isEdit && !option.status.hide && item.videos.manufacturer == '乐橙'"
|
||||
:deviceId="item.videos.videourl"
|
||||
:channelId="0"
|
||||
:index="index"
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
:videoMuted="option.dataStyle.videoMuted"
|
||||
/>
|
||||
<MonitorTX
|
||||
v-if="!isEdit && item.videos.videourl && item.videos.manufacturer == '腾讯'"
|
||||
v-if="!isEdit && !option.status.hide && item.videos.manufacturer == '腾讯'"
|
||||
:videourl="item.videos.videourl"
|
||||
:index="index + '-0'"
|
||||
:width="`${option.dataStyle.videoWidth - 2 * option.dataStyle.videoBorderWidth - 2 * option.dataStyle.videoPadding}`"
|
||||
|
|
@ -238,14 +238,6 @@
|
|||
// 是否是编辑状态
|
||||
const isEdit = window.location.href.includes('/chart/home/');
|
||||
|
||||
watch(
|
||||
() => option.status.hide,
|
||||
() => {
|
||||
if (!option.status.hide) {
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// 初始化视频控件
|
||||
onMounted(() => {
|
||||
// 用于规避视频id重复
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ const submitModal = ref(false)
|
|||
const fieId:any = ref([])
|
||||
const excelLoading = ref(false)
|
||||
const shpLoading = ref(false)
|
||||
const props = defineProps(['tableColumn','tableName'])
|
||||
const props = defineProps(['tableColumn','tableName','applicationName'])
|
||||
const emits = defineEmits(['changeBatchProcessingModal'])
|
||||
const sqlValue = ref('')
|
||||
const filterList:any = ref([])
|
||||
|
|
@ -153,17 +153,18 @@ const exportFile = (type) => {
|
|||
page: 1,
|
||||
limit: 99999999,
|
||||
tableName: props.tableName,
|
||||
tableCNName: props.applicationName,
|
||||
filter: filterList.value,
|
||||
field: fieId.value
|
||||
}
|
||||
if (type == 'excel') {
|
||||
excelLoading.value = true
|
||||
url = VITE_GLOB_API_URL + '/api/ApplicationData/ExportExcel';
|
||||
fileName = '数据导出' + new Date().getTime() + '.xls';
|
||||
fileName = props.applicationName + '.xls';
|
||||
} else if (type == 'shp') {
|
||||
shpLoading.value = true
|
||||
url = VITE_GLOB_API_URL + '/api/ApplicationData/ExportShapefile';
|
||||
fileName = '数据导出' + new Date().getTime() + '.zip';
|
||||
fileName = props.applicationName + '.zip';
|
||||
}
|
||||
axios({
|
||||
method: 'post',
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<div class="content">
|
||||
<ImportComponent @changeBatchProcessingModal="changeBatchProcessingModal" :tableName="props.tableName" :tableColumn="tableColumn" v-if="control == 0"/>
|
||||
<UpdateComponent @changeBatchProcessingModal="changeBatchProcessingModal" :tableName="props.tableName" :tableColumn="tableColumn" v-if="control == 1"/>
|
||||
<ExportComponent @changeBatchProcessingModal="changeBatchProcessingModal" :tableName="props.tableName" :tableColumn="tableColumn" v-if="control == 2"/>
|
||||
<ExportComponent @changeBatchProcessingModal="changeBatchProcessingModal" :applicationName="props.applicationName" :tableName="props.tableName" :tableColumn="tableColumn" v-if="control == 2"/>
|
||||
<BatchOperationsComponent @changeBatchProcessingModal="changeBatchProcessingModal" :tableName="props.tableName" :tableColumn="tableColumn" v-if="control == 3"/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -27,7 +27,7 @@ import ExportComponent from './ExportComponent/index.vue'
|
|||
import BatchOperationsComponent from './BatchOperationsComponent/index.vue'
|
||||
import { GetTableColumnList } from '@/api/demo/BatchProcessingModal'
|
||||
const emits = defineEmits(['changeBatchProcessingModal'])
|
||||
const props = defineProps(['tableName'])
|
||||
const props = defineProps(['tableName','applicationName'])
|
||||
const control = ref(0)
|
||||
const tableColumn = ref([])
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['onLoad'])
|
||||
|
||||
onMounted(() => {
|
||||
let options = {
|
||||
scene: {
|
||||
|
|
@ -243,6 +246,10 @@
|
|||
isFirstLoad.value = false;
|
||||
// 初始化矢量图层
|
||||
handlerInitEntityLayer();
|
||||
|
||||
map.on(mars3d.EventType.load, function (event) {
|
||||
emit('onLoad', map);
|
||||
})
|
||||
};
|
||||
|
||||
let graphicLayer = null;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,255 @@
|
|||
import { wktToGeoJSON,geojsonToWKT } from "@terraformer/wkt"
|
||||
import * as turf from '@turf/turf'
|
||||
import * as mars3d from 'mars3d';
|
||||
import { EventBus } from '@/utils/eventBus';
|
||||
|
||||
// wkt 转 geojson
|
||||
const WktToGeojson = (wktData)=> {
|
||||
return wktToGeoJSON(wktData);
|
||||
}
|
||||
|
||||
// geojson 转 wkt
|
||||
const GeojsonToWkt = (geojsonData)=> {
|
||||
return geojsonToWKT(geojsonData)
|
||||
}
|
||||
|
||||
// 获取数据中心点
|
||||
const GetGeometryCenter = (geometry) => {
|
||||
let geojson = null;
|
||||
|
||||
// wkt
|
||||
if(typeof geometry == 'string'){
|
||||
geojson = wktToGeoJSON(geometry);
|
||||
}
|
||||
|
||||
let coordinates = null;
|
||||
let centerPointGeojson = null;
|
||||
|
||||
switch(geojson?.type){
|
||||
|
||||
case "Point":
|
||||
coordinates = geojson.coordinates;
|
||||
break;
|
||||
|
||||
case "Polygon":
|
||||
let polygon = turf.polygon(geojson.coordinates);
|
||||
centerPointGeojson = turf.centerOfMass(polygon);
|
||||
coordinates = centerPointGeojson.geometry.coordinates;
|
||||
break;
|
||||
|
||||
case "MultiPolygon":
|
||||
let multiPolygon = turf.multiPolygon(geojson.coordinates);
|
||||
centerPointGeojson = turf.centerOfMass(multiPolygon);
|
||||
coordinates = centerPointGeojson.geometry.coordinates;
|
||||
break;
|
||||
}
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let drawingGraphicLayer = new mars3d.layer.GeoJsonLayer();
|
||||
|
||||
// 编辑图斑
|
||||
const EditDrawingGeometry = (map,geometry) => {
|
||||
|
||||
// 获取geojson
|
||||
let geojson = null;
|
||||
|
||||
if(typeof geometry == 'string'){
|
||||
let jsonData = WktToGeojson(geometry)
|
||||
|
||||
geojson = {
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"geometry": jsonData
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
console.log("geojson",geojson);
|
||||
|
||||
// 加载图层
|
||||
drawingGraphicLayer = new mars3d.layer.GeoJsonLayer({
|
||||
name: "编辑图层",
|
||||
data:geojson,
|
||||
isAutoEditing:true,
|
||||
symbol: {
|
||||
styleOptions: {
|
||||
color: "#0d3685",
|
||||
outlineColor: "#0d3685",
|
||||
opacity: 0.8,
|
||||
clampToGround:true,
|
||||
"color": "#2f00b0",
|
||||
"pixelSize": 10,
|
||||
"opacity": 1,
|
||||
"outline": true,
|
||||
"outlineColor": "#ffffff",
|
||||
"outlineOpacity": 0.6,
|
||||
"outlineWidth": 2,
|
||||
"scaleByDistance_far": 1000000,
|
||||
"scaleByDistance_farValue": 0.1,
|
||||
"scaleByDistance_near": 1000,
|
||||
"scaleByDistance_nearValue": 1,
|
||||
"distanceDisplayCondition_far": 10000,
|
||||
"visibleDepth": true
|
||||
}
|
||||
},
|
||||
popup: [],
|
||||
popupOptions: {
|
||||
showNull: true
|
||||
},
|
||||
flyTo: true
|
||||
})
|
||||
|
||||
drawingGraphicLayer.bindContextMenu([
|
||||
{
|
||||
text: "开始编辑对象",
|
||||
icon: "fa fa-edit",
|
||||
show: function (e) {
|
||||
const graphic = e.graphic
|
||||
if (!graphic || !graphic.hasEdit) {
|
||||
return false
|
||||
}
|
||||
return !graphic.isEditing
|
||||
},
|
||||
callback: (e) => {
|
||||
const graphic = e.graphic
|
||||
if (!graphic) {
|
||||
return false
|
||||
}
|
||||
if (graphic) {
|
||||
drawingGraphicLayer.startEditing(graphic)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "停止编辑对象",
|
||||
icon: "fa fa-edit",
|
||||
show: function (e) {
|
||||
const graphic = e.graphic
|
||||
if (!graphic || !graphic.hasEdit) {
|
||||
return false
|
||||
}
|
||||
return graphic.isEditing
|
||||
},
|
||||
callback: (e) => {
|
||||
const graphic = e.graphic
|
||||
if (!graphic) {
|
||||
return false
|
||||
}
|
||||
if (graphic) {
|
||||
graphic.stopEditing()
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "还原编辑(还原到初始)",
|
||||
icon: "fa fa-pencil",
|
||||
show: (event) => {
|
||||
function hasRestore(graphic) {
|
||||
if (!graphic || !graphic.hasEdit || !graphic.isEditing) {
|
||||
return false
|
||||
}
|
||||
return graphic.editing?.hasRestore()
|
||||
}
|
||||
|
||||
const graphic = event.graphic
|
||||
if (hasRestore(graphic)) {
|
||||
return true
|
||||
}
|
||||
if (graphic.isPrivate && graphic.parent) {
|
||||
return hasRestore(graphic.parent) // 右击是编辑点时
|
||||
}
|
||||
return false
|
||||
},
|
||||
callback: (event) => {
|
||||
const graphic = event.graphic
|
||||
if (graphic.editing?.restore) {
|
||||
graphic.editing.restore() // 撤销编辑,可直接调用
|
||||
} else if (graphic.parent?.editing?.restore) {
|
||||
graphic.parent.editing.restore() // 右击是编辑点时
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "撤销编辑(还原到上一步)",
|
||||
icon: "fa fa-pencil",
|
||||
show: (event) => {
|
||||
function hasRevoke(graphic) {
|
||||
if (!graphic || !graphic.hasEdit || !graphic.isEditing) {
|
||||
return false
|
||||
}
|
||||
return graphic.editing?.hasRevoke()
|
||||
}
|
||||
|
||||
const graphic = event.graphic
|
||||
if (hasRevoke(graphic)) {
|
||||
return true
|
||||
}
|
||||
if (graphic.isPrivate && graphic.parent) {
|
||||
return hasRevoke(graphic.parent) // 右击是编辑点时
|
||||
}
|
||||
return false
|
||||
},
|
||||
callback: (event) => {
|
||||
const graphic = event.graphic
|
||||
if (graphic.editing?.revoke) {
|
||||
graphic.editing.revoke() // 撤销编辑,可直接调用
|
||||
} else if (graphic.parent?.editing?.revoke) {
|
||||
graphic.parent.editing.revoke() // 右击是编辑点时
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
map.addLayer(drawingGraphicLayer)
|
||||
|
||||
// 获取编辑结果
|
||||
drawingGraphicLayer.on(mars3d.EventType.editStop, function (e) {
|
||||
let resultGeojson = e.graphic.toGeoJSON({standard:true,noAlt:true})
|
||||
|
||||
let resultWkt = GeojsonToWkt(resultGeojson.geometry)
|
||||
EventBus.emit("editLayerEnd",resultWkt)
|
||||
})
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
// 添加图斑
|
||||
const AddDrawingGeometry = (map) => {
|
||||
|
||||
}
|
||||
|
||||
// 查看图斑
|
||||
const DetailDrawingGeometryy = (map,geometry) => {
|
||||
// 获取geojson
|
||||
let geojson = null;
|
||||
|
||||
if(typeof geometry == 'string'){
|
||||
let jsonData = WktToGeojson(geometry)
|
||||
|
||||
geojson = {
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"geometry": jsonData
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 结束停止编辑
|
||||
const DrawingEnd = () => {
|
||||
drawingGraphicLayer.clear();
|
||||
}
|
||||
|
||||
|
||||
export {WktToGeojson,GeojsonToWkt,GetGeometryCenter,EditDrawingGeometry,AddDrawingGeometry,DrawingEnd}
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
@remove="tableVisible = false"
|
||||
/>
|
||||
<div class="map-container w-3/4 xl:w-4/5">
|
||||
<Map />
|
||||
<Map @onLoad="onMapLoad"/>
|
||||
<!-- 数据列表 -->
|
||||
<div class="table-constainer" v-show="tableVisible">
|
||||
<div class="drawer-title-box">
|
||||
|
|
@ -149,6 +149,7 @@
|
|||
style="top: 50px"
|
||||
>
|
||||
<BatchProcessingModal
|
||||
:applicationName="applicationName"
|
||||
:tableName="tableName"
|
||||
@changeBatchProcessingModal="changeBatchProcessingModal"
|
||||
/>
|
||||
|
|
@ -171,7 +172,24 @@
|
|||
import { getAppEnvConfig } from '@/utils/env';
|
||||
import BatchProcessingModal from './BatchProcessingModal/index.vue';
|
||||
import { Upload, UploadShape, UploadExcelAll } from '@/api/demo/BatchProcessingModal'
|
||||
import { message } from 'ant-design-vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { EventBus } from '@/utils/eventBus';
|
||||
import {GetGeometryCenter,EditDrawingGeometry,AddDrawingGeometry,DrawingEnd} from "./geometryHandler.ts"
|
||||
import * as mars3d from 'mars3d';
|
||||
|
||||
let globalMap: mars3d.Map;
|
||||
|
||||
const onMapLoad = (map) => {
|
||||
globalMap = map;
|
||||
}
|
||||
|
||||
EventBus.on("editLayerEnd",function(e){
|
||||
|
||||
formState.value.geom = e;
|
||||
|
||||
console.log("formState",formState.value);
|
||||
})
|
||||
|
||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
|
|
@ -226,6 +244,7 @@ import { message } from 'ant-design-vue';
|
|||
|
||||
const formState = ref({});
|
||||
const tableName = ref();
|
||||
const applicationName = ref()
|
||||
const styleName = ref();
|
||||
const rules = {
|
||||
name: [
|
||||
|
|
@ -263,6 +282,7 @@ import { message } from 'ant-design-vue';
|
|||
console.log('res', res);
|
||||
if (res) {
|
||||
createMessage.success('编辑成功!');
|
||||
DrawingEnd();
|
||||
showTable.value = '';
|
||||
} else {
|
||||
createMessage.error('编辑失败!');
|
||||
|
|
@ -275,10 +295,12 @@ import { message } from 'ant-design-vue';
|
|||
};
|
||||
const resetForm = () => {
|
||||
showTable.value = '';
|
||||
DrawingEnd();
|
||||
};
|
||||
|
||||
const handleSelect = (record) => {
|
||||
tableName.value = record.serverId;
|
||||
applicationName.value = record.applicationName;
|
||||
tableVisible.value = true;
|
||||
keyWord.value = null;
|
||||
keyValue.value = null;
|
||||
|
|
@ -304,6 +326,8 @@ import { message } from 'ant-design-vue';
|
|||
selectVal.value = record;
|
||||
formState.value = record;
|
||||
showTable.value = 'edit';
|
||||
|
||||
EditDrawingGeometry(globalMap,record.geom)
|
||||
};
|
||||
const viewData = (record) => {
|
||||
console.log('record', record);
|
||||
|
|
@ -329,7 +353,14 @@ import { message } from 'ant-design-vue';
|
|||
};
|
||||
const fileUrl = ref('');
|
||||
const fileUrlView: any = ref({});
|
||||
const posData = (record) => {};
|
||||
|
||||
|
||||
|
||||
const posData = (record) => {
|
||||
let centerLngLat = GetGeometryCenter(record.geom)
|
||||
globalMap.flyToPoint(centerLngLat,{radius:500})
|
||||
};
|
||||
|
||||
const styleHandle = () => {
|
||||
fileUrl.value = '';
|
||||
fileUrlView.value = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue