修改固定物显示

main
suixy 3 weeks ago
parent 8be3c66672
commit c424365e25

@ -87,6 +87,24 @@
{{ index + 1 }}
</span>
</div>
<div
v-for="(dot, index) in dots2"
:key="index"
class="dot"
:id="`dotb${index+1}`"
:style="{
left: `${getDotX(dot.x)}%`,
bottom: `${getDotY(dot.y)}%`,
transform: `translate(-50%, 50%) `,
background: 'radial-gradient(circle at center, #ccc 0%, rgba(116, 228, 116, 0.2) 100%)'
}"
style="white-space: nowrap"
>
<span style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);color: #333;font-size: 12px">
{{ index + 1 }}
</span>
</div>
</div>
</div>
</template>
@ -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)
}

@ -73,6 +73,8 @@
:dotIndex="dotIndex"
:dots1="dots1"
:dotIndex1="dotIndex1"
:dots2="dots2"
:dotIndex2="dotIndex2"
:dot1Show="dot1Show"
:scan="scan"
/>
@ -580,7 +582,8 @@
<el-button style="margin-right: 16px" @click="batchDel3"></el-button>
</el-popover>
</div>
<el-table ref="table4Ref" :data="tableData3" style="width: 100%">
<el-table
@row-click="table2Current" ref="table4Ref" :data="tableData3" style="width: 100%">
<el-table-column type="selection" width="55"/>
<el-table-column label="序号" type="index" width="60"/>
<el-table-column prop="longitude" label="目标经度" width="100"/>
@ -630,6 +633,7 @@
highlight-current-row
:data="tableData2"
style="width: 100%"
@row-click="table2Current"
>
<el-table-column type="selection" width="55"/>
<el-table-column label="序号" type="index" width="60"/>
@ -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

Loading…
Cancel
Save