export function reportDownload(id) { | export function reportDownload(id) { | ||||
return request({ | return request({ | ||||
url: `report/${id}/word`, | url: `report/${id}/word`, | ||||
method: 'GET' | |||||
method: 'GET', | |||||
headers: { | |||||
responseType: 'arraybuffer' | |||||
} | |||||
}) | }) | ||||
} | } | ||||
<over-lay :data="problemData" :type="positionType" @close="closeOverlay" /> | <over-lay :data="problemData" :type="positionType" @close="closeOverlay" /> | ||||
</div> | </div> | ||||
<ul class="legend_list"> | |||||
<ul v-if="showLegend" class="legend_list"> | |||||
<li v-for="(item, index) in legendList" :key="index" class="legend_item"> | <li v-for="(item, index) in legendList" :key="index" class="legend_item"> | ||||
<div class="legend_point" :style="{background: item.color}" /> | <div class="legend_point" :style="{background: item.color}" /> | ||||
<span class="legend_name">{{ item.name }}</span> | <span class="legend_name">{{ item.name }}</span> | ||||
type: { | type: { | ||||
type: String, | type: String, | ||||
default: 'look' | default: 'look' | ||||
}, | |||||
showLegend: { | |||||
type: Boolean, | |||||
default: true | |||||
} | } | ||||
}, | }, | ||||
emits: {}, | emits: {}, |
id: 'video-inner', | id: 'video-inner', | ||||
width: '100%', | width: '100%', | ||||
height: '100%', | height: '100%', | ||||
// source: row?.externalMonitorUrl, | |||||
source: 'http://101.43.84.72:8080/live/34020000001320000001@34020000001320000001.flv', | |||||
source: row?.externalMonitorUrl, | |||||
// source: 'http://101.43.84.72:8080/live/34020000001320000001@34020000001320000001.flv', | |||||
// source: 'https://live.play.t-aaron.com/live/THSAl_hd.m3u8', | // source: 'https://live.play.t-aaron.com/live/THSAl_hd.m3u8', | ||||
isLive: true | isLive: true | ||||
} | } |
</n-form> | </n-form> | ||||
</p> | </p> | ||||
</div> | </div> | ||||
<div v-if="!hasLive" class="card__video"> | |||||
<div v-if="!hasPlayer" class="card__video"> | |||||
<div class="card__video--empty"> | <div class="card__video--empty"> | ||||
<img src="@/assets/images/no-live.png"> | <img src="@/assets/images/no-live.png"> | ||||
<p>当前暂无直播</p> | <p>当前暂无直播</p> | ||||
}, | }, | ||||
airOptions: [], | airOptions: [], | ||||
taskOptions: [], | taskOptions: [], | ||||
hasLive: false, | |||||
hasPlayer: false, | |||||
airportIdBack: null, | airportIdBack: null, | ||||
airportUrl: { | airportUrl: { | ||||
origin: null, | origin: null, | ||||
origin: res.data?.playUrl, | origin: res.data?.playUrl, | ||||
analyse: res.data?.aiplayUrl | analyse: res.data?.aiplayUrl | ||||
} | } | ||||
data.liveUrl = { ...data.airportUrl } | |||||
data.liveUrl = { ...data.airportUrl, isLive: true } | |||||
} | } | ||||
}) | }) | ||||
loadTaskOption(value) | loadTaskOption(value) | ||||
function handleVideoChange(value) { | function handleVideoChange(value) { | ||||
const row = data.taskOptions.find((item) => { return item.id === value }) | const row = data.taskOptions.find((item) => { return item.id === value }) | ||||
if (!value) { | if (!value) { | ||||
data.liveUrl = { ...data.airportUrl } | |||||
data.liveUrl = { ...data.airportUrl, isLive: true } | |||||
} else { | } else { | ||||
data.liveUrl = { | data.liveUrl = { | ||||
origin: row.videoUrl, | origin: row.videoUrl, | ||||
analyse: row.aiVideoUrl | |||||
analyse: row.aiVideoUrl, | |||||
isLive: false | |||||
} | } | ||||
} | } | ||||
} | } | ||||
watch(() => data.liveUrl, | watch(() => data.liveUrl, | ||||
(value) => { | (value) => { | ||||
nextTick(() => { | nextTick(() => { | ||||
data.hasLive = (value.origin && value.analyse) || false | |||||
data.hasPlayer = (value.origin && value.analyse) || false | |||||
}) | }) | ||||
}) | }) | ||||
const getVideoOptions = computed(() => { | const getVideoOptions = computed(() => { | ||||
const { origin, analyse } = data.liveUrl | |||||
const { origin, analyse, isLive } = data.liveUrl | |||||
return { | return { | ||||
origin: { | origin: { | ||||
id: 'video-origin', | id: 'video-origin', | ||||
width: '100%', | width: '100%', | ||||
height: '100%', | height: '100%', | ||||
source: origin, | source: origin, | ||||
isLive: true | |||||
isLive: isLive | |||||
}, | }, | ||||
analyse: { | analyse: { | ||||
id: 'video-analyse', | id: 'video-analyse', | ||||
width: '100%', | width: '100%', | ||||
height: '100%', | height: '100%', | ||||
source: analyse, | source: analyse, | ||||
isLive: true | |||||
isLive: isLive | |||||
} | } | ||||
} | } | ||||
}) | }) |
<div class="question__container"> | <div class="question__container"> | ||||
<HeadSearch :info="search" @search="handleSearch" @reset="handleSearch" /> | <HeadSearch :info="search" @search="handleSearch" @reset="handleSearch" /> | ||||
<div class="question__position"> | <div class="question__position"> | ||||
<PositionMsg :data="questionList" /> | |||||
<PositionMsg :data="questionList" :show-legend="false" /> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</n-card> | </n-card> |
</n-grid> | </n-grid> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="report__item"> | |||||
<div v-if="reportDetail.questionCount>0" class="report__item"> | |||||
<p class="report__item--title">问题清单</p> | <p class="report__item--title">问题清单</p> | ||||
<!-- <n-image-group> --> | <!-- <n-image-group> --> | ||||
<div v-for="(item,index) in reportDetail.questionReportList" :key="index"> | <div v-for="(item,index) in reportDetail.questionReportList" :key="index"> | ||||
function handleDownload() { | function handleDownload() { | ||||
reportDownload(props.data.id) | reportDownload(props.data.id) | ||||
.then((res) => { | |||||
const blob = new Blob([res], { type: 'application/msword;charset=UTF-8' }) | |||||
const fileName = '林场巡检报告【' + data.reportDetail.reportNo + '】' | |||||
const link = document.createElement('a') | |||||
link.href = window.URL.createObjectURL(blob) | |||||
link.download = fileName | |||||
link.click() | |||||
window.URL.revokeObjectURL(link.href) | |||||
}) | |||||
} | } | ||||
return { | return { |