From d1f1e76eb77522aab09c2478ced1bc865d6c1061 Mon Sep 17 00:00:00 2001 From: xuhuihui <3548508071@qq.com> Date: Fri, 6 May 2022 12:03:51 +0800 Subject: [PATCH] commit --- .../src/components/MicrowaveRadiation.vue | 58 +++++++++++-------- .../Frontend/src/components/RamanLidar.vue | 1 - .../Frontend/src/uilts/box-drawer.ts | 14 ++--- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/04.系统编码/Frontend/src/components/MicrowaveRadiation.vue b/04.系统编码/Frontend/src/components/MicrowaveRadiation.vue index deff943..2575fd1 100644 --- a/04.系统编码/Frontend/src/components/MicrowaveRadiation.vue +++ b/04.系统编码/Frontend/src/components/MicrowaveRadiation.vue @@ -114,15 +114,8 @@ <div class="picture-view"> <!--质控对比--> - <div v-show ="currentTab === 'MWR'" class="picture-container contrast-picture-container picture-MWR"> -<!-- <el-switch--> -<!-- v-model="SeasonValue"--> -<!-- @change="onchangeSeason"--> -<!-- active-value="1"--> -<!-- inactive-value="2"--> -<!-- active-text="夏"--> -<!-- inactive-text="冬"--> -<!-- />--> + <div v-show ="currentTab === 'MWR'" class="picture-container raman-picture-container "> + <div class="picture special-picture"> <h2 class="title">质控前</h2> <canvas id='original-data-canvas'></canvas> @@ -636,11 +629,11 @@ export default { clearBoxDrawer(drawers.originalDrawer); clearBoxDrawer(drawers.abnormalDrawer); if (response.code != 200 || response.data.radar_data.length === 0) { - createEmptyCanvas('original-data-canvas', 1500, 500); + createEmptyCanvas('original-data-canvas', 800, 600); // createEmptyCanvas('abnormal-canvas', 1500, 500); return; } - drawers.originalDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(options.SeasonValue), response.data, 'original-data-canvas', 'T/℃'); + drawers.originalDrawer = new BoxDrawer(800, 600, prepareTmpOriginalColors(options.SeasonValue), response.data, 'original-data-canvas', 'T/℃'); // drawers.abnormalDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(), response.data, 'abnormal-canvas', '℃'); // options.contrast.noQCImgUrl = drawers.originalDrawer.base64Image; // options.contrast.checkImgUrl = drawers.abnormalDrawer.base64Image; @@ -659,15 +652,15 @@ export default { clearBoxDrawer(drawers.interpolateDrawer); if (response.code != 200 || response.data.radar_data.length === 0) { if (options.currentTab === 'MWR') - createEmptyCanvas('interpolate-canvas', 1500, 500); + createEmptyCanvas('interpolate-canvas', 800, 600); else if (options.currentTab === 'shixu_BPFY') - createEmptyCanvas('BP-temp', 1500, 500); + createEmptyCanvas('BP-temp', 1200, 600); return; } if (options.currentTab === 'MWR') - drawers.interpolateDrawer = new BoxDrawer(1500, 500, prepareTmpOriginalColors(options.SeasonValue), response.data, 'interpolate-canvas', 'T/℃'); + drawers.interpolateDrawer = new BoxDrawer(800, 600, prepareTmpOriginalColors(options.SeasonValue), response.data, 'interpolate-canvas', 'T/℃'); else if (options.currentTab === 'shixu_BPFY') - drawers.interpolateDrawer = new BoxDrawer(1500, 500, prepareBPTempColors(), response.data, 'BP-temp', '(degree)'); + drawers.interpolateDrawer = new BoxDrawer(1200, 600, prepareBPTempColors(), response.data, 'BP-temp', '(degree)'); // options.contrast.fillingImgUrl = drawers.interpolateDrawer.base64Image; }) } @@ -682,10 +675,10 @@ export default { get('/njplatform/radardata/getBpRangeData', params, Constant.baseUrl).then((response: any) => { clearBoxDrawer(drawers.BPRelativeHumidity); if (response.code != 200 || response.data.radar_data.length === 0) { - createEmptyCanvas('BP-relative-humidity', 1500, 500); + createEmptyCanvas('BP-relative-humidity', 1200, 600); return; } - drawers.BPRelativeHumidity = new BoxDrawer(1500, 500, prepareBPRelativeHumidityColors(), response.data, 'BP-relative-humidity', '(%)'); + drawers.BPRelativeHumidity = new BoxDrawer(1200, 600, prepareBPRelativeHumidityColors(), response.data, 'BP-relative-humidity', '(%)'); // options.contrast.fillingImgUrl = drawers.interpolateDrawer.base64Image; }) } @@ -700,10 +693,10 @@ export default { get('/njplatform/radardata/getBpRangeData', params, Constant.baseUrl).then((response: any) => { clearBoxDrawer(drawers.BPVaporDensity); if (response.code != 200 || response.data.radar_data.length === 0) { - createEmptyCanvas('BP-vapor-density', 1500, 500); + createEmptyCanvas('BP-vapor-density', 1200, 600); return; } - drawers.BPVaporDensity = new BoxDrawer(1500, 500, prepareBPVaporDensityColors(), response.data, 'BP-vapor-density', '(g/kg)'); + drawers.BPVaporDensity = new BoxDrawer(1200, 600, prepareBPVaporDensityColors(), response.data, 'BP-vapor-density', '(g/kg)'); // options.contrast.fillingImgUrl = drawers.interpolateDrawer.base64Image; }) } @@ -969,7 +962,7 @@ export default { <style lang="less" scoped> .main { .container { - width: 100%; + //width: 100%; .verticalProfile { width: 100%; height: 100%; @@ -1012,10 +1005,6 @@ export default { height: 45%; position: relative; - #original-data-canvas /*#abnormal-canvas*/, #interpolate-canvas { - transform: scale(0.47, 0.8); - } - .title { width: 100%; font-size: 0.22rem; @@ -1026,6 +1015,25 @@ export default { } } } + .raman-picture-container { + width: calc(~"100% - 1rem"); + margin: 0 auto; + #original-data-canvas /*#abnormal-canvas*/, #interpolate-canvas { + } + .picture { + width: 100%; + position: relative; + margin-top: 30px; + .title { + width: 100%; + font-size: 0.22rem; + position: absolute; + left: 3.4rem; + top: 0; + z-index: 1000; + } + } + } //.BPPicture { // width: 100% !important; // height: 100%!important; @@ -1033,7 +1041,7 @@ export default { // //} #BP-temp, #BP-relative-humidity, #BP-vapor-density { - transform: scale(1, 1.2) translate(-42px, 80px); + transform: scale(1, 1.0) translate(-42px, 55px); } .shiXu { diff --git a/04.系统编码/Frontend/src/components/RamanLidar.vue b/04.系统编码/Frontend/src/components/RamanLidar.vue index 76edb7d..00806d3 100644 --- a/04.系统编码/Frontend/src/components/RamanLidar.vue +++ b/04.系统编码/Frontend/src/components/RamanLidar.vue @@ -260,7 +260,6 @@ </div> </div> - </div> </div> </div> diff --git a/04.系统编码/Frontend/src/uilts/box-drawer.ts b/04.系统编码/Frontend/src/uilts/box-drawer.ts index a760596..11710f7 100644 --- a/04.系统编码/Frontend/src/uilts/box-drawer.ts +++ b/04.系统编码/Frontend/src/uilts/box-drawer.ts @@ -26,7 +26,7 @@ export class BoxDrawer{ private readonly width: number = null; private readonly height: number = null; - private readonly paddingLeft: number = 200; + private readonly paddingLeft: number = 150; private readonly paddingRight: number = 130; private readonly paddingTop: number = 60; private readonly paddingBottom: number = 50; @@ -44,7 +44,7 @@ export class BoxDrawer{ private verticalScaleIntervalLength: number = 0; private horizontalScaleIntervalLength: number = 0; - private paddingColorLeft: number = 50; + private paddingColorLeft: number = 25; private defaultColorWidth: number = 30; private calc: Calc = null; @@ -242,11 +242,11 @@ export class BoxDrawer{ private drawHeightText(): void { this.canvasContext.save(); let name = "高度(km)"; - this.canvasContext.translate(90, this.height / 2 + this.paddingTop - this.canvasContext.measureText(name).width); + this.canvasContext.font="normal 22px 微软雅黑"; + this.canvasContext.translate(80, this.height / 2 + this.paddingTop); this.canvasContext.rotate(Math.PI * 1.5); - this.canvasContext.font="normal 35px 微软雅黑"; this.canvasContext.fillStyle="#000000"; - this.canvasContext.fillText(name, -120, 0); + this.canvasContext.fillText(name, 0, 0); this.canvasContext.restore(); // let name =['高','度','(','k','m',')']; // 文本内容 // let x = 70,y = 150; // 文字开始的坐标 @@ -306,7 +306,7 @@ export class BoxDrawer{ this.canvasContext.stroke(); if (flag){ - this.canvasContext.font = "normal 30px 微软雅黑"; + this.canvasContext.font = "normal 20px 微软雅黑"; this.canvasContext.fillStyle = "#000000"; const text = moment(this.values.radar_data[index].data_time).format("HH:mm"); this.canvasContext.fillText(text, _x - this.canvasContext.measureText(text).width / 2, startY + yInterval + this.borderHeight + 36); @@ -449,7 +449,7 @@ export class Box implements IBox{ time: string; util: string; //提示框的宽高 - rectWidth: number = 240; + rectWidth: number = 270; rectHeight: number = 90; rectX: number; rectY: number;