Browse Source

mc

tags/v1.2.0
lixin 1 year ago
parent
commit
bbe28d8b17
2 changed files with 34 additions and 7 deletions
  1. +9
    -0
      src/api/dashboard/index.js
  2. +25
    -7
      src/views/dashboard/components/FireAlarm.vue

+ 9
- 0
src/api/dashboard/index.js View File

}) })
} }


// 定点飞行
export function pointflight(params) {
return request({
url: `/airport/pointflight`,
method: 'POST',
params
})
}


+ 25
- 7
src/views/dashboard/components/FireAlarm.vue View File

<p class="alarm-title">机场调度</p> <p class="alarm-title">机场调度</p>
<p class="dispatch-detail"> <p class="dispatch-detail">
<span>选择机场:</span> <span>选择机场:</span>
<n-select v-model:value="airValue" placeholder="请选择机场" :options="airpotOptions" />
<n-select v-model:value="airportId" placeholder="请选择机场" :options="airpotOptions" />
<a @click="checkAirport">可用机场列表</a> <a @click="checkAirport">可用机场列表</a>
</p> </p>
<p class="dispatch-detail"> <p class="dispatch-detail">


import { reactive, toRefs, watch } from 'vue' import { reactive, toRefs, watch } from 'vue'
import { EARLY_SOURCE, TASK_STATUS } from '@/utils/dictionary.js' import { EARLY_SOURCE, TASK_STATUS } from '@/utils/dictionary.js'
import { getWarningRecord, getWarningInfo, ignoreWarning, confirmWarning } from '@/api/dashboard/index.js'
import { getWarningRecord, getWarningInfo, ignoreWarning, confirmWarning, pointflight } from '@/api/dashboard/index.js'
// turf 用于简单的空间计算 // turf 用于简单的空间计算
import * as turf from '@turf/turf' import * as turf from '@turf/turf'
export default { export default {
airportShow: false, airportShow: false,
warningInfo: {}, warningInfo: {},
airportSelect: '', airportSelect: '',
airValue: 0,
airportId: null,
warningPic: null, warningPic: null,
recoedList: [], recoedList: [],
warningShow: false, warningShow: false,
// 分析后的图片 // 分析后的图片
data.warningPic = info?.data?.fileMarkerUrl || null data.warningPic = info?.data?.fileMarkerUrl || null
// 任务id // 任务id
data.missionId = info?.data?.missionId || null
data.missionId = info?.data?.missionId
showUsableAirport(info) showUsableAirport(info)
showWarningRecord(record) showWarningRecord(record)
}) })
label: item.name label: item.name
}) })
}) })
data.airValue = data.airpotOptions[0]?.value || null
data.airportId = data.airpotOptions[0]?.value || null
} }


const checkAirport = () => { const checkAirport = () => {
data.warningShow = false data.warningShow = false
} }


const test = () => {
const test = async() => {
handleExecute() handleExecute()
console.log(data.warningInfo)
var airportName = ''
data.airpotOptions?.map((item) => {
if (item.value === data.airportId) {
airportName = item.label
}
})
const res = await pointflight({
airportId: parseInt(data.airportId),
airportName: airportName,
warningId: parseInt(data.warningInfo?.id),
missionId: parseInt(data.missionId),
alt: String(data.flyHeight),
lon: String(data.warningInfo.lng),
lat: String(data.warningInfo.lat)
})

if (res.code === 0) {
console.log(res)
}
} }


// 忽略预警 // 忽略预警

Loading…
Cancel
Save