Browse Source

commit

master
xuhuihui 3 years ago
parent
commit
ab16f97d53
  1. 77
      04.系统编码/Frontend/src/components/RamanLidar.vue
  2. 2
      04.系统编码/Frontend/src/model/heat-map-drawer.ts

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

@ -203,8 +203,8 @@ export default {
pm10Drawer: null
}
let options = reactive({
// currentTab: 'MWR',
currentTab: 'BingoCloud',
currentTab: 'MWR',
// currentTab: 'BingoCloud',
currentRegion: 'jiangning',
currentElement: 'PBLH',
currentType: '边界层高度',
@ -302,19 +302,20 @@ export default {
if (options.currentTab === 'boundary-layer-height') {
reloadCloudRecognition(101, 'watervapor', drawSingleWatervapor);
} else if (options.currentTab === 'optical-property') {
extinctionApi()
LidarRatioApi()
// extinctionApi()
// LidarRatioApi()
reloadCloudRecognition(801, 'extinction', drawOpticsExtinction);
} else if (options.currentTab === 'aerosol-product') {
boundaryLayerHeightDate()
// boundaryLayerHeightDate()
reloadChartsRecognition('pblh', drawCharts)
reloadCloudRecognition(201, 'pm2_5', drawPm2Point5);
reloadCloudRecognition(201, 'pm10', drawPm10);
// boundaryCharacteristicApi()
//aerosolApi()
} else if (options.currentTab === 'BingoCloud') {
//layerTypeApi()
cloudsHeightApi()
cloudTopHeightApi()
// cloudsHeightApi()
// cloudTopHeightApi()
reloadCloudRecognition(801, 'layertype', drawCloudSol);
} else if (options.currentTab === 'MWR') {
//waterVapourApi()
@ -359,6 +360,10 @@ export default {
creates.pm10Drawer.draw();
}
const drawCharts = (result: CustomeArray<any>) => {
if (result.length != 24) return;
console.log(result)
}
const preparePmColors = () => {
return new ColorChart(['#F6EF20','#FEC338', '#C5C22A', '#72CD64', '#31C69F', '#01B8CA', '#259BE8', '#327CFC', '#4853F4', '#422EC1'],
[100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0], true, true
@ -456,6 +461,15 @@ export default {
reloadSingleCloudRecognition(capacity, time.clone().add(-index, 'h').format('M_D_H'), element, result);
}
}
//
const reloadChartsRecognition = (element: string, callback: any) => {
let result = new CustomeArray(callback);
let time = moment(options.date);
for(let index = 0; index < 24; index ++){
reloadSingleChartsRecognition( time.clone().add(-index, 'h').format('M_D_H'), element, result);
}
}
const drawCloudRecognition = (result: CustomeArray<any>) => {
if (result.length != 24) return;
@ -516,6 +530,8 @@ export default {
return matrix;
}
const reloadSingleCloudRecognition = (capacity: number, time: string, elementCode, result: CustomeArray<any>) => {
const params = prepareApiParams(time, elementCode)
get('/njqxj/lmlidar', params, ConstantRamanLidar.baseUrl).then((response: any) => {
@ -523,10 +539,20 @@ export default {
setCloudRecognitionResult(capacity, time, response.message, null, result);
return;
}
setCloudRecognitionResult(capacity, time, response.message, response.data, result);
})
}
//
const reloadSingleChartsRecognition = (time: string, elementCode, result: CustomeArray<any>) => {
const params = prepareApiParams(time, elementCode)
get('/njqxj/lmlidar', params, ConstantRamanLidar.baseUrl).then((response: any) => {
if (response.state != 0) {
setChartsRecognitionResult(time, response.message, null, result);
return;
}
setChartsRecognitionResult( time, response.message, response.data, result);
})
}
const setCloudRecognitionResult = (capacity: number, time: string, message: string, data: any, result: CustomeArray<any>) =>{
result.push({
@ -535,6 +561,14 @@ export default {
data: data == null ? null : JSON.parse(data).slice(0, capacity)
})
}
//
const setChartsRecognitionResult = ( time: string, message: string, data: any, result: CustomeArray<any> ) => {
result.push({
time: time,
message: message,
data: data == null ? null : JSON.parse(data)
})
}
const initEcharts = (name) => {
if (name === 'boundary-layer-height') {
@ -681,7 +715,6 @@ export default {
//
const onTimeClick = (time, index) => {
options.currentTime = time.date;
options.date = time.date;
reloadChangeData()
@ -824,20 +857,23 @@ export default {
}
}
//
const boundaryLayerHeightDate = () => {
options.boundaryLayerHeightList = []
const time = moment(options.date).format('MM_DD')
const time = moment(options.date).format('M_D_2')
const params = prepareApiParams(time, 'pblh')
get('/njqxj/lmlidar', params, ConstantRamanLidar.baseUrl).then((response: any) => {
if (response.length <= 0) {
if (response.state != 0) {
error()
return;
}
if (response.data.length === 0) {
verify()
return;
}
for (let i in response) {
for (let val in response[i]) {
options.boundaryLayerHeightList.push(response[i][val])
for (let i in JSON.parse(response.data)) {
for (let val in JSON.parse(response.data)[i]) {
options.boundaryLayerHeightList.push(JSON.parse(response.data)[i][val])
}
}
creates.boundaryLayerHeight.updateSeries(0, options.boundaryLayerHeightList)
@ -860,6 +896,7 @@ export default {
const time = moment(options.date).format('MM_DD')
const params = prepareApiParams(time, 'lidarratio')
get('/njqxj/lmlidar', params, ConstantRamanLidar.baseUrl).then((response: any) => {
if (response.length <= 0) {
verify()
return;
@ -973,6 +1010,16 @@ export default {
duration: 1500
})
}
const error = () => {
ElMessage({
showClose: true,
message: '请求接口错误',
icon: '',
type: null,
grouping: true,
duration: 1500
})
}
return {
...toRefs(options),

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

@ -151,7 +151,7 @@ export class HeatMapDrawer{
this.values[dataIndex] = this.values[dataIndex].reverse();
}
console.log(this.values);
this.createCalc(this.values);
}

Loading…
Cancel
Save