Browse Source

modify some codes

master
xiaowuler 3 years ago
parent
commit
ac67833166
  1. 8
      04.系统编码/Backend/src/main/resources/application.yml
  2. 17
      04.系统编码/Frontend/src/components/RamanLidar.vue
  3. 31
      04.系统编码/Frontend/src/model/high-chart-create.ts

8
04.系统编码/Backend/src/main/resources/application.yml

@ -20,9 +20,9 @@ custom:
image:
url: ${custom.parent-url}:${server.port}/product
gifPath: ${custom.image.path}/gif
path: D:/Deployments/LamanRadar/product
parent-url: http://localhost
# path: /home/project/NJEnvironmentPlatform/html/product
# parent-url: http://10.124.102.10
# path: D:/Deployments/LamanRadar/product
# parent-url: http://localhost
path: /home/project/NJEnvironmentPlatform/html/product
parent-url: http://10.124.102.10
# path: /home/develop/product
# parent-url: http://rdp.nagr.com.cn

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

@ -383,7 +383,8 @@ export default {
creates.opticalThickness = new HighChartCreate('opticalThickness');
creates.opticalThickness.setChart();
// creates.opticalThickness.setSpecialXAxis('', 24, 0, 2);
creates.opticalThickness.setXAxis('时间(天/时)', false);
// creates.opticalThickness.setXAxis('(/)', false);
creates.opticalThickness.setXAxisTypeDate();
creates.opticalThickness.setYAxis('光学厚度', 6, 0, 1, 7);
creates.opticalThickness.setLegend(true);
creates.opticalThickness.setTooltip('{point.y}');
@ -622,10 +623,9 @@ export default {
const drawAerosolCharts = (result: CustomeArray<any>) => {
if (result.length != 24) return;
const data = prepareChartData(result);
creates.opticalThickness.updateSeries(0, data)
creates.opticalThickness.updateXAxis(options.chartTimeData, 0)
creates.opticalThickness.updateSeries(0, data);
// creates.opticalThickness.updateXAxis(options.chartTimeData, 0)
options.loadingOpticalThicknessStatus = false
}
@ -633,7 +633,7 @@ export default {
if (result.length != 24) return;
const data = prepareChartData(result);
creates.opticalThickness.updateSeries(1, data)
creates.opticalThickness.updateXAxis(options.chartTimeData, 0)
// creates.opticalThickness.updateXAxis(options.chartTimeData, 0)
options.loadingOpticalThicknessStatus = false
}
@ -641,7 +641,7 @@ export default {
if (result.length != 24) return;
const data = prepareChartData(result);
creates.opticalThickness.updateSeries(2, data)
creates.opticalThickness.updateXAxis(options.chartTimeData, 0)
// creates.opticalThickness.updateXAxis(options.chartTimeData, 0)
options.loadingOpticalThicknessStatus = false
}
@ -670,7 +670,7 @@ export default {
options.chartTimeData.push(item.time)
if (item.data == null) {
let temp = [];
for (let i = 0; i < 60; i++) {
for (let i = 0; i < 11; i++) {
temp.push(NaN);
}
item.data = [temp];
@ -681,8 +681,9 @@ export default {
})
let interval = (24 / prepareData.length);
let data = [];
let startTimeMoment = moment(result[0].time, 'M_D_H').add(8, 'h').add(-30, 'm');
for (let i = 0, len = prepareData.length; i < len; i++) {
data.push([parseFloat((interval * i).toFixed(2)), prepareData[i]])
data.push([startTimeMoment.clone().add(interval * i, 'h').valueOf(), prepareData[i]]);
}
return data;
}

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

@ -11,6 +11,7 @@ export class HighChartCreate {
private series: Array<any> = [];
private legend: any = null;
private tooltip: any = null;
private time: any = null;
constructor(id: string) {
this.id = id;
@ -40,6 +41,33 @@ export class HighChartCreate {
showFirstLabel: true,
});
}
public setXAxisTypeDate(): void{
this.time = {
useUTC: false
}
this.xAxis.push({
type: 'datetime',
labels: {
formatter: function () {
console.log(this)
return Highcharts.dateFormat('%d日%H时', this.value);
}
}
// dateTimeLabelFormats: {
// millisecond: '%H:%M:%S.%L',
// second: '%H:%M:%S',
// minute: '%H:%M',
// hour: '%H:%M',
// day: '%m-%d',
// week: '%m-%d',
// month: '%Y-%m',
// year: '%Y'
// }
})
}
public setSpecialXAxis(text: string, max: number, min: number, tickInterval: number, opposite: boolean = false, lineWidth: number = 1, reversed: boolean = true) {
this.xAxis.push({
title: {
@ -140,6 +168,9 @@ export class HighChartCreate {
if (this.legend != null)
options.legend = this.legend;
if (this.time != null)
options.time = this.time;
return options;
}

Loading…
Cancel
Save