You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1147 lines
35 KiB
Vue

4 months ago
<template>
3 months ago
<!-- <div class="app-container" :style="{ transform: `scale(${scaleRatio})`,transformOrigin: `left top` }">-->
<!-- <div :style="{ transform: `scale(${scaleRatio})`,transformOrigin: `left top` }">-->
4 months ago
<div class="app-container">
3 months ago
<TOP/>
<LEFT/>
<RIGHT/>
3 months ago
<el-button style="position: fixed;top: 10px;right: 10px" type="primary" @click="toAdmin"></el-button>
4 months ago
</div>
3 months ago
<!-- </div>-->
4 months ago
</template>
3 months ago
<script setup lang="jsx">
4 months ago
import Ruler from "@/components/ruler.vue";
3 months ago
import {defineComponent, nextTick, onMounted, ref} from "vue";
4 months ago
import {
getParasPos,
getParasSignalpro,
setParasPos,
setParasSignalpro,
getShildList,
addShildData,
3 months ago
delShildData, StartWork, StopWork, RestartWork, ShutDownWork, getAllAirPort, getArea, GetAllCData
4 months ago
} from "@/api/api";
3 months ago
import {useRouter} from "vue-router";
4 months ago
3 months ago
const scaleRatio = ref(window.innerWidth / 1080)
const onSubmit = (e) => {
console.log(e)
}
const TOP = defineComponent({
name: 'TOP',
setup() {
return () => (
<div class="top">
<div class="title">探测系统</div>
<div class="items">
<div
class={{item: true, click: itemsId.value === 1}}
onClick={() => setItemsId(1)}
>
<span>主界面</span>
</div>
<div
class={{item: true, click: itemsId.value === 2}}
onClick={() => setItemsId(2)}
>
<span>区域标定</span>
</div>
<div
class={{item: true, click: itemsId.value === 3}}
onClick={() => setItemsId(3)}
>
<span>软件设置</span>
</div>
<div
class={{item: true, click: itemsId.value === 4}}
onClick={() => setItemsId(4)}
>
<span>历史记录</span>
</div>
</div>
</div>
)
}
})
const LEFT = defineComponent({
name: 'LEFT',
setup() {
3 months ago
const boxPos = ref({x: 100, y: 100, rotate: 30})
3 months ago
return () => (
<div class="left">
<Ruler
ref={rulerRef}
index={dotIndex.value}
3 months ago
width={500}
height={1000}
3 months ago
boxPos={boxPos.value}
3 months ago
dots={dots.value}
dotIndex={0}
3 months ago
/>
</div>
)
}
})
const RIGHT = defineComponent({
name: 'RIGHT',
setup() {
return () => (
<div class="right">
{itemsId.value === 1 && (
<div class="tabsItem">
<ElCard shadow="always">
<ElForm inline model={form1.value} class="demo-form-inline">
<ElFormItem>
<ElSelect
modelValue={form1.value.region}
placeholder="请选择机场名称"
style={{width: "200px"}}
clearable
3 months ago
onUpdate:modelValue={val => selectUpdate(val)}
3 months ago
>
3 months ago
{
options1.value.map(i => {
return <ElOption label={i.name} value={i.id}/>
})
}
3 months ago
</ElSelect>
</ElFormItem>
<ElFormItem>
<ElSelect
modelValue={form1.value.region1}
placeholder="请选择区域名称"
style={{width: "200px"}}
clearable
onUpdate:modelValue={val => (form1.value.region1 = val)}
>
3 months ago
{
options2.value.map(i => {
return <ElOption label={i.name} value={i.id}/>
})
}
3 months ago
</ElSelect>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" onClick={onSubmit}>固定目标</ElButton>
</ElFormItem>
</ElForm>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
<ElButton
type="primary"
disabled={radarWorkState.value === 1}
onClick={StartWorkBtn}
>
启动雷达
</ElButton>
<ElButton
type="danger"
disabled={radarWorkState.value === 0}
onClick={StopWorkBtn}
>
关闭雷达
</ElButton>
<ElButton type="warning" onClick={RestartWorkBtn}>重启雷达</ElButton>
<ElButton type="info" onClick={ShutDownWorkBtn}>急停雷达</ElButton>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
{radarWorkState.value === 1 && (
<div style={{
width: 'calc(50% - 50px)',
position: 'relative',
borderRadius: '5px',
backgroundColor: '#01CE69',
height: '44px',
display: 'inline-block',
padding: '0 20px',
marginRight: '20px'
}}>
<span style={{
position: 'absolute',
top: '50%',
transform: 'translateY(-50%)',
left: '20%',
color: '#fff',
letterSpacing: '2px'
}}>雷达通讯状态</span>
<ElIcon size="20px" style={{
position: 'absolute',
top: '50%',
transform: 'translateY(-50%)',
right: '40px'
}}>
<SuccessFilled color="#fff"/>
</ElIcon>
</div>
)}
{radarWorkState.value === 0 && (
<div style={{
width: 'calc(50% - 50px)',
position: 'relative',
borderRadius: '5px',
backgroundColor: '#E8370D',
height: '44px',
display: 'inline-block',
padding: '0 20px'
}}>
<span style={{
position: 'absolute',
top: '50%',
transform: 'translateY(-50%)',
left: '20%',
color: '#fff',
letterSpacing: '2px'
}}>雷达通讯状态</span>
<ElIcon size="20px" style={{
position: 'absolute',
top: '50%',
transform: 'translateY(-50%)',
right: '40px'
}}>
<WarningFilled color="#fff"/>
</ElIcon>
</div>
)}
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
<ElForm inline model={form2.value} class="demo-form-inline">
<ElFormItem>
<ElDatePicker
modelValue={form2.value.date}
type="date"
placeholder="选择时间"
clearable
onUpdate:modelValue={val => (form2.value.date = val)}
/>
</ElFormItem>
<ElFormItem>
<ElButton onClick={onSubmit}>停止检测</ElButton>
<ElButton type="primary" onClick={onSubmit}>批量操作</ElButton>
</ElFormItem>
</ElForm>
<ElTable
highlightCurrentRow
onCurrentChange={table1Current}
data={tableData1.value}
style={{width: "100%"}}
>
<ElTableColumn type="selection" width={55}/>
<ElTableColumn label="序号" type="index" width={60}/>
<ElTableColumn prop="Lon" label="目标经度" width={120}/>
<ElTableColumn prop="Lat" label="目标纬度" width={120}/>
<ElTableColumn label="告警等级" width={160}>
{{
default: scope => <ElRate modelValue={scope.row.rate || 3} disabled/>
}}
</ElTableColumn>
<ElTableColumn label="处理状态" showOverflowTooltip>
{{
default: scope => (
<>
<ElButton type="primary" link>已处理</ElButton>
<ElButton type="primary" link onClick={() => addShildItem()}>不处理</ElButton>
<ElButton type="primary" link>未发现</ElButton>
</>
)
}}
</ElTableColumn>
</ElTable>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
<ElTable data={tableData2.value} style={{width: "100%"}}>
<ElTableColumn label="序号" type="index" width={60}/>
<ElTableColumn prop="name" label="目标名称" width={120}/>
<ElTableColumn prop="lon" label="目标经度" width={120}/>
<ElTableColumn prop="lat" label="目标纬度" width={120}/>
<ElTableColumn prop="deviation" label="deviation" width={120}/>
<ElTableColumn prop="shielding" label="shielding" width={120}/>
<ElTableColumn label="操作" showOverflowTooltip>
{{
default: scope => (
<ElButton type="primary" link onClick={() => delShildItem(scope.row)}>删除</ElButton>
)
}}
</ElTableColumn>
</ElTable>
</ElCard>
</div>
)}
{itemsId.value === 2 && (
<div class="tabsItem">
<ElCard shadow="always">
<ElForm inline model={form5.value} class="demo-form-inline">
<ElFormItem>
<ElInput
modelValue={form5.value.region}
placeholder="请输入机场名称"
style={{width: "200px"}}
onUpdate:modelValue={val => (form5.value.region = val)}
/>
</ElFormItem>
<ElFormItem>
<ElInput
modelValue={form5.value.region1}
placeholder="请输入区域名称"
style={{width: "200px"}}
onUpdate:modelValue={val => (form5.value.region1 = val)}
/>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" onClick={onSubmit}>添加</ElButton>
</ElFormItem>
</ElForm>
<ElForm inline model={form6.value} class="demo-form-inline" style={{marginTop: "12px"}}>
<ElFormItem>
<ElSelect
modelValue={form6.value.region}
placeholder="请选择机场名称"
style={{width: "200px"}}
clearable
3 months ago
onUpdate:modelValue={val => select2Update(val)}
3 months ago
>
3 months ago
{
options1.value.map(i => {
return <ElOption label={i.name} value={i.id}/>
})
}
3 months ago
</ElSelect>
</ElFormItem>
<ElFormItem>
<ElSelect
modelValue={form6.value.region1}
placeholder="请选择区域名称"
style={{width: "200px"}}
clearable
3 months ago
onUpdate:modelValue={val => select3Update(val)}
3 months ago
>
3 months ago
{
options2.value.map(i => {
return <ElOption label={i.name} value={i.id}/>
})
}
3 months ago
</ElSelect>
</ElFormItem>
<ElFormItem>
3 months ago
<ElButton type="primary" onClick={getArea2}>确定</ElButton>
3 months ago
</ElFormItem>
</ElForm>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
{points.value.map((i, k) => (
<div style={{marginBottom: "12px"}} key={k}>
<ElInput disabled modelValue={i.name} style={{width: "100px"}}/>
<ElInput
modelValue={i.lon}
style={{width: "150px", marginLeft: "20px"}}
onUpdate:modelValue={val => (points.value[k].lon = val)}
/>
<ElInput
modelValue={i.lat}
style={{width: "150px", marginLeft: "20px"}}
onUpdate:modelValue={val => (points.value[k].lat = val)}
/>
<ElButton type="primary" onClick={() => getPoint(k)}
style={{marginLeft: "20px"}}>获取</ElButton>
</div>
))}
</ElCard>
<div style={{textAlign: "center", marginTop: "12px"}}>
<ElButton type="primary" onClick={savePoint} style={{marginLeft: "20px"}}>提交</ElButton>
</div>
</div>
)}
{itemsId.value === 3 && (
<div class="tabsItem">
<div>成像设置</div>
<ElForm model={parasSignalproForm.value} inline labelWidth="auto" labelPosition="top">
{["imaging_rangemin", "imaging_rangemax", "imaging_rangeres", "imaging_azimuthlength", "imaging_azimuthres"].map((key, idx) => (
<ElFormItem style={{width: "calc(33% - 32px)"}} label={key} key={idx}>
<ElInput
modelValue={(parasSignalproForm.value.imaging || {})[key]}
onUpdate:modelValue={val => ((parasSignalproForm.value.imaging ||= {})[key] = val)}
/>
</ElFormItem>
))}
</ElForm>
<div>检测设置</div>
<ElForm model={parasSignalproForm.value} inline labelWidth="auto" labelPosition="top">
{["alpha", "decstartr", "decwidth", "sk_r", "sk_a", "lk_r", "lk_a"].map((key, idx) => (
<ElFormItem style={{width: "calc(33% - 32px)"}} label={key} key={idx}>
<ElInput
modelValue={(parasSignalproForm.value.dectection || {})[key]}
onUpdate:modelValue={val => ((parasSignalproForm.value.dectection ||= {})[key] = val)}
/>
</ElFormItem>
))}
<ElFormItem style={{width: "100%"}}>
<div style={{textAlign: "center", width: "100%"}}>
<ElButton type="primary" onClick={saveParasSignalproForm}>保存</ElButton>
</div>
</ElFormItem>
</ElForm>
<div>路线设置</div>
<ElForm model={parasPosForm.value} inline labelWidth="auto" labelPosition="top">
<ElFormItem style={{width: "calc(33% - 32px)"}} label="路线数量">
<ElInputNumber
modelValue={(parasPosForm.value.runwaynum || {}).startpos_num}
precision={0}
step={1}
min={0}
onUpdate:modelValue={val => {
parasPosForm.value.runwaynum.startpos_num = val;
updateRunwayNum(val);
}}
/>
</ElFormItem>
{Array.from({length: (parasPosForm.value.runwaynum || {}).startpos_num || 0}).map((_, k) => (
<div key={k} style="width: 100%">
<div>路线{k + 1}设置</div>
{["startpos_lon_a", "startpos_lat_a", "startpos_alt_a", "startpos_lon_b", "startpos_lat_b", "startpos_alt_b", "startpos_ori"].map((field, idx) => (
<ElFormItem style={{width: "calc(33% - 32px)", display: "inline-block"}} label={field}
key={idx}>
<ElInput
modelValue={(parasPosForm.value.runwayedges[k] || {})[field]}
onUpdate:modelValue={val => (((parasPosForm.value.runwayedges[k] ||= {})[field] = val))}
/>
</ElFormItem>
))}
</div>
))}
<ElFormItem style={{width: "100%"}}>
<div style={{textAlign: "center", width: "100%"}}>
<ElButton type="primary" onClick={saveParasPosForm}>保存</ElButton>
</div>
</ElFormItem>
</ElForm>
</div>
)}
{itemsId.value === 4 && (
<div class="tabsItem">
<ElCard shadow="always">
<ElDatePicker
style={{width: "calc(100% - 20px)"}}
modelValue={date1.value}
type="datetimerange"
rangeSeparator="到"
startPlaceholder="选择开始时间"
endPlaceholder="选择结束时间"
onUpdate:modelValue={val => (date1.value = val)}
/>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
<ElForm inline model={form3.value} class="demo-form-inline">
{["region", "region1", "region2"].map((key, idx) => (
<ElFormItem key={idx}>
{key === "region2" ? (
<ElSelect
modelValue={form3.value[key]}
placeholder="请选择固定目标"
style={{width: "170px"}}
clearable
onUpdate:modelValue={val => (form3.value[key] = val)}
>
<ElOption label="目标1" value="shanghai"/>
<ElOption label="目标2" value="beijing"/>
</ElSelect>
) : (
<ElSelect
modelValue={form3.value[key]}
placeholder={`请选择${key === "region" ? "机场" : "区域"}`}
style={{width: "170px"}}
clearable
onUpdate:modelValue={val => (form3.value[key] = val)}
>
<ElOption label="机场1" value="shanghai"/>
<ElOption label="机场2" value="beijing"/>
<ElOption label="区域1" value="shanghai"/>
<ElOption label="区域2" value="beijing"/>
</ElSelect>
)}
</ElFormItem>
))}
</ElForm>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
<ElForm inline model={form4.value} class="demo-form-inline">
<ElFormItem>
<ElInput
modelValue={form4.value.input1}
placeholder="请输入检测序号"
style={{width: "170px"}}
onUpdate:modelValue={val => (form4.value.input1 = val)}
/>
</ElFormItem>
<ElFormItem>
<ElDatePicker
modelValue={form4.value.date1}
type="date"
placeholder="选择检测时间"
clearable
style={{width: "170px"}}
onUpdate:modelValue={val => (form4.value.date1 = val)}
/>
</ElFormItem>
<ElFormItem>
<ElInput
modelValue={form4.value.input2}
placeholder="请输入检测人员"
style={{width: "170px"}}
onUpdate:modelValue={val => (form4.value.input2 = val)}
/>
</ElFormItem>
</ElForm>
</ElCard>
<ElCard shadow="always" style={{marginTop: "12px"}}>
<ElTable data={tableData2.value} style={{width: "100%"}}>
<ElTableColumn label="序号" type="index" width={60}/>
<ElTableColumn prop="coordinate" label="目标坐标" width={120}/>
<ElTableColumn label="告警等级" width={160}>
{{default: scope => <ElRate modelValue={scope.row.rate} disabled/>}}
</ElTableColumn>
<ElTableColumn label="处理状态" showOverflowTooltip>
{{
default: scope => (
<>
<span>{scope.row.type === 1 ? "已处理" : ""}</span>
<span>{scope.row.type === 2 ? "不处理" : ""}</span>
<span>{scope.row.type === 3 ? "未发现" : ""}</span>
</>
)
}}
</ElTableColumn>
</ElTable>
</ElCard>
</div>
)}
</div>
)
}
})
3 months ago
const router = useRouter();
const toAdmin = () => {
router.push('/serve')
}
3 months ago
// setTimeout(() => {
// setZoom({lon: 120.0005, lat: 30.005}, 2)
// }, 30000)
4 months ago
const socketData = [
{
"TimeQuality": 19124,
"GpsWeek": 2378,
"GpsSeconds": 443388.33,
"Latitude": 28.24388795549,
"Longitude": 113.00382002762,
"EllipsoidHeight": 14.6323,
"VelocityNorth": -0.1931,
"VelocityEast": 3.2447,
"ActualSpeed": 11.701587,
"RollAngle": 1.047412,
"HeadingAngle": 92.054855,
"IncludedAngle": 0.0,
"SolutionStatus": "",
"Fps": 3.485E-42,
"FpsNum": 0.0,
"MotorPitchAngle": 0.0,
"MotorAzimuthAngle": 0.0,
"ty": 3
},
{
"radar_type": 0,
"radar_ver": "0.1.1",
"arm_ver": "0.0.0",
"al_ver": "0.0.0",
"pwc_ver": "0.0.0",
"cd_ver": "0.0.0",
"v1": 0,
"v2": 0,
"v3": 0,
"v4": 0,
"radar_total_vol": 23.5,
"radar_total_cur": 0.0,
"nx_vol": 0.0,
"nx_cur": 0.0,
"nx_temp": 25.0,
"arm_vol": 23.5,
"arm_cur": 0.0,
"arm_temp": 25.0,
"ant_vol": 23.5,
"ant_cur": 0.0,
"ant_temp": 0.0,
"at_work_area_status": 0,
"pwb_err_code": 0,
"pwa_err_code": 0,
"al_err_code": 0,
"arm_err_code": 0,
"radar_err_code": 0,
"radar_work_state": 0,
"ty": 1
},
{
"Seq": 3.0,
"MD5": null,
"TimeStamp": 5.644776E+24,
"MissionID": 5.644776E+24,
"RngRes": 0.075,
"RngNum": 0.0,
"RngMin": 15.0,
"AziRes": 0.1,
"AziNum": 0.0,
"AziMin": 600.0,
"DataType": 2.8E-44,
"LonMin": 112.99582,
"LatMin": 28.242912,
"TarNum": 6E-45,
"ty": 4
}
]
let area = {
4 months ago
"LatMin": 36.14505053622,
"LatMax": 36.15302618219,
"LonMin": 120.38532472236,
"LonMax": 120.39109582218,
4 months ago
}
3 months ago
const dots = ref([
{
3 months ago
x: 150,
y: 98
3 months ago
},
{
3 months ago
x: 50,
y: 102
3 months ago
},
{
3 months ago
x: 75,
y: 75
3 months ago
},
{
3 months ago
x: 125,
y: 125
}
3 months ago
])
4 months ago
const points = ref([
{
lon: 120.38532472236,
lat: 36.14505053622,
name: '点位1',
},
{
lon: 120.38532472236,
lat: 36.15302618219,
name: '点位2',
},
{
lon: 120.39109582218,
lat: 36.15302618219,
name: '点位3',
},
{
lon: 120.39109582218,
lat: 36.14505053622,
name: '点位4',
},
])
3 months ago
const a = ref(window)
4 months ago
const list = ref([
{
value1: '点位1',
value2: '经纬度:(528,11)'
},
{
value1: '点位1',
value2: '经纬度:(528,11)'
},
{
value1: '点位1',
value2: '经纬度:(528,11)'
},
])
3 months ago
const rulerRef = ref()
4 months ago
const itemsId = ref(1)
const form1 = ref({})
const form2 = ref({})
const form3 = ref({})
const form4 = ref({})
const form5 = ref({})
const form6 = ref({})
4 months ago
const radarWorkState = ref(0)
3 months ago
const dotIndex = ref(-1)
3 months ago
const tableData1 = ref([])
4 months ago
const tableData2 = ref([
{
4 months ago
"id": 2,
"name": "测试",
"lon": 12.2299995,
"lat": 323.329987,
"deviation": 12,
"shielding": 20
4 months ago
},
4 months ago
{
"id": 1,
"name": "测试",
"lon": 12.2299995,
"lat": 323.329987,
"deviation": 12,
"shielding": 20
}
4 months ago
])
const date1 = ref([])
const setItemsId = (e) => {
itemsId.value = e
}
3 months ago
const locationData = ref({})
const currentPosition = ref({})
4 months ago
const processData = (data) => {
4 months ago
// console.log('data',data.ty)
console.log('FodName', data.FodName)
3 months ago
if (data.FodName === '雷达信息') {
3 months ago
console.log('雷达信息', data.radar_work_state)
4 months ago
radarWorkState.value = data.radar_work_state
}
3 months ago
if (data.FodName === '图像数据') {
4 months ago
}
3 months ago
if (data.FodName === 'fod信息') {
setDot(data)
4 months ago
}
if (data.ty === 3) {
4 months ago
}
3 months ago
if (data.FodName === '车辆信息') {
currentPosition.value = {
lon: data.Longitude,
lat: data.Latitude,
}
4 months ago
// console.log(data.Longitude > area.LonMin, data.Longitude < area.LonMax, data.Latitude > area.LatMin, data.Latitude < area.LatMax)
4 months ago
if (data.Longitude > area.LonMin && data.Longitude < area.LonMax && data.Latitude > area.LatMin && data.Latitude < area.LatMax) {
let location = {
x: 300 - (area.LonMax - data.Longitude) / ((area.LonMax - area.LonMin) / 300),
y: 1800 - (area.LatMax - data.Latitude) / ((area.LatMax - area.LatMin) / 1800),
rotate: data.HeadingAngle
// rotate: 0
}
3 months ago
console.log('location', location)
4 months ago
locationData.value = location
}
}
};
4 months ago
const parasSignalproForm = ref({
imaging: {},
dectection: {}
})
const parasPosForm = ref({
runwaynum: {
startpos_num: 1
4 months ago
},
runwayedges: [
{
startpos_lon_a: '',
startpos_lat_a: '',
startpos_alt_a: '',
startpos_lon_b: '',
startpos_lat_b: '',
startpos_alt_b: '',
startpos_ori: ''
}
]
4 months ago
})
4 months ago
4 months ago
onMounted(() => {
3 months ago
getTableData()
4 months ago
ad()
4 months ago
getOption()
getShildTableList()
3 months ago
points.value = localStorage.getItem('points') ? JSON.parse(localStorage.getItem('points')) : [
3 months ago
{
3 months ago
lon: 117.213524,
lat: 36.837967,
3 months ago
name: '点位1',
},
{
3 months ago
lon: 117.213524,
lat: 36.847967,
3 months ago
name: '点位2',
},
{
3 months ago
lon: 117.223524,
lat: 36.847967,
3 months ago
name: '点位3',
},
{
3 months ago
lon: 117.223524,
lat: 36.837967,
3 months ago
name: '点位4',
},
]
3 months ago
getArea1()
3 months ago
// setDot({
// "DarDatas": [{"Lon": 117.213524, "Lat": 36.837967}, {"Lon": 0.0, "Lat": 0.0}, {
// "Lon": 0.0,
// "Lat": 0.0
// }, {"Lon": 0.0, "Lat": 0.0}, {"Lon": 117.2134, "Lat": 36.837967}, {"Lon": 0.0, "Lat": 0.0}, {
// "Lon": 0.0,
// "Lat": 0.0
// }, {"Lon": 0.0, "Lat": 0.0}, {"Lon": 117.21341, "Lat": 36.837986}, {"Lon": 0.0, "Lat": 0.0}, {
// "Lon": 0.0,
// "Lat": 0.0
// }, {"Lon": 0.0, "Lat": 0.0}, {"Lon": 117.21337, "Lat": 36.838}, {"Lon": 0.0, "Lat": 0.0}],
// "Seq": 0,
// "MD5": "038fb0493c415f58c703ab205f9f2c94",
// "TimeStamp": 1757556826,
// "MissionID": 1757556826,
// "RngRes": 0.075,
// "RngNum": 0,
// "RngMin": 10.0,
// "AziRes": 0.1,
// "AziNum": 0,
// "AziMin": 0.03593219,
// "DataType": 20,
// "LonMin": 117.213844,
// "LatMin": 36.83799,
// "TarNum": 14,
// "ty": 0,
// "FodName": "fod信息"
// })
4 months ago
})
4 months ago
const getOption = () => {
getParasPos().then((e) => {
parasPosForm.value = {
runwaynum: e.runwaynum,
runwayedges: e.runwayedges,
}
})
getParasSignalpro().then((e) => {
parasSignalproForm.value = {
imaging: e.imaging,
dectection: e.dectection,
}
})
}
const saveParasSignalproForm = () => {
setParasSignalpro(parasSignalproForm.value).then(e => {
console.log(e)
})
}
const saveParasPosForm = () => {
setParasPos(parasPosForm.value).then(e => {
console.log(e)
})
}
const updateRunwayNum = (e) => {
let arr = new Array(e).fill(0)
.map((item, index) => {
if (index <= parasPosForm.value.runwayedges.length - 1) {
return JSON.parse(JSON.stringify(parasPosForm.value.runwayedges[index]))
} else {
return {
startpos_lon_a: '',
startpos_lat_a: '',
startpos_alt_a: '',
startpos_lon_b: '',
startpos_lat_b: '',
startpos_alt_b: '',
startpos_ori: ''
}
}
})
console.log(arr)
parasPosForm.value.runwayedges = JSON.parse(JSON.stringify(arr))
}
const addShildItem = () => {
addShildData({
name: 'string',
lon: 123,
lat: 12,
deviation: 12,
shielding: 23
}).then(e => {
getShildTableList()
})
}
const delShildItem = (e) => {
delShildData(e).then(e => {
getShildTableList()
})
}
const getShildTableList = () => {
getShildList({
pageIndex: 1,
pageSize: 10,
name: 'string'
}).then((e) => {
tableData2.value = e.data
})
}
4 months ago
const ad = () => {
3 months ago
// 1. 创建 WebSocket 连接ws:// 或 wss://
// const socket = new WebSocket("ws://192.168.1.123:7789/ws");
3 months ago
const socket = new WebSocket("ws://192.168.1.123:7789/ws");
4 months ago
3 months ago
// 2. 连接成功时触发
4 months ago
socket.addEventListener("open", () => {
console.log("✅ WebSocket 连接成功");
});
3 months ago
// 3. 接收消息
4 months ago
socket.addEventListener("message", (event) => {
4 months ago
console.log(JSON.parse(event.data))
4 months ago
processData(JSON.parse(event.data))
4 months ago
});
3 months ago
// 4. 连接关闭时触发
4 months ago
socket.addEventListener("close", () => {
console.log("❌ WebSocket 已关闭");
});
3 months ago
// 5. 出错时触发
4 months ago
socket.addEventListener("error", (error) => {
console.error("⚠️ WebSocket 出错:", error);
});
}
4 months ago
const StartWorkBtn = () => {
StartWork()
3 months ago
rulerRef.value.setDot([], true)
3 months ago
tableData1.value = []
4 months ago
}
const StopWorkBtn = () => {
StopWork()
}
const RestartWorkBtn = () => {
RestartWork()
}
const ShutDownWorkBtn = () => {
ShutDownWork()
}
const getPoint = (k) => {
3 months ago
points.value[k].lon = currentPosition.value.lon || 0
points.value[k].lat = currentPosition.value.lat || 0
}
3 months ago
const getArea1 = () => {
3 months ago
if (points.value.length < 4) return
let data = points.value
4 months ago
let latMin = data[0].lat;
let latMax = data[0].lat;
let lonMin = data[0].lon;
let lonMax = data[0].lon;
for (let i = 1; i < data.length; i++) {
const p = data[i];
if (p.lat < latMin) latMin = p.lat;
if (p.lat > latMax) latMax = p.lat;
if (p.lon < lonMin) lonMin = p.lon;
if (p.lon > lonMax) lonMax = p.lon;
}
area = {
LatMin: latMin,
LatMax: latMax,
LonMin: lonMin,
LonMax: lonMax,
}
}
3 months ago
const savePoint = () => {
localStorage.setItem('points', JSON.stringify(points.value))
3 months ago
getArea1()
3 months ago
}
3 months ago
const setDot = (e) => {
let dots = e.DarDatas.map((v, k) => {
if (v.Lon == 0 && v.Lat == 0) return null
return {
x: 300 - (area.LonMax - v.Lon) / ((area.LonMax - area.LonMin) / 300),
y: 1800 - (area.LatMax - v.Lat) / ((area.LatMax - area.LatMin) / 1800),
index: k
}
}).filter(v => v)
3 months ago
tableData1.value = [...tableData1.value, ...e.DarDatas.filter(v => v.Lon !== 0 && v.Lat !== 0).map((v, k) => {
3 months ago
return {...v, index: k}
3 months ago
})]
3 months ago
rulerRef.value.setDot(dots, false)
3 months ago
}
3 months ago
const table1Current = (e, v) => {
3 months ago
if (dotIndex.value === e.index) {
dotIndex.value = -1
} else {
dotIndex.value = e.index || 0
}
3 months ago
console.log(e)
}
3 months ago
const getBoundingBoxAndSize = (points) => {
if (!points || points.length === 0) return null;
// 1. 找最大最小经纬度
let lons = points.map(p => p.lon);
let lats = points.map(p => p.lat);
let maxLon = Math.max(...lons);
let minLon = Math.min(...lons);
let maxLat = Math.max(...lats);
let minLat = Math.min(...lats);
// 2. 经纬度差值 (转弧度)
const R = 6371000; // 地球半径,米
const toRad = d => d * Math.PI / 180;
let dLat = toRad(maxLat - minLat);
let dLon = toRad(maxLon - minLon);
// 取矩形中心纬度用于修正经度距离
let midLat = (maxLat + minLat) / 2;
let midLatRad = toRad(midLat);
// 3. 转换成米
let height = dLat * R;
let width = dLon * R * Math.cos(midLatRad);
return {
maxLon, minLon, maxLat, minLat,
width: Math.abs(width),
height: Math.abs(height)
};
}
const options1 = ref([])
const options2 = ref([])
const getTableData = async () => {
await getAllAirPort().then(e => {
options1.value = e.data
})
}
const selectUpdate = (val) => {
form1.value.region = val
getArea({airId: val}).then(e => {
options2.value = e.data
})
}
const select2Update = (val) => {
form6.value.region = val
getArea({airId: val}).then(e => {
options2.value = e.data
})
}
const select3Update = (val) => {
form6.value.region1 = val
}
const getArea2 = () => {
GetAllCData({airId: form6.value.region})
}
4 months ago
</script>
<style>
.app-container {
3 months ago
width: 1080px;
min-width: 1080px;
3 months ago
height: 100vh;
4 months ago
margin: 0 auto;
}
.top {
width: 100%;
height: 80px;
font-size: 24px;
background-color: #202227;
position: relative;
}
.items {
position: absolute;
top: 15%;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
}
.item {
display: inline-block;
width: 120px;
height: 100%;
color: #8C9A9C;
line-height: 56px;
cursor: pointer;
font-size: 18px;
font-weight: 600;
letter-spacing: 2px;
}
.item span {
display: inline-block;
height: 100%;
}
3 months ago
.item.click span,
.item:hover span {
4 months ago
color: #0D52BF;
border-bottom: 2px solid #0D52BF;
}
.title {
line-height: 80px;
color: #fff;
margin-left: 20px;
display: inline-block;
text-align: left;
}
.left {
display: inline-block;
3 months ago
height: calc(100vh - 80px);
width: 34%;
4 months ago
vertical-align: top;
}
.right {
3 months ago
padding: 20px 20px 0 20px;
4 months ago
display: inline-block;
3 months ago
height: calc(100vh - 80px - 20px);
width: calc(66% - 40px);
4 months ago
background-color: #F6F7FB;
3 months ago
overflow: auto;
4 months ago
}
</style>