@idmui/spot 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +122 -120
- package/dist/index.umd.cjs +7 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import ce from "moment";
|
|
2
|
+
import de from "moment-timezone";
|
|
3
3
|
import { Search as ze } from "@element-plus/icons-vue";
|
|
4
4
|
import { LngLatHelper as ve } from "@idm-plugin/geo";
|
|
5
|
-
import * as
|
|
6
|
-
import { markRaw as Pe, resolveComponent as ye, openBlock as i, createElementBlock as o, createElementVNode as A, createVNode as Qe, withCtx as Ee, Fragment as K, renderList as U, createBlock as ke, normalizeClass as X, toDisplayString as D, createCommentVNode as De, createTextVNode as S, normalizeStyle as
|
|
5
|
+
import * as Be from "echarts";
|
|
6
|
+
import { markRaw as Pe, resolveComponent as ye, openBlock as i, createElementBlock as o, createElementVNode as A, createVNode as Qe, withCtx as Ee, Fragment as K, renderList as U, createBlock as ke, normalizeClass as X, toDisplayString as D, createCommentVNode as De, createTextVNode as S, normalizeStyle as fe } from "vue";
|
|
7
7
|
import be from "axios";
|
|
8
8
|
class Ie {
|
|
9
9
|
static pickHourly(e, t) {
|
|
10
|
-
var n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p,
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
const m =
|
|
14
|
-
let
|
|
10
|
+
var n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p, ae, te, se, r, ne, re, le, f, ie, d, $, ee, pe, we;
|
|
11
|
+
const me = typeof t == "string" ? ce(t) : t, he = e == null ? void 0 : e.weather, g = e == null ? void 0 : e.marine, oe = ce((s = (n = he == null ? void 0 : he[0]) == null ? void 0 : n.hourly) == null ? void 0 : s.date).utc(), c = oe.clone().add((H = (L = (C = he == null ? void 0 : he[0]) == null ? void 0 : C.hourly) == null ? void 0 : L.time) == null ? void 0 : H.at(0), "h"), ue = oe.clone().add((b = (E = (Q = he == null ? void 0 : he[0]) == null ? void 0 : Q.hourly) == null ? void 0 : E.time) == null ? void 0 : b.at(-1), "h"), u = [];
|
|
12
|
+
if (me.isBetween(c, ue, "millisecond", "[]")) {
|
|
13
|
+
const m = me.utc().diff(c, "h", !1);
|
|
14
|
+
let Ae, ge;
|
|
15
15
|
if (he)
|
|
16
16
|
for (const Ce of he) {
|
|
17
17
|
const B = Ce.hourly;
|
|
18
|
-
|
|
18
|
+
Ae = {
|
|
19
19
|
temp: (M = B.temperature_2m) == null ? void 0 : M.at(m),
|
|
20
20
|
apparentTemp: (O = B.apparent_temperature) == null ? void 0 : O.at(m),
|
|
21
21
|
rh: (v = B.relative_humidity_2m) == null ? void 0 : v.at(m),
|
|
@@ -37,8 +37,8 @@ class Ie {
|
|
|
37
37
|
},
|
|
38
38
|
isDay: (W = B.is_day) == null ? void 0 : W.at(m)
|
|
39
39
|
};
|
|
40
|
-
const { name: Me, url: Le, bg: He } = this.parseWeatherCode(
|
|
41
|
-
|
|
40
|
+
const { name: Me, url: Le, bg: He } = this.parseWeatherCode(Ae.code, Ae.isDay);
|
|
41
|
+
Ae.name = Me, Ae.url = Le, Ae.bg = He, Ae.wind.scale = this.beaufort(this.kts2ms(Ae.wind.kts)), Ae.wind.direction = this.degree2Direction(Ae.wind.degree);
|
|
42
42
|
}
|
|
43
43
|
if (g)
|
|
44
44
|
for (const Ce of g) {
|
|
@@ -55,30 +55,30 @@ class Ie {
|
|
|
55
55
|
height: (P = B.swell_wave_height) == null ? void 0 : P.at(m),
|
|
56
56
|
degree: (I = B.swell_wave_direction) == null ? void 0 : I.at(m),
|
|
57
57
|
bearing: ((y = B.swell_wave_direction) == null ? void 0 : y.at(m)) !== null ? (((p = B.swell_wave_direction) == null ? void 0 : p.at(m)) + 180) % 360 : null,
|
|
58
|
-
period: (
|
|
59
|
-
peakPeriod: (
|
|
58
|
+
period: (ae = B.swell_wave_period) == null ? void 0 : ae.at(m),
|
|
59
|
+
peakPeriod: (te = B.swell_wave_peak_period) == null ? void 0 : te.at(m)
|
|
60
60
|
},
|
|
61
61
|
wd: {
|
|
62
|
-
height: (
|
|
62
|
+
height: (se = B.wind_wave_height) == null ? void 0 : se.at(m),
|
|
63
63
|
degree: (r = B.wind_wave_direction) == null ? void 0 : r.at(m),
|
|
64
64
|
bearing: ((ne = B.wind_wave_direction) == null ? void 0 : ne.at(m)) !== null ? (((re = B.wind_wave_direction) == null ? void 0 : re.at(m)) + 180) % 360 : null,
|
|
65
|
-
period: (
|
|
66
|
-
peakPeriod: (
|
|
65
|
+
period: (le = B.wind_wave_period) == null ? void 0 : le.at(m),
|
|
66
|
+
peakPeriod: (f = B.wind_wave_peak_period) == null ? void 0 : f.at(m)
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
current: {
|
|
70
|
-
speed: (
|
|
71
|
-
kts: (
|
|
72
|
-
degree: (
|
|
73
|
-
bearing: ((
|
|
70
|
+
speed: (ie = B.ocean_current_velocity) == null ? void 0 : ie.at(m),
|
|
71
|
+
kts: (d = B.ocean_current_velocity) == null ? void 0 : d.at(m),
|
|
72
|
+
degree: ($ = B.ocean_current_direction) == null ? void 0 : $.at(m),
|
|
73
|
+
bearing: ((ee = B.ocean_current_direction) == null ? void 0 : ee.at(m)) ?? null
|
|
74
74
|
},
|
|
75
|
-
sst: (
|
|
76
|
-
height: (
|
|
75
|
+
sst: (pe = B.sea_surface_temperature) == null ? void 0 : pe.at(m),
|
|
76
|
+
height: (we = B.sea_level_height_msl) == null ? void 0 : we.at(m)
|
|
77
77
|
}, ge.wave = this.parseWave(ge.wave), ge.current.direction = this.degree2Direction(ge.current.degree);
|
|
78
78
|
}
|
|
79
79
|
u.push({
|
|
80
80
|
utc: c.add(m, "h").format(),
|
|
81
|
-
weather: { ...
|
|
81
|
+
weather: { ...Ae },
|
|
82
82
|
...ge
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -106,13 +106,13 @@ class Ie {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
static pickDaily(e, t) {
|
|
109
|
-
var n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p,
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
109
|
+
var n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p, ae, te, se, r, ne, re, le, f, ie, d;
|
|
110
|
+
const $ = typeof t == "string" ? ce(t) : t, ee = e == null ? void 0 : e.weather, pe = e == null ? void 0 : e.marine, we = ce((C = (s = (n = ee == null ? void 0 : ee[0]) == null ? void 0 : n.daily) == null ? void 0 : s.time) == null ? void 0 : C.at(0)), me = ce((Q = (H = (L = ee == null ? void 0 : ee[0]) == null ? void 0 : L.daily) == null ? void 0 : H.time) == null ? void 0 : Q.at(-1)), he = [];
|
|
111
|
+
if ($.isBetween(we, me, "millisecond", "[]")) {
|
|
112
112
|
let g, oe;
|
|
113
|
-
const c =
|
|
114
|
-
if (
|
|
115
|
-
for (const ue of
|
|
113
|
+
const c = $.diff(we, "d", !1);
|
|
114
|
+
if (ee)
|
|
115
|
+
for (const ue of ee) {
|
|
116
116
|
const u = ue.daily;
|
|
117
117
|
g = {
|
|
118
118
|
code: (E = u.weather_code) == null ? void 0 : E.at(c),
|
|
@@ -146,11 +146,11 @@ class Ie {
|
|
|
146
146
|
bearing: ((q = u.wind_direction_10m_dominant) == null ? void 0 : q.at(c)) !== null ? (((V = u.wind_direction_10m_dominant) == null ? void 0 : V.at(c)) + 180) % 360 : null
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
const { name: m, url:
|
|
150
|
-
g.name = m, g.url =
|
|
149
|
+
const { name: m, url: Ae, bg: ge } = this.parseWeatherCode(g.code, !0);
|
|
150
|
+
g.name = m, g.url = Ae, g.bg = ge, g.wind.scale = this.beaufort(this.kts2ms(g.wind.kts)), g.wind.direction = this.degree2Direction(g.wind.degree);
|
|
151
151
|
}
|
|
152
|
-
if (
|
|
153
|
-
for (const ue of
|
|
152
|
+
if (pe)
|
|
153
|
+
for (const ue of pe) {
|
|
154
154
|
const u = ue.daily;
|
|
155
155
|
oe = {
|
|
156
156
|
wave: {
|
|
@@ -163,22 +163,22 @@ class Ie {
|
|
|
163
163
|
swell: {
|
|
164
164
|
height: (y = u.swell_wave_height_max) == null ? void 0 : y.at(c),
|
|
165
165
|
degree: (p = u.swell_wave_direction_dominant) == null ? void 0 : p.at(c),
|
|
166
|
-
period: (
|
|
167
|
-
peakPeriod: (
|
|
168
|
-
bearing: ((
|
|
166
|
+
period: (ae = u.swell_wave_period_max) == null ? void 0 : ae.at(c),
|
|
167
|
+
peakPeriod: (te = u.swell_wave_peak_period_max) == null ? void 0 : te.at(c),
|
|
168
|
+
bearing: ((se = u.swell_wave_direction_dominant) == null ? void 0 : se.at(c)) !== null ? (((r = u.swell_wave_direction_dominant) == null ? void 0 : r.at(c)) + 180) % 360 : null
|
|
169
169
|
},
|
|
170
170
|
wd: {
|
|
171
171
|
height: (ne = u.wind_wave_height_max) == null ? void 0 : ne.at(c),
|
|
172
172
|
degree: (re = u.wind_wave_direction_dominant) == null ? void 0 : re.at(c),
|
|
173
|
-
period: (
|
|
174
|
-
peakPeriod: (
|
|
175
|
-
bearing: ((
|
|
173
|
+
period: (le = u.wind_wave_period_max) == null ? void 0 : le.at(c),
|
|
174
|
+
peakPeriod: (f = u.wind_wave_peak_period_max) == null ? void 0 : f.at(c),
|
|
175
|
+
bearing: ((ie = u.wind_wave_direction_dominant) == null ? void 0 : ie.at(c)) !== null ? (((d = u.wind_wave_direction_dominant) == null ? void 0 : d.at(c)) + 180) % 360 : null
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}, oe.wave = this.parseWave(oe.wave);
|
|
179
179
|
}
|
|
180
180
|
he.push({
|
|
181
|
-
utc:
|
|
181
|
+
utc: we.add(c, "d").utc().format(),
|
|
182
182
|
weather: { ...g },
|
|
183
183
|
...oe
|
|
184
184
|
});
|
|
@@ -579,7 +579,7 @@ const Ne = (h, e) => {
|
|
|
579
579
|
},
|
|
580
580
|
ts: {
|
|
581
581
|
type: String,
|
|
582
|
-
default:
|
|
582
|
+
default: ce().utc().format()
|
|
583
583
|
},
|
|
584
584
|
timeZone: {
|
|
585
585
|
type: Number,
|
|
@@ -623,7 +623,7 @@ const Ne = (h, e) => {
|
|
|
623
623
|
computeHourLT() {
|
|
624
624
|
return function(h) {
|
|
625
625
|
if (h) {
|
|
626
|
-
const e =
|
|
626
|
+
const e = de(h).tz(this.positionGmt);
|
|
627
627
|
return `${e == null ? void 0 : e.format("HH")}`;
|
|
628
628
|
}
|
|
629
629
|
return "-";
|
|
@@ -632,7 +632,7 @@ const Ne = (h, e) => {
|
|
|
632
632
|
computeHourZ() {
|
|
633
633
|
return function(h) {
|
|
634
634
|
if (h) {
|
|
635
|
-
const e =
|
|
635
|
+
const e = ce(h).utc();
|
|
636
636
|
return `${e == null ? void 0 : e.format("HH")}Z`;
|
|
637
637
|
}
|
|
638
638
|
return "-";
|
|
@@ -641,7 +641,7 @@ const Ne = (h, e) => {
|
|
|
641
641
|
computeWeekLT() {
|
|
642
642
|
return function(h) {
|
|
643
643
|
if (h) {
|
|
644
|
-
const e =
|
|
644
|
+
const e = de(h).tz(this.positionGmt);
|
|
645
645
|
return `${e == null ? void 0 : e.format("dddd")}`;
|
|
646
646
|
}
|
|
647
647
|
return "-";
|
|
@@ -650,7 +650,7 @@ const Ne = (h, e) => {
|
|
|
650
650
|
computeMMMDDLT() {
|
|
651
651
|
return function(h) {
|
|
652
652
|
if (h) {
|
|
653
|
-
const e =
|
|
653
|
+
const e = de(h).tz(this.positionGmt);
|
|
654
654
|
return `${e == null ? void 0 : e.format("MMM-DD")}`;
|
|
655
655
|
}
|
|
656
656
|
return "-";
|
|
@@ -749,7 +749,7 @@ const Ne = (h, e) => {
|
|
|
749
749
|
},
|
|
750
750
|
initInfo() {
|
|
751
751
|
var h, e, t, n;
|
|
752
|
-
this.positionGmt = (e = (h = this.meteoData.weather) == null ? void 0 : h[0]) == null ? void 0 : e.timezone, this.positionOffset = (n = (t = this.meteoData.weather) == null ? void 0 : t[0]) == null ? void 0 : n.offset, this.issuedDate =
|
|
752
|
+
this.positionGmt = (e = (h = this.meteoData.weather) == null ? void 0 : h[0]) == null ? void 0 : e.timezone, this.positionOffset = (n = (t = this.meteoData.weather) == null ? void 0 : t[0]) == null ? void 0 : n.offset, this.issuedDate = ce(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = de(this.ts).tz(this.positionGmt).hour(), this.pickedDate = de(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.collectList = JSON.parse(localStorage.getItem("idmCollectList") || "[]"), this.positionList = JSON.parse(JSON.stringify(this.collectList)), this.isCollected = this.collectList.some((s) => {
|
|
753
753
|
var C;
|
|
754
754
|
return s.name === ((C = this.position) == null ? void 0 : C.name);
|
|
755
755
|
});
|
|
@@ -772,21 +772,21 @@ const Ne = (h, e) => {
|
|
|
772
772
|
var N, G, T, F, a, l, J, R, W, q, V, Z, _;
|
|
773
773
|
this.loading.weatherEchart = !1;
|
|
774
774
|
for (let w = 0; w < 7; w++) {
|
|
775
|
-
const P =
|
|
776
|
-
h.push(
|
|
775
|
+
const P = ce(this.pickedDate).clone().add(w, "d");
|
|
776
|
+
h.push(de(P).tz(this.positionGmt).format("yyyy-MM-DD")), e.push(this.computeMMMDDLT(P)), t.push(w === 0 ? "Today" : this.computeWeekLT(P));
|
|
777
777
|
const I = ((N = Ie.pickDaily(this.meteoData, P)) == null ? void 0 : N[0]) || {};
|
|
778
778
|
n.push(this.roundPrecision((T = (G = I.weather) == null ? void 0 : G.temp) == null ? void 0 : T.min, 0)), s.push(this.roundPrecision((a = (F = I.weather) == null ? void 0 : F.temp) == null ? void 0 : a.max, 0)), H.push(this.roundPrecision((J = (l = I.weather) == null ? void 0 : l.wind) == null ? void 0 : J.kts, 1) ?? "- kts"), E.push(this.roundPrecision((W = (R = I.weather) == null ? void 0 : R.precip) == null ? void 0 : W.sum, 0) ?? "- mm"), C.push({ symbol: "image://" + ((q = I.weather) == null ? void 0 : q.url) }), L.push((V = I.weather) == null ? void 0 : V.name), Q.push((_ = (Z = I.weather) == null ? void 0 : Z.wind) == null ? void 0 : _.degree);
|
|
779
779
|
const y = document.createElement("canvas"), p = y.getContext("2d");
|
|
780
780
|
y.width = v.width, y.height = v.height;
|
|
781
|
-
const
|
|
782
|
-
p.translate(y.width / 2, y.height / 2), p.rotate(
|
|
783
|
-
const
|
|
781
|
+
const te = Q[w] * (Math.PI / 180);
|
|
782
|
+
p.translate(y.width / 2, y.height / 2), p.rotate(te), p.translate(-v.width / 2, -v.height / 2), p.drawImage(v, 0, 0, 64, 64);
|
|
783
|
+
const se = y.toDataURL();
|
|
784
784
|
b[`WindIcon${w}`] = {
|
|
785
785
|
height: 12,
|
|
786
786
|
width: 12,
|
|
787
787
|
align: "left",
|
|
788
788
|
backgroundColor: {
|
|
789
|
-
image:
|
|
789
|
+
image: se
|
|
790
790
|
}
|
|
791
791
|
};
|
|
792
792
|
}
|
|
@@ -1094,10 +1094,10 @@ const Ne = (h, e) => {
|
|
|
1094
1094
|
]
|
|
1095
1095
|
};
|
|
1096
1096
|
this.$nextTick(() => {
|
|
1097
|
-
const w =
|
|
1097
|
+
const w = Be.init(document.getElementById("weather-chart"));
|
|
1098
1098
|
w.setOption(z), w.on("click", (P) => {
|
|
1099
1099
|
const I = P.dataIndex, y = h[I].split("-");
|
|
1100
|
-
this.pickedDate =
|
|
1100
|
+
this.pickedDate = de().tz(this.positionGmt).set({ year: y[0], month: Number(y[1] - 1), date: Number(y[2]), hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.pickedWeek = I === 0 ? "Today" : this.computeWeekLT(this.pickedDate), this.activeIndex = I === 0 ? de(this.ts).tz(this.positionGmt).hour() : void 0, this.initHoursTableData(), z.series[3].markArea = {
|
|
1101
1101
|
itemStyle: {
|
|
1102
1102
|
color: "rgb(71,143,206)"
|
|
1103
1103
|
},
|
|
@@ -1143,24 +1143,25 @@ const Ne = (h, e) => {
|
|
|
1143
1143
|
)
|
|
1144
1144
|
), n = new Image(64, 64);
|
|
1145
1145
|
n.src = t, n.onload = () => {
|
|
1146
|
-
var
|
|
1146
|
+
var C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p, ae, te, se, r, ne, re, le;
|
|
1147
1147
|
this.loading.meteogramEchart = !1;
|
|
1148
|
+
const s = de(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format();
|
|
1148
1149
|
for (let f = 0; f < 7 * 24; f++) {
|
|
1149
|
-
const
|
|
1150
|
-
(
|
|
1151
|
-
const d = ((
|
|
1152
|
-
if (f % 12 === 0 && f % 24 !== 0 ? (
|
|
1153
|
-
const $ = document.createElement("canvas"),
|
|
1150
|
+
const ie = ce(s).clone().add(f, "h");
|
|
1151
|
+
(C = this.meteogramData) == null || C.dates.push(ie);
|
|
1152
|
+
const d = ((L = Ie.pickHourly(this.meteoData, ie)) == null ? void 0 : L[0]) || {};
|
|
1153
|
+
if (f % 12 === 0 && f % 24 !== 0 ? (H = this.meteogramData) == null || H.xDates.push(de(ie).tz(this.positionGmt).format("MMM-DD")) : (Q = this.meteogramData) == null || Q.xDates.push(""), f % 3 === 0 ? (E = this.meteogramData) == null || E.hours.push(this.computeHourLT(ie)) : (b = this.meteogramData) == null || b.hours.push(""), (O = this.meteogramData) == null || O.temperatures.push(this.roundPrecision((M = d == null ? void 0 : d.weather) == null ? void 0 : M.temp, 0)), (j = this.meteogramData) == null || j.precip.push(this.roundPrecision((k = (v = d == null ? void 0 : d.weather) == null ? void 0 : v.precip) == null ? void 0 : k.sum, 0)), (z = this.meteogramData) == null || z.windspeed.push(this.roundPrecision((x = (Y = d.weather) == null ? void 0 : Y.wind) == null ? void 0 : x.kts, 1)), (T = this.meteogramData) == null || T.windGusts.push(this.roundPrecision((G = (N = d == null ? void 0 : d.weather) == null ? void 0 : N.wind) == null ? void 0 : G.gusts, 1)), (l = this.meteogramData) == null || l.sigWaveHeight.push(this.roundPrecision((a = (F = d == null ? void 0 : d.wave) == null ? void 0 : F.sig) == null ? void 0 : a.height)), (W = this.meteogramData) == null || W.swellHeight.push(this.roundPrecision((R = (J = d == null ? void 0 : d.wave) == null ? void 0 : J.swell) == null ? void 0 : R.height)), f % 6 === 0 ? ((V = this.meteogramData) == null || V.weatherIcons.push({ symbol: "image://" + ((q = d.weather) == null ? void 0 : q.url), symbolSize: 24 }), (_ = this.meteogramData) == null || _.weatherNames.push((Z = d.weather) == null ? void 0 : Z.name)) : ((P = this.meteogramData) == null || P.weatherIcons.push({ symbol: "image://" + ((w = d.weather) == null ? void 0 : w.url), symbolSize: 0 }), (I = this.meteogramData) == null || I.weatherNames.push("")), f % 2 === 0 ? (ae = this.meteogramData) == null || ae.windDir.push((p = (y = d.weather) == null ? void 0 : y.wind) == null ? void 0 : p.degree) : (te = this.meteogramData) == null || te.windDir.push(""), f % 2 === 0) {
|
|
1154
|
+
const $ = document.createElement("canvas"), ee = $.getContext("2d");
|
|
1154
1155
|
$.width = n.width, $.height = n.height;
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1156
|
+
const we = ((se = this.meteogramData) == null ? void 0 : se.windDir[f]) * (Math.PI / 180);
|
|
1157
|
+
ee.translate($.width / 2, $.height / 2), ee.rotate(we), ee.translate(-n.width / 2, -n.height / 2), ee.drawImage(n, 0, 0, 64, 64);
|
|
1158
|
+
const me = $.toDataURL();
|
|
1158
1159
|
this.meteogramData.windDirIcons[`WindIcon${f}`] = {
|
|
1159
1160
|
height: 12,
|
|
1160
1161
|
width: 12,
|
|
1161
1162
|
align: "left",
|
|
1162
1163
|
backgroundColor: {
|
|
1163
|
-
image:
|
|
1164
|
+
image: me
|
|
1164
1165
|
}
|
|
1165
1166
|
};
|
|
1166
1167
|
} else
|
|
@@ -1170,7 +1171,7 @@ const Ne = (h, e) => {
|
|
|
1170
1171
|
align: "left",
|
|
1171
1172
|
backgroundColor: "none"
|
|
1172
1173
|
};
|
|
1173
|
-
(
|
|
1174
|
+
(r = d == null ? void 0 : d.weather) != null && r.isDay ? e.end === void 0 && e.start >= 0 && (e.end = f) : e.start === void 0 && (e.start = f), (e.start >= 0 && e.end >= 0 || e.start >= 0 && f === 7 * 24 - 1) && ((ne = this.meteogramData) == null || ne.markarea.push(
|
|
1174
1175
|
[
|
|
1175
1176
|
{
|
|
1176
1177
|
x: 4 + e.start / (7 * 24) * 92 + "%"
|
|
@@ -1181,7 +1182,7 @@ const Ne = (h, e) => {
|
|
|
1181
1182
|
]
|
|
1182
1183
|
), e = { start: void 0, end: void 0 });
|
|
1183
1184
|
}
|
|
1184
|
-
this.meteogramData.offset = 4 + 0.5 / ((
|
|
1185
|
+
this.meteogramData.offset = 4 + 0.5 / ((le = (re = this.meteogramData) == null ? void 0 : re.dates) == null ? void 0 : le.length) * 92 + "%", this.$nextTick(() => {
|
|
1185
1186
|
this.initMeteogramEchart();
|
|
1186
1187
|
});
|
|
1187
1188
|
};
|
|
@@ -1213,24 +1214,25 @@ const Ne = (h, e) => {
|
|
|
1213
1214
|
)
|
|
1214
1215
|
), n = new Image(64, 64);
|
|
1215
1216
|
n.src = t, n.onload = () => {
|
|
1216
|
-
var
|
|
1217
|
+
var C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p, ae, te, se, r, ne, re, le;
|
|
1217
1218
|
this.loading.meteogramEchart = !1;
|
|
1219
|
+
const s = de(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format();
|
|
1218
1220
|
for (let f = 0; f < 14 * 24; f++) {
|
|
1219
|
-
const
|
|
1220
|
-
(
|
|
1221
|
-
const d = ((
|
|
1222
|
-
if ((
|
|
1223
|
-
const $ = document.createElement("canvas"),
|
|
1221
|
+
const ie = ce(s).clone().add(f, "h");
|
|
1222
|
+
(C = this.meteogramData) == null || C.dates.push(ie);
|
|
1223
|
+
const d = ((L = Ie.pickHourly(this.meteoData, ie)) == null ? void 0 : L[0]) || {};
|
|
1224
|
+
if ((Q = this.meteogramData) == null || Q.temperatures.push(this.roundPrecision((H = d == null ? void 0 : d.weather) == null ? void 0 : H.temp, 0)), (M = this.meteogramData) == null || M.precip.push(this.roundPrecision((b = (E = d == null ? void 0 : d.weather) == null ? void 0 : E.precip) == null ? void 0 : b.sum, 0)), (k = this.meteogramData) == null || k.windspeed.push(this.roundPrecision((v = (O = d.weather) == null ? void 0 : O.wind) == null ? void 0 : v.kts, 1)), (x = this.meteogramData) == null || x.windGusts.push(this.roundPrecision((Y = (j = d == null ? void 0 : d.weather) == null ? void 0 : j.wind) == null ? void 0 : Y.gusts, 1)), (G = this.meteogramData) == null || G.sigWaveHeight.push(this.roundPrecision((N = (z = d == null ? void 0 : d.wave) == null ? void 0 : z.sig) == null ? void 0 : N.height)), (a = this.meteogramData) == null || a.swellHeight.push(this.roundPrecision((F = (T = d == null ? void 0 : d.wave) == null ? void 0 : T.swell) == null ? void 0 : F.height)), f % 12 === 0 && f % 24 !== 0 ? (l = this.meteogramData) == null || l.xDates.push(de(ie).tz(this.positionGmt).format("MMM-DD")) : (J = this.meteogramData) == null || J.xDates.push(""), f % 6 === 0 ? (R = this.meteogramData) == null || R.hours.push(this.computeHourLT(ie)) : (W = this.meteogramData) == null || W.hours.push(""), f % 9 === 0 ? ((V = this.meteogramData) == null || V.weatherIcons.push({ symbol: "image://" + ((q = d.weather) == null ? void 0 : q.url), symbolSize: 24 }), (_ = this.meteogramData) == null || _.weatherNames.push((Z = d.weather) == null ? void 0 : Z.name)) : ((P = this.meteogramData) == null || P.weatherIcons.push({ symbol: "image://" + ((w = d.weather) == null ? void 0 : w.url), symbolSize: 0 }), (I = this.meteogramData) == null || I.weatherNames.push("")), f % 6 === 0 ? (ae = this.meteogramData) == null || ae.windDir.push((p = (y = d.weather) == null ? void 0 : y.wind) == null ? void 0 : p.degree) : (te = this.meteogramData) == null || te.windDir.push(""), f % 6 === 0) {
|
|
1225
|
+
const $ = document.createElement("canvas"), ee = $.getContext("2d");
|
|
1224
1226
|
$.width = n.width, $.height = n.height;
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1227
|
+
const we = ((se = this.meteogramData) == null ? void 0 : se.windDir[f]) * (Math.PI / 180);
|
|
1228
|
+
ee.translate($.width / 2, $.height / 2), ee.rotate(we), ee.translate(-n.width / 2, -n.height / 2), ee.drawImage(n, 0, 0, 64, 64);
|
|
1229
|
+
const me = $.toDataURL();
|
|
1228
1230
|
this.meteogramData.windDirIcons[`WindIcon${f}`] = {
|
|
1229
1231
|
height: 12,
|
|
1230
1232
|
width: 12,
|
|
1231
1233
|
align: "left",
|
|
1232
1234
|
backgroundColor: {
|
|
1233
|
-
image:
|
|
1235
|
+
image: me
|
|
1234
1236
|
}
|
|
1235
1237
|
};
|
|
1236
1238
|
} else
|
|
@@ -1240,7 +1242,7 @@ const Ne = (h, e) => {
|
|
|
1240
1242
|
align: "left",
|
|
1241
1243
|
backgroundColor: "none"
|
|
1242
1244
|
};
|
|
1243
|
-
(
|
|
1245
|
+
(r = d == null ? void 0 : d.weather) != null && r.isDay ? e.end === void 0 && e.start >= 0 && (e.end = f) : e.start === void 0 && (e.start = f), (e.start >= 0 && e.end >= 0 || e.start >= 0 && f === 14 * 24 - 1) && ((ne = this.meteogramData) == null || ne.markarea.push(
|
|
1244
1246
|
[
|
|
1245
1247
|
{
|
|
1246
1248
|
x: 4 + e.start / (14 * 24) * 92 + "%"
|
|
@@ -1251,14 +1253,14 @@ const Ne = (h, e) => {
|
|
|
1251
1253
|
]
|
|
1252
1254
|
), e = { start: void 0, end: void 0 });
|
|
1253
1255
|
}
|
|
1254
|
-
this.meteogramData.offset = 4 + 0.5 / ((
|
|
1256
|
+
this.meteogramData.offset = 4 + 0.5 / ((le = (re = this.meteogramData) == null ? void 0 : re.dates) == null ? void 0 : le.length) * 92 + "%", this.$nextTick(() => {
|
|
1255
1257
|
this.initMeteogramEchart();
|
|
1256
1258
|
});
|
|
1257
1259
|
};
|
|
1258
1260
|
},
|
|
1259
1261
|
initMeteogramEchart() {
|
|
1260
|
-
var M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p,
|
|
1261
|
-
const h =
|
|
1262
|
+
var M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p, ae, te, se, r, ne, re, le, f, ie, d, $, ee, pe, we, me, he;
|
|
1263
|
+
const h = Be.init(document.getElementById("weather-icons")), e = {
|
|
1262
1264
|
grid: {
|
|
1263
1265
|
show: !0,
|
|
1264
1266
|
bottom: "0%",
|
|
@@ -1381,7 +1383,7 @@ const Ne = (h, e) => {
|
|
|
1381
1383
|
};
|
|
1382
1384
|
h.setOption(e);
|
|
1383
1385
|
let t = Math.max(...this.meteogramData.temperatures.filter((g) => typeof g == "number" && !isNaN(g))), s = Math.min(...this.meteogramData.temperatures.filter((g) => typeof g == "number" && !isNaN(g))) > 0 ? 0 : Math.min(...this.meteogramData.temperatures.filter((g) => typeof g == "number" && !isNaN(g))), C = Math.ceil(t / 5) * 5, L = Math.ceil((C - s) / 5);
|
|
1384
|
-
const H =
|
|
1386
|
+
const H = Be.init(document.getElementById("weather-condition")), Q = {
|
|
1385
1387
|
title: {
|
|
1386
1388
|
text: "Weather conditions",
|
|
1387
1389
|
top: "10px",
|
|
@@ -1405,15 +1407,15 @@ const Ne = (h, e) => {
|
|
|
1405
1407
|
show: !0,
|
|
1406
1408
|
position: "right",
|
|
1407
1409
|
formatter: (g) => {
|
|
1408
|
-
var c, ue, u, m,
|
|
1410
|
+
var c, ue, u, m, Ae, ge;
|
|
1409
1411
|
const oe = (c = g == null ? void 0 : g[0]) == null ? void 0 : c.dataIndex;
|
|
1410
|
-
return g.find((Ce) => Ce.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${
|
|
1412
|
+
return g.find((Ce) => Ce.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${de((ue = this.meteogramData) == null ? void 0 : ue.dates[oe]).tz(this.positionGmt).format("MMM-DD/HHmm[LT]")}</strong></div>
|
|
1411
1413
|
<div style="display: ${(u = this.meteogramData) != null && u.weatherNames[oe] ? "block" : "none"}; font-size: 13px;">
|
|
1412
1414
|
<span>Weather : </span><strong>${(m = this.meteogramData) == null ? void 0 : m.weatherNames[oe]}</strong>
|
|
1413
1415
|
</div>
|
|
1414
1416
|
<div style="font-size: 13px;">
|
|
1415
1417
|
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #f2a71c;}"></span>
|
|
1416
|
-
<span>Temperature : </span><strong>${(
|
|
1418
|
+
<span>Temperature : </span><strong>${(Ae = g[0]) == null ? void 0 : Ae.value}</strong><span style="padding-left: 3px;">℃</span>
|
|
1417
1419
|
</div>
|
|
1418
1420
|
<div style="font-size: 13px;">
|
|
1419
1421
|
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #0c73a8;}"></span>
|
|
@@ -1631,7 +1633,7 @@ const Ne = (h, e) => {
|
|
|
1631
1633
|
singleAxisIndex: 2,
|
|
1632
1634
|
coordinateSystem: "singleAxis",
|
|
1633
1635
|
type: "scatter",
|
|
1634
|
-
data: (
|
|
1636
|
+
data: (ae = this.meteogramData) == null ? void 0 : ae.hours,
|
|
1635
1637
|
label: {
|
|
1636
1638
|
show: !0,
|
|
1637
1639
|
fontSize: 11,
|
|
@@ -1646,7 +1648,7 @@ const Ne = (h, e) => {
|
|
|
1646
1648
|
singleAxisIndex: 3,
|
|
1647
1649
|
coordinateSystem: "singleAxis",
|
|
1648
1650
|
type: "scatter",
|
|
1649
|
-
data: (
|
|
1651
|
+
data: (te = this.meteogramData) == null ? void 0 : te.xDates,
|
|
1650
1652
|
label: {
|
|
1651
1653
|
show: !0,
|
|
1652
1654
|
fontSize: 13,
|
|
@@ -1660,7 +1662,7 @@ const Ne = (h, e) => {
|
|
|
1660
1662
|
]
|
|
1661
1663
|
};
|
|
1662
1664
|
H.setOption(Q);
|
|
1663
|
-
const E =
|
|
1665
|
+
const E = Be.init(document.getElementById("wave-swell")), b = {
|
|
1664
1666
|
title: {
|
|
1665
1667
|
text: "Weather conditions",
|
|
1666
1668
|
top: "10px",
|
|
@@ -1685,9 +1687,9 @@ const Ne = (h, e) => {
|
|
|
1685
1687
|
show: !0,
|
|
1686
1688
|
position: "right",
|
|
1687
1689
|
formatter: (g) => {
|
|
1688
|
-
var c, ue, u, m,
|
|
1690
|
+
var c, ue, u, m, Ae, ge;
|
|
1689
1691
|
const oe = (c = g == null ? void 0 : g[0]) == null ? void 0 : c.dataIndex;
|
|
1690
|
-
return g.find((Ce) => Ce.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${
|
|
1692
|
+
return g.find((Ce) => Ce.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${de((ue = this.meteogramData) == null ? void 0 : ue.dates[oe]).tz(this.positionGmt).format("MMM-DD/HHmm[LT]")}</strong></div>
|
|
1691
1693
|
<div style="font-size: 13px;">
|
|
1692
1694
|
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #0ddd9f;}"></span>
|
|
1693
1695
|
<span>Wind Speed : </span><strong>${(u = g[0]) == null ? void 0 : u.value}</strong><span style="padding-left: 3px;">kts</span>
|
|
@@ -1698,7 +1700,7 @@ const Ne = (h, e) => {
|
|
|
1698
1700
|
</div>
|
|
1699
1701
|
<div style="font-size: 13px;">
|
|
1700
1702
|
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #2a57b7;}"></span>
|
|
1701
|
-
<span>Sig.Wave Height : </span><strong>${(
|
|
1703
|
+
<span>Sig.Wave Height : </span><strong>${(Ae = g[2]) == null ? void 0 : Ae.value}</strong><span style="padding-left: 3px;">m</span>
|
|
1702
1704
|
</div>
|
|
1703
1705
|
<div style="font-size: 13px;">
|
|
1704
1706
|
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #673AB7;"></span>
|
|
@@ -1719,7 +1721,7 @@ const Ne = (h, e) => {
|
|
|
1719
1721
|
top: "50%",
|
|
1720
1722
|
height: "50%",
|
|
1721
1723
|
type: "category",
|
|
1722
|
-
data: (
|
|
1724
|
+
data: (se = this.meteogramData) == null ? void 0 : se.dates,
|
|
1723
1725
|
show: !1
|
|
1724
1726
|
},
|
|
1725
1727
|
axisLine: {
|
|
@@ -1753,8 +1755,8 @@ const Ne = (h, e) => {
|
|
|
1753
1755
|
height: "2%"
|
|
1754
1756
|
},
|
|
1755
1757
|
{
|
|
1756
|
-
left: (
|
|
1757
|
-
right: (
|
|
1758
|
+
left: (le = this.meteogramData) == null ? void 0 : le.offset,
|
|
1759
|
+
right: (f = this.meteogramData) == null ? void 0 : f.offset,
|
|
1758
1760
|
type: "category",
|
|
1759
1761
|
show: !1,
|
|
1760
1762
|
axisLine: {
|
|
@@ -1774,7 +1776,7 @@ const Ne = (h, e) => {
|
|
|
1774
1776
|
// 隐藏分割线
|
|
1775
1777
|
},
|
|
1776
1778
|
boundaryGap: !1,
|
|
1777
|
-
data: (
|
|
1779
|
+
data: (ie = this.meteogramData) == null ? void 0 : ie.dates,
|
|
1778
1780
|
top: "92%",
|
|
1779
1781
|
height: "2%"
|
|
1780
1782
|
}
|
|
@@ -1811,7 +1813,7 @@ const Ne = (h, e) => {
|
|
|
1811
1813
|
name: "Wind Speed",
|
|
1812
1814
|
type: "line",
|
|
1813
1815
|
yAxisIndex: 0,
|
|
1814
|
-
data: (
|
|
1816
|
+
data: (d = this.meteogramData) == null ? void 0 : d.windspeed,
|
|
1815
1817
|
symbol: "none",
|
|
1816
1818
|
smooth: !1,
|
|
1817
1819
|
itemStyle: {
|
|
@@ -1824,7 +1826,7 @@ const Ne = (h, e) => {
|
|
|
1824
1826
|
itemStyle: {
|
|
1825
1827
|
color: "rgba(239,239,239,0.6)"
|
|
1826
1828
|
},
|
|
1827
|
-
data: (
|
|
1829
|
+
data: ($ = this.meteogramData) == null ? void 0 : $.markarea,
|
|
1828
1830
|
emphasis: {
|
|
1829
1831
|
disabled: !0
|
|
1830
1832
|
}
|
|
@@ -1834,7 +1836,7 @@ const Ne = (h, e) => {
|
|
|
1834
1836
|
name: "Wind Gusts",
|
|
1835
1837
|
type: "line",
|
|
1836
1838
|
yAxisIndex: 0,
|
|
1837
|
-
data: (
|
|
1839
|
+
data: (ee = this.meteogramData) == null ? void 0 : ee.windGusts,
|
|
1838
1840
|
symbol: "none",
|
|
1839
1841
|
smooth: !1,
|
|
1840
1842
|
itemStyle: {
|
|
@@ -1852,7 +1854,7 @@ const Ne = (h, e) => {
|
|
|
1852
1854
|
name: "Sig.Wave Height",
|
|
1853
1855
|
type: "line",
|
|
1854
1856
|
yAxisIndex: 1,
|
|
1855
|
-
data: (
|
|
1857
|
+
data: (pe = this.meteogramData) == null ? void 0 : pe.sigWaveHeight,
|
|
1856
1858
|
symbol: "none",
|
|
1857
1859
|
smooth: !1,
|
|
1858
1860
|
itemStyle: {
|
|
@@ -1866,7 +1868,7 @@ const Ne = (h, e) => {
|
|
|
1866
1868
|
name: "Swell Height",
|
|
1867
1869
|
type: "line",
|
|
1868
1870
|
yAxisIndex: 1,
|
|
1869
|
-
data: (
|
|
1871
|
+
data: (we = this.meteogramData) == null ? void 0 : we.swellHeight,
|
|
1870
1872
|
symbol: "none",
|
|
1871
1873
|
smooth: !1,
|
|
1872
1874
|
itemStyle: {
|
|
@@ -1881,7 +1883,7 @@ const Ne = (h, e) => {
|
|
|
1881
1883
|
singleAxisIndex: 0,
|
|
1882
1884
|
coordinateSystem: "singleAxis",
|
|
1883
1885
|
type: "scatter",
|
|
1884
|
-
data: (
|
|
1886
|
+
data: (me = this.meteogramData) == null ? void 0 : me.hours,
|
|
1885
1887
|
itemStyle: {
|
|
1886
1888
|
color: "#fff"
|
|
1887
1889
|
},
|
|
@@ -1913,7 +1915,7 @@ const Ne = (h, e) => {
|
|
|
1913
1915
|
E.setOption(b);
|
|
1914
1916
|
},
|
|
1915
1917
|
disposeEcharts() {
|
|
1916
|
-
document.getElementById("weather-chart") &&
|
|
1918
|
+
document.getElementById("weather-chart") && Be.dispose(document.getElementById("weather-chart")), document.getElementById("weather-icons") && Be.dispose(document.getElementById("weather-icons")), document.getElementById("weather-condition") && Be.dispose(document.getElementById("weather-condition")), document.getElementById("wave-swell") && Be.dispose(document.getElementById("wave-swell"));
|
|
1917
1919
|
},
|
|
1918
1920
|
initHoursTableData() {
|
|
1919
1921
|
var h, e, t, n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P;
|
|
@@ -1944,7 +1946,7 @@ const Ne = (h, e) => {
|
|
|
1944
1946
|
seaTemp: []
|
|
1945
1947
|
};
|
|
1946
1948
|
for (let I = 0; I < 24; I++) {
|
|
1947
|
-
const y =
|
|
1949
|
+
const y = ce(this.pickedDate).clone().add(I, "h").format();
|
|
1948
1950
|
this.hoursTableData.hours.push(y);
|
|
1949
1951
|
const p = ((h = Ie.pickHourly(this.meteoData, y)) == null ? void 0 : h[0]) || {};
|
|
1950
1952
|
this.hoursTableData.weatherUrls.push((e = p.weather) == null ? void 0 : e.url), this.hoursTableData.weatherNames.push(((t = p.weather) == null ? void 0 : t.name) ?? "-"), this.hoursTableData.temp.push(this.roundPrecision((n = p.weather) == null ? void 0 : n.temp, 0) ?? "-"), this.hoursTableData.precipProbability.push(this.roundPrecision((C = (s = p.weather) == null ? void 0 : s.precip) == null ? void 0 : C.probability, 0) ?? "-"), this.hoursTableData.precip1h.push(this.roundPrecision((H = (L = p.weather) == null ? void 0 : L.precip) == null ? void 0 : H.sum, 0) ?? "-"), this.hoursTableData.visibility.push(this.roundPrecision((Q = p.weather) == null ? void 0 : Q.visibility, 0) ?? "-"), this.hoursTableData.humidity.push(this.roundPrecision((E = p.weather) == null ? void 0 : E.rh, 0) ?? "-"), this.hoursTableData.windSpeed.push(this.roundPrecision((M = (b = p.weather) == null ? void 0 : b.wind) == null ? void 0 : M.kts, 1)), this.hoursTableData.windDir.push((v = (O = p.weather) == null ? void 0 : O.wind) == null ? void 0 : v.bearing), this.hoursTableData.windGust.push(this.roundPrecision((j = (k = p.weather) == null ? void 0 : k.wind) == null ? void 0 : j.gusts, 1) ?? "-"), this.hoursTableData.sigwaveHeight.push(this.roundPrecision((x = (Y = p.wave) == null ? void 0 : Y.sig) == null ? void 0 : x.height, 1) ?? "-"), this.hoursTableData.sigwaveDir.push((N = (z = p.wave) == null ? void 0 : z.sig) == null ? void 0 : N.bearing), this.hoursTableData.windwaveHeight.push(this.roundPrecision((T = (G = p.wave) == null ? void 0 : G.wd) == null ? void 0 : T.height, 1) ?? "-"), this.hoursTableData.windwaveDir.push((a = (F = p.wave) == null ? void 0 : F.wd) == null ? void 0 : a.bearing), this.hoursTableData.windwavePeriod.push(this.roundPrecision((J = (l = p.wave) == null ? void 0 : l.wd) == null ? void 0 : J.period, 1) ?? "-"), this.hoursTableData.swellHeight.push(this.roundPrecision((W = (R = p.wave) == null ? void 0 : R.swell) == null ? void 0 : W.height, 1) ?? "-"), this.hoursTableData.swellDir.push((V = (q = p.wave) == null ? void 0 : q.swell) == null ? void 0 : V.bearing), this.hoursTableData.swellPeriod.push(this.roundPrecision((_ = (Z = p.wave) == null ? void 0 : Z.swell) == null ? void 0 : _.period, 1) ?? "-"), this.hoursTableData.currentSpeed.push(this.roundPrecision((w = p.current) == null ? void 0 : w.speed, 1) ?? "-"), this.hoursTableData.currentDir.push((P = p.current) == null ? void 0 : P.bearing), this.hoursTableData.seaLevel.push(this.roundPrecision(p.height, 1) ?? "-"), this.hoursTableData.seaTemp.push(this.roundPrecision(p.sst, 0) ?? "-");
|
|
@@ -1952,18 +1954,18 @@ const Ne = (h, e) => {
|
|
|
1952
1954
|
this.loading.hoursTable = !1;
|
|
1953
1955
|
},
|
|
1954
1956
|
handleClearHoursTable() {
|
|
1955
|
-
this.position = {}, this.meteoData = {}, this.isCollected = !1,
|
|
1957
|
+
this.position = {}, this.meteoData = {}, this.isCollected = !1, Be && document.getElementById("weather-chart") && Be.dispose(document.getElementById("weather-chart"));
|
|
1956
1958
|
},
|
|
1957
1959
|
initDaysTableData() {
|
|
1958
|
-
var e, t, n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p,
|
|
1960
|
+
var e, t, n, s, C, L, H, Q, E, b, M, O, v, k, j, Y, x, z, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, p, ae;
|
|
1959
1961
|
this.daysTableData = [];
|
|
1960
|
-
const h =
|
|
1961
|
-
for (let
|
|
1962
|
-
const
|
|
1962
|
+
const h = ce().startOf("day");
|
|
1963
|
+
for (let te = 0; te < 14; te++) {
|
|
1964
|
+
const se = h.clone().add(te, "d").format(), r = ((e = Ie.pickDaily(this.meteoData, se)) == null ? void 0 : e[0]) || {};
|
|
1963
1965
|
console.log(r), this.daysTableData.push(
|
|
1964
1966
|
{
|
|
1965
|
-
localWeek: this.computeWeekLT(
|
|
1966
|
-
localDate: this.computeMMMDDLT(
|
|
1967
|
+
localWeek: this.computeWeekLT(se),
|
|
1968
|
+
localDate: this.computeMMMDDLT(se),
|
|
1967
1969
|
weatherUrl: (t = r == null ? void 0 : r.weather) == null ? void 0 : t.url,
|
|
1968
1970
|
minTemp: this.roundPrecision((s = (n = r == null ? void 0 : r.weather) == null ? void 0 : n.temp) == null ? void 0 : s.min, 0) ?? "-",
|
|
1969
1971
|
maxTemp: this.roundPrecision((L = (C = r == null ? void 0 : r.weather) == null ? void 0 : C.temp) == null ? void 0 : L.max, 0) ?? "-",
|
|
@@ -1982,7 +1984,7 @@ const Ne = (h, e) => {
|
|
|
1982
1984
|
swellWaveDir: (_ = (Z = r == null ? void 0 : r.wave) == null ? void 0 : Z.swell) == null ? void 0 : _.bearing,
|
|
1983
1985
|
sigWaveHeight: this.roundPrecision((P = (w = r == null ? void 0 : r.wave) == null ? void 0 : w.sig) == null ? void 0 : P.height, 1) ?? "-",
|
|
1984
1986
|
sigWavePeriod: this.roundPrecision((y = (I = r == null ? void 0 : r.wave) == null ? void 0 : I.sig) == null ? void 0 : y.period, 1) ?? "-",
|
|
1985
|
-
sigWaveDir: (
|
|
1987
|
+
sigWaveDir: (ae = (p = r == null ? void 0 : r.wave) == null ? void 0 : p.sig) == null ? void 0 : ae.bearing
|
|
1986
1988
|
}
|
|
1987
1989
|
);
|
|
1988
1990
|
}
|
|
@@ -2346,7 +2348,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2346
2348
|
isNaN(a) ? (i(), o("span", mt, "-")) : (i(), o("span", {
|
|
2347
2349
|
key: 0,
|
|
2348
2350
|
class: "iconfont icon",
|
|
2349
|
-
style:
|
|
2351
|
+
style: fe({ display: "inline-block", transform: `rotate(${a}deg)` })
|
|
2350
2352
|
}, "", 4))
|
|
2351
2353
|
], 2))), 128))
|
|
2352
2354
|
]),
|
|
@@ -2419,7 +2421,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2419
2421
|
isNaN(a) ? (i(), o("span", Dt, "-")) : (i(), o("span", {
|
|
2420
2422
|
key: 0,
|
|
2421
2423
|
class: "iconfont icon",
|
|
2422
|
-
style:
|
|
2424
|
+
style: fe({ display: "inline-block", transform: `rotate(${a}deg)` })
|
|
2423
2425
|
}, "", 4))
|
|
2424
2426
|
], 2))), 128))
|
|
2425
2427
|
]),
|
|
@@ -2473,7 +2475,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2473
2475
|
isNaN(a) ? (i(), o("span", yt, "-")) : (i(), o("span", {
|
|
2474
2476
|
key: 0,
|
|
2475
2477
|
class: "iconfont icon",
|
|
2476
|
-
style:
|
|
2478
|
+
style: fe({ display: "inline-block", transform: `rotate(${a}deg)` })
|
|
2477
2479
|
}, "", 4))
|
|
2478
2480
|
], 2))), 128))
|
|
2479
2481
|
]),
|
|
@@ -2527,7 +2529,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2527
2529
|
isNaN(a) ? (i(), o("span", Mt, "-")) : (i(), o("span", {
|
|
2528
2530
|
key: 0,
|
|
2529
2531
|
class: "iconfont icon",
|
|
2530
|
-
style:
|
|
2532
|
+
style: fe({ display: "inline-block", transform: `rotate(${a}deg)` })
|
|
2531
2533
|
}, "", 4))
|
|
2532
2534
|
], 2))), 128))
|
|
2533
2535
|
]),
|
|
@@ -2726,7 +2728,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2726
2728
|
isNaN(a.windSpeedDir) ? (i(), o("span", Wt, "-")) : (i(), o("span", {
|
|
2727
2729
|
key: 0,
|
|
2728
2730
|
class: "iconfont icon",
|
|
2729
|
-
style:
|
|
2731
|
+
style: fe({ display: "inline-block", transform: `rotate(${a.windSpeedDir}deg)` })
|
|
2730
2732
|
}, "", 4))
|
|
2731
2733
|
]),
|
|
2732
2734
|
A("td", qt, [
|
|
@@ -2739,7 +2741,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2739
2741
|
isNaN(a.windWaveDir) ? (i(), o("span", Zt, "-")) : (i(), o("span", {
|
|
2740
2742
|
key: 0,
|
|
2741
2743
|
class: "iconfont icon",
|
|
2742
|
-
style:
|
|
2744
|
+
style: fe({ display: "inline-block", transform: `rotate(${a.windWaveDir}deg)` })
|
|
2743
2745
|
}, "", 4))
|
|
2744
2746
|
]),
|
|
2745
2747
|
A("td", _t, [
|
|
@@ -2748,7 +2750,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2748
2750
|
isNaN(a.swellWaveDir) ? (i(), o("span", $t, "-")) : (i(), o("span", {
|
|
2749
2751
|
key: 0,
|
|
2750
2752
|
class: "iconfont icon",
|
|
2751
|
-
style:
|
|
2753
|
+
style: fe({ display: "inline-block", transform: `rotate(${a.swellWaveDir}deg)` })
|
|
2752
2754
|
}, "", 4))
|
|
2753
2755
|
]),
|
|
2754
2756
|
A("td", es, [
|
|
@@ -2757,7 +2759,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2757
2759
|
isNaN(a.sigWaveDir) ? (i(), o("span", ts, "-")) : (i(), o("span", {
|
|
2758
2760
|
key: 0,
|
|
2759
2761
|
class: "iconfont icon",
|
|
2760
|
-
style:
|
|
2762
|
+
style: fe({ display: "inline-block", transform: `rotate(${a.sigWaveDir}deg)` })
|
|
2761
2763
|
}, "", 4))
|
|
2762
2764
|
])
|
|
2763
2765
|
]))), 128))
|
|
@@ -2772,7 +2774,7 @@ function as(h, e, t, n, s, C) {
|
|
|
2772
2774
|
])
|
|
2773
2775
|
]);
|
|
2774
2776
|
}
|
|
2775
|
-
const is = /* @__PURE__ */ Ne(Ge, [["render", as], ["__scopeId", "data-v-
|
|
2777
|
+
const is = /* @__PURE__ */ Ne(Ge, [["render", as], ["__scopeId", "data-v-5b0a40d2"]]), ds = {
|
|
2776
2778
|
install(h) {
|
|
2777
2779
|
h.component("SpotReport", is);
|
|
2778
2780
|
}
|