@idmwx/idmui-gl4 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -8255,21 +8255,23 @@ const Cs = {
|
|
|
8255
8255
|
}
|
|
8256
8256
|
},
|
|
8257
8257
|
mounted() {
|
|
8258
|
+
console.log(this.form.dateTime);
|
|
8258
8259
|
},
|
|
8259
8260
|
methods: {
|
|
8260
8261
|
handleMenuToggle() {
|
|
8261
8262
|
this.isLogin ? this.toggle = !this.toggle : this.$emit("login");
|
|
8262
8263
|
},
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8264
|
+
clickForm() {
|
|
8265
|
+
var t;
|
|
8266
|
+
this.showMeteo = !1, (t = this.meteoMarker) == null || t.remove(), this.meteoMarker = void 0, this.$refs.spotForm.validate().then(async (e) => {
|
|
8267
|
+
var o;
|
|
8268
|
+
if (e != null && e.valid) {
|
|
8267
8269
|
this.form.lat = (Number(this.form.latDegree ?? 0) + Number(this.form.latMinute ?? 0) / 60) * (this.form.latDirection === "N" ? 1 : -1), this.form.lng = (Number(this.form.lngDegree ?? 0) + Number(this.form.lngMinute ?? 0) / 60) * (this.form.lngDirection === "E" ? 1 : -1), this.point = {
|
|
8268
8270
|
lat: this.form.lat,
|
|
8269
8271
|
lng: this.form.lng
|
|
8270
8272
|
};
|
|
8271
|
-
const
|
|
8272
|
-
((
|
|
8273
|
+
const i = D();
|
|
8274
|
+
((o = D(this.realTime)) == null ? void 0 : o.diff(i, "d", !0)) >= 0 ? await this.fetchMeteoData(this.form) : await this.fetchHistoryData(this.form);
|
|
8273
8275
|
}
|
|
8274
8276
|
});
|
|
8275
8277
|
},
|
|
@@ -8307,7 +8309,7 @@ const Cs = {
|
|
|
8307
8309
|
Authorization: this.token || this.defaultMeteoToken
|
|
8308
8310
|
}
|
|
8309
8311
|
});
|
|
8310
|
-
(a == null ? void 0 : a.data.code) === 0 && (this.meteoData = a == null ? void 0 : a.data.data), this.loading = !1;
|
|
8312
|
+
(a == null ? void 0 : a.data.code) === 0 && (this.meteoData = a == null ? void 0 : a.data.data, this.initTableData(this.meteoData), this.handleRender()), this.loading = !1;
|
|
8311
8313
|
},
|
|
8312
8314
|
async fetchHistoryData(t) {
|
|
8313
8315
|
this.loading = !0, this.meteoData = [];
|
|
@@ -8324,7 +8326,7 @@ const Cs = {
|
|
|
8324
8326
|
Authorization: this.token || this.defaultMeteoToken
|
|
8325
8327
|
}
|
|
8326
8328
|
});
|
|
8327
|
-
(a == null ? void 0 : a.data.code) === 0 && (this.meteoData = a == null ? void 0 : a.data.data), this.loading = !1;
|
|
8329
|
+
(a == null ? void 0 : a.data.code) === 0 && (this.meteoData = a == null ? void 0 : a.data.data, this.initTableData(this.meteoData), this.handleRender()), this.loading = !1;
|
|
8328
8330
|
},
|
|
8329
8331
|
initTableData(t) {
|
|
8330
8332
|
var o, i, a, r, s, n, c, g, p, d, f, z, x, S, C, N, M, L, v, _, P, k, R, V, X, q, Y, $, ee, Q, se, de, pe, me, K, ie, F, le, fe, xe, ve;
|
|
@@ -8338,31 +8340,33 @@ const Cs = {
|
|
|
8338
8340
|
},
|
|
8339
8341
|
handleClick(t) {
|
|
8340
8342
|
if (t.originalEvent.stopPropagation(), t.originalEvent.target.className === "mapboxgl-canvas")
|
|
8341
|
-
this.handleDrawMarker(t.lngLat)
|
|
8343
|
+
this.handleDrawMarker(t.lngLat), this.$nextTick(() => {
|
|
8344
|
+
var o, i, a;
|
|
8345
|
+
(a = (i = (o = this.$refs) == null ? void 0 : o.submitSpot) == null ? void 0 : i.$el) == null || a.click();
|
|
8346
|
+
});
|
|
8342
8347
|
else
|
|
8343
8348
|
return !1;
|
|
8344
8349
|
},
|
|
8345
8350
|
handleDrawMarker(t) {
|
|
8346
|
-
var e;
|
|
8347
|
-
if (this.form.latDegree = Number(oe.lat2pretty(t.lat).degree), this.form.latMinute = Number(oe.lat2pretty(t.lat).minute), this.form.latDirection = oe.lat2pretty(t.lat).direction, this.form.lngDegree = Number(oe.lng2pretty(t.lng).degree), this.form.lngMinute = Number(oe.lng2pretty(t.lng).minute), this.form.lngDirection = oe.lng2pretty(t.lng).direction, this.point = {
|
|
8351
|
+
var e, o;
|
|
8352
|
+
if (this.showMeteo = !1, (e = this.meteoMarker) == null || e.remove(), this.meteoMarker = void 0, this.form.latDegree = Number(oe.lat2pretty(t.lat).degree), this.form.latMinute = Number(oe.lat2pretty(t.lat).minute), this.form.latDirection = oe.lat2pretty(t.lat).direction, this.form.lngDegree = Number(oe.lng2pretty(t.lng).degree), this.form.lngMinute = Number(oe.lng2pretty(t.lng).minute), this.form.lngDirection = oe.lng2pretty(t.lng).direction, this.point = {
|
|
8348
8353
|
lat: t.lat,
|
|
8349
8354
|
lng: t.lng
|
|
8350
8355
|
}, this.positionMarker)
|
|
8351
|
-
(
|
|
8356
|
+
(o = this.positionMarker) == null || o.setLngLat([this.point.lng, this.point.lat]);
|
|
8352
8357
|
else {
|
|
8353
|
-
const
|
|
8354
|
-
|
|
8358
|
+
const i = document.createElement("div");
|
|
8359
|
+
i.innerHTML = '<svg t="1755510770354" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5552" width="200" height="200"><path d="M511.960615 827.234462s330.358154-215.906462 330.358154-465.526154C842.318769 183.650462 694.468923 39.384615 512 39.384615S181.563077 183.689846 181.563077 361.668923c0 249.659077 330.397538 465.565538 330.397538 465.565539z" fill="#FF8C00" p-id="5553"></path><path d="M511.921231 496.836923a127.054769 127.054769 0 1 0 0-254.148923 127.054769 127.054769 0 0 0 0 254.148923z" fill="#FFFFFF" p-id="5554"></path><path d="M354.461538 945.230769a157.538462 39.384615 0 1 0 315.076924 0 157.538462 39.384615 0 1 0-315.076924 0Z" fill="#494C4F" opacity=".4" p-id="5555"></path></svg>', i.firstChild.style.height = "28px", i.firstChild.style.width = "28px", this.positionMarker = new we.Marker(i).setLngLat([this.point.lng, this.point.lat]).setOffset([0, -14]).addTo(this.map);
|
|
8355
8360
|
}
|
|
8356
8361
|
},
|
|
8357
8362
|
handleRender() {
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
if (this.meteoMarker)
|
|
8363
|
+
this.point && (this.map.flyTo({
|
|
8364
|
+
center: [this.point.lng, this.point.lat],
|
|
8365
|
+
duration: 800
|
|
8366
|
+
}), setTimeout(() => {
|
|
8367
|
+
this.showMeteo = !0, this.$nextTick(() => {
|
|
8368
|
+
var t, e, o;
|
|
8369
|
+
if ((t = this.positionMarker) == null || t.remove(), this.positionMarker = void 0, this.meteoMarker)
|
|
8366
8370
|
(e = this.meteoMarker) == null || e.setLngLat([this.point.lng, this.point.lat]);
|
|
8367
8371
|
else {
|
|
8368
8372
|
const i = document.createElement("div");
|
|
@@ -8374,8 +8378,8 @@ const Cs = {
|
|
|
8374
8378
|
const i = document.getElementById("idm-gl4-spot-meteo");
|
|
8375
8379
|
this.meteoInfoMarker = new we.Marker(i).setLngLat([this.point.lng, this.point.lat]).setOffset([0, -200]).addTo(this.map);
|
|
8376
8380
|
}
|
|
8377
|
-
}
|
|
8378
|
-
});
|
|
8381
|
+
});
|
|
8382
|
+
}, 1e3));
|
|
8379
8383
|
},
|
|
8380
8384
|
handleMeteoMore() {
|
|
8381
8385
|
this.point.forecastModel = this.forecastModel, this.$emit("meteoMore", this.point);
|
|
@@ -8465,7 +8469,7 @@ function Ws(t, e, o, i, a, r) {
|
|
|
8465
8469
|
ref: "spotForm",
|
|
8466
8470
|
autocomplete: "off",
|
|
8467
8471
|
class: "form-box",
|
|
8468
|
-
onSubmit: Xa(r.
|
|
8472
|
+
onSubmit: Xa(r.clickForm, ["prevent"])
|
|
8469
8473
|
}, {
|
|
8470
8474
|
default: u(() => [
|
|
8471
8475
|
l("div", Ms, [
|
|
@@ -8726,6 +8730,7 @@ function Ws(t, e, o, i, a, r) {
|
|
|
8726
8730
|
__: [21]
|
|
8727
8731
|
}, 8, ["onClick"]),
|
|
8728
8732
|
h(s, {
|
|
8733
|
+
ref: "submitSpot",
|
|
8729
8734
|
loading: a.loading,
|
|
8730
8735
|
size: "small",
|
|
8731
8736
|
variant: "flat",
|