@idmui/spot 0.1.3 → 0.1.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/Spot/src/index.vue.d.ts +1 -0
- package/dist/index.js +75 -75
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,39 +3,39 @@ import X from "moment-timezone";
|
|
|
3
3
|
import { Search as be } from "@element-plus/icons-vue";
|
|
4
4
|
import { LngLatHelper as re } from "@idm-plugin/geo";
|
|
5
5
|
import * as ge from "echarts";
|
|
6
|
-
import { markRaw as ke, resolveComponent as le, openBlock as n, createElementBlock as o, createElementVNode as i, createVNode as
|
|
6
|
+
import { markRaw as ke, resolveComponent as le, openBlock as n, createElementBlock as o, createElementVNode as i, createVNode as he, withCtx as de, Fragment as f, renderList as y, createBlock as De, toDisplayString as x, createCommentVNode as ce, createTextVNode as _, normalizeClass as b, normalizeStyle as ie } from "vue";
|
|
7
7
|
import ve from "axios";
|
|
8
8
|
class fe {
|
|
9
9
|
static pickHourly(e, t) {
|
|
10
|
-
var
|
|
10
|
+
var h, s, v, M, C, S, L, N, I, P, H, a, r, q, z, T, R, A, E, G, F, B, V, O, U, J, Z, Y, w, D, m, k, W, u, Q, p, $, g, se, ae;
|
|
11
11
|
const ue = typeof t == "string" ? K(t) : t, te = e.weather, pe = e.marine, me = K(te[0].hourly.date).utc(), ne = me.clone().add(te[0].hourly.time.at(0), "h"), ye = me.clone().add(te[0].hourly.time.at(-1), "h"), we = [];
|
|
12
12
|
if (ue.isBetween(ne, ye, "millisecond", "[]")) {
|
|
13
|
-
const
|
|
13
|
+
const d = ue.utc().diff(ne, "h", !1);
|
|
14
14
|
let j, ee;
|
|
15
15
|
if (te)
|
|
16
16
|
for (const oe of te) {
|
|
17
17
|
const c = oe.hourly;
|
|
18
18
|
j = {
|
|
19
|
-
temp: (
|
|
20
|
-
apparentTemp: (s = c.apparent_temperature) == null ? void 0 : s.at(
|
|
21
|
-
rh: (v = c.relative_humidity_2m) == null ? void 0 : v.at(
|
|
22
|
-
dp: (M = c.dew_point_2m) == null ? void 0 : M.at(
|
|
19
|
+
temp: (h = c.temperature_2m) == null ? void 0 : h.at(d),
|
|
20
|
+
apparentTemp: (s = c.apparent_temperature) == null ? void 0 : s.at(d),
|
|
21
|
+
rh: (v = c.relative_humidity_2m) == null ? void 0 : v.at(d),
|
|
22
|
+
dp: (M = c.dew_point_2m) == null ? void 0 : M.at(d),
|
|
23
23
|
precip: {
|
|
24
|
-
probability: (C = c.precipitation_probability) == null ? void 0 : C.at(
|
|
25
|
-
sum: (S = c.precipitation) == null ? void 0 : S.at(
|
|
24
|
+
probability: (C = c.precipitation_probability) == null ? void 0 : C.at(d),
|
|
25
|
+
sum: (S = c.precipitation) == null ? void 0 : S.at(d)
|
|
26
26
|
},
|
|
27
|
-
pmsl: (L = c.pressure_msl) == null ? void 0 : L.at(
|
|
28
|
-
psurf: (N = c.surface_pressure) == null ? void 0 : N.at(
|
|
29
|
-
code: (I = c.weather_code) == null ? void 0 : I.at(
|
|
30
|
-
visibility: this.m2nm((P = c.visibility) == null ? void 0 : P.at(
|
|
27
|
+
pmsl: (L = c.pressure_msl) == null ? void 0 : L.at(d),
|
|
28
|
+
psurf: (N = c.surface_pressure) == null ? void 0 : N.at(d),
|
|
29
|
+
code: (I = c.weather_code) == null ? void 0 : I.at(d),
|
|
30
|
+
visibility: this.m2nm((P = c.visibility) == null ? void 0 : P.at(d)),
|
|
31
31
|
wind: {
|
|
32
|
-
speed: (H = c.wind_speed_10m) == null ? void 0 : H.at(
|
|
33
|
-
kts: (a = c.wind_speed_10m) == null ? void 0 : a.at(
|
|
34
|
-
degree: (r = c.wind_direction_10m) == null ? void 0 : r.at(
|
|
35
|
-
bearing: ((q = c.wind_direction_10m) == null ? void 0 : q.at(
|
|
36
|
-
gusts: (T = c.wind_gusts_10m) == null ? void 0 : T.at(
|
|
32
|
+
speed: (H = c.wind_speed_10m) == null ? void 0 : H.at(d),
|
|
33
|
+
kts: (a = c.wind_speed_10m) == null ? void 0 : a.at(d),
|
|
34
|
+
degree: (r = c.wind_direction_10m) == null ? void 0 : r.at(d),
|
|
35
|
+
bearing: ((q = c.wind_direction_10m) == null ? void 0 : q.at(d)) !== null ? (((z = c.wind_direction_10m) == null ? void 0 : z.at(d)) + 180) % 360 : null,
|
|
36
|
+
gusts: (T = c.wind_gusts_10m) == null ? void 0 : T.at(d)
|
|
37
37
|
},
|
|
38
|
-
isDay: (R = c.is_day) == null ? void 0 : R.at(
|
|
38
|
+
isDay: (R = c.is_day) == null ? void 0 : R.at(d)
|
|
39
39
|
};
|
|
40
40
|
const { name: xe, url: _e } = this.parseWeatherCode(j.code, j.isDay);
|
|
41
41
|
j.name = xe, j.url = _e, j.wind.scale = this.beaufort(this.kts2ms(j.wind.kts)), j.wind.direction = this.degree2Direction(j.wind.degree);
|
|
@@ -46,38 +46,38 @@ class fe {
|
|
|
46
46
|
ee = {
|
|
47
47
|
wave: {
|
|
48
48
|
sig: {
|
|
49
|
-
height: (A = c.wave_height) == null ? void 0 : A.at(
|
|
50
|
-
degree: (E = c.wave_direction) == null ? void 0 : E.at(
|
|
51
|
-
bearing: ((G = c.wave_direction) == null ? void 0 : G.at(
|
|
52
|
-
period: (B = c.wave_period) == null ? void 0 : B.at(
|
|
49
|
+
height: (A = c.wave_height) == null ? void 0 : A.at(d),
|
|
50
|
+
degree: (E = c.wave_direction) == null ? void 0 : E.at(d),
|
|
51
|
+
bearing: ((G = c.wave_direction) == null ? void 0 : G.at(d)) !== null ? (((F = c.wave_direction) == null ? void 0 : F.at(d)) + 180) % 360 : null,
|
|
52
|
+
period: (B = c.wave_period) == null ? void 0 : B.at(d)
|
|
53
53
|
},
|
|
54
54
|
swell: {
|
|
55
|
-
height: (V = c.swell_wave_height) == null ? void 0 : V.at(
|
|
56
|
-
degree: (O = c.swell_wave_direction) == null ? void 0 : O.at(
|
|
57
|
-
bearing: ((U = c.swell_wave_direction) == null ? void 0 : U.at(
|
|
58
|
-
period: (Z = c.swell_wave_period) == null ? void 0 : Z.at(
|
|
59
|
-
peakPeriod: (Y = c.swell_wave_peak_period) == null ? void 0 : Y.at(
|
|
55
|
+
height: (V = c.swell_wave_height) == null ? void 0 : V.at(d),
|
|
56
|
+
degree: (O = c.swell_wave_direction) == null ? void 0 : O.at(d),
|
|
57
|
+
bearing: ((U = c.swell_wave_direction) == null ? void 0 : U.at(d)) !== null ? (((J = c.swell_wave_direction) == null ? void 0 : J.at(d)) + 180) % 360 : null,
|
|
58
|
+
period: (Z = c.swell_wave_period) == null ? void 0 : Z.at(d),
|
|
59
|
+
peakPeriod: (Y = c.swell_wave_peak_period) == null ? void 0 : Y.at(d)
|
|
60
60
|
},
|
|
61
61
|
wd: {
|
|
62
|
-
height: (w = c.wind_wave_height) == null ? void 0 : w.at(
|
|
63
|
-
degree: (D = c.wind_wave_direction) == null ? void 0 : D.at(
|
|
64
|
-
bearing: ((m = c.wind_wave_direction) == null ? void 0 : m.at(
|
|
65
|
-
period: (W = c.wind_wave_period) == null ? void 0 : W.at(
|
|
66
|
-
peakPeriod: (u = c.wind_wave_peak_period) == null ? void 0 : u.at(
|
|
62
|
+
height: (w = c.wind_wave_height) == null ? void 0 : w.at(d),
|
|
63
|
+
degree: (D = c.wind_wave_direction) == null ? void 0 : D.at(d),
|
|
64
|
+
bearing: ((m = c.wind_wave_direction) == null ? void 0 : m.at(d)) !== null ? (((k = c.wind_wave_direction) == null ? void 0 : k.at(d)) + 180) % 360 : null,
|
|
65
|
+
period: (W = c.wind_wave_period) == null ? void 0 : W.at(d),
|
|
66
|
+
peakPeriod: (u = c.wind_wave_peak_period) == null ? void 0 : u.at(d)
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
current: {
|
|
70
|
-
speed: (Q = c.ocean_current_velocity) == null ? void 0 : Q.at(
|
|
71
|
-
kts: (p = c.ocean_current_velocity) == null ? void 0 : p.at(
|
|
72
|
-
degree: ($ = c.ocean_current_direction) == null ? void 0 : $.at(
|
|
73
|
-
bearing: ((g = c.ocean_current_direction) == null ? void 0 : g.at(
|
|
70
|
+
speed: (Q = c.ocean_current_velocity) == null ? void 0 : Q.at(d),
|
|
71
|
+
kts: (p = c.ocean_current_velocity) == null ? void 0 : p.at(d),
|
|
72
|
+
degree: ($ = c.ocean_current_direction) == null ? void 0 : $.at(d),
|
|
73
|
+
bearing: ((g = c.ocean_current_direction) == null ? void 0 : g.at(d)) ?? null
|
|
74
74
|
},
|
|
75
|
-
sst: (se = c.sea_surface_temperature) == null ? void 0 : se.at(
|
|
76
|
-
height: (ae = c.sea_level_height_msl) == null ? void 0 : ae.at(
|
|
75
|
+
sst: (se = c.sea_surface_temperature) == null ? void 0 : se.at(d),
|
|
76
|
+
height: (ae = c.sea_level_height_msl) == null ? void 0 : ae.at(d)
|
|
77
77
|
}, ee.wave = this.parseWave(ee.wave), ee.current.direction = this.degree2Direction(ee.current.degree);
|
|
78
78
|
}
|
|
79
79
|
we.push({
|
|
80
|
-
utc: ne.add(
|
|
80
|
+
utc: ne.add(d, "h").format(),
|
|
81
81
|
weather: { ...j },
|
|
82
82
|
...ee
|
|
83
83
|
});
|
|
@@ -105,7 +105,7 @@ class fe {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
static pickDaily(e, t) {
|
|
108
|
-
var
|
|
108
|
+
var h, s, v, M, C, S, L, N, I, P, H, a, r, q, z, T, R, A, E, G, F, B, V, O, U, J, Z;
|
|
109
109
|
const Y = typeof t == "string" ? K(t) : t, w = e.weather, D = e.marine, m = K(w[0].daily.time.at(0)), k = K(w[0].daily.time.at(-1)), W = [];
|
|
110
110
|
if (Y.isBetween(m, k, "millisecond", "[]")) {
|
|
111
111
|
let u, Q;
|
|
@@ -114,7 +114,7 @@ class fe {
|
|
|
114
114
|
for (const $ of w) {
|
|
115
115
|
const g = $.daily;
|
|
116
116
|
u = {
|
|
117
|
-
code: (
|
|
117
|
+
code: (h = g.weather_code) == null ? void 0 : h.at(p),
|
|
118
118
|
temp: {
|
|
119
119
|
max: (s = g.temperature_2m_max) == null ? void 0 : s.at(p),
|
|
120
120
|
min: (v = g.temperature_2m_min) == null ? void 0 : v.at(p),
|
|
@@ -181,8 +181,8 @@ class fe {
|
|
|
181
181
|
return e.sig.direction = this.degree2Direction(e.sig.degree), e.swell.direction = this.degree2Direction(e.swell.degree), e.wd.direction = this.degree2Direction(e.wd.degree), e.sig.scale = this.douglas(e.sig.height), e.swell.scale = this.douglas(e.swell.height), e.wd.scale = this.douglas(e.wd.height), e;
|
|
182
182
|
}
|
|
183
183
|
static parseWeatherCode(e, t) {
|
|
184
|
-
const
|
|
185
|
-
return (t ?
|
|
184
|
+
const h = this.weatherCode(e);
|
|
185
|
+
return (t ? h.day : h.night) || {};
|
|
186
186
|
}
|
|
187
187
|
static weatherCode(e) {
|
|
188
188
|
const t = {
|
|
@@ -478,9 +478,9 @@ class fe {
|
|
|
478
478
|
const t = this.degree2Radian(e);
|
|
479
479
|
if (isNaN(t) || t === null)
|
|
480
480
|
return null;
|
|
481
|
-
let
|
|
481
|
+
let h = "N/A";
|
|
482
482
|
const s = Math.PI / 16;
|
|
483
|
-
return t < s ?
|
|
483
|
+
return t < s ? h = "N" : t >= s && t < 3 * s ? h = "NNE" : t >= 3 * s && t < 5 * s ? h = "NE" : t >= 5 * s && t < 7 * s ? h = "ENE" : t >= 7 * s && t < 9 * s ? h = "E" : t >= 9 * s && t < 11 * s ? h = "ESE" : t >= 11 * s && t < 13 * s ? h = "SE" : t >= 13 * s && t < 15 * s ? h = "SSE" : t >= 15 * s && t < 17 * s ? h = "S" : t >= 17 * s && t < 19 * s ? h = "SSW" : t >= 19 * s && t < 21 * s ? h = "SW" : t >= 21 * s && t < 23 * s ? h = "WSW" : t >= 23 * s && t < 25 * s ? h = "W" : t >= 25 * s && t < 27 * s ? h = "WNW" : t >= 27 * s && t < 29 * s ? h = "NW" : t >= 29 * s && t < 31 * s ? h = "NNW" : t >= 31 * s && t < 32 * s && (h = "N"), h;
|
|
484
484
|
}
|
|
485
485
|
/**
|
|
486
486
|
* 计算风力蒲福等级
|
|
@@ -502,12 +502,11 @@ class fe {
|
|
|
502
502
|
}
|
|
503
503
|
const ze = (l, e) => {
|
|
504
504
|
const t = l.__vccOpts || l;
|
|
505
|
-
for (const [
|
|
506
|
-
t[
|
|
505
|
+
for (const [h, s] of e)
|
|
506
|
+
t[h] = s;
|
|
507
507
|
return t;
|
|
508
508
|
}, Se = {
|
|
509
509
|
name: "SpotReport",
|
|
510
|
-
// components: { Search }, //Download
|
|
511
510
|
props: {
|
|
512
511
|
token: {
|
|
513
512
|
type: String,
|
|
@@ -526,6 +525,7 @@ const ze = (l, e) => {
|
|
|
526
525
|
default: () => ({})
|
|
527
526
|
}
|
|
528
527
|
},
|
|
528
|
+
emits: ["url"],
|
|
529
529
|
data() {
|
|
530
530
|
return {
|
|
531
531
|
placeholder: "search for port name or coordinates",
|
|
@@ -586,12 +586,12 @@ const ze = (l, e) => {
|
|
|
586
586
|
watch: {
|
|
587
587
|
"report.version": {
|
|
588
588
|
handler() {
|
|
589
|
-
var l, e;
|
|
589
|
+
var l, e, t;
|
|
590
590
|
this.report && (this.meteoData = this.report, this.position = {
|
|
591
591
|
id: this.report.portId,
|
|
592
592
|
lat: (l = this.report) == null ? void 0 : l.lat,
|
|
593
593
|
lng: (e = this.report) == null ? void 0 : e.lng,
|
|
594
|
-
name: this.computeLat(this.report.lat) + "," + this.computeLng(this.report.lng)
|
|
594
|
+
name: ((t = this.report) == null ? void 0 : t.searchName) || this.computeLat(this.report.lat) + "," + this.computeLng(this.report.lng)
|
|
595
595
|
}, this.handleRender());
|
|
596
596
|
}
|
|
597
597
|
}
|
|
@@ -605,12 +605,12 @@ const ze = (l, e) => {
|
|
|
605
605
|
initInfo() {
|
|
606
606
|
var l, e;
|
|
607
607
|
this.loading = !1, this.positionGmt = (e = (l = this.meteoData.weather) == null ? void 0 : l[0]) == null ? void 0 : e.timezone, this.issuedDate = K(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = X(this.ts).tz(this.positionGmt).hour(), this.pickedDate = X(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((t) => {
|
|
608
|
-
var
|
|
609
|
-
return t.name === ((
|
|
608
|
+
var h;
|
|
609
|
+
return t.name === ((h = this.position) == null ? void 0 : h.name);
|
|
610
610
|
});
|
|
611
611
|
},
|
|
612
612
|
initTableData() {
|
|
613
|
-
var l, e, t,
|
|
613
|
+
var l, e, t, h, s, v, M, C, S, L, N, I, P, H, a, r, q, z, T, R, A, E, G, F, B, V, O, U, J, Z, Y, w, D, m;
|
|
614
614
|
this.tableData = {
|
|
615
615
|
hours: [],
|
|
616
616
|
utcHours: [],
|
|
@@ -641,19 +641,19 @@ const ze = (l, e) => {
|
|
|
641
641
|
const W = K(this.pickedDate).clone().add(k, "h").format();
|
|
642
642
|
this.tableData.hours.push(W);
|
|
643
643
|
const u = ((l = fe.pickHourly(this.meteoData, W)) == null ? void 0 : l[0]) || {};
|
|
644
|
-
this.tableData.weatherUrls.push((e = u.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = u.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((
|
|
644
|
+
this.tableData.weatherUrls.push((e = u.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = u.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((h = u.weather) == null ? void 0 : h.temp, 0) ?? "-"), this.tableData.precipProbability.push(this.roundPrecision((v = (s = u.weather) == null ? void 0 : s.precip) == null ? void 0 : v.probability, 0) ?? "-"), this.tableData.precip1h.push(this.roundPrecision((C = (M = u.weather) == null ? void 0 : M.precip) == null ? void 0 : C.sum, 0) ?? "-"), this.tableData.visibility.push(this.roundPrecision((S = u.weather) == null ? void 0 : S.visibility, 0) ?? "-"), this.tableData.humidity.push(this.roundPrecision((L = u.weather) == null ? void 0 : L.rh, 0) ?? "-"), this.tableData.windSpeed.push(this.roundPrecision((I = (N = u.weather) == null ? void 0 : N.wind) == null ? void 0 : I.kts, 1)), this.tableData.windDir.push((H = (P = u.weather) == null ? void 0 : P.wind) == null ? void 0 : H.bearing), this.tableData.windGust.push(this.roundPrecision((r = (a = u.weather) == null ? void 0 : a.wind) == null ? void 0 : r.gusts, 1) ?? "-"), this.tableData.sigwaveHeight.push(this.roundPrecision((z = (q = u.wave) == null ? void 0 : q.sig) == null ? void 0 : z.height, 1) ?? "-"), this.tableData.sigwaveDir.push((R = (T = u.wave) == null ? void 0 : T.sig) == null ? void 0 : R.bearing), this.tableData.windwaveHeight.push(this.roundPrecision((E = (A = u.wave) == null ? void 0 : A.wd) == null ? void 0 : E.height, 1) ?? "-"), this.tableData.windwaveDir.push((F = (G = u.wave) == null ? void 0 : G.wd) == null ? void 0 : F.bearing), this.tableData.windwavePeriod.push(this.roundPrecision((V = (B = u.wave) == null ? void 0 : B.wd) == null ? void 0 : V.period, 1) ?? "-"), this.tableData.swellHeight.push(this.roundPrecision((U = (O = u.wave) == null ? void 0 : O.swell) == null ? void 0 : U.height, 1) ?? "-"), this.tableData.swellDir.push((Z = (J = u.wave) == null ? void 0 : J.swell) == null ? void 0 : Z.bearing), this.tableData.swellPeriod.push(this.roundPrecision((w = (Y = u.wave) == null ? void 0 : Y.swell) == null ? void 0 : w.period, 1) ?? "-"), this.tableData.currentSpeed.push(this.roundPrecision((D = u.current) == null ? void 0 : D.speed, 1) ?? "-"), this.tableData.currentDir.push((m = u.current) == null ? void 0 : m.bearing), this.tableData.seaLevel.push(this.roundPrecision(u.height, 1) ?? "-"), this.tableData.seaTemp.push(this.roundPrecision(u.sst, 0) ?? "-");
|
|
645
645
|
}
|
|
646
646
|
},
|
|
647
647
|
initEchart() {
|
|
648
648
|
var T, R, A, E, G, F, B, V, O, U, J, Z, Y;
|
|
649
|
-
const l = [], e = [], t = [],
|
|
649
|
+
const l = [], e = [], t = [], h = [], s = [], v = [], M = [], C = [], S = [], L = [], N = {};
|
|
650
650
|
for (let w = 0; w < 7; w++) {
|
|
651
651
|
const D = K(this.pickedDate).clone().add(w, "d");
|
|
652
652
|
l.push(X(D).tz(this.positionGmt).format("yyyy-MM-DD")), e.push(this.computeMMMDD(D)), t.push(w === 0 ? "Today" : this.computeWeek(D));
|
|
653
653
|
const m = ((T = fe.pickDaily(this.meteoData, D)) == null ? void 0 : T[0]) || {};
|
|
654
|
-
|
|
654
|
+
h.push(this.roundPrecision((A = (R = m.weather) == null ? void 0 : R.temp) == null ? void 0 : A.min, 0)), s.push(this.roundPrecision((G = (E = m.weather) == null ? void 0 : E.temp) == null ? void 0 : G.max, 0)), C.push(this.roundPrecision((B = (F = m.weather) == null ? void 0 : F.wind) == null ? void 0 : B.kts, 1) ?? "- kts"), L.push(this.roundPrecision((O = (V = m.weather) == null ? void 0 : V.precip) == null ? void 0 : O.sum, 0) ?? "- mm"), v.push({ symbol: "image://" + ((U = m.weather) == null ? void 0 : U.url) }), M.push((J = m.weather) == null ? void 0 : J.name), S.push((Y = (Z = m.weather) == null ? void 0 : Z.wind) == null ? void 0 : Y.degree);
|
|
655
655
|
}
|
|
656
|
-
const I = Math.max(...s.filter((w) => typeof w == "number" && !isNaN(w))) - Math.min(...
|
|
656
|
+
const I = Math.max(...s.filter((w) => typeof w == "number" && !isNaN(w))) - Math.min(...h.filter((w) => typeof w == "number" && !isNaN(w))), P = Math.min(...h.filter((w) => typeof w == "number" && !isNaN(w))) - 1.5 * I, H = Math.max(...s.filter((w) => typeof w == "number" && !isNaN(w))) + 2 * I, a = 4 + 0.5 / l.length * 92 + "%", r = "data:image/svg+xml;base64," + window.btoa(
|
|
657
657
|
unescape(
|
|
658
658
|
encodeURIComponent(
|
|
659
659
|
'<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'
|
|
@@ -888,7 +888,7 @@ const ze = (l, e) => {
|
|
|
888
888
|
{
|
|
889
889
|
name: "温度(℃)",
|
|
890
890
|
type: "line",
|
|
891
|
-
data:
|
|
891
|
+
data: h,
|
|
892
892
|
smooth: !0,
|
|
893
893
|
itemStyle: {
|
|
894
894
|
color: "rgba(255,255,255,0.7)"
|
|
@@ -1009,7 +1009,7 @@ const ze = (l, e) => {
|
|
|
1009
1009
|
this.isCollected = !this.isCollected, this.isCollected ? this.collectList.push({ name: this.position.name, lat: this.position.lat, lng: this.position.lng }) : this.collectList = this.collectList.filter((l) => l.name !== this.position.name), localStorage.setItem("idmCollectList", JSON.stringify(this.collectList));
|
|
1010
1010
|
},
|
|
1011
1011
|
async fetchSuggestPosition(l) {
|
|
1012
|
-
var
|
|
1012
|
+
var h;
|
|
1013
1013
|
const e = l.replaceAll(",", ",");
|
|
1014
1014
|
if (!e)
|
|
1015
1015
|
return this.positionList = this.collectList, !1;
|
|
@@ -1018,18 +1018,18 @@ const ze = (l, e) => {
|
|
|
1018
1018
|
Authorization: this.token
|
|
1019
1019
|
}
|
|
1020
1020
|
});
|
|
1021
|
-
(t == null ? void 0 : t.data.code) === 0 && (this.positionList = (
|
|
1021
|
+
(t == null ? void 0 : t.data.code) === 0 && (this.positionList = (h = t == null ? void 0 : t.data.data) == null ? void 0 : h.map((s) => (s.name = s.id ? s.name : this.computeLat(s.lat) + ", " + this.computeLng(s.lng), s)));
|
|
1022
1022
|
},
|
|
1023
1023
|
async handleFetchMeteo() {
|
|
1024
|
-
var t,
|
|
1024
|
+
var t, h, s;
|
|
1025
1025
|
if (!this.searchName)
|
|
1026
1026
|
return !1;
|
|
1027
1027
|
this.position = {
|
|
1028
1028
|
portId: (t = this.positionList.find((v) => v.name === this.searchName)) == null ? void 0 : t.id,
|
|
1029
|
-
lat: (
|
|
1029
|
+
lat: (h = this.positionList.find((v) => v.name === this.searchName)) == null ? void 0 : h.lat,
|
|
1030
1030
|
lng: (s = this.positionList.find((v) => v.name === this.searchName)) == null ? void 0 : s.lng,
|
|
1031
1031
|
name: this.searchName
|
|
1032
|
-
}, this.handleClear();
|
|
1032
|
+
}, this.$emit("url", this.position), this.handleClear();
|
|
1033
1033
|
const l = {
|
|
1034
1034
|
lat: this.position.lat,
|
|
1035
1035
|
lng: this.position.lng,
|
|
@@ -1061,21 +1061,21 @@ const ze = (l, e) => {
|
|
|
1061
1061
|
}, Ge = {
|
|
1062
1062
|
key: 3,
|
|
1063
1063
|
class: "card-box"
|
|
1064
|
-
}, Fe = { class: "date" }, Be = { class: "basic-table" }, Ve = { class: "day" }, Oe = { class: "hour" }, Ue = { class: "icon" }, Je = ["src"], Ze = { class: "text" }, Ye = { class: "text" }, qe = { class: "text" }, je = { class: "text" }, Ke = { class: "text" }, Qe = { class: "text" }, Xe = { key: 1 }, $e = { class: "text" }, et = { class: "text" }, tt = { class: "wave-current-table" }, st = { class: "text" }, at = { class: "text" }, it = { key: 1 }, nt = { class: "text" }, ot = { class: "text" }, rt = { class: "text" }, lt = { key: 1 },
|
|
1064
|
+
}, Fe = { class: "date" }, Be = { class: "basic-table" }, Ve = { class: "day" }, Oe = { class: "hour" }, Ue = { class: "icon" }, Je = ["src"], Ze = { class: "text" }, Ye = { class: "text" }, qe = { class: "text" }, je = { class: "text" }, Ke = { class: "text" }, Qe = { class: "text" }, Xe = { key: 1 }, $e = { class: "text" }, et = { class: "text" }, tt = { class: "wave-current-table" }, st = { class: "text" }, at = { class: "text" }, it = { key: 1 }, nt = { class: "text" }, ot = { class: "text" }, rt = { class: "text" }, lt = { key: 1 }, ht = { class: "text" }, dt = { class: "text" }, ct = { class: "text" }, ut = { key: 1 }, pt = { class: "text" }, mt = { class: "sea-table" }, wt = { class: "text" }, gt = { class: "text" }, vt = {
|
|
1065
1065
|
key: 4,
|
|
1066
1066
|
class: "card-box flex-center"
|
|
1067
1067
|
}, ft = {
|
|
1068
1068
|
key: 5,
|
|
1069
1069
|
class: "card-box flex-center"
|
|
1070
1070
|
};
|
|
1071
|
-
function yt(l, e, t,
|
|
1071
|
+
function yt(l, e, t, h, s, v) {
|
|
1072
1072
|
var L, N, I, P, H;
|
|
1073
1073
|
const M = le("ElOption"), C = le("ElSelect"), S = le("ElTooltip");
|
|
1074
1074
|
return n(), o("div", Le, [
|
|
1075
1075
|
i("div", Ne, [
|
|
1076
1076
|
i("div", Ie, [
|
|
1077
1077
|
i("div", Me, [
|
|
1078
|
-
|
|
1078
|
+
he(C, {
|
|
1079
1079
|
modelValue: s.searchName,
|
|
1080
1080
|
"onUpdate:modelValue": e[0] || (e[0] = (a) => s.searchName = a),
|
|
1081
1081
|
filterable: "",
|
|
@@ -1090,7 +1090,7 @@ function yt(l, e, t, d, s, v) {
|
|
|
1090
1090
|
"remote-method": v.fetchSuggestPosition,
|
|
1091
1091
|
onChange: v.handleFetchMeteo
|
|
1092
1092
|
}, {
|
|
1093
|
-
default:
|
|
1093
|
+
default: de(() => [
|
|
1094
1094
|
(n(!0), o(f, null, y(s.positionList, (a) => (n(), De(M, {
|
|
1095
1095
|
key: a.name,
|
|
1096
1096
|
label: a.name,
|
|
@@ -1109,13 +1109,13 @@ function yt(l, e, t, d, s, v) {
|
|
|
1109
1109
|
i("div", We, "At " + x((N = s.position) != null && N.portId ? "port" : "coordinates") + ", issued " + x(s.issuedDate), 1)
|
|
1110
1110
|
]),
|
|
1111
1111
|
i("div", Te, [
|
|
1112
|
-
|
|
1112
|
+
he(S, {
|
|
1113
1113
|
placement: "left",
|
|
1114
1114
|
effect: "light",
|
|
1115
1115
|
content: s.isCollected ? "remove the port/coordinate from the search list" : "add the port/coordinate to the search list",
|
|
1116
1116
|
"show-after": 1e3
|
|
1117
1117
|
}, {
|
|
1118
|
-
default:
|
|
1118
|
+
default: de(() => [
|
|
1119
1119
|
s.isCollected ? (n(), o("span", {
|
|
1120
1120
|
key: 0,
|
|
1121
1121
|
class: "iconfont icon active",
|
|
@@ -1181,13 +1181,13 @@ function yt(l, e, t, d, s, v) {
|
|
|
1181
1181
|
class: b(s.activeIndex === r ? "active" : ""),
|
|
1182
1182
|
key: Math.random() + "url"
|
|
1183
1183
|
}, [
|
|
1184
|
-
|
|
1184
|
+
he(S, {
|
|
1185
1185
|
placement: "top",
|
|
1186
1186
|
effect: "light",
|
|
1187
1187
|
content: s.tableData.weatherNames[r],
|
|
1188
1188
|
"show-after": 500
|
|
1189
1189
|
}, {
|
|
1190
|
-
default:
|
|
1190
|
+
default: de(() => [
|
|
1191
1191
|
a ? (n(), o("img", {
|
|
1192
1192
|
key: 0,
|
|
1193
1193
|
class: "iconfont weather-icon",
|
|
@@ -1427,7 +1427,7 @@ function yt(l, e, t, d, s, v) {
|
|
|
1427
1427
|
}, "", 4))
|
|
1428
1428
|
], 2))), 128))
|
|
1429
1429
|
]),
|
|
1430
|
-
i("tr",
|
|
1430
|
+
i("tr", ht, [
|
|
1431
1431
|
e[21] || (e[21] = i("td", {
|
|
1432
1432
|
rowspan: "1",
|
|
1433
1433
|
colspan: "1",
|
|
@@ -1443,7 +1443,7 @@ function yt(l, e, t, d, s, v) {
|
|
|
1443
1443
|
key: Math.random() + a
|
|
1444
1444
|
}, x(a), 3))), 128))
|
|
1445
1445
|
]),
|
|
1446
|
-
i("tr",
|
|
1446
|
+
i("tr", dt, [
|
|
1447
1447
|
e[22] || (e[22] = i("td", {
|
|
1448
1448
|
rowspan: "1",
|
|
1449
1449
|
colspan: "1",
|
|
@@ -1537,7 +1537,7 @@ function yt(l, e, t, d, s, v) {
|
|
|
1537
1537
|
])
|
|
1538
1538
|
]);
|
|
1539
1539
|
}
|
|
1540
|
-
const xt = /* @__PURE__ */ ze(Se, [["render", yt], ["__scopeId", "data-v-
|
|
1540
|
+
const xt = /* @__PURE__ */ ze(Se, [["render", yt], ["__scopeId", "data-v-299b53fa"]]), Lt = {
|
|
1541
1541
|
install(l) {
|
|
1542
1542
|
l.component("SpotReport", xt);
|
|
1543
1543
|
}
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],x):(f=typeof globalThis<"u"?globalThis:f||self,x(f["idmui-spot"]={},f.moment,f["moment-timezone"],f["@element-plus/icons-vue"],f["@idm-plugin/geo"],f.echarts,f.Vue,f.axios))})(this,function(f,x,Z,ce,v,de,e,te){"use strict";function he(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const se=he(de);class ae{static pickHourly(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m,u,S,d,J,h,Y,w,X,j;const oe=typeof s=="string"?x(s):s,Q=t.weather,ie=t.marine,re=x(Q[0].hourly.date).utc(),$=re.clone().add(Q[0].hourly.time.at(0),"h"),lt=re.clone().add(Q[0].hourly.time.at(-1),"h"),le=[];if(oe.isBetween($,lt,"millisecond","[]")){const l=oe.utc().diff($,"h",!1);let U,K;if(Q)for(const ee of Q){const c=ee.hourly;U={temp:(r=c.temperature_2m)==null?void 0:r.at(l),apparentTemp:(a=c.apparent_temperature)==null?void 0:a.at(l),rh:(g=c.relative_humidity_2m)==null?void 0:g.at(l),dp:(D=c.dew_point_2m)==null?void 0:D.at(l),precip:{probability:(B=c.precipitation_probability)==null?void 0:B.at(l),sum:(_=c.precipitation)==null?void 0:_.at(l)},pmsl:(b=c.pressure_msl)==null?void 0:b.at(l),psurf:(N=c.surface_pressure)==null?void 0:N.at(l),code:(E=c.weather_code)==null?void 0:E.at(l),visibility:this.m2nm((z=c.visibility)==null?void 0:z.at(l)),wind:{speed:(V=c.wind_speed_10m)==null?void 0:V.at(l),kts:(n=c.wind_speed_10m)==null?void 0:n.at(l),degree:(i=c.wind_direction_10m)==null?void 0:i.at(l),bearing:((q=c.wind_direction_10m)==null?void 0:q.at(l))!==null?(((y=c.wind_direction_10m)==null?void 0:y.at(l))+180)%360:null,gusts:(L=c.wind_gusts_10m)==null?void 0:L.at(l)},isDay:(C=c.is_day)==null?void 0:C.at(l)};const{name:ct,url:dt}=this.parseWeatherCode(U.code,U.isDay);U.name=ct,U.url=dt,U.wind.scale=this.beaufort(this.kts2ms(U.wind.kts)),U.wind.direction=this.degree2Direction(U.wind.degree)}if(ie)for(const ee of ie){const c=ee.hourly;K={wave:{sig:{height:(I=c.wave_height)==null?void 0:I.at(l),degree:(M=c.wave_direction)==null?void 0:M.at(l),bearing:((P=c.wave_direction)==null?void 0:P.at(l))!==null?(((T=c.wave_direction)==null?void 0:T.at(l))+180)%360:null,period:(H=c.wave_period)==null?void 0:H.at(l)},swell:{height:(F=c.swell_wave_height)==null?void 0:F.at(l),degree:(W=c.swell_wave_direction)==null?void 0:W.at(l),bearing:((R=c.swell_wave_direction)==null?void 0:R.at(l))!==null?(((A=c.swell_wave_direction)==null?void 0:A.at(l))+180)%360:null,period:(G=c.swell_wave_period)==null?void 0:G.at(l),peakPeriod:(O=c.swell_wave_peak_period)==null?void 0:O.at(l)},wd:{height:(p=c.wind_wave_height)==null?void 0:p.at(l),degree:(k=c.wind_wave_direction)==null?void 0:k.at(l),bearing:((m=c.wind_wave_direction)==null?void 0:m.at(l))!==null?(((u=c.wind_wave_direction)==null?void 0:u.at(l))+180)%360:null,period:(S=c.wind_wave_period)==null?void 0:S.at(l),peakPeriod:(d=c.wind_wave_peak_period)==null?void 0:d.at(l)}},current:{speed:(J=c.ocean_current_velocity)==null?void 0:J.at(l),kts:(h=c.ocean_current_velocity)==null?void 0:h.at(l),degree:(Y=c.ocean_current_direction)==null?void 0:Y.at(l),bearing:((w=c.ocean_current_direction)==null?void 0:w.at(l))??null},sst:(X=c.sea_surface_temperature)==null?void 0:X.at(l),height:(j=c.sea_level_height_msl)==null?void 0:j.at(l)},K.wave=this.parseWave(K.wave),K.current.direction=this.degree2Direction(K.current.degree)}le.push({utc:$.add(l,"h").format(),weather:{...U},...K})}return le}static toLegacy(t){return{wind:t.weather.wind,visibility:t.weather.visibility,temp:t.weather.temp,prmsl:t.weather.pmsl,gusts:{kts:t.weather.wind.gusts},precip:t.weather.precip,code:t.weather.code,name:t.weather.name,url:t.weather.url,wave:t.wave,current:t.current,sst:t.sst,height:t.height,utc:t.utc}}static pickDaily(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G;const O=typeof s=="string"?x(s):s,p=t.weather,k=t.marine,m=x(p[0].daily.time.at(0)),u=x(p[0].daily.time.at(-1)),S=[];if(O.isBetween(m,u,"millisecond","[]")){let d,J;const h=O.diff(m,"d",!1);if(p)for(const Y of p){const w=Y.daily;d={code:(r=w.weather_code)==null?void 0:r.at(h),temp:{max:(a=w.temperature_2m_max)==null?void 0:a.at(h),min:(g=w.temperature_2m_min)==null?void 0:g.at(h),mean:(D=w.temperature_2m_mean)==null?void 0:D.at(h)},apparentTemp:{max:(B=w.apparent_temperature_max)==null?void 0:B.at(h),min:(_=w.apparent_temperature_min)==null?void 0:_.at(h)},precip:{sum:(b=w.precipitation_sum)==null?void 0:b.at(h),hours:(N=w.precipitation_hours)==null?void 0:N.at(h),probability:(E=w.precipitation_probability_max)==null?void 0:E.at(h)},rh:{max:(z=w.relative_humidity_2m_max)==null?void 0:z.at(h),min:(V=w.relative_humidity_2m_min)==null?void 0:V.at(h),mean:(n=w.relative_humidity_2m_mean)==null?void 0:n.at(h)},wind:{speed:(i=w.wind_speed_10m_max)==null?void 0:i.at(h),kts:(q=w.wind_speed_10m_max)==null?void 0:q.at(h),degree:(y=w.wind_direction_10m_dominant)==null?void 0:y.at(h),gusts:(L=w.wind_gusts_10m_max)==null?void 0:L.at(h)}};const{name:X,url:j}=this.parseWeatherCode(d.code,!0);d.name=X,d.url=j,d.wind.scale=this.beaufort(this.kts2ms(d.wind.kts)),d.wind.direction=this.degree2Direction(d.wind.degree)}if(k)for(const Y of k){const w=Y.daily;J={wave:{sig:{height:(C=w.wave_height_max)==null?void 0:C.at(h),degree:(I=w.wave_direction_dominant)==null?void 0:I.at(h),period:(M=w.wave_period_max)==null?void 0:M.at(h)},swell:{height:(P=w.swell_wave_height_max)==null?void 0:P.at(h),degree:(T=w.wave_direction_dominant)==null?void 0:T.at(h),period:(H=w.swell_wave_period_max)==null?void 0:H.at(h),peakPeriod:(F=w.swell_wave_peak_period_max)==null?void 0:F.at(h)},wd:{height:(W=w.wind_wave_height_max)==null?void 0:W.at(h),degree:(R=w.wind_wave_direction_dominant)==null?void 0:R.at(h),period:(A=w.wind_wave_period_max)==null?void 0:A.at(h),peakPeriod:(G=w.wind_wave_peak_period_max)==null?void 0:G.at(h)}}},J.wave=this.parseWave(J.wave)}S.push({utc:m.add(h,"d").utc().format(),weather:{...d},...J})}return S}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return(s?r.day:r.night)||{}}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ht="",me=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},pe={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:x().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ce.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${x(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return v.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return v.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":v.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=x(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"),this.activeIndex=Z(this.ts).tz(this.positionGmt).hour(),this.pickedDate=Z(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=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let u=0;u<24;u++){const S=x(this.pickedDate).clone().add(u,"h").format();this.tableData.hours.push(S);const d=((o=ae.pickHourly(this.meteoData,S))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=d.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=d.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=d.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((g=(a=d.weather)==null?void 0:a.precip)==null?void 0:g.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(D=d.weather)==null?void 0:D.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((_=d.weather)==null?void 0:_.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((b=d.weather)==null?void 0:b.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((E=(N=d.weather)==null?void 0:N.wind)==null?void 0:E.kts,1)),this.tableData.windDir.push((V=(z=d.weather)==null?void 0:z.wind)==null?void 0:V.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=d.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((y=(q=d.wave)==null?void 0:q.sig)==null?void 0:y.height,1)??"-"),this.tableData.sigwaveDir.push((C=(L=d.wave)==null?void 0:L.sig)==null?void 0:C.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(I=d.wave)==null?void 0:I.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=d.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((F=(H=d.wave)==null?void 0:H.wd)==null?void 0:F.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((R=(W=d.wave)==null?void 0:W.swell)==null?void 0:R.height,1)??"-"),this.tableData.swellDir.push((G=(A=d.wave)==null?void 0:A.swell)==null?void 0:G.bearing),this.tableData.swellPeriod.push(this.roundPrecision((p=(O=d.wave)==null?void 0:O.swell)==null?void 0:p.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((k=d.current)==null?void 0:k.speed,1)??"-"),this.tableData.currentDir.push((m=d.current)==null?void 0:m.bearing),this.tableData.seaLevel.push(this.roundPrecision(d.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(d.sst,0)??"-")}},initEchart(){var L,C,I,M,P,T,H,F,W,R,A,G,O;const o=[],t=[],s=[],r=[],a=[],g=[],D=[],B=[],_=[],b=[],N={};for(let p=0;p<7;p++){const k=x(this.pickedDate).clone().add(p,"d");o.push(Z(k).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(k)),s.push(p===0?"Today":this.computeWeek(k));const m=((L=ae.pickDaily(this.meteoData,k))==null?void 0:L[0])||{};r.push(this.roundPrecision((I=(C=m.weather)==null?void 0:C.temp)==null?void 0:I.min,0)),a.push(this.roundPrecision((P=(M=m.weather)==null?void 0:M.temp)==null?void 0:P.max,0)),B.push(this.roundPrecision((H=(T=m.weather)==null?void 0:T.wind)==null?void 0:H.kts,1)??"- kts"),b.push(this.roundPrecision((W=(F=m.weather)==null?void 0:F.precip)==null?void 0:W.sum,0)??"- mm"),g.push({symbol:"image://"+((R=m.weather)==null?void 0:R.url)}),D.push((A=m.weather)==null?void 0:A.name),_.push((O=(G=m.weather)==null?void 0:G.wind)==null?void 0:O.degree)}const E=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),z=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*E,V=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*E,n=4+.5/o.length*92+"%",i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'))),q="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'))),y=new Image(64,64);y.src=q,y.onload=()=>{for(let m=0;m<7;m++){const u=document.createElement("canvas"),S=u.getContext("2d");u.width=y.width,u.height=y.height;const J=_[m]*(Math.PI/180);S.translate(u.width/2,u.height/2),S.rotate(J),S.translate(-y.width/2,-y.height/2),S.drawImage(y,0,0,64,64);const h=u.toDataURL();N[`WindIcon${m}`]={height:12,width:12,align:"left",backgroundColor:{image:h}}}const p=se.init(document.getElementById("weather-chart")),k={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"item",show:!0,position:"right",formatter:function(m){return m.seriesName==="Weather Icon"?D[m.dataIndex]:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:z,max:V,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#fff",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#fff",formatter:"{c}"},symbolSize:0},{name:"Weather Icon",singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:g,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,12],formatter:"{c} °C",fontSize:12},markArea:{itemStyle:{color:"rgb(71,143,206)"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,-12],formatter:"{c} °C",fontSize:12}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:B,label:{show:!0,color:"#fff",rich:{...N,title:{align:"center",vertical:"center"}},formatter:function(m){return`{WindIcon${m.dataIndex}|}{title|${m.value}} kts`}},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:b,label:{show:!0,color:"#fff",rich:{dIcon:{height:16,width:16,align:"left",backgroundColor:{image:i}},title:{align:"center",vertical:"center"}},formatter:function(m){return`{dIcon|}{title|${m.value}} mm`}},symbolSize:0}]};p.setOption(k),p.on("click",m=>{const u=m.dataIndex;this.pickedDate=Z(o[u]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=u===0?"Today":this.computeWeek(this.pickedDate),this.activeIndex=u===0?Z(this.ts).tz(this.positionGmt).hour():void 0,this.initTableData(),k.series[3].markArea={itemStyle:{color:"rgb(71,143,206)"},data:[[{x:4+u/o.length*92+"%"},{x:4+(u+1)/o.length*92+"%"}]]},p.setOption(k)})}},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await te.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(g=>g.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(g=>g.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(g=>g.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,forecastDays:8,selfHosted:!1},t=await te.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,se.dispose(document.getElementById("weather-chart"))}}},we={class:"spot-report"},ge={class:"header-box flex-between"},ue={class:"bg"},ke={class:"search-box flex-start"},ye={class:"content-box"},fe={class:"title-box flex-between"},xe={class:"main-title"},_e={class:"sub-title"},be={class:"flex-end"},Ne={key:0,id:"weather-chart"},Ee={key:1,class:"weather-chart flex-center"},De={key:2,class:"weather-chart flex-center"},Be={key:3,class:"card-box"},ze={class:"date"},Ve={class:"basic-table"},Se={class:"day"},Le={class:"hour"},Ce={class:"icon"},Ie=["src"],Me={class:"text"},Pe={class:"text"},Te={class:"text"},He={class:"text"},Fe={class:"text"},We={class:"text"},Re={key:1},Ae={class:"text"},Ge={class:"text"},Oe={class:"wave-current-table"},qe={class:"text"},Ue={class:"text"},Je={key:1},Ze={class:"text"},Ye={class:"text"},Ke={class:"text"},Qe={key:1},Xe={class:"text"},je={class:"text"},ve={class:"text"},$e={key:1},et={class:"text"},tt={class:"sea-table"},st={class:"text"},at={class:"text"},nt={key:4,class:"card-box flex-center"},ot={key:5,class:"card-box flex-center"};function it(o,t,s,r,a,g){var b,N,E,z,V;const D=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),_=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",ge,[e.createElementVNode("div",ue,[e.createElementVNode("div",ke,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":g.fetchSuggestPosition,onChange:g.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(D,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ye,[e.createElementVNode("div",fe,[e.createElementVNode("div",null,[e.createElementVNode("div",xe,"Weather forecast for "+e.toDisplayString(((b=a.position)==null?void 0:b.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",_e,"At "+e.toDisplayString((N=a.position)!=null&&N.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",be,[e.createVNode(_,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>g.handleCollect&&g.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>g.handleCollect&&g.handleCollect(...n))},""))]),_:1},8,["content"])])]),(E=a.position)!=null&&E.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne)):a.loading?(e.openBlock(),e.createElementBlock("div",Ee,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,"No Data")),(z=a.position)!=null&&z.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",ze,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(g.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",Ve,[e.createElementVNode("tr",Se,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(g.computeHourL(n)),3))),128))]),e.createElementVNode("tr",Le,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(g.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ce,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(_,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Ie)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Me,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",He,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Fe,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Re,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ae,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Oe,[e.createElementVNode("tr",qe,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Je,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ze,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ke,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Qe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Xe,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",je,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",ve,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",$e,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",et,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",tt,[e.createElementVNode("tr",st,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",at,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",nt,"Loading....")):(V=a.position)!=null&&V.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ot,"No Data"))])])}const ne=me(pe,[["render",it],["__scopeId","data-v-4a0bd795"]]),rt={install(o){o.component("SpotReport",ne)}};f.SpotReport=ne,f.SpotReportPlugin=rt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],x):(f=typeof globalThis<"u"?globalThis:f||self,x(f["idmui-spot"]={},f.moment,f["moment-timezone"],f["@element-plus/icons-vue"],f["@idm-plugin/geo"],f.echarts,f.Vue,f.axios))})(this,function(f,x,Z,ce,v,de,e,te){"use strict";function he(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const se=he(de);class ae{static pickHourly(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m,u,S,d,J,h,Y,w,X,j;const oe=typeof s=="string"?x(s):s,Q=t.weather,ie=t.marine,re=x(Q[0].hourly.date).utc(),$=re.clone().add(Q[0].hourly.time.at(0),"h"),lt=re.clone().add(Q[0].hourly.time.at(-1),"h"),le=[];if(oe.isBetween($,lt,"millisecond","[]")){const l=oe.utc().diff($,"h",!1);let U,K;if(Q)for(const ee of Q){const c=ee.hourly;U={temp:(r=c.temperature_2m)==null?void 0:r.at(l),apparentTemp:(a=c.apparent_temperature)==null?void 0:a.at(l),rh:(g=c.relative_humidity_2m)==null?void 0:g.at(l),dp:(D=c.dew_point_2m)==null?void 0:D.at(l),precip:{probability:(B=c.precipitation_probability)==null?void 0:B.at(l),sum:(_=c.precipitation)==null?void 0:_.at(l)},pmsl:(b=c.pressure_msl)==null?void 0:b.at(l),psurf:(N=c.surface_pressure)==null?void 0:N.at(l),code:(E=c.weather_code)==null?void 0:E.at(l),visibility:this.m2nm((z=c.visibility)==null?void 0:z.at(l)),wind:{speed:(V=c.wind_speed_10m)==null?void 0:V.at(l),kts:(n=c.wind_speed_10m)==null?void 0:n.at(l),degree:(i=c.wind_direction_10m)==null?void 0:i.at(l),bearing:((q=c.wind_direction_10m)==null?void 0:q.at(l))!==null?(((y=c.wind_direction_10m)==null?void 0:y.at(l))+180)%360:null,gusts:(L=c.wind_gusts_10m)==null?void 0:L.at(l)},isDay:(C=c.is_day)==null?void 0:C.at(l)};const{name:ct,url:dt}=this.parseWeatherCode(U.code,U.isDay);U.name=ct,U.url=dt,U.wind.scale=this.beaufort(this.kts2ms(U.wind.kts)),U.wind.direction=this.degree2Direction(U.wind.degree)}if(ie)for(const ee of ie){const c=ee.hourly;K={wave:{sig:{height:(I=c.wave_height)==null?void 0:I.at(l),degree:(M=c.wave_direction)==null?void 0:M.at(l),bearing:((P=c.wave_direction)==null?void 0:P.at(l))!==null?(((T=c.wave_direction)==null?void 0:T.at(l))+180)%360:null,period:(H=c.wave_period)==null?void 0:H.at(l)},swell:{height:(F=c.swell_wave_height)==null?void 0:F.at(l),degree:(W=c.swell_wave_direction)==null?void 0:W.at(l),bearing:((R=c.swell_wave_direction)==null?void 0:R.at(l))!==null?(((A=c.swell_wave_direction)==null?void 0:A.at(l))+180)%360:null,period:(G=c.swell_wave_period)==null?void 0:G.at(l),peakPeriod:(O=c.swell_wave_peak_period)==null?void 0:O.at(l)},wd:{height:(p=c.wind_wave_height)==null?void 0:p.at(l),degree:(k=c.wind_wave_direction)==null?void 0:k.at(l),bearing:((m=c.wind_wave_direction)==null?void 0:m.at(l))!==null?(((u=c.wind_wave_direction)==null?void 0:u.at(l))+180)%360:null,period:(S=c.wind_wave_period)==null?void 0:S.at(l),peakPeriod:(d=c.wind_wave_peak_period)==null?void 0:d.at(l)}},current:{speed:(J=c.ocean_current_velocity)==null?void 0:J.at(l),kts:(h=c.ocean_current_velocity)==null?void 0:h.at(l),degree:(Y=c.ocean_current_direction)==null?void 0:Y.at(l),bearing:((w=c.ocean_current_direction)==null?void 0:w.at(l))??null},sst:(X=c.sea_surface_temperature)==null?void 0:X.at(l),height:(j=c.sea_level_height_msl)==null?void 0:j.at(l)},K.wave=this.parseWave(K.wave),K.current.direction=this.degree2Direction(K.current.degree)}le.push({utc:$.add(l,"h").format(),weather:{...U},...K})}return le}static toLegacy(t){return{wind:t.weather.wind,visibility:t.weather.visibility,temp:t.weather.temp,prmsl:t.weather.pmsl,gusts:{kts:t.weather.wind.gusts},precip:t.weather.precip,code:t.weather.code,name:t.weather.name,url:t.weather.url,wave:t.wave,current:t.current,sst:t.sst,height:t.height,utc:t.utc}}static pickDaily(t,s){var r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G;const O=typeof s=="string"?x(s):s,p=t.weather,k=t.marine,m=x(p[0].daily.time.at(0)),u=x(p[0].daily.time.at(-1)),S=[];if(O.isBetween(m,u,"millisecond","[]")){let d,J;const h=O.diff(m,"d",!1);if(p)for(const Y of p){const w=Y.daily;d={code:(r=w.weather_code)==null?void 0:r.at(h),temp:{max:(a=w.temperature_2m_max)==null?void 0:a.at(h),min:(g=w.temperature_2m_min)==null?void 0:g.at(h),mean:(D=w.temperature_2m_mean)==null?void 0:D.at(h)},apparentTemp:{max:(B=w.apparent_temperature_max)==null?void 0:B.at(h),min:(_=w.apparent_temperature_min)==null?void 0:_.at(h)},precip:{sum:(b=w.precipitation_sum)==null?void 0:b.at(h),hours:(N=w.precipitation_hours)==null?void 0:N.at(h),probability:(E=w.precipitation_probability_max)==null?void 0:E.at(h)},rh:{max:(z=w.relative_humidity_2m_max)==null?void 0:z.at(h),min:(V=w.relative_humidity_2m_min)==null?void 0:V.at(h),mean:(n=w.relative_humidity_2m_mean)==null?void 0:n.at(h)},wind:{speed:(i=w.wind_speed_10m_max)==null?void 0:i.at(h),kts:(q=w.wind_speed_10m_max)==null?void 0:q.at(h),degree:(y=w.wind_direction_10m_dominant)==null?void 0:y.at(h),gusts:(L=w.wind_gusts_10m_max)==null?void 0:L.at(h)}};const{name:X,url:j}=this.parseWeatherCode(d.code,!0);d.name=X,d.url=j,d.wind.scale=this.beaufort(this.kts2ms(d.wind.kts)),d.wind.direction=this.degree2Direction(d.wind.degree)}if(k)for(const Y of k){const w=Y.daily;J={wave:{sig:{height:(C=w.wave_height_max)==null?void 0:C.at(h),degree:(I=w.wave_direction_dominant)==null?void 0:I.at(h),period:(M=w.wave_period_max)==null?void 0:M.at(h)},swell:{height:(P=w.swell_wave_height_max)==null?void 0:P.at(h),degree:(T=w.wave_direction_dominant)==null?void 0:T.at(h),period:(H=w.swell_wave_period_max)==null?void 0:H.at(h),peakPeriod:(F=w.swell_wave_peak_period_max)==null?void 0:F.at(h)},wd:{height:(W=w.wind_wave_height_max)==null?void 0:W.at(h),degree:(R=w.wind_wave_direction_dominant)==null?void 0:R.at(h),period:(A=w.wind_wave_period_max)==null?void 0:A.at(h),peakPeriod:(G=w.wind_wave_peak_period_max)==null?void 0:G.at(h)}}},J.wave=this.parseWave(J.wave)}S.push({utc:m.add(h,"d").utc().format(),weather:{...d},...J})}return S}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return(s?r.day:r.night)||{}}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ht="",me=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},pe={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:x().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},emits:["url"],data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ce.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${x(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${Z(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return v.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return v.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":v.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t,s;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:((s=this.report)==null?void 0:s.searchName)||this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=x(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"),this.activeIndex=Z(this.ts).tz(this.positionGmt).hour(),this.pickedDate=Z(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=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,g,D,B,_,b,N,E,z,V,n,i,q,y,L,C,I,M,P,T,H,F,W,R,A,G,O,p,k,m;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let u=0;u<24;u++){const S=x(this.pickedDate).clone().add(u,"h").format();this.tableData.hours.push(S);const d=((o=ae.pickHourly(this.meteoData,S))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=d.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=d.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=d.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((g=(a=d.weather)==null?void 0:a.precip)==null?void 0:g.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(D=d.weather)==null?void 0:D.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((_=d.weather)==null?void 0:_.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((b=d.weather)==null?void 0:b.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((E=(N=d.weather)==null?void 0:N.wind)==null?void 0:E.kts,1)),this.tableData.windDir.push((V=(z=d.weather)==null?void 0:z.wind)==null?void 0:V.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=d.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((y=(q=d.wave)==null?void 0:q.sig)==null?void 0:y.height,1)??"-"),this.tableData.sigwaveDir.push((C=(L=d.wave)==null?void 0:L.sig)==null?void 0:C.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(I=d.wave)==null?void 0:I.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=d.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((F=(H=d.wave)==null?void 0:H.wd)==null?void 0:F.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((R=(W=d.wave)==null?void 0:W.swell)==null?void 0:R.height,1)??"-"),this.tableData.swellDir.push((G=(A=d.wave)==null?void 0:A.swell)==null?void 0:G.bearing),this.tableData.swellPeriod.push(this.roundPrecision((p=(O=d.wave)==null?void 0:O.swell)==null?void 0:p.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((k=d.current)==null?void 0:k.speed,1)??"-"),this.tableData.currentDir.push((m=d.current)==null?void 0:m.bearing),this.tableData.seaLevel.push(this.roundPrecision(d.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(d.sst,0)??"-")}},initEchart(){var L,C,I,M,P,T,H,F,W,R,A,G,O;const o=[],t=[],s=[],r=[],a=[],g=[],D=[],B=[],_=[],b=[],N={};for(let p=0;p<7;p++){const k=x(this.pickedDate).clone().add(p,"d");o.push(Z(k).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(k)),s.push(p===0?"Today":this.computeWeek(k));const m=((L=ae.pickDaily(this.meteoData,k))==null?void 0:L[0])||{};r.push(this.roundPrecision((I=(C=m.weather)==null?void 0:C.temp)==null?void 0:I.min,0)),a.push(this.roundPrecision((P=(M=m.weather)==null?void 0:M.temp)==null?void 0:P.max,0)),B.push(this.roundPrecision((H=(T=m.weather)==null?void 0:T.wind)==null?void 0:H.kts,1)??"- kts"),b.push(this.roundPrecision((W=(F=m.weather)==null?void 0:F.precip)==null?void 0:W.sum,0)??"- mm"),g.push({symbol:"image://"+((R=m.weather)==null?void 0:R.url)}),D.push((A=m.weather)==null?void 0:A.name),_.push((O=(G=m.weather)==null?void 0:G.wind)==null?void 0:O.degree)}const E=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),z=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*E,V=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*E,n=4+.5/o.length*92+"%",i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'))),q="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'))),y=new Image(64,64);y.src=q,y.onload=()=>{for(let m=0;m<7;m++){const u=document.createElement("canvas"),S=u.getContext("2d");u.width=y.width,u.height=y.height;const J=_[m]*(Math.PI/180);S.translate(u.width/2,u.height/2),S.rotate(J),S.translate(-y.width/2,-y.height/2),S.drawImage(y,0,0,64,64);const h=u.toDataURL();N[`WindIcon${m}`]={height:12,width:12,align:"left",backgroundColor:{image:h}}}const p=se.init(document.getElementById("weather-chart")),k={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"item",show:!0,position:"right",formatter:function(m){return m.seriesName==="Weather Icon"?D[m.dataIndex]:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:n,right:n,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:z,max:V,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#fff",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#fff",formatter:"{c}"},symbolSize:0},{name:"Weather Icon",singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:g,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,12],formatter:"{c} °C",fontSize:12},markArea:{itemStyle:{color:"rgb(71,143,206)"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,-12],formatter:"{c} °C",fontSize:12}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:B,label:{show:!0,color:"#fff",rich:{...N,title:{align:"center",vertical:"center"}},formatter:function(m){return`{WindIcon${m.dataIndex}|}{title|${m.value}} kts`}},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:b,label:{show:!0,color:"#fff",rich:{dIcon:{height:16,width:16,align:"left",backgroundColor:{image:i}},title:{align:"center",vertical:"center"}},formatter:function(m){return`{dIcon|}{title|${m.value}} mm`}},symbolSize:0}]};p.setOption(k),p.on("click",m=>{const u=m.dataIndex;this.pickedDate=Z(o[u]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=u===0?"Today":this.computeWeek(this.pickedDate),this.activeIndex=u===0?Z(this.ts).tz(this.positionGmt).hour():void 0,this.initTableData(),k.series[3].markArea={itemStyle:{color:"rgb(71,143,206)"},data:[[{x:4+u/o.length*92+"%"},{x:4+(u+1)/o.length*92+"%"}]]},p.setOption(k)})}},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await te.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(g=>g.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(g=>g.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(g=>g.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.$emit("url",this.position),this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,forecastDays:8,selfHosted:!1},t=await te.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,se.dispose(document.getElementById("weather-chart"))}}},we={class:"spot-report"},ge={class:"header-box flex-between"},ue={class:"bg"},ke={class:"search-box flex-start"},ye={class:"content-box"},fe={class:"title-box flex-between"},xe={class:"main-title"},_e={class:"sub-title"},be={class:"flex-end"},Ne={key:0,id:"weather-chart"},Ee={key:1,class:"weather-chart flex-center"},De={key:2,class:"weather-chart flex-center"},Be={key:3,class:"card-box"},ze={class:"date"},Ve={class:"basic-table"},Se={class:"day"},Le={class:"hour"},Ce={class:"icon"},Ie=["src"],Me={class:"text"},Pe={class:"text"},Te={class:"text"},He={class:"text"},Fe={class:"text"},We={class:"text"},Re={key:1},Ae={class:"text"},Ge={class:"text"},Oe={class:"wave-current-table"},qe={class:"text"},Ue={class:"text"},Je={key:1},Ze={class:"text"},Ye={class:"text"},Ke={class:"text"},Qe={key:1},Xe={class:"text"},je={class:"text"},ve={class:"text"},$e={key:1},et={class:"text"},tt={class:"sea-table"},st={class:"text"},at={class:"text"},nt={key:4,class:"card-box flex-center"},ot={key:5,class:"card-box flex-center"};function it(o,t,s,r,a,g){var b,N,E,z,V;const D=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),_=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",ge,[e.createElementVNode("div",ue,[e.createElementVNode("div",ke,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":g.fetchSuggestPosition,onChange:g.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(D,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ye,[e.createElementVNode("div",fe,[e.createElementVNode("div",null,[e.createElementVNode("div",xe,"Weather forecast for "+e.toDisplayString(((b=a.position)==null?void 0:b.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",_e,"At "+e.toDisplayString((N=a.position)!=null&&N.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",be,[e.createVNode(_,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>g.handleCollect&&g.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>g.handleCollect&&g.handleCollect(...n))},""))]),_:1},8,["content"])])]),(E=a.position)!=null&&E.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne)):a.loading?(e.openBlock(),e.createElementBlock("div",Ee,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,"No Data")),(z=a.position)!=null&&z.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",ze,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(g.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",Ve,[e.createElementVNode("tr",Se,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(g.computeHourL(n)),3))),128))]),e.createElementVNode("tr",Le,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(g.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ce,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(_,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Ie)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Me,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",He,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Fe,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Re,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ae,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Oe,[e.createElementVNode("tr",qe,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Je,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ze,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ke,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Qe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Xe,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",je,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",ve,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",$e,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",et,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",tt,[e.createElementVNode("tr",st,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",at,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",nt,"Loading....")):(V=a.position)!=null&&V.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ot,"No Data"))])])}const ne=me(pe,[["render",it],["__scopeId","data-v-299b53fa"]]),rt={install(o){o.component("SpotReport",ne)}};f.SpotReport=ne,f.SpotReportPlugin=rt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@page{size:1200px;margin:20px auto 40px}.spot-report[data-v-
|
|
1
|
+
@page{size:1200px;margin:20px auto 40px}.spot-report[data-v-299b53fa]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-299b53fa]{width:100%;padding:10px 0}.spot-report .header-box .search-box .input[data-v-299b53fa]{width:300px}.spot-report .header-box .search-box .info[data-v-299b53fa]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-299b53fa]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box .main-title[data-v-299b53fa]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-299b53fa]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-299b53fa]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-299b53fa]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-299b53fa]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-299b53fa],.spot-report .content-box .weather-chart[data-v-299b53fa]{height:225px;width:100%;font-size:14px;color:#fff;border:1px solid var(--idm-gray-light);border-radius:5px;box-sizing:border-box;background:rgb(104,184,251)}.spot-report .content-box .card-box[data-v-299b53fa]{min-height:500px;margin:5px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-299b53fa]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table[data-v-299b53fa],.spot-report .content-box .card-box .sea-table[data-v-299b53fa]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-299b53fa],.spot-report .content-box .card-box .sea-table .tr-title[data-v-299b53fa]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-299b53fa],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-299b53fa]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table td[data-v-299b53fa],.spot-report .content-box .card-box .sea-table td[data-v-299b53fa]{text-align:center;line-height:20px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table td.active[data-v-299b53fa],.spot-report .content-box .card-box .sea-table td.active[data-v-299b53fa]{color:#fff;background:rgb(71,143,206)}.spot-report .content-box .card-box .basic-table th[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table th[data-v-299b53fa],.spot-report .content-box .card-box .sea-table th[data-v-299b53fa]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:20px;width:40px}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-299b53fa],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-299b53fa],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-299b53fa]{width:24px;height:24px;cursor:pointer}
|