|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<canvas id="myCanvas"></canvas> |
|
|
|
|
|
|
|
<div class="tabs"> |
|
|
|
<div class="tab-item" @click="onTabClick('MWR')" :class="{'active': currentTab === 'MWR'}"> |
|
|
|
质控对比 |
|
|
@ -96,74 +96,60 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="picture-view"> |
|
|
|
<span class="arrow arrow-prev" @click="onPrevImgClick"><img src="/images/prev-btn.png" /></span> |
|
|
|
<span class="arrow arrow-next" @click="onNextImgClick"><img src="/images/next-btn.png" /></span> |
|
|
|
<span class="save-btn" @click="onSaveClick" v-if="currentTab === 'MWR'"><img src="/images/save.png" /></span> |
|
|
|
<a :href="downloadImgUrl" download class="save-btn" v-else><img src="/images/save.png" /></a> |
|
|
|
<div class="download-pictures hide" id="pictures"> |
|
|
|
<a v-for="(url, index) in urls" :key="index" download></a> |
|
|
|
</div> |
|
|
|
<!-- <span class="arrow arrow-prev" @click="onPrevImgClick"><img src="/images/prev-btn.png" /></span>--> |
|
|
|
<!-- <span class="arrow arrow-next" @click="onNextImgClick"><img src="/images/next-btn.png" /></span>--> |
|
|
|
<!-- <span class="save-btn" @click="onSaveClick" v-if="currentTab === 'MWR'"><img src="/images/save.png" /></span>--> |
|
|
|
<!-- <a :href="downloadImgUrl" download class="save-btn" v-else><img src="/images/save.png" /></a>--> |
|
|
|
<!-- <div class="download-pictures hide" id="pictures">--> |
|
|
|
<!-- <a v-for="(url, index) in urls" :key="index" download></a>--> |
|
|
|
<!-- </div>--> |
|
|
|
<div class="picture-container contrast-picture-container" v-if="currentTab === 'MWR'"> |
|
|
|
<div class="picture"> |
|
|
|
<h2 class="title">{{ titleStartTime }}~{{ titleEndTime }}温度原始数据</h2> |
|
|
|
<el-image |
|
|
|
:src="contrast.noQCImgUrl" |
|
|
|
:preview-src-list="contrast.noQCImgPreview" |
|
|
|
:initial-index="0" |
|
|
|
fit="contain" |
|
|
|
@load="onImageLoad" |
|
|
|
> |
|
|
|
<template #error> |
|
|
|
<div class="image-slot"> |
|
|
|
<img src="/images/null-picture.png" /> |
|
|
|
</div> |
|
|
|
<p class="image-tip">暂无图片</p> |
|
|
|
</template> |
|
|
|
<template #placeholder> |
|
|
|
<div class="image-placeholder">正在加载...</div> |
|
|
|
</template> |
|
|
|
</el-image> |
|
|
|
<canvas id="original-data-canvas"></canvas> |
|
|
|
<!-- <el-image--> |
|
|
|
<!-- :src="contrast.noQCImgUrl"--> |
|
|
|
<!-- :preview-src-list="contrast.noQCImgPreview"--> |
|
|
|
<!-- :initial-index="0"--> |
|
|
|
<!-- fit="contain"--> |
|
|
|
<!-- @load="onImageLoad"--> |
|
|
|
<!-- >--> |
|
|
|
<!-- <template #error>--> |
|
|
|
<!-- <div class="image-slot">--> |
|
|
|
<!-- <img src="/images/null-picture.png" />--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <p class="image-tip">暂无图片</p>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- <template #placeholder>--> |
|
|
|
<!-- <div class="image-placeholder">正在加载...</div>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-image>--> |
|
|
|
</div> |
|
|
|
<div class="picture"> |
|
|
|
<h2 class="title">{{ titleStartTime }}~{{ titleEndTime }}温度异常值标记</h2> |
|
|
|
<el-image |
|
|
|
:src="contrast.checkImgUrl" |
|
|
|
:preview-src-list="contrast.checkImgPreview" |
|
|
|
:initial-index="0" |
|
|
|
fit="contain" |
|
|
|
@load="onImageLoad" |
|
|
|
@mousemove="onImageMove" |
|
|
|
> |
|
|
|
<template #error> |
|
|
|
<div class="image-slot"> |
|
|
|
<img src="/images/null-picture.png" /> |
|
|
|
</div> |
|
|
|
<p class="image-tip">暂无图片</p> |
|
|
|
</template> |
|
|
|
<template #placeholder> |
|
|
|
<div class="image-placeholder">正在加载...</div> |
|
|
|
</template> |
|
|
|
</el-image> |
|
|
|
<canvas id="abnormal-canvas"></canvas> |
|
|
|
<!-- <el-image--> |
|
|
|
<!-- :src="contrast.checkImgUrl"--> |
|
|
|
<!-- :preview-src-list="contrast.checkImgPreview"--> |
|
|
|
<!-- :initial-index="0"--> |
|
|
|
<!-- fit="contain"--> |
|
|
|
<!-- @load="onImageLoad"--> |
|
|
|
<!-- @mousemove="onImageMove"--> |
|
|
|
<!-- >--> |
|
|
|
<!-- <template #error>--> |
|
|
|
<!-- <div class="image-slot">--> |
|
|
|
<!-- <img src="/images/null-picture.png" />--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <p class="image-tip">暂无图片</p>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- <template #placeholder>--> |
|
|
|
<!-- <div class="image-placeholder">正在加载...</div>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-image>--> |
|
|
|
</div> |
|
|
|
<div class="picture"> |
|
|
|
<h2 class="title">{{ titleStartTime }}~{{ titleEndTime }}温度野点插补结果</h2> |
|
|
|
<el-image |
|
|
|
:src="contrast.fillingImgUrl" |
|
|
|
:preview-src-list="contrast.fillingImgPreview" |
|
|
|
:initial-index="0" |
|
|
|
fit="contain" |
|
|
|
@load="onImageLoad" |
|
|
|
> |
|
|
|
<template #error> |
|
|
|
<div class="image-slot"> |
|
|
|
<img src="/images/null-picture.png" /> |
|
|
|
</div> |
|
|
|
<p class="image-tip">暂无图片</p> |
|
|
|
</template> |
|
|
|
<template #placeholder> |
|
|
|
<div class="image-placeholder">正在加载...</div> |
|
|
|
</template> |
|
|
|
</el-image> |
|
|
|
<canvas id="interpolate-canvas"></canvas> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
@ -199,7 +185,7 @@ |
|
|
|
import moment from "moment"; |
|
|
|
import { MicrowaveRadiationConfig } from '../uilts/Config'; |
|
|
|
import { post, get } from '../uilts/axios'; |
|
|
|
import {BoxDrawer, ColorChart} from "../uilts/box-drawer"; |
|
|
|
import {BoxDrawer, ColorChart, createEmptyCanvas} from "../uilts/box-drawer"; |
|
|
|
import {ElMessage} from "element-plus"; |
|
|
|
|
|
|
|
export default { |
|
|
@ -239,7 +225,13 @@ |
|
|
|
titleEndTime: null, |
|
|
|
apiTimeLength: -2, |
|
|
|
apiTimeInterval: 6 |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
let drawers = { |
|
|
|
originalDrawer: null, |
|
|
|
interpolateDrawer: null, |
|
|
|
abnormalDrawer: null |
|
|
|
} |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
reloadQualityComparison() |
|
|
@ -521,32 +513,32 @@ |
|
|
|
options.titleEndTime = moment(options.date).hour(parseInt(options.currentHour)).minute(options.currentElement === 'six-minute' ? 30 : 0).format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
} |
|
|
|
|
|
|
|
const onPrevImgClick = () => { |
|
|
|
prevElement(); |
|
|
|
} |
|
|
|
|
|
|
|
const onNextImgClick = () => { |
|
|
|
nextElement(); |
|
|
|
} |
|
|
|
|
|
|
|
const prevElement = () => { |
|
|
|
let element = getCurrentElement(); |
|
|
|
// const onPrevImgClick = () => { |
|
|
|
// prevElement(); |
|
|
|
// } |
|
|
|
|
|
|
|
options.index--; |
|
|
|
if (options.index < 0) |
|
|
|
options.index = element.childElementCount - 1; |
|
|
|
// const onNextImgClick = () => { |
|
|
|
// nextElement(); |
|
|
|
// } |
|
|
|
|
|
|
|
setCurrentPlayElement(element); |
|
|
|
} |
|
|
|
// const prevElement = () => { |
|
|
|
// let element = getCurrentElement(); |
|
|
|
// |
|
|
|
// options.index--; |
|
|
|
// if (options.index < 0) |
|
|
|
// options.index = element.childElementCount - 1; |
|
|
|
// |
|
|
|
// setCurrentPlayElement(element); |
|
|
|
// } |
|
|
|
|
|
|
|
const nextElement = () => { |
|
|
|
let element = getCurrentElement(); |
|
|
|
options.index++; |
|
|
|
if (options.index > element.childElementCount - 1) |
|
|
|
options.index = 0; |
|
|
|
|
|
|
|
setCurrentPlayElement(element); |
|
|
|
} |
|
|
|
// const nextElement = () => { |
|
|
|
// let element = getCurrentElement(); |
|
|
|
// options.index++; |
|
|
|
// if (options.index > element.childElementCount - 1) |
|
|
|
// options.index = 0; |
|
|
|
// |
|
|
|
// setCurrentPlayElement(element); |
|
|
|
// } |
|
|
|
//重置时间 |
|
|
|
const onRefreshClick = () => { |
|
|
|
// cancelActive(); |
|
|
@ -666,45 +658,56 @@ |
|
|
|
const startTime = moment(options.currentTime).add(options.apiTimeLength, 'h').add(options.apiTimeInterval, 'm'); |
|
|
|
const params = prepareApiParams(401, startTime, moment(options.currentTime)); |
|
|
|
get('/njplatform/radardata/getOriginRangeData',params,'http://rdp.nagr.com.cn:18080').then((response: any)=> { |
|
|
|
if (response.code != 200){ |
|
|
|
clearBoxDrawer(drawers.originalDrawer); |
|
|
|
clearBoxDrawer(drawers.abnormalDrawer); |
|
|
|
if (response.code != 200 || response.data.radar_data.length === 0){ |
|
|
|
ElMessage.error({ |
|
|
|
message: "请求失败", |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
createEmptyCanvas('original-data-canvas', 1500, 500); |
|
|
|
createEmptyCanvas('abnormal-canvas', 1500, 500); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
console.log(response); |
|
|
|
let boxDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(), response.data, 'myCanvas'); |
|
|
|
options.contrast.noQCImgUrl = boxDrawer.base64Image; |
|
|
|
options.contrast.noQCImgPreview = [boxDrawer.base64Image] |
|
|
|
options.contrast.checkImgUrl = boxDrawer.base64Image |
|
|
|
options.contrast.checkImgPreview = [boxDrawer.base64Image] |
|
|
|
|
|
|
|
drawers.originalDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(), response.data, 'original-data-canvas'); |
|
|
|
drawers.abnormalDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(), response.data, 'abnormal-canvas'); |
|
|
|
options.contrast.noQCImgUrl = drawers.originalDrawer.base64Image; |
|
|
|
options.contrast.checkImgUrl = drawers.abnormalDrawer.base64Image |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const clearBoxDrawer = (boxDrawer: BoxDrawer) => { |
|
|
|
if (boxDrawer == null) return; |
|
|
|
boxDrawer.close(); |
|
|
|
} |
|
|
|
|
|
|
|
const reloadQualityInterpolation = () => { |
|
|
|
const startTime = moment(options.currentTime).add(options.apiTimeLength, 'h').add(options.apiTimeInterval, 'm'); |
|
|
|
const params = prepareApiParams(401, startTime, moment(options.currentTime)); |
|
|
|
get('/njplatform/radardata/getBpRangeData',params,'http://rdp.nagr.com.cn:18080').then((response: any)=> { |
|
|
|
if (response.code != 200){ |
|
|
|
|
|
|
|
clearBoxDrawer(drawers.interpolateDrawer); |
|
|
|
if (response.code != 200 || response.data.radar_data.length === 0){ |
|
|
|
ElMessage.error({ |
|
|
|
message: "请求失败", |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
}); |
|
|
|
createEmptyCanvas('interpolate-canvas', 1500, 500); |
|
|
|
return; |
|
|
|
} |
|
|
|
let boxDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(), response.data, null); |
|
|
|
options.contrast.fillingImgUrl = boxDrawer.base64Image; |
|
|
|
options.contrast.fillingImgPreview = [boxDrawer.base64Image] |
|
|
|
|
|
|
|
drawers.interpolateDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(), response.data, 'interpolate-canvas'); |
|
|
|
options.contrast.fillingImgUrl = drawers.interpolateDrawer.base64Image; |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const prepareTmpOriginalColors = () => { |
|
|
|
return new ColorChart(['#860200','#CD0402','#FF1A04','#FF5E0C','#FEA61B','#FDED2A', |
|
|
|
'#C1FE46','#7AFD86','#2BFDCD','#05E6FD','#14A0FA','#1B5AFB','#1C1FF9','#1310C4','#09067C'], |
|
|
|
[ 999, 305, 300, 295, 290, 285, 280, 275, 270, 265, 260, 255, 250, 245, 240, 0]); |
|
|
|
return new ColorChart(['#860200','#CD0402','#FF1A04','#FF5E0C', |
|
|
|
'#FEA61B','#FDED2A','#C1FE46','#7AFD86', |
|
|
|
'#2BFDCD','#05E6FD','#14A0FA','#1B5AFB', |
|
|
|
'#1C1FF9','#1310C4','#09067C'], |
|
|
|
[ 999, 305, 300, 295, 290, 285, 280, 275, 270, 265, 260, 255, 250, 245, 240, -999]); |
|
|
|
} |
|
|
|
|
|
|
|
const prepareApiParams = (radarDataCode, startTime, endTime) => { |
|
|
@ -728,8 +731,8 @@ |
|
|
|
// onDayClick, |
|
|
|
onPrevDayClick, |
|
|
|
onNextDayClick, |
|
|
|
onPrevImgClick, |
|
|
|
onNextImgClick, |
|
|
|
// onPrevImgClick, |
|
|
|
// onNextImgClick, |
|
|
|
onRefreshClick, |
|
|
|
onPlayClick, |
|
|
|
onChange, |
|
|
@ -752,16 +755,18 @@ |
|
|
|
.picture { |
|
|
|
width: 100%; |
|
|
|
flex-direction: column; |
|
|
|
:deep(.el-image) { |
|
|
|
//width: 100%; |
|
|
|
} |
|
|
|
:deep(.el-image__inner) { |
|
|
|
width: 100%; |
|
|
|
//transform: scaleX(4.5); |
|
|
|
position: relative; |
|
|
|
|
|
|
|
#original-data-canvas , #abnormal-canvas ,#interpolate-canvas{ |
|
|
|
transform: scale(0.5,0.4); |
|
|
|
} |
|
|
|
.title { |
|
|
|
padding-bottom: 0; |
|
|
|
font-size: 0.22rem; |
|
|
|
position: absolute; |
|
|
|
left: 296px; |
|
|
|
top: 0; |
|
|
|
z-index: 100; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|