@ -53,6 +53,8 @@
: boxPos = "boxPos"
: dots = "dots"
: dotIndex = "dotIndex"
: dots1 = "dots1"
: dotIndex1 = "dotIndex1"
/ >
< / div >
@ -203,14 +205,14 @@
< el -table
ref = "table1Ref"
highlight - current - row
: data = "table1Data "
: data = "table1Data .slice((currentPage1 - 1) * pageSize1, currentPage1 * pageSize1) "
style = "width: 100%"
@ row - click = "table1Current"
>
< el -table -column type = "selection" width = "55" / >
< el -table -column label = "序号" width = "60" >
< el -table -column label = "序号" width = "60" >
< template # default = "scope" >
{ { ( currentPage1 - 1 ) * pageSize1 + scope . $index + 1 } }
{ { ( currentPage1 - 1 ) * pageSize1 + scope . $index + 1 } }
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "Lon" label = "目标经度" width = "100" / >
@ -239,7 +241,7 @@
: pager - count = "4"
: page - sizes = "[10,20,50,100, 200, 300, 400]"
layout = "total, sizes, prev, pager, next, jumper"
: total = "table Data1 .length"
: total = "table 1 Data.length"
/ >
< / e l - c a r d >
@ -247,28 +249,33 @@
< el -card shadow = "always" style = "margin-top: 12px" >
< el -table
highlight - current - row
: data = "table Data2"
: data = "table 2 Data.slice((currentPage 2 - 1) * pageSize2, currentPage2 * pageSize2) "
style = "width: 100%"
@ row - click = "table1Current1"
>
<!-- < el -table -column type = "selection" width = "55" / > -- >
< el -table -column label = "序号" type = "index" width = "60" / >
< el -table -column prop = "name" label = "名称" width = "100" / >
< 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 type = "selection" width = "55" / >
< el -table -column label = "序号" width = "60" >
< template # default = "scope" >
< el -button type = "primary" link @click.stop ="openShildDialog1(scope)" > 修改 < / e l - b u t t o n >
{ { ( currentPage2 - 1 ) * pageSize2 + scope . $index + 1 } }
< / template >
< / e l - t a b l e - c o l u m n >
< 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 = "200" fixed = "right" >
< template # default = "scope" >
< el -button type = "primary" @click.stop ="openHandleObstacleDialog(scope)" link > 处置 < / e l - b u t t o n >
< el -popconfirm
class = "box-item"
title = "确定删除这个点位吗?"
placement = "top"
@ confirm = "delShildItem(scope)"
@ confirm = "del Point (scope)"
>
< template # reference >
< el -button type = "primary" @ click.stop link > 删除 < / e l - b u t t o n >
< / template >
< / e l - p o p c o n f i r m >
< el -button type = "primary" @click.stop ="openShildDialog(scope)" link > 固定物 < / e l - b u t t o n >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
@ -278,7 +285,7 @@
: pager - count = "4"
: page - sizes = "[10,20,50,100, 200, 300, 400]"
layout = "total, sizes, prev, pager, next, jumper"
: total = "t otal2 "
: total = "t able2Data.length "
@ change = "getShildTableList"
/ >
< / e l - c a r d >
@ -599,22 +606,43 @@
< div v-if ="itemsId === 5" class="tabsItem" >
<!-- 数据表格 -- >
< el -card shadow = "always" style = "margin-top: 12px" >
< el -table :data ="tableData2" style = "width: 100%" >
< el -table
highlight - current - row
: data = "tableData2"
style = "width: 100%"
>
<!-- < el -table -column type = "selection" width = "55" / > -- >
< el -table -column label = "序号" type = "index" width = "60" / >
< el -table -column prop = "coordinate" label = "目标坐标" width = "120" / >
< el -table -column label = "告警等级" width = "160" >
< el -table -column prop = "name" label = "名称" width = "100" / >
< 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" >
< template # default = "scope" >
< el -rate :model-value ="scope.row.rate" disabled / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "处理状态" show -overflow -tooltip >
< template # default = "scope" >
< span v-if ="scope.row.type === 1" > 已 处 理 < / span >
< span v -else -if = " scope.row.type = = = 2 " > 不处理 < / span >
< span v -else -if = " scope.row.type = = = 3 " > 未发现 < / span >
< el -button type = "primary" link @click.stop ="openShildDialog1(scope)" > 修改 < / e l - b u t t o n >
< el -popconfirm
class = "box-item"
title = "确定删除这个点位吗?"
placement = "top"
@ confirm = "delShildItem(scope)"
>
< template # reference >
< el -button type = "primary" @ click.stop link > 删除 < / e l - b u t t o n >
< / template >
< / e l - p o p c o n f i r m >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< el -pagination
v - model : current - page = "currentPage3"
v - model : page - size = "pageSize3"
: pager - count = "4"
: page - sizes = "[10,20,50,100, 200, 300, 400]"
layout = "total, sizes, prev, pager, next, jumper"
: total = "total3"
@ change = "getShildTableList"
/ >
< / e l - c a r d >
< / div >
< / div >
@ -727,7 +755,7 @@
< / template >
< script setup >
import Ruler from "@/components/ruler.vue" ;
import { onMounted , ref , watch , computed } from "vue" ;
import { onMounted , ref , watch , computed } from "vue" ;
import {
addShildData ,
DeleteCData ,
@ -954,12 +982,21 @@ const boxPos = ref({x: 100, y: 150, rotate: 0})
const currentPosition = ref ( { } )
/ / 表 格 点 击 事 件
const table1Current = ( e , ) => {
dotIndex1 . value = - 1
if ( dotIndex . value === e . index ) {
dotIndex . value = - 1
} else {
dotIndex . value = e . index
}
}
const table1Current1 = ( e , ) => {
dotIndex . value = - 1
if ( dotIndex1 . value === e . index ) {
dotIndex1 . value = - 1
} else {
dotIndex1 . value = e . index
}
}
/ / w s 连 接
const getSocket = ( ) => {
@ -1023,24 +1060,78 @@ const setTable1Data = (e) => {
/ / 障 碍 物 列 表
const tableData1 = ref ( [ ] )
const table1Data = computed ( ( ) => {
return tableData1 . value . slice ( ( currentPage1 . value - 1 ) * pageSize1 . value , currentPage1 . value * pageSize1 . value )
return tableData1 . value . filter ( e => e . Status == 0 ) . map ( ( v , k ) => {
return {
... v ,
index : k
}
} )
} ) ;
/ / 当 前 页
const currentPage1 = ref ( 1 )
/ / 每 页 数 量
const pageSize1 = ref ( 10 )
/ / 固 定 物 列 表
const tableData2 = ref ( [ ] )
const table2Data = computed ( ( ) => {
return tableData1 . value . filter ( e => e . Status == 2 ) . map ( ( v , k ) => {
return {
... v ,
index : k
}
} )
} ) ;
/ / 当 前 页
const currentPage2 = ref ( 1 )
/ / 每 页 数 量
const pageSize2 = ref ( 10 )
const total2 = ref ( 0 )
/ / 固 定 物 列 表
const tableData2 = ref ( [ ] )
/ / 当 前 页
const currentPage3 = ref ( 1 )
/ / 每 页 数 量
const pageSize3 = ref ( 10 )
const total3 = ref ( 0 )
/ / 障 碍 物 点 位
const dots = ref ( [ ] )
const dots = computed ( ( ) => {
return table1Data . 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 ) ) ,
type : v . Status
}
} else {
return null
}
} ) . filter ( v => v )
} )
const dots1 = computed ( ( ) => {
return table2Data . 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 ) ) ,
type : v . Status
}
} else {
return null
}
} ) . filter ( v => v )
} )
/ / 当 前 的 目 标 障 碍 物
const dotIndex = ref ( - 1 )
const dotIndex1 = ref ( - 1 )
/ / 固 定 物 模 态 框
const shildDialog = ref ( false )
const shildForm = ref ( { } )
@ -1063,20 +1154,23 @@ const openShildDialog1 = (e) => {
}
/ / 设 置 固 定 物
const addShildItem = ( ) => {
if ( shildForm . value . id ) {
updateShildData ( shildForm . value ) . then ( e => {
shildDialog . value = false
shildForm . value = { }
getShildTableList ( )
} )
} else {
tableData1 . value . splice ( ( currentPage1 . value - 1 ) * pageSize1 . value + shildForm . value . $index , 1 ) ;
addShildData ( shildForm . value ) . then ( e => {
shildDialog . value = false
shildForm . value = { }
getShildTableList ( )
} )
let data = null
if ( dotIndex . value >= 0 ) {
data = table1Data . value [ dotIndex . value ]
}
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
}
}
addShildData ( shildForm . value ) . then ( e => {
shildDialog . value = false
shildForm . value = { }
getShildTableList ( )
} )
}
/ / 删 除 固 定 物
const delShildItem = ( e ) => {
@ -1087,12 +1181,11 @@ const delShildItem = (e) => {
/ / 获 取 固 定 物 列 表
const getShildTableList = ( ) => {
getShildList ( {
pageIndex : currentPage 2 . value ,
pageSize : pageSize 2 . value ,
pageIndex : currentPage 3 . value ,
pageSize : pageSize 3 . value ,
} ) . then ( ( e ) => {
tableData2 . value = e . data
total2 . value = e . totalCount
total3 . value = e . totalCount
} )
}
@ -1103,11 +1196,21 @@ const dialogImageUrl = ref('')
const imgDialog = ref ( false )
/ / 删 除
const delPoint = ( e ) => {
let arr = JSON . parse ( JSON . stringify ( tableData1 . value ) )
arr . splice ( ( currentPage1 . value - 1 ) * pageSize1 . value + e . $index , 1 ) ;
tableData1 . value = arr || [ ]
dotIndexF ( ( currentPage1 . value - 1 ) * pageSize1 . value + e . $index )
table1DataIndexF ( )
let data = null
if ( dotIndex . value >= 0 ) {
data = table1Data . value [ dotIndex . value ]
}
tableData1 . value = tableData1 . value . filter ( v => ! ( v . Lon === e . row . Lon && v . Lat === e . row . Lat && v . Strength === e . row . 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
}
}
}
/ / 打 开 处 置 模 态 框
const openHandleObstacleDialog = ( e ) => {
@ -1119,7 +1222,7 @@ const openHandleObstacleDialog = (e) => {
longitude : e . row . Lon ,
latitude : e . row . Lat ,
strength : e . row . Strength ,
fileList : [ {url : 'https://dummyimage.com/640x360' } , { url : 'https://placehold.co/600x400/png' } ]
fileList : [ ]
}
}
/ / 确 定 处 理
@ -1131,18 +1234,30 @@ const handleObstacle = () => {
files : dialog1Form . value . fileList . map ( e => e . url ) ,
findTime : dialog1Form . value . time ,
} ) . then ( e => {
let data = null
if ( dotIndex . value >= 0 ) {
data = table1Data . value [ dotIndex . value ]
}
dialog1 . value = false
dotIndexF ( dialog1Form . value . dotIndex )
tableData1 . value . splice ( ( currentPage1 . value - 1 ) * pageSize1 . value + dialog1Form . value . index , 1 ) ;
table1DataIndexF ( )
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
}
}
} )
}
/ / 批 量 处 理
const table1Ref = ref ( )
const batchDisposal = ( ) => {
dotIndex . value = - 1
let data = null
if ( dotIndex . value >= 0 ) {
data = table1Data . value [ dotIndex . value ]
}
let datas = table1Ref . value . getSelectionRows ( )
let arr = JSON . parse ( JSON . stringify ( tableData1 . value ) )
datas . forEach ( ( row ) => {
InserDealObstacleModel ( {
longitude : row . Lon ,
@ -1151,24 +1266,44 @@ const batchDisposal = () => {
files : [ ] ,
findTime : '' ,
} )
tableData1. value = tableData1 . value . filter ( item => row . index !== item . index ) ;
arr = arr . filter ( v => ! ( v . Lon === row . Lon && v . Lat === row . Lat && v . Strength === row . Strength ) )
} )
tableData1 . value = arr
getShildTableList ( )
table1DataIndexF ( )
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
}
}
}
/ / 批 量 删 除
const batchDel = ( ) => {
dotIndex . value = - 1
let data = null
if ( dotIndex . value >= 0 ) {
data = table1Data . value [ dotIndex . value ]
}
let datas = table1Ref . value . getSelectionRows ( )
let arr = JSON . parse ( JSON . stringify ( tableData1 . value ) )
datas . forEach ( ( row ) => {
tableData1 . value = tableData1 . value . filter ( item => row . index !== item . index ) ;
arr = arr . filter ( v => ! ( v . Lon === row . Lon && v . Lat === row . Lat && v . Strength === row . Strength ) )
} )
table1DataIndexF ( )
tableData1 . value = arr
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
}
}
}
/ / 批 量 固 定
const batchShild = ( ) => {
dotIndex . value = - 1
let data = null
if ( dotIndex . value >= 0 ) {
data = table1Data . value [ dotIndex . value ]
}
let datas = table1Ref . value . getSelectionRows ( )
let arr = JSON . parse ( JSON . stringify ( tableData1 . value ) )
datas . forEach ( ( row ) => {
addShildData ( {
lon : row . Lon ,
@ -1178,10 +1313,16 @@ const batchShild = () => {
deviation : shieldInfoForm . value . deviation ,
shielding : shieldInfoForm . value . shielding ,
} )
tableData1. value = tableData1 . value . filter ( item => row . index !== item . index ) ;
arr = arr . filter ( v => ! ( v . Lon === row . Lon && v . Lat === row . Lat && v . Strength === row . Strength ) )
} )
tableData1 . value = arr
getShildTableList ( )
table1DataIndexF ( )
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
}
}
}
/ / 区 域 标 定 页 面 获 取 区 域 信 息
@ -1228,24 +1369,123 @@ const dotIndexF = (index) => {
}
}
const readTableData = ( ) => {
const storedStr = localStorage . getItem ( 'tableData1' ) ;
if ( ! storedStr ) {
return ;
}
const storedData = JSON . parse ( storedStr ) ;
if ( ! Array . isArray ( storedData ) ) {
return ;
}
tableData1 . value . splice ( 0 , tableData1 . value . length , ... ( storedData . map ( ( e , index ) => {
tableData1 . value = [
{ "Lon" : 119.68158733286303 , "Lat" : 25.929632812633325 , "Status" : 0 } ,
{ "Lon" : 119.68226426875183 , "Lat" : 25.930447575308917 , "Status" : 2 } ,
{ "Lon" : 119.68096665515995 , "Lat" : 25.92785426333515 , "Status" : 0 } ,
{ "Lon" : 119.68278645438862 , "Lat" : 25.931322676440597 , "Status" : 2 } ,
{ "Lon" : 119.6812308665526 , "Lat" : 25.92833823728329 , "Status" : 0 } ,
{ "Lon" : 119.68318456612818 , "Lat" : 25.93195533358216 , "Status" : 2 } ,
{ "Lon" : 119.68036755668337 , "Lat" : 25.926887965282527 , "Status" : 0 } ,
{ "Lon" : 119.68192384565978 , "Lat" : 25.92998287455529 , "Status" : 2 } ,
{ "Lon" : 119.68250211437338 , "Lat" : 25.930826764153685 , "Status" : 0 } ,
{ "Lon" : 119.68173244334253 , "Lat" : 25.92945659218239 , "Status" : 2 } ,
{ "Lon" : 119.68295065558712 , "Lat" : 25.93161275117524 , "Status" : 0 } ,
{ "Lon" : 119.68105985472717 , "Lat" : 25.92803513687375 , "Status" : 2 } ,
{ "Lon" : 119.68341837732858 , "Lat" : 25.932375885682826 , "Status" : 0 } ,
{ "Lon" : 119.68064788438357 , "Lat" : 25.927279242277973 , "Status" : 2 } ,
{ "Lon" : 119.68209525287522 , "Lat" : 25.93029711876587 , "Status" : 0 } ,
{ "Lon" : 119.68265453337758 , "Lat" : 25.931034055557433 , "Status" : 2 } ,
{ "Lon" : 119.68139455255315 , "Lat" : 25.928622731163285 , "Status" : 0 } ,
{ "Lon" : 119.6832675327453 , "Lat" : 25.93210835721747 , "Status" : 2 } ,
{ "Lon" : 119.68018322877646 , "Lat" : 25.92664065235554 , "Status" : 0 } ,
{ "Lon" : 119.68150073637315 , "Lat" : 25.929251557521317 , "Status" : 2 } ,
{ "Lon" : 119.68237556552133 , "Lat" : 25.93061626521737 , "Status" : 0 } ,
{ "Lon" : 119.68289878364453 , "Lat" : 25.93148441687782 , "Status" : 2 } ,
{ "Lon" : 119.68087065652437 , "Lat" : 25.927625231566176 , "Status" : 0 } ,
{ "Lon" : 119.68183456587315 , "Lat" : 25.92978651727634 , "Status" : 2 } ,
{ "Lon" : 119.68241653211357 , "Lat" : 25.93071232314118 , "Status" : 0 } ,
{ "Lon" : 119.68309635565385 , "Lat" : 25.93180587653187 , "Status" : 2 } ,
{ "Lon" : 119.68114278553872 , "Lat" : 25.92820365476537 , "Status" : 0 } ,
{ "Lon" : 119.68055145252318 , "Lat" : 25.92715353326578 , "Status" : 2 } ,
{ "Lon" : 119.6821865443212 , "Lat" : 25.93045772867326 , "Status" : 0 } ,
{ "Lon" : 119.68271563257338 , "Lat" : 25.93115482282882 , "Status" : 2 } ,
{ "Lon" : 119.6816754333553 , "Lat" : 25.92959862621233 , "Status" : 0 } ,
{ "Lon" : 119.68334676542355 , "Lat" : 25.932253615880354 , "Status" : 2 } ,
{ "Lon" : 119.68027543254352 , "Lat" : 25.92676543256789 , "Status" : 0 } ,
{ "Lon" : 119.68198765432156 , "Lat" : 25.93012345678901 , "Status" : 2 } ,
{ "Lon" : 119.68256789012345 , "Lat" : 25.93098765432156 , "Status" : 0 } ,
{ "Lon" : 119.68143215432156 , "Lat" : 25.92876543215678 , "Status" : 2 } ,
{ "Lon" : 119.6829123456789 , "Lat" : 25.9315432156789 , "Status" : 0 } ,
{ "Lon" : 119.68076543215678 , "Lat" : 25.92743215678901 , "Status" : 2 } ,
{ "Lon" : 119.68226543215678 , "Lat" : 25.93034567890123 , "Status" : 0 } ,
{ "Lon" : 119.6831123456789 , "Lat" : 25.93198765432156 , "Status" : 2 } ,
{ "Lon" : 119.68126543215678 , "Lat" : 25.92843215678901 , "Status" : 0 } ,
{ "Lon" : 119.68046543215678 , "Lat" : 25.92698765432156 , "Status" : 2 } ,
{ "Lon" : 119.68186543215678 , "Lat" : 25.92984567890123 , "Status" : 0 } ,
{ "Lon" : 119.68266543215678 , "Lat" : 25.93114567890123 , "Status" : 2 } ,
{ "Lon" : 119.68346543215678 , "Lat" : 25.93244567890123 , "Status" : 0 } ,
{ "Lon" : 119.68066543215678 , "Lat" : 25.92734567890123 , "Status" : 2 } ,
{ "Lon" : 119.68166543215678 , "Lat" : 25.92944567890123 , "Status" : 0 } ,
{ "Lon" : 119.68246543215678 , "Lat" : 25.93074567890123 , "Status" : 2 } ,
{ "Lon" : 119.68306543215678 , "Lat" : 25.93184567890123 , "Status" : 0 } ,
{ "Lon" : 119.68096543215678 , "Lat" : 25.92774567890123 , "Status" : 2 } ,
{ "Lon" : 119.68216543215678 , "Lat" : 25.93024567890123 , "Status" : 0 } ,
{ "Lon" : 119.68286543215678 , "Lat" : 25.93134567890123 , "Status" : 2 } ,
{ "Lon" : 119.68136543215678 , "Lat" : 25.92864567890123 , "Status" : 0 } ,
{ "Lon" : 119.68036543215678 , "Lat" : 25.92684567890123 , "Status" : 2 } ,
{ "Lon" : 119.68176543215678 , "Lat" : 25.92964567890123 , "Status" : 0 } ,
{ "Lon" : 119.68256543215678 , "Lat" : 25.93084567890123 , "Status" : 2 } ,
{ "Lon" : 119.68326543215678 , "Lat" : 25.93204567890123 , "Status" : 0 } ,
{ "Lon" : 119.68106543215678 , "Lat" : 25.92794567890123 , "Status" : 2 } ,
{ "Lon" : 119.68236543215678 , "Lat" : 25.93054567890123 , "Status" : 0 } ,
{ "Lon" : 119.68296543215678 , "Lat" : 25.93164567890123 , "Status" : 2 } ,
{ "Lon" : 119.68156543215678 , "Lat" : 25.92914567890123 , "Status" : 0 } ,
{ "Lon" : 119.68086543215678 , "Lat" : 25.92764567890123 , "Status" : 2 } ,
{ "Lon" : 119.68206543215678 , "Lat" : 25.92994567890123 , "Status" : 0 } ,
{ "Lon" : 119.68276543215678 , "Lat" : 25.93124567890123 , "Status" : 2 } ,
{ "Lon" : 119.68336543215678 , "Lat" : 25.93234567890123 , "Status" : 0 } ,
{ "Lon" : 119.68116543215678 , "Lat" : 25.92824567890123 , "Status" : 2 } ,
{ "Lon" : 119.68056543215678 , "Lat" : 25.92704567890123 , "Status" : 0 } ,
{ "Lon" : 119.68196543215678 , "Lat" : 25.93004567890123 , "Status" : 2 } ,
{ "Lon" : 119.68266543215678 , "Lat" : 25.93094567890123 , "Status" : 0 } ,
{ "Lon" : 119.68316543215678 , "Lat" : 25.93174567890123 , "Status" : 2 } ,
{ "Lon" : 119.68066543215678 , "Lat" : 25.92724567890123 , "Status" : 0 } ,
{ "Lon" : 119.68146543215678 , "Lat" : 25.92884567890123 , "Status" : 2 } ,
{ "Lon" : 119.68226543215678 , "Lat" : 25.93044567890123 , "Status" : 0 } ,
{ "Lon" : 119.68286543215678 , "Lat" : 25.93144567890123 , "Status" : 2 } ,
{ "Lon" : 119.68356543215678 , "Lat" : 25.93254567890123 , "Status" : 0 } ,
{ "Lon" : 119.68076543215678 , "Lat" : 25.92754567890123 , "Status" : 2 } ,
{ "Lon" : 119.68136543215678 , "Lat" : 25.92854567890123 , "Status" : 0 } ,
{ "Lon" : 119.68216543215678 , "Lat" : 25.93034567890123 , "Status" : 2 } ,
{ "Lon" : 119.68296543215678 , "Lat" : 25.93174567890123 , "Status" : 0 } ,
{ "Lon" : 119.68166543215678 , "Lat" : 25.92934567890123 , "Status" : 2 } ,
{ "Lon" : 119.68046543215678 , "Lat" : 25.92694567890123 , "Status" : 0 } ,
{ "Lon" : 119.68186543215678 , "Lat" : 25.92974567890123 , "Status" : 2 } ,
{ "Lon" : 119.68246543215678 , "Lat" : 25.93064567890123 , "Status" : 0 } ,
{ "Lon" : 119.68306543215678 , "Lat" : 25.93154567890123 , "Status" : 2 } ,
{ "Lon" : 119.68326543215678 , "Lat" : 25.93214567890123 , "Status" : 0 } ,
{ "Lon" : 119.68106543215678 , "Lat" : 25.92784567890123 , "Status" : 2 } ,
{ "Lon" : 119.68236543215678 , "Lat" : 25.93064567890123 , "Status" : 0 } ,
{ "Lon" : 119.68276543215678 , "Lat" : 25.93114567890123 , "Status" : 2 } ,
{ "Lon" : 119.68126543215678 , "Lat" : 25.92834567890123 , "Status" : 0 } ,
{ "Lon" : 119.68026543215678 , "Lat" : 25.92664567890123 , "Status" : 2 }
] . map ( ( e , i ) => {
return {
... e ,
index : index ,
Strength : Math . ceil ( Math . random ( ) * 200 ) ,
index : i
}
} ) ) ) ;
if ( table1Ref . value ) {
table1Ref . value . doLayout ( ) ; / / 强 制 表 格 重 新 计 算 布 局
}
} )
/ / c o n s t s t o r e d S t r = l o c a l S t o r a g e . g e t I t e m ( ' t a b l e D a t a 1 ' ) ;
/ / i f ( ! s t o r e d S t r ) {
/ / r e t u r n ;
/ / }
/ / c o n s t s t o r e d D a t a = J S O N . p a r s e ( s t o r e d S t r ) ;
/ / i f ( ! A r r a y . i s A r r a y ( s t o r e d D a t a ) ) {
/ / r e t u r n ;
/ / }
/ / t a b l e D a t a 1 . v a l u e . s p l i c e ( 0 , t a b l e D a t a 1 . v a l u e . l e n g t h , . . . ( s t o r e d D a t a . m a p ( ( e , i n d e x ) = > {
/ / r e t u r n {
/ / . . . e ,
/ / i n d e x : i n d e x ,
/ / }
/ / } ) ) ) ;
/ / i f ( t a b l e 1 R e f . v a l u e ) {
/ / t a b l e 1 R e f . v a l u e . d o L a y o u t ( ) ; / / 强 制 表 格 重 新 计 算 布 局
/ / }
}
const getTableData = async ( ) => {
await getAllAirPort ( ) . then ( e => {
options1 . value = e . data
@ -1280,8 +1520,7 @@ onMounted(() => {
getSocket ( )
getOption ( )
getShildTableList ( )
/ / t e s t F u n ( )
getDotsData ( )
testFun ( )
} )
const testFun = ( ) => {
let areaData111 = [
@ -1340,30 +1579,13 @@ const testFun = () => {
getLocal ( )
}
const getDotsData = ( ) => {
dots . value = [ ... tableData1 . value . map ( ( v , k ) => {
const rectInfo = calcRectangleFromPoints ( areaPoints . value ) ;
const point = {
lon : v . Lon ,
lat : v . Lat ,
rotate : 0 ,
} ;
return {
... correctDeviation ( getLocalPositionRelativeToP4 ( point , areaPoints . value , rectInfo ) ) ,
type : v . Status
}
} ) . filter ( v => v ) ]
}
watch ( ( ) => JSON . stringify ( [ tableData1 . value , areaPoints . value ] ) , ( oldVal , newVal ) => {
console . log ( tableData1 . value )
localStorage . setItem ( 'tableData1' , JSON . stringify ( tableData1 . value ) ) ;
getDotsData ( )
console . log ( dots . value )
} , { deep : true } )
const table1DataIndexF = ( ) => {
tableData1 . value = tableData1 . value . map ( ( v , k ) => {
return {
... v ,