nxd-plugin 1.7.1 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nxd-plugin",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "main": "dist/nxd-plugin.mjs",
5
5
  "module": "dist/nxd-plugin.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -1,231 +0,0 @@
1
- import "./rolldown-runtime-Dd0fQ6-X.mjs";
2
- import { a as e, n as t, r as n } from "./component-AqiMonitor-DoGm_NCt.mjs";
3
- import { A as r, C as i, D as a, E as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as ee, a as te, b as ne, c as re, d as p, f as ie, g as ae, h as m, i as h, j as g, k as _, l as v, m as oe, n as se, o as ce, p as y, r as b, s as x, u as S, v as C, w, x as T, y as E } from "./component-HighwayWeatherForecast-Dn6tjaR-.mjs";
4
- import { n as D } from "./component-LithiumBatteryMiningArea-Dj1DMKuU.mjs";
5
- import { Fragment as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, defineComponent as M, getCurrentInstance as N, normalizeClass as P, onMounted as F, openBlock as I, ref as L, renderList as R, toDisplayString as z, vShow as B, withDirectives as V } from "vue";
6
- //#region src/components/WeatherForecast/WeatherForecast.vue?vue&type=script&setup=true&lang.ts
7
- var le = {
8
- class: "WeatherForecast",
9
- "element-loading-background": "rgba(0, 0, 0, 0.4)"
10
- }, H = { class: "WeatherForecast__head" }, U = { class: "WeatherForecast__head-top" }, W = { class: "WeatherForecast__body" }, ue = {
11
- key: 0,
12
- class: "WeatherForecast__area-select"
13
- }, de = { style: {
14
- display: "flex",
15
- "align-items": "center"
16
- } }, fe = { class: "WeatherForecast__area-panel" }, pe = ["onClick"], me = { class: "WeatherForecast__wrap" }, he = ["src", "alt"], G = /* @__PURE__ */ t(/* @__PURE__ */ M({
17
- __name: "WeatherForecast",
18
- props: {
19
- appKey: {
20
- type: String,
21
- default: ""
22
- },
23
- appSalt: {
24
- type: String,
25
- default: ""
26
- },
27
- baseHttp: {
28
- type: String,
29
- default: ""
30
- },
31
- ids: {
32
- type: Object,
33
- default: () => ({})
34
- },
35
- title: {
36
- type: String,
37
- default: "天气预报"
38
- }
39
- },
40
- emits: ["close"],
41
- setup(t, { emit: M }) {
42
- let G = N()?.appContext.config.globalProperties.$bus, K = t, ge = M, q = L(!1), J = L([]), Y = L({}), X = L([
43
- {
44
- name: "阿克苏市",
45
- value: "aksu",
46
- longitude: "80.2651",
47
- latitude: "41.1707"
48
- },
49
- {
50
- name: "库车市",
51
- value: "kuche",
52
- longitude: "82.9989",
53
- latitude: "41.7160"
54
- },
55
- {
56
- name: "拜城县",
57
- value: "baicheng",
58
- longitude: "81.8670",
59
- latitude: "41.7860"
60
- },
61
- {
62
- name: "新和县",
63
- value: "xinhe",
64
- longitude: "82.6100",
65
- latitude: "41.5490"
66
- },
67
- {
68
- name: "沙雅县",
69
- value: "shaya",
70
- longitude: "82.7800",
71
- latitude: "41.2200"
72
- },
73
- {
74
- name: "温宿县",
75
- value: "wensu",
76
- longitude: "80.3000",
77
- latitude: "41.1600"
78
- },
79
- {
80
- name: "乌什县",
81
- value: "wushi",
82
- longitude: "79.2300",
83
- latitude: "41.2100"
84
- },
85
- {
86
- name: "柯坪县",
87
- value: "keping",
88
- longitude: "79.0200",
89
- latitude: "40.5000"
90
- }
91
- ]), Z = L(null), Q = L(!1);
92
- F(() => {
93
- G?.on("toComponent", (e) => {
94
- e.componentName === "WeatherForecast" && (Y.value = e.data, _e());
95
- });
96
- }), document.addEventListener("click", (e) => {
97
- e.target.closest(".WeatherForecast__area-select") || (Q.value = !1);
98
- });
99
- let _e = async () => {
100
- await be();
101
- }, ve = () => {
102
- ge("close", "WeatherForecast");
103
- }, ye = () => {
104
- Q.value = !Q.value;
105
- }, $ = async (e) => {
106
- Z.value?.value !== e.value && (Z.value = e, Q.value = !1);
107
- }, be = async () => {
108
- q.value = !0;
109
- let e = {
110
- lon: Y.value.longitude,
111
- lat: Y.value.latitude,
112
- hours: 168
113
- }, t = await n({
114
- appKey: K.appKey,
115
- appSalt: K.appSalt,
116
- id: K.ids.data.id,
117
- variables: { str: D.encode(JSON.stringify(e)) },
118
- baseHttp: K.baseHttp,
119
- reqType: K.ids.data.reqType,
120
- isFormData: K.ids.data.isFormData
121
- });
122
- q.value = !1;
123
- let O = t.data?.result?.output;
124
- if (!O) {
125
- console.warn("天气预报接口返回为空", t), J.value = [];
126
- return;
127
- }
128
- let k = (typeof O == "string" ? JSON.parse(O) : O).ds;
129
- if (!Array.isArray(k) || k.length === 0) {
130
- J.value = [];
131
- return;
132
- }
133
- let A = [
134
- "日",
135
- "一",
136
- "二",
137
- "三",
138
- "四",
139
- "五",
140
- "六"
141
- ];
142
- J.value = k.map((e, t) => {
143
- let n = new Date(e.observation_time.replace(/\//g, "-"));
144
- n.setDate(n.getDate() + t);
145
- let D = `${n.getMonth() + 1}`.padStart(2, "0"), O = `${n.getDate()}`.padStart(2, "0");
146
- return {
147
- ...e,
148
- _date: `${D}-${O}`,
149
- _week: `周${A[n.getDay()]}`,
150
- _icon: new URL((/* @__PURE__ */ Object.assign({
151
- "../../assets/img/weatherIcon/0.gif": u,
152
- "../../assets/img/weatherIcon/1.gif": c,
153
- "../../assets/img/weatherIcon/10.gif": s,
154
- "../../assets/img/weatherIcon/11.gif": g,
155
- "../../assets/img/weatherIcon/12.gif": r,
156
- "../../assets/img/weatherIcon/13.gif": _,
157
- "../../assets/img/weatherIcon/14.gif": l,
158
- "../../assets/img/weatherIcon/15.gif": a,
159
- "../../assets/img/weatherIcon/16.gif": o,
160
- "../../assets/img/weatherIcon/17.gif": f,
161
- "../../assets/img/weatherIcon/18.gif": w,
162
- "../../assets/img/weatherIcon/19.gif": i,
163
- "../../assets/img/weatherIcon/2.gif": d,
164
- "../../assets/img/weatherIcon/20.gif": T,
165
- "../../assets/img/weatherIcon/21.gif": ne,
166
- "../../assets/img/weatherIcon/22.gif": E,
167
- "../../assets/img/weatherIcon/23.gif": C,
168
- "../../assets/img/weatherIcon/24.gif": ee,
169
- "../../assets/img/weatherIcon/25.gif": ae,
170
- "../../assets/img/weatherIcon/26.gif": m,
171
- "../../assets/img/weatherIcon/27.gif": oe,
172
- "../../assets/img/weatherIcon/28.gif": y,
173
- "../../assets/img/weatherIcon/29.gif": ie,
174
- "../../assets/img/weatherIcon/3.gif": p,
175
- "../../assets/img/weatherIcon/30.gif": S,
176
- "../../assets/img/weatherIcon/31.gif": v,
177
- "../../assets/img/weatherIcon/4.gif": re,
178
- "../../assets/img/weatherIcon/5.gif": x,
179
- "../../assets/img/weatherIcon/53.gif": ce,
180
- "../../assets/img/weatherIcon/6.gif": te,
181
- "../../assets/img/weatherIcon/7.gif": h,
182
- "../../assets/img/weatherIcon/8.gif": b,
183
- "../../assets/img/weatherIcon/9.gif": se
184
- }))[`../../assets/img/weatherIcon/${e.weatherPhenomenon}.gif`], import.meta.url).href
185
- };
186
- });
187
- };
188
- return (n, r) => {
189
- let i = e;
190
- return V((I(), A("div", le, [j("div", H, [j("div", U, [j("div", null, z(t.title), 1), j("div", {
191
- class: "closeBtn",
192
- onClick: ve,
193
- title: "关闭"
194
- })]), r[1] ||= j("img", {
195
- class: "WeatherForecast__head-line",
196
- src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbsAAAASBAMAAAAwI22/AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAwUExURQAAAAem/wem/wem/wem/wem/wem/wem/wem/wem/wem/wem/wem/wem/wem/wem/5bu5GYAAAAPdFJOUwAFwAwc2M8ULQYDn/hGXGnV2UoAAAGZSURBVEjH7ZM/S8NAGId/JYGmmeLspptThurk0CHWRXGo0Nk/S50y6CYSHMRF7Efo4uQXEIpbwUnM6OhnEIeChXjv5ZLLXdLtLCX68vDCe0eGJ7/3AJN1VcL+UImB/SruVJwYTqSAW5V3LLyaPR1c+IIdH12OPZiLcyTAjccZEdccZ0Nn4bXpC3KpCuFu5tkdziX3FJxBSBZZdFk9HempCduMk4xSitJTpOgJSSIPrx10YAUB0tYOwrQ1g12k7ZyODIYXZmQpppLV26rtbDFOXVhua2Fn7WTWwUEyAe5Zc2hiLWTTC3jjk8Hw+jrSM9/Z8raKOAtZVmyr9jbpee4lU9hvSUStw6YvOpqwiXlK9d8IL0Oq5tuqvc3KLMs7q9uyCC0y22aKvDVp4u2SjnJ1c+Wecg7h9gV4CFV8NHpEaw7yF2wVGcIa6OBx/Ax3PI6pRWx6Am98alBbpSODNVTxgAbQUpF3KeVv0s80xMUow8N//YVaqWEV9BJDdby2PBUZ1/te0uU0YzeLa623jjrrvaLOep/+str9ACyAtv25BhHcAAAAAElFTkSuQmCC",
197
- alt: ""
198
- }, null, -1)]), j("div", W, [X.value.length > 0 ? (I(), A("div", ue, [j("div", de, [
199
- r[2] ||= j("label", { style: { "font-size": "12px" } }, "区域选择:", -1),
200
- j("div", {
201
- class: "WeatherForecast__area-trigger",
202
- onClick: ye
203
- }, [j("span", null, z(Z.value?.name || "选择区域"), 1), j("span", { class: P(["WeatherForecast__arrow", { "is-open": Q.value }]) }, "▼", 2)]),
204
- V(j("div", fe, [j("div", {
205
- class: P(["WeatherForecast__area-item", { "is-selected": Z.value?.value === "" }]),
206
- onClick: r[0] ||= (e) => $({})
207
- }, " 区域选择 ", 2), (I(!0), A(O, null, R(X.value, (e, t) => (I(), A("div", {
208
- key: t,
209
- class: P(["WeatherForecast__area-item", { "is-selected": Z.value?.value === e.value }]),
210
- onClick: (t) => $(e)
211
- }, z(e.name), 11, pe))), 128))], 512), [[B, Q.value]])
212
- ])])) : k("", !0), j("div", me, [(I(!0), A(O, null, R(J.value, (e) => (I(), A("div", {
213
- class: "WeatherForecast__item",
214
- key: `${e.observation_time}-${e.hour}`
215
- }, [
216
- j("div", null, z(e._date), 1),
217
- j("div", null, z(e._week), 1),
218
- j("img", {
219
- src: e._icon,
220
- alt: e.weather
221
- }, null, 8, he),
222
- j("div", null, z(e.weather), 1),
223
- j("div", null, z(e.temp_low) + "~" + z(e.temp_high) + "℃", 1),
224
- j("div", null, z(e.wind_directinfo), 1),
225
- j("div", null, z(e.wind_speedinfo === null || Number(e.wind_speedinfo) < 3 ? "<3级" : `${e.wind_speedinfo}级`), 1)
226
- ]))), 128))])])])), [[i, q.value]]);
227
- };
228
- }
229
- }), [["__scopeId", "data-v-41b5dc1c"]]);
230
- //#endregion
231
- export { G as t };