字典配置轨迹文件格式
This commit is contained in:
parent
d76271da24
commit
50462faaff
@ -7,11 +7,7 @@
|
||||
|
||||
<svg ref="svgRef" class="trajectory-svg" :width="svgWidth" :height="svgHeight">
|
||||
<g class="zoom-container">
|
||||
<image
|
||||
:xlink:href="imageUrl"
|
||||
:width="svgWidth"
|
||||
:height="svgHeight"
|
||||
/>
|
||||
<image :xlink:href="imageUrl" :width="svgWidth" :height="svgHeight" />
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
@ -83,7 +79,7 @@ const initMap = () => {
|
||||
const initZoom = () => {
|
||||
const mapZoom = d3.zoom()
|
||||
.scaleExtent([0.5, 3]) // 缩放范围
|
||||
.translateExtent([[-svgWidth.value, -svgHeight.value], [2*svgWidth.value, 2*svgHeight.value]])
|
||||
.translateExtent([[-svgWidth.value, -svgHeight.value], [2 * svgWidth.value, 2 * svgHeight.value]])
|
||||
.on("zoom", (event) => {
|
||||
d3.select(svgRef.value).select('.zoom-container')
|
||||
.attr("transform", event.transform)
|
||||
@ -131,10 +127,10 @@ const renderTrajectoryPath = () => {
|
||||
.attr('stroke', '#1890FF')
|
||||
.attr('stroke-width', 2.5)
|
||||
.attr('fill', 'none')
|
||||
.attr('stroke-dasharray', function() {
|
||||
.attr('stroke-dasharray', function () {
|
||||
return this.getTotalLength()
|
||||
})
|
||||
.attr('stroke-dashoffset', function() {
|
||||
.attr('stroke-dashoffset', function () {
|
||||
return this.getTotalLength()
|
||||
})
|
||||
.transition()
|
||||
@ -162,12 +158,12 @@ const renderTrajectoryMarkers = () => {
|
||||
.attr('fill', '#FF4D4F')
|
||||
.attr('stroke', '#fff')
|
||||
.attr('stroke-width', 0.8)
|
||||
.on('mouseover', function() {
|
||||
.on('mouseover', function () {
|
||||
d3.select(this)
|
||||
.attr('r', 4)
|
||||
.attr('stroke-width', 1.2)
|
||||
})
|
||||
.on('mouseout', function() {
|
||||
.on('mouseout', function () {
|
||||
d3.select(this)
|
||||
.attr('r', 2.5)
|
||||
.attr('stroke-width', 0.8)
|
||||
@ -216,24 +212,26 @@ const toggleFullscreen = () => {
|
||||
// === 全屏状态更新处理 ===
|
||||
const handleFullscreenChange = () => {
|
||||
isFullscreen.value = !!document.fullscreenElement
|
||||
|
||||
// 全屏切换时主动清除原有轨迹
|
||||
clearOldElements()
|
||||
requestAnimationFrame(() => {
|
||||
// 延迟执行以确保DOM更新
|
||||
setTimeout(() => {
|
||||
initMap()
|
||||
updateTrajectory()
|
||||
}, 500)
|
||||
})
|
||||
|
||||
// 延迟执行以确保DOM更新
|
||||
setTimeout(() => {
|
||||
initMap()
|
||||
updateTrajectory()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
// === 窗口大小变化处理 ===
|
||||
const handleResize = () => {
|
||||
if (resizeTimeout) clearTimeout(resizeTimeout)
|
||||
resizeTimeout = setTimeout(() => {
|
||||
clearOldElements()
|
||||
initMap()
|
||||
updateTrajectory()
|
||||
}, 300)
|
||||
},500)
|
||||
}
|
||||
|
||||
// === 响应式监听与生命周期 ===
|
||||
|
20
web/src/views/testdata/datamanagement/index.vue
vendored
20
web/src/views/testdata/datamanagement/index.vue
vendored
@ -44,6 +44,7 @@ import VideoPlayerAsyncLoading from "@/components/file/preview/VideoPlayerAsyncL
|
||||
import TextViewerAsyncLoading from "@/components/file/preview/TextViewerAsyncLoading.vue";
|
||||
import MarkdownViewerDialogAsyncLoading from "@/components/file/preview/MarkdownViewerDialogAsyncLoading.vue";
|
||||
import { display } from "html2canvas/dist/types/css/property-descriptors/display";
|
||||
import { getDict } from '@/api/dict'
|
||||
const { dialogVideoVisible, dialogTextVisible, dialogPdfVisible, dialogOfficeVisible, dialog3dVisible } = useFilePreview();
|
||||
const { clearALlFinishedUploadFile } = useFileUpload();
|
||||
const { currentStorageKey } = useHeaderStorageList();
|
||||
@ -51,6 +52,7 @@ const { openRow } = useFileData();
|
||||
const userStore = useUserStore();
|
||||
onMounted(() => {
|
||||
getProject()
|
||||
getDictOne()
|
||||
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
@ -63,6 +65,15 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
})
|
||||
const trackFileType = ref([])
|
||||
function getDictOne() {
|
||||
getDict({ dictcode: 'Trajectory_File_Key' }).then((res: any) => {
|
||||
trackFileType.value = res.data
|
||||
})
|
||||
}
|
||||
function iftrackFile(name: string): boolean {
|
||||
return trackFileType.value.some((item: any) => name.includes(item.dictname));
|
||||
}
|
||||
//拖动条
|
||||
const vMove = {
|
||||
mounted(el: any) {
|
||||
@ -1769,6 +1780,10 @@ function getSSELink() {
|
||||
try {
|
||||
const data = JSON.parse(e.data)
|
||||
console.log('SSE消息:', data)
|
||||
if(data.message == '配置文件选择错误,请重新选择!'){
|
||||
ElMessage.warning(data.message)
|
||||
return
|
||||
}
|
||||
if (data) {
|
||||
dynamicCoordinates.value.push([data.lon, data.lat])
|
||||
if (dynamicCoordinates.value.length > 2) {
|
||||
@ -1960,7 +1975,8 @@ const configradio: any = ref(null)
|
||||
style="cursor: pointer;"> -->
|
||||
<img src="@/assets/project/chong.png" alt="" title="重命名" @click="editfile(scope.row, false)"
|
||||
style="cursor: pointer;">
|
||||
<img v-if="scope.row.fileName.includes('ins_img') || scope.row.fileName == 'VINS.csv'"
|
||||
|
||||
<img v-if="iftrackFile(scope.row.fileName)"
|
||||
src="@/assets/MenuIcon/guiji.png" alt="" @click="openMap(scope.row)" title="轨迹预览图"
|
||||
style="cursor: pointer;">
|
||||
<img src="@/assets/MenuIcon/lbcz_xg.png" alt="" @click="editfile(scope.row, true)"
|
||||
@ -2281,7 +2297,7 @@ const configradio: any = ref(null)
|
||||
<el-button @click="">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 800px;height:600px;overflow: hidden;margin: auto;" v-else>
|
||||
<div style="width: 800px;height:600px;margin: auto;" v-else>
|
||||
<Imggui :imageUrl="pngobj.pngurl" :bounds="pngobj.textcontent" :trajectory="imgarrdata"
|
||||
:qvehuan="qvehuan" @qvehuan1="handleCustomEvent" />
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user