Merge remote-tracking branch 'origin/main'

main
scrin 2 months ago
commit 653002853e

@ -28,7 +28,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="content"> <div class="content" :style="bgStyle">
<div <div
v-if="boxPos" v-if="boxPos"
class="box" class="box"
@ -87,6 +87,24 @@
{{ index + 1 }} {{ index + 1 }}
</span> </span>
</div> </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>
</div> </div>
</template> </template>
@ -107,11 +125,29 @@ const props = defineProps({
dotIndex: {type: Number, required: true}, dotIndex: {type: Number, required: true},
dots1: {type: Array, required: true}, dots1: {type: Array, required: true},
dotIndex1: {type: Number, required: true}, dotIndex1: {type: Number, required: true},
dots2: {type: Array, required: true},
dotIndex2: {type: Number, required: true},
dot1Show: {type: Boolean, required: true}, dot1Show: {type: Boolean, required: true},
scan: {type: Boolean, required: true}, scan: {type: Boolean, required: true},
}) })
const boxContentX = ref(0) const boxContentX = ref(0)
const boxContentY = 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) => { watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => {
getBoxPos() getBoxPos()
getDistanceAndZoom() getDistanceAndZoom()
@ -120,8 +156,11 @@ watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => {
zoomScale(props.boxPos.y, 1) zoomScale(props.boxPos.y, 1)
getBoxPos() getBoxPos()
} else { } else {
differenceValue.value = 0
zoomScale(props.boxPos.y, 0) zoomScale(props.boxPos.y, 0)
} }
} else {
differenceValue.value = 0
} }
if (props.dotIndex >= 0) { if (props.dotIndex >= 0) {
getLineData('head', `dot${props.dotIndex + 1}`) getLineData('head', `dot${props.dotIndex + 1}`)
@ -129,6 +168,9 @@ watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => {
if (props.dotIndex1 >= 0) { if (props.dotIndex1 >= 0) {
getLineData('head', `dota${props.dotIndex1 + 1}`) getLineData('head', `dota${props.dotIndex1 + 1}`)
} }
if (props.dotIndex2 >= 0) {
getLineData('head', `dotb${props.dotIndex2 + 1}`)
}
}) })
onMounted(() => { onMounted(() => {
getBoxPos() getBoxPos()
@ -139,9 +181,12 @@ onMounted(() => {
if (props.dotIndex1 >= 0) { if (props.dotIndex1 >= 0) {
getLineData('head', `dota${props.dotIndex1 + 1}`) 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() getBoxPos()
getDistanceAndZoom() getDistanceAndZoom()
if (distance1.value) { if (distance1.value) {
@ -149,13 +194,19 @@ watch(() => JSON.stringify([props.dotIndex, props.dotIndex1]), (newVal, oldVal)
zoomScale(props.boxPos.y, 1) zoomScale(props.boxPos.y, 1)
getBoxPos() getBoxPos()
} else { } else {
differenceValue.value = 0
zoomScale(props.boxPos.y, 0) zoomScale(props.boxPos.y, 0)
} }
} else {
differenceValue.value = 0
} }
if (props.dotIndex >= 0) { if (props.dotIndex >= 0) {
getLineData('head', `dot${props.dotIndex + 1}`) getLineData('head', `dot${props.dotIndex + 1}`)
} else if (props.dotIndex1 >= 0) { } else if (props.dotIndex1 >= 0) {
getLineData('head', `dota${props.dotIndex1 + 1}`) getLineData('head', `dota${props.dotIndex1 + 1}`)
} else if (props.dotIndex2 >= 0) {
getLineData('head', `dotb${props.dotIndex2 + 1}`)
}else{ }else{
zoomScale(props.boxPos.y, 0) zoomScale(props.boxPos.y, 0)
} }
@ -177,6 +228,14 @@ const getDistanceAndZoom = () => {
let a = dotx - carx let a = dotx - carx
let b = doty - cary let b = doty - cary
distance1.value = Math.sqrt(a * a + b * b); 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 { } else {
distance1.value = 0 distance1.value = 0
} }
@ -239,6 +298,9 @@ function zoomScale(value, type) {
if (props.dotIndex1 >= 0) { if (props.dotIndex1 >= 0) {
getLineData('head', `dota${props.dotIndex1 + 1}`) getLineData('head', `dota${props.dotIndex1 + 1}`)
} }
if (props.dotIndex2 >= 0) {
getLineData('head', `dotb${props.dotIndex2 + 1}`)
}
}, 10) }, 10)
} }
@ -249,6 +311,7 @@ function getAxisRange() {
return {min: Math.min(...values), max: Math.max(...values)} return {min: Math.min(...values), max: Math.max(...values)}
} }
const differenceValue = ref(0)
const leftTicks = computed(() => { const leftTicks = computed(() => {
const arr = [] const arr = []
@ -276,7 +339,7 @@ const leftTicks = computed(() => {
let startValue = centerValue.value - half * step let startValue = centerValue.value - half * step
let endValue = centerValue.value + half * step let endValue = centerValue.value + half * step
console.log(endValue - startValue) differenceValue.value = endValue - startValue
if (startValue < 0) { if (startValue < 0) {
endValue += -startValue endValue += -startValue
@ -336,6 +399,7 @@ const ticks = computed(() => {
height: 100%; height: 100%;
background-color: #000; background-color: #000;
.left { .left {
position: absolute; position: absolute;
width: 40px; width: 40px;
@ -440,6 +504,9 @@ const ticks = computed(() => {
background-color: #666; background-color: #666;
top: 0; top: 0;
left: 40px; left: 40px;
//background-image: url("@/assets/car.png");
background-repeat: no-repeat;
background-size: 100% 100%;
.dot { .dot {
width: 20px; width: 20px;

File diff suppressed because it is too large Load Diff

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

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

Loading…
Cancel
Save