Browse Source

commit

master
xuhuihui 3 years ago
parent
commit
5672fa3d15
  1. 3
      04.系统编码/Frontend/src/components/RamanLidar.vue
  2. 14
      04.系统编码/Frontend/src/model/heat-map-drawer.ts
  3. 6
      04.系统编码/Frontend/src/model/high-chart-create.ts
  4. 16
      04.系统编码/Frontend/src/uilts/box-drawer.ts

3
04.系统编码/Frontend/src/components/RamanLidar.vue

@ -116,7 +116,6 @@
</div> </div>
</div> </div>
<div class="picture-container raman-picture-container" v-show="currentElement=== '气溶胶PM'"> <div class="picture-container raman-picture-container" v-show="currentElement=== '气溶胶PM'">
<div class="picture special-picture"> <div class="picture special-picture">
<div v-loading="loadingPmStatus" <div v-loading="loadingPmStatus"
@ -159,8 +158,6 @@
</div> </div>
<div class="picture-container raman-picture-container" v-show="currentElement=== '云气溶胶分类'"> <div class="picture-container raman-picture-container" v-show="currentElement=== '云气溶胶分类'">
<div class="picture special-picture"> <div class="picture special-picture">
<div v-loading="loadingCloudSolStatus" <div v-loading="loadingCloudSolStatus"

14
04.系统编码/Frontend/src/model/heat-map-drawer.ts

@ -75,7 +75,7 @@ export class HeatMapDrawer{
this.canvasContext.rect(startX, startY, this.defaultColorWidth, this.borderHeight - heightInterval); this.canvasContext.rect(startX, startY, this.defaultColorWidth, this.borderHeight - heightInterval);
this.canvasContext.stroke(); this.canvasContext.stroke();
this.canvasContext.font = "normal 20px Verdana"; this.canvasContext.font = "normal 20px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
for(let lastLen = this.colorChart.colors.length - 1, index = lastLen; index >= 0; index --){ for(let lastLen = this.colorChart.colors.length - 1, index = lastLen; index >= 0; index --){
@ -259,7 +259,7 @@ export class HeatMapDrawer{
this.canvasContext.translate(x, y); this.canvasContext.translate(x, y);
this.canvasContext.rotate(Math.PI / 180 * 90); this.canvasContext.rotate(Math.PI / 180 * 90);
this.canvasContext.textBaseline = 'bottom'; this.canvasContext.textBaseline = 'bottom';
this.canvasContext.font = "normal 25px Verdana"; this.canvasContext.font = "normal 25px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
this.canvasContext.fillText(str, 0, 0); this.canvasContext.fillText(str, 0, 0);
this.canvasContext.restore(); this.canvasContext.restore();
@ -267,7 +267,7 @@ export class HeatMapDrawer{
} else if (str.match(/[\u4E00-\u9FA5]/) && (y < 576)) { } else if (str.match(/[\u4E00-\u9FA5]/) && (y < 576)) {
this.canvasContext.save(); this.canvasContext.save();
this.canvasContext.textBaseline = 'top'; this.canvasContext.textBaseline = 'top';
this.canvasContext.font = "normal 25px Verdana"; this.canvasContext.font = "normal 25px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
this.canvasContext.fillText(str, x, y); this.canvasContext.fillText(str, x, y);
this.canvasContext.restore(); this.canvasContext.restore();
@ -277,14 +277,14 @@ export class HeatMapDrawer{
} }
//温度单位 //温度单位
private drawTemperatureText(unit): void { private drawTemperatureText(unit): void {
this.canvasContext.font = "normal 25px Verdana"; this.canvasContext.font = "normal 25px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
let unitX = 680 let unitX = 680
this.canvasContext.fillText(unit, unitX, 70); this.canvasContext.fillText(unit, unitX, 70);
} }
private drawResolutionName(name): void { private drawResolutionName(name): void {
this.canvasContext.font = "normal 35px Verdana"; this.canvasContext.font = "normal 35px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
let nameX = 380 let nameX = 380
this.canvasContext.fillText(name, nameX, 60) this.canvasContext.fillText(name, nameX, 60)
@ -309,7 +309,7 @@ export class HeatMapDrawer{
this.canvasContext.stroke(); this.canvasContext.stroke();
if (true){ if (true){
this.canvasContext.font = "normal 18px Verdana"; this.canvasContext.font = "normal 18px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
this.canvasContext.fillText(this.xAxis.scales[index], _x - this.canvasContext.measureText(this.xAxis.scales[index]).width / 2, startY + this.verticalScaleLine + this.borderHeight + 36); this.canvasContext.fillText(this.xAxis.scales[index], _x - this.canvasContext.measureText(this.xAxis.scales[index]).width / 2, startY + this.verticalScaleLine + this.borderHeight + 36);
} }
@ -335,7 +335,7 @@ export class HeatMapDrawer{
this.canvasContext.stroke(); this.canvasContext.stroke();
if (true) { if (true) {
this.canvasContext.font = "normal 20px Verdana"; this.canvasContext.font = "normal 20px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
this.canvasContext.fillText(this.yAxis.scales[index], startX - this.canvasContext.measureText(this.yAxis.scales[index]).width - this.horizontalScaleLine, _y + 10); this.canvasContext.fillText(this.yAxis.scales[index], startX - this.canvasContext.measureText(this.yAxis.scales[index]).width - this.horizontalScaleLine, _y + 10);
} }

6
04.系统编码/Frontend/src/model/high-chart-create.ts

@ -32,7 +32,7 @@ export class HighChartCreate {
style: { style: {
color: '#000000', color: '#000000',
fontSize: '14px', fontSize: '14px',
fontFamily: 'Verdana' fontFamily: '微软雅黑'
} }
}, },
categories: [], categories: [],
@ -48,7 +48,7 @@ export class HighChartCreate {
style: { style: {
color: '#000000', color: '#000000',
fontSize: '14px', fontSize: '14px',
fontFamily: 'Verdana' fontFamily: '微软雅黑'
} }
}, },
max: max, max: max,
@ -66,7 +66,7 @@ export class HighChartCreate {
style: { style: {
color: '#000000', color: '#000000',
fontSize: '14px', fontSize: '14px',
fontFamily: 'Verdana' fontFamily: '微软雅黑'
} }
}, },
max: max, max: max,

16
04.系统编码/Frontend/src/uilts/box-drawer.ts

@ -10,7 +10,7 @@ export function createEmptyCanvas(id: string, width: number, height: number): vo
canvasContext.fillStyle = 'white'; canvasContext.fillStyle = 'white';
canvasContext.fillRect(0,0, width, height); canvasContext.fillRect(0,0, width, height);
canvasContext.font = "normal 48px Verdana"; canvasContext.font = "normal 48px 微软雅黑";
canvasContext.fillStyle = "#000000"; canvasContext.fillStyle = "#000000";
canvasContext.fillText('暂无数据', (width / 2) - (canvasContext.measureText('暂无数据').width / 2), height / 2 - 24); canvasContext.fillText('暂无数据', (width / 2) - (canvasContext.measureText('暂无数据').width / 2), height / 2 - 24);
} }
@ -73,7 +73,7 @@ export class BoxDrawer{
let startY = this.paddingTop + this.verticalScaleLine + heightInterval; let startY = this.paddingTop + this.verticalScaleLine + heightInterval;
let interval = (this.borderHeight - heightInterval) / (this.colorChart.colors.length) let interval = (this.borderHeight - heightInterval) / (this.colorChart.colors.length)
this.canvasContext.font = "normal 24px Verdana"; this.canvasContext.font = "normal 24px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
for(let lastLen = this.colorChart.colors.length - 1, index = lastLen; index >= 0; index --){ for(let lastLen = this.colorChart.colors.length - 1, index = lastLen; index >= 0; index --){
@ -250,7 +250,7 @@ export class BoxDrawer{
this.canvasContext.translate(x, y); this.canvasContext.translate(x, y);
this.canvasContext.rotate(Math.PI / 180 * 90); this.canvasContext.rotate(Math.PI / 180 * 90);
this.canvasContext.textBaseline = 'bottom'; this.canvasContext.textBaseline = 'bottom';
this.canvasContext.font = "normal 35px Verdana"; this.canvasContext.font = "normal 35px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
this.canvasContext.fillText(str, 0, 0); this.canvasContext.fillText(str, 0, 0);
this.canvasContext.restore(); this.canvasContext.restore();
@ -258,7 +258,7 @@ export class BoxDrawer{
} else if (str.match(/[\u4E00-\u9FA5]/) && (y < 576)) { } else if (str.match(/[\u4E00-\u9FA5]/) && (y < 576)) {
this.canvasContext.save(); this.canvasContext.save();
this.canvasContext.textBaseline = 'top'; this.canvasContext.textBaseline = 'top';
this.canvasContext.font = "normal 35px Verdana"; this.canvasContext.font = "normal 35px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
this.canvasContext.fillText(str, x, y); this.canvasContext.fillText(str, x, y);
this.canvasContext.restore(); this.canvasContext.restore();
@ -268,7 +268,7 @@ export class BoxDrawer{
} }
//温度单位 //温度单位
private drawTemperatureText(unit): void { private drawTemperatureText(unit): void {
this.canvasContext.font = "normal 35px Verdana"; this.canvasContext.font = "normal 35px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
let unitX = 1390 let unitX = 1390
if (unit === '(degree)') unitX =1350 if (unit === '(degree)') unitX =1350
@ -298,7 +298,7 @@ export class BoxDrawer{
this.canvasContext.stroke(); this.canvasContext.stroke();
if (flag){ if (flag){
this.canvasContext.font = "normal 30px Verdana"; this.canvasContext.font = "normal 30px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
const text = moment(this.values.radar_data[index].data_time).format("HH:mm"); 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); this.canvasContext.fillText(text, _x - this.canvasContext.measureText(text).width / 2, startY + yInterval + this.borderHeight + 36);
@ -328,7 +328,7 @@ export class BoxDrawer{
this.canvasContext.stroke(); this.canvasContext.stroke();
if (flag) { if (flag) {
this.canvasContext.font = "normal 30px Verdana"; this.canvasContext.font = "normal 30px 微软雅黑";
this.canvasContext.fillStyle = "#000000"; this.canvasContext.fillStyle = "#000000";
const text = this.values.radar_info[index].col_factor; const text = this.values.radar_info[index].col_factor;
this.canvasContext.fillText(text, startX - this.canvasContext.measureText(text).width - this.horizontalScaleLine, _y + 10); this.canvasContext.fillText(text, startX - this.canvasContext.measureText(text).width - this.horizontalScaleLine, _y + 10);
@ -543,7 +543,7 @@ export class Box implements IBox{
} }
private setText(canvasContext: any) : void{ private setText(canvasContext: any) : void{
canvasContext.font = "normal 26px Arial"; canvasContext.font = "normal 26px 微软雅黑";
canvasContext.fillStyle = "#fafafa"; canvasContext.fillStyle = "#fafafa";
const centerX = this.rectX + this.rectWidth / 2; const centerX = this.rectX + this.rectWidth / 2;

Loading…
Cancel
Save