@@ -33,7 +33,10 @@ export function getReportDetail(id) { | |||
export function reportDownload(id) { | |||
return request({ | |||
url: `report/${id}/word`, | |||
method: 'GET' | |||
method: 'GET', | |||
headers: { | |||
responseType: 'arraybuffer' | |||
} | |||
}) | |||
} | |||
@@ -5,7 +5,7 @@ | |||
<over-lay :data="problemData" :type="positionType" @close="closeOverlay" /> | |||
</div> | |||
<ul class="legend_list"> | |||
<ul v-if="showLegend" class="legend_list"> | |||
<li v-for="(item, index) in legendList" :key="index" class="legend_item"> | |||
<div class="legend_point" :style="{background: item.color}" /> | |||
<span class="legend_name">{{ item.name }}</span> | |||
@@ -39,6 +39,10 @@ export default { | |||
type: { | |||
type: String, | |||
default: 'look' | |||
}, | |||
showLegend: { | |||
type: Boolean, | |||
default: true | |||
} | |||
}, | |||
emits: {}, |
@@ -109,8 +109,8 @@ export default { | |||
id: 'video-inner', | |||
width: '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', | |||
isLive: true | |||
} |
@@ -18,7 +18,7 @@ | |||
</n-form> | |||
</p> | |||
</div> | |||
<div v-if="!hasLive" class="card__video"> | |||
<div v-if="!hasPlayer" class="card__video"> | |||
<div class="card__video--empty"> | |||
<img src="@/assets/images/no-live.png"> | |||
<p>当前暂无直播</p> | |||
@@ -54,7 +54,7 @@ export default { | |||
}, | |||
airOptions: [], | |||
taskOptions: [], | |||
hasLive: false, | |||
hasPlayer: false, | |||
airportIdBack: null, | |||
airportUrl: { | |||
origin: null, | |||
@@ -99,7 +99,7 @@ export default { | |||
origin: res.data?.playUrl, | |||
analyse: res.data?.aiplayUrl | |||
} | |||
data.liveUrl = { ...data.airportUrl } | |||
data.liveUrl = { ...data.airportUrl, isLive: true } | |||
} | |||
}) | |||
loadTaskOption(value) | |||
@@ -108,11 +108,12 @@ export default { | |||
function handleVideoChange(value) { | |||
const row = data.taskOptions.find((item) => { return item.id === value }) | |||
if (!value) { | |||
data.liveUrl = { ...data.airportUrl } | |||
data.liveUrl = { ...data.airportUrl, isLive: true } | |||
} else { | |||
data.liveUrl = { | |||
origin: row.videoUrl, | |||
analyse: row.aiVideoUrl | |||
analyse: row.aiVideoUrl, | |||
isLive: false | |||
} | |||
} | |||
} | |||
@@ -120,26 +121,26 @@ export default { | |||
watch(() => data.liveUrl, | |||
(value) => { | |||
nextTick(() => { | |||
data.hasLive = (value.origin && value.analyse) || false | |||
data.hasPlayer = (value.origin && value.analyse) || false | |||
}) | |||
}) | |||
const getVideoOptions = computed(() => { | |||
const { origin, analyse } = data.liveUrl | |||
const { origin, analyse, isLive } = data.liveUrl | |||
return { | |||
origin: { | |||
id: 'video-origin', | |||
width: '100%', | |||
height: '100%', | |||
source: origin, | |||
isLive: true | |||
isLive: isLive | |||
}, | |||
analyse: { | |||
id: 'video-analyse', | |||
width: '100%', | |||
height: '100%', | |||
source: analyse, | |||
isLive: true | |||
isLive: isLive | |||
} | |||
} | |||
}) |
@@ -4,7 +4,7 @@ | |||
<div class="question__container"> | |||
<HeadSearch :info="search" @search="handleSearch" @reset="handleSearch" /> | |||
<div class="question__position"> | |||
<PositionMsg :data="questionList" /> | |||
<PositionMsg :data="questionList" :show-legend="false" /> | |||
</div> | |||
</div> | |||
</n-card> |
@@ -51,7 +51,7 @@ | |||
</n-grid> | |||
</div> | |||
</div> | |||
<div class="report__item"> | |||
<div v-if="reportDetail.questionCount>0" class="report__item"> | |||
<p class="report__item--title">问题清单</p> | |||
<!-- <n-image-group> --> | |||
<div v-for="(item,index) in reportDetail.questionReportList" :key="index"> | |||
@@ -156,6 +156,15 @@ export default defineComponent({ | |||
function handleDownload() { | |||
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 { |