@idmwx/idmui-gl4 0.9.0 → 0.9.2

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
@@ -8226,7 +8226,7 @@ const Cs = {
8226
8226
  },
8227
8227
  toggle: {
8228
8228
  handler() {
8229
- this.handleBind();
8229
+ this.showForm = !!this.toggle, this.handleBind();
8230
8230
  },
8231
8231
  immediate: !0
8232
8232
  },
@@ -8258,18 +8258,19 @@ const Cs = {
8258
8258
  },
8259
8259
  methods: {
8260
8260
  handleMenuToggle() {
8261
- this.isLogin ? (this.toggle = !this.toggle, this.showForm = !!this.toggle) : this.$emit("login");
8261
+ this.isLogin ? this.toggle = !this.toggle : this.$emit("login");
8262
8262
  },
8263
- submitForm() {
8264
- this.$refs.spotForm.validate().then(async (t) => {
8265
- var e;
8266
- if (t != null && t.valid) {
8263
+ clickForm() {
8264
+ var t;
8265
+ this.showMeteo = !1, (t = this.meteoMarker) == null || t.remove(), this.meteoMarker = void 0, this.$refs.spotForm.validate().then(async (e) => {
8266
+ var o;
8267
+ if (e != null && e.valid) {
8267
8268
  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
8269
  lat: this.form.lat,
8269
8270
  lng: this.form.lng
8270
8271
  };
8271
- const o = D();
8272
- ((e = D(this.realTime)) == null ? void 0 : e.diff(o, "d", !0)) >= 0 ? await this.fetchMeteoData(this.form) : await this.fetchHistoryData(this.form), this.initTableData(this.meteoData), this.showMeteo = !0, this.handleRender();
8272
+ const i = D();
8273
+ ((o = D(this.realTime)) == null ? void 0 : o.diff(i, "d", !0)) >= 0 ? await this.fetchMeteoData(this.form) : await this.fetchHistoryData(this.form), this.initTableData(this.meteoData), this.handleRender();
8273
8274
  }
8274
8275
  });
8275
8276
  },
@@ -8337,30 +8338,34 @@ const Cs = {
8337
8338
  this.toggle ? ((t = this.map) == null || t.on("click", this.handleClick), this.map.getCanvas().style.cursor = "pointer") : ((e = this.map) == null || e.off("click", this.handleClick), this.handleCloseMeteo());
8338
8339
  },
8339
8340
  handleClick(t) {
8340
- var o;
8341
- if (t.originalEvent.stopPropagation(), t.originalEvent.target.className === "mapboxgl-canvas") {
8342
- const i = t.lngLat;
8343
- if (this.form.latDegree = Number(oe.lat2pretty(i.lat).degree), this.form.latMinute = Number(oe.lat2pretty(i.lat).minute), this.form.latDirection = oe.lat2pretty(i.lat).direction, this.form.lngDegree = Number(oe.lng2pretty(i.lng).degree), this.form.lngMinute = Number(oe.lng2pretty(i.lng).minute), this.form.lngDirection = oe.lng2pretty(i.lng).direction, this.point = {
8344
- lat: i.lat,
8345
- lng: i.lng
8346
- }, this.positionMarker)
8347
- (o = this.positionMarker) == null || o.setLngLat([this.point.lng, this.point.lat]);
8348
- else {
8349
- const a = document.createElement("div");
8350
- a.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>', a.firstChild.style.height = "28px", a.firstChild.style.width = "28px", this.positionMarker = new we.Marker(a).setLngLat([this.point.lng, this.point.lat]).setOffset([0, -14]).addTo(this.map);
8351
- }
8352
- } else
8341
+ if (t.originalEvent.stopPropagation(), t.originalEvent.target.className === "mapboxgl-canvas")
8342
+ this.handleDrawMarker(t.lngLat), this.$nextTick(() => {
8343
+ var o, i, a;
8344
+ (a = (i = (o = this.$refs) == null ? void 0 : o.submitSpot) == null ? void 0 : i.$el) == null || a.click();
8345
+ });
8346
+ else
8353
8347
  return !1;
8354
8348
  },
8349
+ handleDrawMarker(t) {
8350
+ var e, o;
8351
+ 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 = {
8352
+ lat: t.lat,
8353
+ lng: t.lng
8354
+ }, this.positionMarker)
8355
+ (o = this.positionMarker) == null || o.setLngLat([this.point.lng, this.point.lat]);
8356
+ else {
8357
+ const i = document.createElement("div");
8358
+ 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);
8359
+ }
8360
+ },
8355
8361
  handleRender() {
8356
- var t;
8357
- (t = this.positionMarker) == null || t.remove(), this.positionMarker = void 0, this.$nextTick(() => {
8358
- this.point && (this.map.flyTo({
8359
- center: [this.point.lng, this.point.lat],
8360
- duration: 800
8361
- }), setTimeout(() => {
8362
- var e, o;
8363
- if (this.meteoMarker)
8362
+ this.point && (this.map.flyTo({
8363
+ center: [this.point.lng, this.point.lat],
8364
+ duration: 800
8365
+ }), setTimeout(() => {
8366
+ this.showMeteo = !0, this.$nextTick(() => {
8367
+ var t, e, o;
8368
+ if ((t = this.positionMarker) == null || t.remove(), this.positionMarker = void 0, this.meteoMarker)
8364
8369
  (e = this.meteoMarker) == null || e.setLngLat([this.point.lng, this.point.lat]);
8365
8370
  else {
8366
8371
  const i = document.createElement("div");
@@ -8372,8 +8377,8 @@ const Cs = {
8372
8377
  const i = document.getElementById("idm-gl4-spot-meteo");
8373
8378
  this.meteoInfoMarker = new we.Marker(i).setLngLat([this.point.lng, this.point.lat]).setOffset([0, -200]).addTo(this.map);
8374
8379
  }
8375
- }, 1e3));
8376
- });
8380
+ });
8381
+ }, 1e3));
8377
8382
  },
8378
8383
  handleMeteoMore() {
8379
8384
  this.point.forecastModel = this.forecastModel, this.$emit("meteoMore", this.point);
@@ -8463,7 +8468,7 @@ function Ws(t, e, o, i, a, r) {
8463
8468
  ref: "spotForm",
8464
8469
  autocomplete: "off",
8465
8470
  class: "form-box",
8466
- onSubmit: Xa(r.submitForm, ["prevent"])
8471
+ onSubmit: Xa(r.clickForm, ["prevent"])
8467
8472
  }, {
8468
8473
  default: u(() => [
8469
8474
  l("div", Ms, [
@@ -8724,6 +8729,7 @@ function Ws(t, e, o, i, a, r) {
8724
8729
  __: [21]
8725
8730
  }, 8, ["onClick"]),
8726
8731
  h(s, {
8732
+ ref: "submitSpot",
8727
8733
  loading: a.loading,
8728
8734
  size: "small",
8729
8735
  variant: "flat",