区域选择
+
- 温度
- 湿度
- CAPE
- CIN
+ 温度
+ 湿度
+ 水汽密度
+ CAPE
+ CIN
@@ -77,7 +74,7 @@
要素选择


-
{
initHours();
initTimeLine();
- setTitle(moment(options.date, 'YYYY-MM-DD').hour(parseInt(options.currentHour)));
- setTimeout(() => {
- activeImage(moment(options.times[options.times.length - 1].date).hour(), moment(options.times[options.times.length - 1].date).minute());
- }, 50);
})
const onTabClick = (name) => {
options.currentTab = name;
- if (options.currentTab === 'kuoxian') {
- options.currentType = 'TEMP';
- options.currentElement = 'TEMPERATURE';
- } else if (options.currentTab === 'shixu') {
- options.currentType = 'CAPE';
- options.currentElement = 'CAPE时序图';
- } else if (options.currentTab === 'T-logP') {
- options.currentType = 'T-logP';
- options.currentElement = 'T-logP';
- } else {
- options.currentType = 'BPFY';
- options.currentElement = 'BPFY';
- }
+ if (options.currentTab === 'kuoxian' || options.currentTab === 'shixu_BPFY')
+ options.currentElement = 'TEMP';
+ else if (options.currentTab === 'shixu')
+ options.currentElement = 'CAPE';
cancelActive();
- setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
@@ -167,16 +150,13 @@ import { post } from '../uilts/axios';
options.currentRegion = region;
cancelActive();
- setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
- const onElementClick = (element, type) => {
+ const onElementClick = (element) => {
options.currentElement = element;
- options.currentType = type;
cancelActive();
- setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
@@ -184,13 +164,9 @@ import { post } from '../uilts/axios';
options.currentCategory = category;
}
- const setTitle = (date) => {
- options.title = date.format('YYYY.MM.DD HH:mm') + ' ' + options.currentElement;
- }
-
const activeImage = (hour, minute) => {
let time = moment(options.date).hour(hour).minute(minute);
- let type = (options.currentTab === 'T-logP' || options.currentTab === 'BPFY') ? options.currentTab : (options.currentTab + '_' + options.currentType);
+ let type = options.currentTab === 'T-logP' ? options.currentTab : (options.currentTab + '_' + options.currentElement);
options.imgUrl = MicrowaveRadiationConfig.getUrl(options.currentRegion, type, time);
options.srcList = [options.imgUrl];
}
@@ -241,7 +217,7 @@ import { post } from '../uilts/axios';
let urls = [];
for(let index = 0, len = options.times.length; index < len; index++){
let time = moment(options.times[index].date);
- let type = (options.currentTab === 'T-logP' || options.currentTab === 'BPFY') ? options.currentTab : (options.currentTab + '_' + options.currentType);
+ let type = options.currentTab + '_' + options.currentType;
urls.push(MicrowaveRadiationConfig.getUrl(options.currentRegion, type, time));
}
@@ -268,9 +244,9 @@ import { post } from '../uilts/axios';
const initTimeLine = () => {
options.times = [];
- options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).format('YYYY-MM-DD HH:mm');
-
- let now = moment(options.date).hour(parseInt(options.currentHour) - 2);
+ options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).minute(30).format('YYYY-MM-DD HH:mm');
+
+ let now = moment(options.date).hour(parseInt(options.currentHour) - 2).minute(30);
let minute = now.minute();
const remainder = minute % 6;
@@ -292,7 +268,7 @@ import { post } from '../uilts/axios';
}
const initHours = () => {
- for (let i = 0; i < 23; i++) {
+ for (let i = 0; i < 24; i++) {
options.hours.push({
value: i,
label: i < 10 ? '0' + i : i,
@@ -304,7 +280,6 @@ import { post } from '../uilts/axios';
options.currentTime = time.date;
options.index = index;
cancelActive();
- setTitle(moment(time.date, 'YYYY-MM-DD HH:mm'));
activeImage(moment(time.date).hour(), moment(time.date).minute());
}
@@ -314,11 +289,17 @@ import { post } from '../uilts/axios';
}
const onPrevDayClick = () => {
- options.date = moment(options.date).add(-1, 'day').format('YYYY-MM-DD')
+ options.date = moment(options.date).add(-1, 'day').format('YYYY-MM-DD');
+
+ initTimeLine();
+ activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
const onNextDayClick = () => {
- options.date = moment(options.date).add(1, 'day').format('YYYY-MM-DD')
+ options.date = moment(options.date).add(1, 'day').format('YYYY-MM-DD');
+
+ initTimeLine();
+ activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
const onPrevImgClick = () => {
@@ -345,11 +326,10 @@ import { post } from '../uilts/axios';
cancelActive();
let element = getCurrentElement();;
- options.currentHour = '10';
- options.date = moment('2021-11-01').format('YYYY-MM-DD');
+ options.currentHour = '23';
+ options.date = moment('2021-12-05').format('YYYY-MM-DD');
options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).format('YYYY-MM-DD HH:mm');
- setTitle(moment(options.currentTime, 'YYYY-MM-DD HH:mm'));
activeImage(moment(options.currentTime).hour(), moment(options.currentTime).minute());
element.children[options.times.length - 1].classList.add('active');
}
@@ -392,13 +372,11 @@ import { post } from '../uilts/axios';
element.children[options.index].classList.add('active');
options.currentTime = options.times[options.index].date;
- setTitle(moment(options.times[options.index].date, 'YYYY-MM-DD HH:mm'));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
const onChange = () => {
initTimeLine();
- setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
diff --git a/04.系统编码/Frontend/src/uilts/Config.ts b/04.系统编码/Frontend/src/uilts/Config.ts
index 5bdd79a..291b00e 100644
--- a/04.系统编码/Frontend/src/uilts/Config.ts
+++ b/04.系统编码/Frontend/src/uilts/Config.ts
@@ -9,7 +9,7 @@ export class Config {
export class MicrowaveRadiationConfig {
private static url: string = Config.parentUrl + "/weibo";
public static getUrl(station: string, type: string, time: Moment): string {
- return this.url+ '/' + station + '/' + type + '/' + time.format("YYYY/YYYYMM/YYYYMMDD/YYYYMMDDHHmmss.png");
+ return this.url+ '/' + station + '/' + type + '/' + time.format('YYYY/YYYYMM/YYYYMMDD/') + (type === 'T-logP' ? 'T_logP' : type) + time.format('_YYYYMMDDHHmm.png');
}
}
diff --git a/04.系统编码/Frontend/src/uilts/axios.ts b/04.系统编码/Frontend/src/uilts/axios.ts
index 06a683a..6d600b5 100644
--- a/04.系统编码/Frontend/src/uilts/axios.ts
+++ b/04.系统编码/Frontend/src/uilts/axios.ts
@@ -5,7 +5,7 @@ import { ElLoading } from 'element-plus'
let loading = null;
const service = axios.create({
- baseURL:"http://112.124.40.88:8002",
+ baseURL:"http://localhost:8002",
timeout: 500000
})