const getVideoOptions = computed(() => { | const getVideoOptions = computed(() => { | ||||
const row = data.airOptionsAll.find((item) => { return item.id === data.videoForm.airportId }) | const row = data.airOptionsAll.find((item) => { return item.id === data.videoForm.airportId }) | ||||
const live1 = 'https://live.play.t-aaron.com/live/THSBa_hd.m3u8' | |||||
const video1 = 'https://vod.play.t-aaron.com/af2f261d45fe4468bee5d4e501097405/53f0276aadc741909fd06c94484cd217-7184ea23b102c31c4a5e31d65206f539-fd.mp4' | |||||
const video2 = 'https://vod.play.t-aaron.com/408a38ee77ad4672b2b607e20a4e11d1/6d0d2ac3044a4992b4f2fe8563f75f20-0e1dfeb4f87ab08b10522d261f973f0d-fd.mp4' | |||||
return { | return { | ||||
inner: { | inner: { | ||||
id: 'video-inner', | id: 'video-inner', | ||||
width: '100%', | width: '100%', | ||||
height: '100%', | height: '100%', | ||||
// source: row?.internalMonitorUrl, | |||||
source: row?.id === 2 ? live1 : video2, | |||||
source: row?.externalMonitorUrl, | |||||
// source: 'http://101.43.84.72:8080/live/34020000001320000001@34020000001320000001.flv', | |||||
// source: row?.id === 2 ? live1 : video2, | |||||
isLive: true | isLive: true | ||||
} | } | ||||
// outer: { | // outer: { |
} | } | ||||
function handleVideoChange(value) { | function handleVideoChange(value) { | ||||
// 1 | |||||
} | } | ||||
const getVideoOptions = computed(() => { | const getVideoOptions = computed(() => { |
}, | }, | ||||
setup(props, { emit }) { | setup(props, { emit }) { | ||||
getAirOptions() | getAirOptions() | ||||
if (props?.data?.id) { | |||||
getLineOptions(props.data.droneId) | |||||
} | |||||
const MODAL_TYPE = { | const MODAL_TYPE = { | ||||
'create': '新建任务', | 'create': '新建任务', | ||||
'preview': '任务详情', | 'preview': '任务详情', | ||||
show: props.visible, | show: props.visible, | ||||
title: MODAL_TYPE[props.type], | title: MODAL_TYPE[props.type], | ||||
width: 700, | width: 700, | ||||
negativeText: '取消', | |||||
positiveText: '确认' | |||||
negativeText: props.type !== 'preview' ? '取消' : '', | |||||
positiveText: props.type !== 'preview' ? '确认' : '' | |||||
} | } | ||||
}) | }) | ||||
watch(() => data.taskForm.airportId, | watch(() => data.taskForm.airportId, | ||||
(val) => { | (val) => { | ||||
const { airOptions } = getOptions() | |||||
const item = airOptions.value.find((item) => { return item.id === val }) | |||||
data.taskForm.inspectionLine = '' | data.taskForm.inspectionLine = '' | ||||
getLineOptions(val) | |||||
getLineOptions(item.droneId) | |||||
}) | }) | ||||
/** | /** | ||||
.n-date-picker{ | .n-date-picker{ | ||||
width: 100%; | width: 100%; | ||||
} | } | ||||
::v-deep(.n-date-picker--disabled){ | |||||
.n-input .n-input-wrapper .n-input__input { | |||||
.n-input__input-el{ | |||||
text-decoration-color: transparent !important; | |||||
} | |||||
} | |||||
} | |||||
</style> | </style> |
export const form = reactive({ | export const form = reactive({ | ||||
taskForm: { | taskForm: { | ||||
name: '', | |||||
inspectionType: '', | |||||
airportId: '', | |||||
inspectionLine: '', | |||||
type: '', | |||||
name: null, | |||||
inspectionType: null, | |||||
airportId: null, | |||||
inspectionLine: null, | |||||
type: null, | |||||
executionStartTime: null, | executionStartTime: null, | ||||
note: '' | |||||
note: null | |||||
}, | }, | ||||
taskRules: { | taskRules: { | ||||
name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }], | name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }], | ||||
export const getAirOptions = async function() { | export const getAirOptions = async function() { | ||||
const res = await airportList() | const res = await airportList() | ||||
airOptions.value = dataToSelect(res.data, { label: 'name', value: 'droneId' }) | |||||
airOptions.value = dataToSelect(res.data, { label: 'name', value: 'id' }) | |||||
} | } | ||||
// 获取角色列表 | // 获取角色列表 |
export const getAirOptions = async function() { | export const getAirOptions = async function() { | ||||
const res = await airportList() | const res = await airportList() | ||||
airOptions.value = dataToSelect(res.data, { label: 'name', value: 'droneId' }) | |||||
airOptions.value = dataToSelect(res.data, { label: 'name', value: 'id' }) | |||||
} | } | ||||
// 获取角色列表 | // 获取角色列表 | ||||
export const getLineOptions = async function(id) { | export const getLineOptions = async function(id) { | ||||
const res = await airportLine(id) | |||||
const item = airOptions.value.find((item) => { return item.id === id }) | |||||
const res = await airportLine(item.droneId) | |||||
lineOptions.value = dataToSelect(res.data, { label: 'name', value: 'id' }) | lineOptions.value = dataToSelect(res.data, { label: 'name', value: 'id' }) | ||||
} | } | ||||
<template> | <template> | ||||
<HeadSearch :info="search" /> | |||||
<HeadSearch :info="search" @search="handleSearch" @reset="handleSearch" /> | |||||
<DataTable | <DataTable | ||||
ref="tableRef" | ref="tableRef" | ||||
:columns="columns" | :columns="columns" | ||||
</template> | </template> | ||||
<template #toolbar> | <template #toolbar> | ||||
<n-button @click="handleReported"> | <n-button @click="handleReported"> | ||||
{{ isReported ? '修改并生成报告': '提交并生成报告' }} | |||||
{{ reportStatus ? '修改并生成报告': '提交并生成报告' }} | |||||
</n-button> | </n-button> | ||||
</template> | </template> | ||||
</DataTable> | </DataTable> | ||||
search, | search, | ||||
...toRefs(table), | ...toRefs(table), | ||||
pageData: [], | pageData: [], | ||||
isReported: props.data?.isReported || false | |||||
isReported: props.data?.reportStatus === 1 || false | |||||
}) | }) | ||||
/** | /** |