Merge remote-tracking branch 'origin/main'

main
scrin 2 months ago
commit 653002853e

@ -28,7 +28,7 @@
</div>
</div>
</div>
<div class="content">
<div class="content" :style="bgStyle">
<div
v-if="boxPos"
class="box"
@ -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,11 +125,29 @@ 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},
})
const boxContentX = ref(0)
const boxContentY = ref(0)
const bgStyle = computed(() => {
console.log(differenceValue.value)
const scale = props.height / (differenceValue.value || props.height)
let centerPercent = 0
if (scale === 1) {
centerPercent = 50
} else {
centerPercent = (props.boxPos.y / props.height) * 100
}
return {
backgroundSize: `100% ${589 * scale}px`,
backgroundPosition: `center ${centerPercent}%`
}
})
watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => {
getBoxPos()
getDistanceAndZoom()
@ -120,8 +156,11 @@ watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => {
zoomScale(props.boxPos.y, 1)
getBoxPos()
} else {
differenceValue.value = 0
zoomScale(props.boxPos.y, 0)
}
} else {
differenceValue.value = 0
}
if (props.dotIndex >= 0) {
getLineData('head', `dot${props.dotIndex + 1}`)
@ -129,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()
@ -139,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) {
@ -149,13 +194,19 @@ watch(() => JSON.stringify([props.dotIndex, props.dotIndex1]), (newVal, oldVal)
zoomScale(props.boxPos.y, 1)
getBoxPos()
} else {
differenceValue.value = 0
zoomScale(props.boxPos.y, 0)
}
} else {
differenceValue.value = 0
}
if (props.dotIndex >= 0) {
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)
}
@ -177,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
}
@ -239,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)
}
@ -249,6 +311,7 @@ function getAxisRange() {
return {min: Math.min(...values), max: Math.max(...values)}
}
const differenceValue = ref(0)
const leftTicks = computed(() => {
const arr = []
@ -276,7 +339,7 @@ const leftTicks = computed(() => {
let startValue = centerValue.value - half * step
let endValue = centerValue.value + half * step
console.log(endValue - startValue)
differenceValue.value = endValue - startValue
if (startValue < 0) {
endValue += -startValue
@ -336,6 +399,7 @@ const ticks = computed(() => {
height: 100%;
background-color: #000;
.left {
position: absolute;
width: 40px;
@ -440,6 +504,9 @@ const ticks = computed(() => {
background-color: #666;
top: 0;
left: 40px;
//background-image: url("@/assets/car.png");
background-repeat: no-repeat;
background-size: 100% 100%;
.dot {
width: 20px;

File diff suppressed because it is too large Load Diff

@ -86,7 +86,7 @@ const correctDeviation = (e) => {
}
const parseTime = (time, pattern) => {
if (arguments.length === 0 || !time) {
if (!time) {
return null;
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}';

@ -73,6 +73,8 @@
:dotIndex="dotIndex"
:dots1="dots1"
:dotIndex1="dotIndex1"
:dots2="dots2"
:dotIndex2="dotIndex2"
:dot1Show="dot1Show"
:scan="scan"
/>
@ -126,20 +128,20 @@
<el-card shadow="always" style="margin-top: 12px">
<el-button
type="primary"
:disabled="radarWorkState === 1"
:disabled="!(true || radarWorkState === 1)"
@click="StartWorkBtn"
>
启动雷达
</el-button>
<el-button
type="danger"
:disabled="radarWorkState === 0"
:disabled="!(true || radarWorkState === 0)"
@click="StopWorkBtn"
>
关闭雷达
</el-button>
<el-button type="warning" @click="RestartWorkBtn"></el-button>
<el-button type="info" @click="ShutDownWorkBtn"></el-button>
<el-button type="warning" v-if="false" @click="RestartWorkBtn"></el-button>
<el-button type="info" v-if="false" @click="ShutDownWorkBtn"></el-button>
</el-card>
<!-- 通讯状态 -->
@ -239,8 +241,14 @@
{{ (currentPage1 - 1) * pageSize1 + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="Lon" label="目标经度" width="100"/>
<el-table-column prop="Lat" label="目标纬度" width="100"/>
<el-table-column prop="time" label="时间" width="100"/>
<el-table-column label="目标经纬度" width="120">
<template #default="scope">
<span>{{ scope.row.Lon }}</span>
<br>
<span>{{ scope.row.Lat }}</span>
</template>
</el-table-column>
<el-table-column prop="Strength" label="强度信息" width="100"/>
<el-table-column label="处理方式" show-overflow-tooltip width="200" fixed="right">
<template #default="scope">
@ -297,8 +305,14 @@
{{ (currentPage2 - 1) * pageSize2 + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="Lon" label="目标经度" width="100"/>
<el-table-column prop="Lat" label="目标纬度" width="100"/>
<el-table-column prop="time" label="时间" width="100"/>
<el-table-column label="目标经纬度" width="120">
<template #default="scope">
<span>{{ scope.row.Lon }}</span>
<br>
<span>{{ scope.row.Lat }}</span>
</template>
</el-table-column>
<el-table-column prop="Strength" label="强度信息" width="100"/>
<el-table-column label="处理方式" show-overflow-tooltip width="200" fixed="right">
<template #default="scope">
@ -576,25 +590,32 @@
<template #reference>
<el-button style="margin-right: 16px">批量处理</el-button>
</template>
<el-button style="margin-right: 16px" @click="batchDisposal3"></el-button>
<el-button style="margin-right: 16px" @click="batchShild3"></el-button>
<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="lon" label="目标经度" width="100"/>
<el-table-column prop="lat" label="目标纬度" width="100"/>
<el-table-column prop="strength" label="强度信息" width="100"/>
<el-table-column label="处理方式" show-overflow-tooltip width="160" fixed="right">
<el-table-column prop="findTime" label="时间" width="100"/>
<el-table-column label="目标经纬度" width="120">
<template #default="scope">
<el-button type="primary" link @click.stop="openHandleObstacleDialog2(scope)">处置</el-button>
<el-button type="primary" link @click.stop="openShildDialog2(scope)">修改</el-button>
<span>{{ scope.row.longitude }}</span>
<br>
<span>{{ scope.row.latitude }}</span>
</template>
</el-table-column>
<el-table-column prop="strength" label="强度信息" width="100"/>
<el-table-column label="处理方式" show-overflow-tooltip width="200" fixed="right">
<template #default="scope">
<el-button type="primary" link @click.stop="openShildDialog3(scope)">固定物</el-button>
<el-button type="primary" link @click.stop="openHandleObstacleDialog3(scope)">修改</el-button>
<el-popconfirm
class="box-item"
title="确定删除这个点位吗?"
placement="top"
@confirm="delShildItem(scope)"
@confirm="delObstacleItem(scope)"
>
<template #reference>
<el-button type="primary" @click.stop link>删除</el-button>
@ -630,6 +651,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"/>
@ -868,13 +890,82 @@
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialog2 = false">关闭</el-button>
<el-button @click="dialog3 = false">关闭</el-button>
<el-button type="primary" @click="handleObstacle2">
处理
</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="dialog4" title="处置障碍物" width="500">
<el-form :model="dialog4Form">
<el-form-item label="发现时间" label-width="120px">
<el-input v-model="dialog4Form.time" disabled autocomplete="off"/>
</el-form-item>
<el-form-item label="处理信息描述" label-width="120px">
<el-input
v-model="dialog4Form.description"
style="width: 100%"
:rows="2"
type="textarea"
/>
</el-form-item>
<el-form-item label="处理照片" label-width="120px">
<el-upload @click.stop="onSubmit"
ref="uploadRef"
:http-request="uploadFiles3"
:file-list="dialog4Form.fileList.concat({type:'camera'})"
list-type="picture-card">
<template #trigger>
<el-icon>
<Plus/>
</el-icon>
</template>
<template #file="{ file }">
<div v-if="file.type !=='camera'">
<img class="el-upload-list__item-thumbnail" :src="file.url" alt=""/>
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview3(file)"
>
<el-icon><zoom-in/></el-icon>
</span>
<span
class="el-upload-list__item-delete"
@click="handleDownload3(file)"
>
<el-icon><Download/></el-icon>
</span>
<span
class="el-upload-list__item-delete"
@click="handleRemove3(file)"
>
<el-icon><Delete/></el-icon>
</span>
</span>
</div>
<div @click="openCamera3" v-if="file.type ==='camera'" style="border:none"
class="el-upload--picture-card">
<el-icon>
<Camera/>
</el-icon>
</div>
</template>
</el-upload>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialog4 = false">关闭</el-button>
<el-button type="primary" @click="handleObstacle3">
处理
</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="shildDialog">
<el-form :model="shildForm">
@ -939,6 +1030,27 @@
</div>
</template>
</el-dialog>
<el-dialog v-model="shildDialog3">
<el-form :model="shildForm3">
<el-form-item label="固定物名称" label-width="120px">
<el-input v-model="shildForm3.name" autocomplete="off"/>
</el-form-item>
<el-form-item label="偏差值" label-width="120px">
<el-input v-model="shildForm3.deviation" autocomplete="off"/>
</el-form-item>
<el-form-item label="屏蔽范围" label-width="120px">
<el-input v-model="shildForm3.shielding" autocomplete="off"/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="shildDialog3 = false">关闭</el-button>
<el-button type="primary" @click="addShildItem3">
确定
</el-button>
</div>
</template>
</el-dialog>
<input
ref="cameraInput"
@ -964,6 +1076,14 @@
style="display: none"
@change="handleCameraChange2"
/>
<input
ref="cameraInput3"
type="file"
accept="image/*"
capture="camera"
style="display: none"
@change="handleCameraChange3"
/>
<el-dialog v-model="imgDialog">
<img width="100%" :src="dialogImageUrl" alt="Preview Image"/>
@ -972,7 +1092,7 @@
</template>
<script setup>
import Ruler from "@/components/ruler.vue";
import {onMounted, ref, watch, computed} from "vue";
import {computed, onMounted, ref, watch} from "vue";
import {
addShildData,
DeleteCData,
@ -981,10 +1101,13 @@ import {
GetAllCData,
getArea,
getParasPos,
getParasSignalpro, GetSetting,
getParasSignalpro,
GetSetting,
getShildList,
InserDealObstacleModel,
InsertCListData, PosSetting, PostDealObstacleModel,
InsertCListData,
PosSetting,
PostDealObstacleModel,
RestartWork,
setParasPos,
setParasSignalpro,
@ -1000,9 +1123,10 @@ import {useRouter} from "vue-router";
import {ElMessage} from "element-plus";
import {
calcRectangleFromPoints,
getLocalPositionRelativeToP4,
correctDeviation,
getDeviationValue,
correctDeviation, parseTime
getLocalPositionRelativeToP4,
parseTime
} from '@/utils/tool'
const date1 = ref([])
@ -1039,7 +1163,6 @@ const toAdmin = () => {
//
const StartWorkBtn = () => {
StartWork()
tableData1.value = []
}
//
const StopWorkBtn = () => {
@ -1144,6 +1267,7 @@ const itemsId = ref(1)
// id
const setItemsId = (e) => {
itemsId.value = e
dotIndex2.index = -1
}
//
const areaData = ref({
@ -1163,6 +1287,7 @@ const currentPosition = ref({})
//
const table1Current = (e,) => {
dotIndex1.value = -1
dotIndex2.value = -1
if (dotIndex.value === e.index) {
dotIndex.value = -1
} else {
@ -1171,8 +1296,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) {
@ -1197,6 +1322,9 @@ const getSocket = () => {
socket.addEventListener("close", () => {
console.log("❌ WebSocket 已关闭");
setTimeout(() => {
getSocket()
}, 1000)
});
socket.addEventListener("error", (error) => {
@ -1250,7 +1378,7 @@ const setTable1Data = (e) => {
tableData1.value = [...tableData1.value, ...fodInfo.map((v, k) => {
return {
...v,
time:parseTime(v.time),
time: parseTime(v.time || v.Time),
index: tableData1.value.length + k
}
})]
@ -1338,6 +1466,63 @@ 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) => {
console.log(e)
let index = -1
if (itemsId.value === 4) {
index = tableData3.value.findIndex(v => v.longitude === e.longitude && v.latitude === e.latitude)
}
if (itemsId.value === 5) {
index = tableData2.value.findIndex(v => v.id === e.id)
}
console.log(index)
dotIndex.value = -1
dotIndex1.value = -1
if (dotIndex2.value === index) {
dotIndex2.value = -1
} else {
dotIndex2.value = index
}
console.log(dotIndex2.value)
}
const dot1Show = ref(true)
const dialogImageUrl = ref('')
@ -1351,6 +1536,7 @@ const openShildDialog2 = (e) => {
}
//
const updateShildItem = () => {
dotIndex2.value = -1
updateShildData(shildForm1.value).then(e => {
shildDialog2.value = false
shildForm2.value = {}
@ -1418,28 +1604,35 @@ 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,
findTime: parseTime(new Date()) || dialog3Form.value.time || '',
description: dialog3Form.value.description,
FodAirId: form1.value.region1
}).then(e => {
// delShildData(e.row).then(e => {
// getShildTableList()
// })
getShildTableList()
getObstacleList()
dialog3.value = false
})
}
const table3Ref = ref()
//
const batchDel2 = () => {
dotIndex2.value = -1
let datas = table3Ref.value.getSelectionRows()
let promiseArr = []
datas.forEach((row) => {
@ -1447,10 +1640,12 @@ const batchDel2 = () => {
})
Promise.allSettled(promiseArr).then(() => {
getShildTableList()
getObstacleList()
})
}
//
const batchDisposal2 = () => {
dotIndex2.value = -1
let datas = table3Ref.value.getSelectionRows()
let promiseArr = []
datas.forEach((row) => {
@ -1459,11 +1654,14 @@ const batchDisposal2 = () => {
latitude: row.latitude,
strength: row.strength,
files: [],
findTime: row.time,
findTime: parseTime(new Date()),
description: '',
FodAirId: form1.value.region1
}))
})
Promise.allSettled(promiseArr).then(() => {
getShildTableList()
getObstacleList()
})
}
@ -1492,16 +1690,14 @@ const addShildItem = () => {
}
tableData1.value = tableData1.value.filter(v => !(v.Lon === shildForm.value.lon && v.Lat === shildForm.value.lat && v.Strength === shildForm.value.strength))
if (data) {
let index = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex.value = index
}
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()
getObstacleList()
})
}
//
@ -1562,10 +1758,7 @@ const delPoint = (e) => {
if (data) {
let index = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex.value = index
}
dotIndex.value = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
@ -1589,7 +1782,9 @@ const handleObstacle = () => {
latitude: dialog1Form.value.latitude,
strength: dialog1Form.value.strength,
files: dialog1Form.value.fileList.map(e => e.url),
findTime: dialog1Form.value.time,
findTime: parseTime(new Date()) || dialog1Form.value.time || '',
description: dialog1Form.value.description,
FodAirId: form1.value.region1
}).then(e => {
let data = null
if (dotIndex.value >= 0) {
@ -1598,11 +1793,10 @@ const handleObstacle = () => {
dialog1.value = false
tableData1.value = tableData1.value.filter(v => !(v.Lon === dialog1Form.value.longitude && v.Lat === dialog1Form.value.latitude && v.Strength === dialog1Form.value.strength))
if (data) {
let index = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex.value = index
}
dotIndex.value = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
getShildTableList()
getObstacleList()
})
}
//
@ -1620,7 +1814,9 @@ const batchDisposal = () => {
latitude: row.Lat,
strength: row.Strength,
files: [],
findTime: '',
findTime: parseTime(new Date()),
description: '',
FodAirId: form1.value.region1
})
arr = arr.filter(v => !(v.Lon === row.Lon && v.Lat === row.Lat && v.Strength === row.Strength))
})
@ -1631,11 +1827,9 @@ const batchDisposal = () => {
}
})
getShildTableList()
getObstacleList()
if (data) {
let index = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex.value = index
}
dotIndex.value = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
@ -1656,10 +1850,7 @@ const batchDel = () => {
}
})
if (data) {
let index = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex.value = index
}
dotIndex.value = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
@ -1678,6 +1869,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))
})
@ -1688,11 +1880,9 @@ const batchShild = () => {
}
})
getShildTableList()
getObstacleList()
if (data) {
let index = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex.value = index
}
dotIndex.value = table1Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
@ -1721,16 +1911,14 @@ const addShildItem1 = () => {
}
tableData1.value = tableData1.value.filter(v => !(v.Lon === shildForm.value.lon && v.Lat === shildForm.value.lat && v.Strength === shildForm.value.strength))
if (data) {
let index = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex1.value = index
}
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()
getObstacleList()
})
}
//
@ -1791,10 +1979,7 @@ const delPoint1 = (e) => {
if (data) {
let index = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex1.value = index
}
dotIndex1.value = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
@ -1814,23 +1999,22 @@ const openHandleObstacleDialog1 = (e) => {
//
const handleObstacle1 = () => {
InserDealObstacleModel({
longitude: dialog1Form.value.longitude,
latitude: dialog1Form.value.latitude,
strength: dialog1Form.value.strength,
files: dialog1Form.value.fileList.map(e => e.url),
findTime: dialog1Form.value.time,
longitude: dialog2Form.value.longitude,
latitude: dialog2Form.value.latitude,
strength: dialog2Form.value.strength,
files: dialog2Form.value.fileList.map(e => e.url),
findTime: parseTime(new Date()) || dialog2Form.value.time || '',
description: dialog2Form.value.description,
FodAirId: form1.value.region1
}).then(e => {
let data = null
if (dotIndex1.value >= 0) {
data = table2Data.value[dotIndex1.value]
}
dialog2.value = false
tableData1.value = tableData1.value.filter(v => !(v.Lon === dialog1Form.value.longitude && v.Lat === dialog1Form.value.latitude && v.Strength === dialog1Form.value.strength))
tableData1.value = tableData1.value.filter(v => !(v.Lon === dialog2Form.value.longitude && v.Lat === dialog2Form.value.latitude && v.Strength === dialog2Form.value.strength))
if (data) {
let index = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex1.value = index
}
dotIndex1.value = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
})
}
@ -1849,7 +2033,9 @@ const batchDisposal1 = () => {
latitude: row.Lat,
strength: row.Strength,
files: [],
findTime: '',
findTime: parseTime(new Date()),
description: '',
FodAirId: form1.value.region1
})
arr = arr.filter(v => !(v.Lon === row.Lon && v.Lat === row.Lat && v.Strength === row.Strength))
})
@ -1860,11 +2046,9 @@ const batchDisposal1 = () => {
}
})
getShildTableList()
getObstacleList()
if (data) {
let index = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex1.value = index
}
dotIndex1.value = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
@ -1885,10 +2069,7 @@ const batchDel1 = () => {
}
})
if (data) {
let index = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex1.value = index
}
dotIndex1.value = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
@ -1907,6 +2088,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))
})
@ -1917,20 +2099,140 @@ const batchShild1 = () => {
}
})
getShildTableList()
getObstacleList()
if (data) {
let index = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
if (index >= 0) {
dotIndex1.value = index
}
dotIndex1.value = table2Data.value.findIndex(v => v.Lon === data.Lon && v.Lat === data.Lat && v.Strength === data.Strength)
}
}
//
const shildDialog3 = ref(false)
const shildForm3 = ref({})
//
const openShildDialog3 = (e) => {
shildDialog3.value = true
shildForm3.value = {
lon: e.row.longitude,
lat: e.row.latitude,
strength: e.row.strength,
name: Math.random().toString().split('.')[1],
deviation: shieldInfoForm.value.deviation,
shielding: shieldInfoForm.value.shielding,
}
}
//
const addShildItem3 = () => {
dotIndex2.value = -1
addShildData({...shildForm1.value, FodAirId: form1.value.region1}).then(e => {
shildDialog3.value = false
shildForm3.value = {}
getShildTableList()
getObstacleList()
})
}
//
const dialog4 = ref(false)
const dialog4Form = ref({})
//
const uploadFiles3 = async (e) => {
const res = await UpdateImage({files: [e.file]})
}
//
const handlePictureCardPreview3 = (file) => {
dialogImageUrl.value = file.url
imgDialog.value = true
}
//
const handleDownload3 = (file) => {
console.log(file)
}
//
const handleRemove3 = (file) => {
console.log(file)
dialog4Form.value.fileList = dialog4Form.value.fileList.filter(e => e.url !== file.url)
}
//
const cameraInput3 = ref(null)
const openCamera3 = () => {
cameraInput3.value?.click()
}
const handleCameraChange3 = (e) => {
const file = e.target.files[0]
if (!file) return
const url = URL.createObjectURL(file)
UpdateImage({files: [file]})
dialog4Form.fileList.value.push({
name: file.name,
url,
raw: file
})
// input
e.target.value = ''
}
//
const delObstacleItem = (e) => {
}
//
const openHandleObstacleDialog3 = (e) => {
dialog4.value = true
dialog4Form.value = {
time: e.row.time,
longitude: e.row.longitude,
latitude: e.row.latitude,
strength: e.row.strength,
fileList: e.row.fileList,
description: e.row.description,
}
}
//
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: parseTime(new Date()) || dialog4Form.value.time || '',
description: dialog4Form.value.description,
FodAirId: form1.value.region1
}).then(e => {
})
}
//
const table4Ref = ref()
//
const batchDel3 = () => {
}
//
const batchShild3 = () => {
dotIndex2.value = -1
let datas = table4Ref.value.getSelectionRows()
datas.forEach((row) => {
addShildData({
lon: row.longitude,
lat: row.latitude,
strength: row.strength,
name: Math.random().toString().split('.')[1],
deviation: shieldInfoForm.value.deviation,
shielding: shieldInfoForm.value.shielding,
FodAirId: form1.value.region1
})
})
getShildTableList()
getObstacleList()
}
//
const getShildTableList = () => {
getShildList({
pageIndex: currentPage3.value,
pageSize: pageSize3.value,
FodAirId: form1.value.region1
}).then((e) => {
tableData2.value = e.data
total3.value = e.totalCount
@ -1941,6 +2243,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