From c424365e25efafa3f9d3dff857d0af2b15e457c6 Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Fri, 28 Nov 2025 16:30:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BA=E5=AE=9A=E7=89=A9?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ruler.vue | 41 ++++++++++++++++- src/views/index.vue | 97 +++++++++++++++++++++++++++++++++++----- 2 files changed, 125 insertions(+), 13 deletions(-) diff --git a/src/components/ruler.vue b/src/components/ruler.vue index 1646eb3..6a6b273 100644 --- a/src/components/ruler.vue +++ b/src/components/ruler.vue @@ -87,6 +87,24 @@ {{ index + 1 }} +
+ + {{ index + 1 }} + +
@@ -107,6 +125,8 @@ const props = defineProps({ dotIndex: {type: Number, required: true}, dots1: {type: Array, required: true}, dotIndex1: {type: Number, required: true}, + dots2: {type: Array, required: true}, + dotIndex2: {type: Number, required: true}, dot1Show: {type: Boolean, required: true}, scan: {type: Boolean, required: true}, }) @@ -148,6 +168,9 @@ watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => { if (props.dotIndex1 >= 0) { getLineData('head', `dota${props.dotIndex1 + 1}`) } + if (props.dotIndex2 >= 0) { + getLineData('head', `dotb${props.dotIndex2 + 1}`) + } }) onMounted(() => { getBoxPos() @@ -158,9 +181,12 @@ onMounted(() => { if (props.dotIndex1 >= 0) { getLineData('head', `dota${props.dotIndex1 + 1}`) } + if (props.dotIndex2 >= 0) { + getLineData('head', `dotb${props.dotIndex2 + 1}`) + } }) }) -watch(() => JSON.stringify([props.dotIndex, props.dotIndex1]), (newVal, oldVal) => { +watch(() => JSON.stringify([props.dotIndex, props.dotIndex1, props.dotIndex2]), (newVal, oldVal) => { getBoxPos() getDistanceAndZoom() if (distance1.value) { @@ -179,6 +205,8 @@ watch(() => JSON.stringify([props.dotIndex, props.dotIndex1]), (newVal, oldVal) getLineData('head', `dot${props.dotIndex + 1}`) } else if (props.dotIndex1 >= 0) { getLineData('head', `dota${props.dotIndex1 + 1}`) + } else if (props.dotIndex2 >= 0) { + getLineData('head', `dotb${props.dotIndex2 + 1}`) }else{ zoomScale(props.boxPos.y, 0) } @@ -200,6 +228,14 @@ const getDistanceAndZoom = () => { let a = dotx - carx let b = doty - cary distance1.value = Math.sqrt(a * a + b * b); + } else if (props.dotIndex2 >= 0) { + let dotx = props.dots2[props.dotIndex2].x + let doty = props.dots2[props.dotIndex2].y + let carx = props.boxPos.x + let cary = props.boxPos.y + let a = dotx - carx + let b = doty - cary + distance1.value = Math.sqrt(a * a + b * b); } else { distance1.value = 0 } @@ -262,6 +298,9 @@ function zoomScale(value, type) { if (props.dotIndex1 >= 0) { getLineData('head', `dota${props.dotIndex1 + 1}`) } + if (props.dotIndex2 >= 0) { + getLineData('head', `dotb${props.dotIndex2 + 1}`) + } }, 10) } diff --git a/src/views/index.vue b/src/views/index.vue index 2e612bb..8bc3f8f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -73,6 +73,8 @@ :dotIndex="dotIndex" :dots1="dots1" :dotIndex1="dotIndex1" + :dots2="dots2" + :dotIndex2="dotIndex2" :dot1Show="dot1Show" :scan="scan" /> @@ -580,7 +582,8 @@ 删除 - + @@ -630,6 +633,7 @@ highlight-current-row :data="tableData2" style="width: 100%" + @row-click="table2Current" > @@ -1245,6 +1249,7 @@ const itemsId = ref(1) // 菜单id跳转 const setItemsId = (e) => { itemsId.value = e + dotIndex2.index = -1 } // 左侧区域宽高 const areaData = ref({ @@ -1264,6 +1269,7 @@ const currentPosition = ref({}) // 表格点击事件 const table1Current = (e,) => { dotIndex1.value = -1 + dotIndex2.value = -1 if (dotIndex.value === e.index) { dotIndex.value = -1 } else { @@ -1272,8 +1278,8 @@ const table1Current = (e,) => { } const table1Current1 = (e,) => { dotIndex.value = -1 + dotIndex2.value = -1 if (!dot1Show.value) { - dotIndex1.value = -1 } else { if (dotIndex1.value === e.index) { @@ -1442,6 +1448,53 @@ const dots1 = computed(() => { // 当前的目标障碍物 const dotIndex = ref(-1) const dotIndex1 = ref(-1) +const dots2 = computed(() => { + if (itemsId.value === 4) { + return tableData3.value.map((v, k) => { + if (v.longitude && v.latitude) { + const rectInfo = calcRectangleFromPoints(areaPoints.value); + const point = { + lon: v.longitude, + lat: v.latitude, + rotate: 0, + }; + return { + ...correctDeviation(getLocalPositionRelativeToP4(point, areaPoints.value, rectInfo)), + } + } else { + return null + } + }).filter(v => v) + } else if (itemsId.value === 5) { + return tableData2.value.map((v, k) => { + if (v.lon && v.lat) { + const rectInfo = calcRectangleFromPoints(areaPoints.value); + const point = { + lon: v.lon, + lat: v.lat, + rotate: 0, + }; + return { + ...correctDeviation(getLocalPositionRelativeToP4(point, areaPoints.value, rectInfo)), + } + } else { + return null + } + }).filter(v => v) + } else { + return [] + } +}) +const dotIndex2 = ref(-1) +const table2Current = (e) => { + dotIndex.value = -1 + dotIndex1.value = -1 + if (dotIndex2.value === e.index) { + dotIndex2.value = -1 + } else { + dotIndex2.value = e.index + } +} const dot1Show = ref(true) const dialogImageUrl = ref('') @@ -1455,6 +1508,7 @@ const openShildDialog2 = (e) => { } // 修改固定物 const updateShildItem = () => { + dotIndex2.value = -1 updateShildData(shildForm1.value).then(e => { shildDialog2.value = false shildForm2.value = {} @@ -1514,19 +1568,22 @@ const openHandleObstacleDialog2 = (e) => { } // 删除固定物 const delShildItem = (e) => { + dotIndex2.value = -1 delShildData(e.row).then(e => { getShildTableList() }) } // 确定处理 const handleObstacle2 = () => { + dotIndex2.value = -1 InserDealObstacleModel({ longitude: dialog3Form.value.longitude, latitude: dialog3Form.value.latitude, strength: dialog3Form.value.strength, files: dialog3Form.value.fileList.map(e => e.url), findTime: dialog3Form.value.time || '', - description: dialog3Form.value.description + description: dialog3Form.value.description, + FodAirId: form1.value.region1 }).then(e => { // delShildData(e.row).then(e => { // getShildTableList() @@ -1539,6 +1596,7 @@ const handleObstacle2 = () => { const table3Ref = ref() // 批量删除 const batchDel2 = () => { + dotIndex2.value = -1 let datas = table3Ref.value.getSelectionRows() let promiseArr = [] datas.forEach((row) => { @@ -1551,6 +1609,7 @@ const batchDel2 = () => { } // 批量处置 const batchDisposal2 = () => { + dotIndex2.value = -1 let datas = table3Ref.value.getSelectionRows() let promiseArr = [] datas.forEach((row) => { @@ -1560,7 +1619,8 @@ const batchDisposal2 = () => { strength: row.strength, files: [], findTime: row.time, - description: '' + description: '', + FodAirId: form1.value.region1 })) }) Promise.allSettled(promiseArr).then(() => { @@ -1597,7 +1657,7 @@ const addShildItem = () => { dotIndex.value = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength) } - addShildData(shildForm.value).then(e => { + addShildData({...shildForm.value, FodAirId: form1.value.region1}).then(e => { shildDialog.value = false shildForm.value = {} getShildTableList() @@ -1680,7 +1740,8 @@ const handleObstacle = () => { strength: dialog1Form.value.strength, files: dialog1Form.value.fileList.map(e => e.url), findTime: dialog1Form.value.time || '', - description: dialog1Form.value.description + description: dialog1Form.value.description, + FodAirId: form1.value.region1 }).then(e => { let data = null if (dotIndex.value >= 0) { @@ -1709,7 +1770,8 @@ const batchDisposal = () => { strength: row.Strength, files: [], findTime: '', - description: '' + description: '', + FodAirId: form1.value.region1 }) arr = arr.filter(v => !(v.Lon === row.Lon && v.Lat === row.Lat && v.Strength === row.Strength)) }) @@ -1762,6 +1824,7 @@ const batchShild = () => { name: Math.random().toString().split('.')[1], deviation: shieldInfoForm.value.deviation, shielding: shieldInfoForm.value.shielding, + FodAirId: form1.value.region1 }) arr = arr.filter(v => !(v.Lon === row.Lon && v.Lat === row.Lat && v.Strength === row.Strength)) }) @@ -1806,7 +1869,7 @@ const addShildItem1 = () => { dotIndex1.value = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength) } - addShildData(shildForm1.value).then(e => { + addShildData({...shildForm1.value, FodAirId: form1.value.region1}).then(e => { shildDialog1.value = false shildForm1.value = {} getShildTableList() @@ -1889,7 +1952,8 @@ const handleObstacle1 = () => { strength: dialog2Form.value.strength, files: dialog2Form.value.fileList.map(e => e.url), findTime: dialog2Form.value.time || '', - description: dialog2Form.value.description + description: dialog2Form.value.description, + FodAirId: form1.value.region1 }).then(e => { let data = null if (dotIndex1.value >= 0) { @@ -1918,7 +1982,8 @@ const batchDisposal1 = () => { strength: row.Strength, files: [], findTime: '', - description: '' + description: '', + FodAirId: form1.value.region1 }) arr = arr.filter(v => !(v.Lon === row.Lon && v.Lat === row.Lat && v.Strength === row.Strength)) }) @@ -1971,6 +2036,7 @@ const batchShild1 = () => { name: Math.random().toString().split('.')[1], deviation: shieldInfoForm.value.deviation, shielding: shieldInfoForm.value.shielding, + FodAirId: form1.value.region1 }) arr = arr.filter(v => !(v.Lon === row.Lon && v.Lat === row.Lat && v.Strength === row.Strength)) }) @@ -2005,7 +2071,8 @@ const openShildDialog3 = (e) => { } // 设置固定物 const addShildItem3 = () => { - addShildData(shildForm1.value).then(e => { + dotIndex2.value = -1 + addShildData({...shildForm1.value, FodAirId: form1.value.region1}).then(e => { shildDialog3.value = false shildForm3.value = {} getShildTableList() @@ -2070,13 +2137,15 @@ const openHandleObstacleDialog3 = (e) => { } // 确定处理 const handleObstacle3 = () => { + dotIndex2.value = -1 InserDealObstacleModel({ longitude: dialog4Form.value.longitude, latitude: dialog4Form.value.latitude, strength: dialog4Form.value.strength, files: dialog4Form.value.fileList.map(e => e.url), findTime: dialog4Form.value.time || '', - description: dialog4Form.value.description + description: dialog4Form.value.description, + FodAirId: form1.value.region1 }).then(e => { }) @@ -2088,6 +2157,7 @@ const batchDel3 = () => { } // 批量固定 const batchShild3 = () => { + dotIndex2.value = -1 let datas = table4Ref.value.getSelectionRows() datas.forEach((row) => { addShildData({ @@ -2097,6 +2167,7 @@ const batchShild3 = () => { name: Math.random().toString().split('.')[1], deviation: shieldInfoForm.value.deviation, shielding: shieldInfoForm.value.shielding, + FodAirId: form1.value.region1 }) }) getShildTableList() @@ -2109,6 +2180,7 @@ const getShildTableList = () => { getShildList({ pageIndex: currentPage3.value, pageSize: pageSize3.value, + FodAirId: form1.value.region1 }).then((e) => { tableData2.value = e.data total3.value = e.totalCount @@ -2119,6 +2191,7 @@ const getObstacleList = () => { PostDealObstacleModel({ pageIndex: currentPage4.value, pageSize: pageSize4.value, + FodAirId: form1.value.region1 }).then(e => { tableData3.value = e.data total4.value = e.totalCount