import "./rolldown-runtime-Dd0fQ6-X.mjs";
import { a as e, n as t, r as n } from "./component-AqiMonitor-DoGm_NCt.mjs";
import { $ as r, A as i, B as a, C as o, D as s, E as c, F as l, G as u, H as d, I as f, J as p, K as m, L as h, M as ee, N as te, O as ne, P as re, Q as ie, R as ae, S as oe, T as se, U as ce, V as le, W as ue, X as de, Y as fe, Z as pe, _ as me, a as he, at as ge, b as _e, c as ve, ct as ye, d as be, dt as xe, et as Se, f as Ce, ft as we, g as Te, h as g, i as _, it as v, j as y, k as b, l as x, lt as S, m as C, n as w, nt as T, o as E, ot as D, p as O, q as Ee, r as De, rt as Oe, s as ke, st as Ae, tt as je, u as Me, ut as Ne, v as Pe, w as Fe, x as Ie, y as Le, z as Re } from "./component-HighWayEarlyWarningRed-D89gFa50.mjs";
import { Fragment as k, computed as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createStaticVNode as ze, createVNode as Be, defineComponent as P, getCurrentInstance as Ve, normalizeStyle as F, onBeforeUnmount as I, onMounted as He, openBlock as L, ref as R, renderList as Ue, toDisplayString as z, unref as B, vShow as We, watch as V, withDirectives as H, withModifiers as U } from "vue";
//#region src/components/WarningSignal/warnPop.vue
var W = { class: "wrap-head-title" }, G = { class: "wrap-head-publicTime" }, K = { class: "wrap-body" }, q = { class: "wrap-body-icon" }, J = ["src"], Y = { class: "wrap-body-explain" }, X = {
	key: 0,
	class: "wrap-body-table"
}, Ge = /* @__PURE__ */ t({
	__name: "warnPop",
	props: { warnPopData: {
		type: Object,
		default() {
			return {};
		}
	} },
	emits: ["closePop"],
	setup(e, { emit: t }) {
		let n = e, r = t, i = R({}), a = R(null), o = R(!1), s = R({
			x: 0,
			y: 0
		}), c = R({
			x: 0,
			y: 0
		}), l = R(!1);
		V(() => n.warnPopData, (e) => {
			e && (process.env.NODE_ENV, i.value = e);
		}, { immediate: !0 });
		let u = () => {
			r("closePop", { popName: "AlertPop" });
		}, d = (e) => {
			e.target.classList.contains("wrap-head-closeBtn") || (o.value = !0, s.value = {
				x: e.clientX - c.value.x,
				y: e.clientY - c.value.y
			}, document.addEventListener("mousemove", f), document.addEventListener("mouseup", p));
		}, f = (e) => {
			o.value && (l.value = !0, c.value = {
				x: e.clientX - s.value.x,
				y: e.clientY - s.value.y
			});
		}, p = () => {
			o.value = !1, document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p);
		};
		I(() => {
			document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p);
		});
		let m = A(() => ({
			transform: `translate(calc(-50% + ${c.value.x}px), ${c.value.y}px)`,
			transition: o.value ? "none" : "transform 0.1s"
		}));
		return (e, t) => (L(), M("div", {
			class: "wrap",
			ref_key: "wrapRef",
			ref: a,
			style: F(m.value)
		}, [
			N("div", {
				class: "wrap-head",
				onMousedown: d
			}, [
				N("div", W, z(i.value.headline), 1),
				N("div", {
					class: "wrap-head-closeBtn",
					onClick: U(u, ["stop"])
				}, "X"),
				N("div", G, "发布时间：" + z(B(w)(i.value.send_time).format("YYYY-MM-DD HH:mm")), 1)
			], 32),
			t[1] ||= N("div", { class: "wrap-head-line" }, null, -1),
			N("div", K, [
				N("div", q, [N("img", {
					src: i.value.icon,
					alt: ""
				}, null, 8, J)]),
				N("div", Y, z(i.value.description), 1),
				i.value._guidelines ? (L(), M("div", X, [N("table", null, [t[0] ||= N("thead", null, [N("tr", null, [N("th", { style: {
					width: "40%",
					"text-align": "center"
				} }, "标准"), N("th", { style: {
					width: "60%",
					"text-align": "center"
				} }, "防御指南")])], -1), N("tbody", null, [N("tr", null, [N("td", null, z(i.value._guidelines.standard), 1), N("td", null, z(i.value._guidelines.guide), 1)])])])])) : j("", !0)
			])
		], 4));
	}
}, [["__scopeId", "data-v-23fc10ad"]]), Ke = {
	class: "WarningSignal",
	"element-loading-background": "rgba(0, 0, 0, 0.4)"
}, qe = { class: "WarningSignal__head" }, Je = { class: "WarningSignal__head-top" }, Ye = { class: "WarningSignal__body" }, Xe = { class: "table-container" }, Z = { class: "table-scroll-body" }, Ze = { class: "data-table" }, Qe = ["onClick"], $e = { style: {
	width: "50px",
	"text-align": "center"
} }, et = ["src"], tt = ["title"], nt = { style: {
	width: "100px",
	"white-space": "nowrap"
} }, rt = { style: {
	width: "40px",
	"text-align": "center"
} }, it = ["onClick"], at = { key: 0 }, Q = /* @__PURE__ */ t(/* @__PURE__ */ P({
	__name: "WarningSignal",
	props: {
		appKey: {
			type: String,
			default: ""
		},
		appSalt: {
			type: String,
			default: ""
		},
		baseHttp: {
			type: String,
			default: ""
		},
		ids: {
			type: Object,
			default: () => ({})
		},
		title: {
			type: String,
			default: "预警信号"
		},
		dataType: {
			type: String,
			default: ""
		},
		staticData: {
			type: Array,
			default: () => []
		}
	},
	emits: [
		"close",
		"addMarker",
		"view",
		"changeMapView"
	],
	setup(t, { emit: w }) {
		let A = Ve()?.appContext.config.globalProperties.$bus, P = t, F = w, I = R(!1), B = R([]), V = R(!1), W = R({}), G = {
			大风: "big_wind",
			暴雨: "rain_storm",
			台风: "typhoon",
			雷电: "thunder",
			雷暴: "thunderstorms",
			寒潮: "cold_wave",
			低温: "cold",
			高温: "high_temperature",
			冰雹: "hail",
			霜冻: "frost",
			大雾: "big_fog",
			霾: "haze",
			道路结冰: "road_freeze",
			沙尘暴: "sand_storm",
			暴雪: "snow_storm",
			海雷: "sea_thunderstorms",
			干旱: "drought"
		}, K = {
			Blue: "blue",
			Yellow: "yellow",
			Orange: "orange",
			Red: "red"
		}, q = (e, t) => {
			let n = "other";
			for (let [t, r] of Object.entries(G)) if (e.includes(t)) {
				n = r;
				break;
			}
			let w = K[t] || "", k = w ? `${n}_${w}` : n;
			try {
				return new URL((/* @__PURE__ */ Object.assign({
					"../../assets/img/warnIcon/big_fog_orange.png": we,
					"../../assets/img/warnIcon/big_fog_red.png": xe,
					"../../assets/img/warnIcon/big_fog_yellow.png": Ne,
					"../../assets/img/warnIcon/big_wind_blue.png": S,
					"../../assets/img/warnIcon/big_wind_orange.png": ye,
					"../../assets/img/warnIcon/big_wind_red.png": Ae,
					"../../assets/img/warnIcon/big_wind_yellow.png": D,
					"../../assets/img/warnIcon/cold_blue.png": ge,
					"../../assets/img/warnIcon/cold_orange.png": v,
					"../../assets/img/warnIcon/cold_red.png": Oe,
					"../../assets/img/warnIcon/cold_wave_blue.png": T,
					"../../assets/img/warnIcon/cold_wave_orange.png": je,
					"../../assets/img/warnIcon/cold_wave_red.png": Se,
					"../../assets/img/warnIcon/cold_wave_yellow.png": r,
					"../../assets/img/warnIcon/cold_yellow.png": ie,
					"../../assets/img/warnIcon/drought_orange.png": pe,
					"../../assets/img/warnIcon/drought_red.png": de,
					"../../assets/img/warnIcon/dzzh01.png": fe,
					"../../assets/img/warnIcon/dzzh02.png": p,
					"../../assets/img/warnIcon/dzzh03.png": Ee,
					"../../assets/img/warnIcon/dzzh04.png": m,
					"../../assets/img/warnIcon/frost_blue.png": u,
					"../../assets/img/warnIcon/frost_orange.png": ue,
					"../../assets/img/warnIcon/frost_yellow.png": ce,
					"../../assets/img/warnIcon/hail_orange.png": d,
					"../../assets/img/warnIcon/hail_red.png": le,
					"../../assets/img/warnIcon/hail_yellow.png": a,
					"../../assets/img/warnIcon/haze_orange.png": Re,
					"../../assets/img/warnIcon/haze_yellow.png": ae,
					"../../assets/img/warnIcon/high_temperature_blue.png": h,
					"../../assets/img/warnIcon/high_temperature_orange.png": f,
					"../../assets/img/warnIcon/high_temperature_red.png": l,
					"../../assets/img/warnIcon/high_temperature_yellow.png": re,
					"../../assets/img/warnIcon/other.png": te,
					"../../assets/img/warnIcon/rain_storm_blue.png": ee,
					"../../assets/img/warnIcon/rain_storm_orange.png": y,
					"../../assets/img/warnIcon/rain_storm_red.png": i,
					"../../assets/img/warnIcon/rain_storm_yellow.png": b,
					"../../assets/img/warnIcon/road_freeze_orange.png": ne,
					"../../assets/img/warnIcon/road_freeze_red.png": s,
					"../../assets/img/warnIcon/road_freeze_yellow.png": c,
					"../../assets/img/warnIcon/sand_storm_orange.png": se,
					"../../assets/img/warnIcon/sand_storm_red.png": Fe,
					"../../assets/img/warnIcon/sand_storm_yellow.png": o,
					"../../assets/img/warnIcon/sea_thunderstorms_blue.png": oe,
					"../../assets/img/warnIcon/sea_thunderstorms_orange.png": Ie,
					"../../assets/img/warnIcon/sea_thunderstorms_red.png": _e,
					"../../assets/img/warnIcon/sea_thunderstorms_yellow.png": Le,
					"../../assets/img/warnIcon/snow_storm_blue.png": Pe,
					"../../assets/img/warnIcon/snow_storm_orange.png": me,
					"../../assets/img/warnIcon/snow_storm_red.png": Te,
					"../../assets/img/warnIcon/snow_storm_yellow.png": g,
					"../../assets/img/warnIcon/thunder_blue.png": C,
					"../../assets/img/warnIcon/thunder_orange.png": O,
					"../../assets/img/warnIcon/thunder_red.png": Ce,
					"../../assets/img/warnIcon/thunder_yellow.png": be,
					"../../assets/img/warnIcon/thunderstorms_orange.png": Me,
					"../../assets/img/warnIcon/thunderstorms_red.png": x,
					"../../assets/img/warnIcon/thunderstorms_yellow.png": ve,
					"../../assets/img/warnIcon/typhoon_blue.png": ke,
					"../../assets/img/warnIcon/typhoon_orange.png": E,
					"../../assets/img/warnIcon/typhoon_red.png": he,
					"../../assets/img/warnIcon/typhoon_white.png": _,
					"../../assets/img/warnIcon/typhoon_yellow.png": De
				}))[`../../assets/img/warnIcon/${k}.png`], import.meta.url).href;
			} catch {
				return new URL("data:image/png;base64, ", "" + import.meta.url).href;
			}
		};
		He(() => {
			A?.on("toComponent", (e) => {
				e.componentName === "WarningSignal" && J();
			}), J();
		});
		let J = async () => {
			await Y();
		}, Y = async () => {
			I.value = !0;
			let e = [];
			if (P.dataType === "static") e = P.staticData || [], console.log("预警信号使用静态数据:", e);
			else {
				let t = await n({
					appKey: P.appKey,
					appSalt: P.appSalt,
					id: P.ids.data.id,
					variables: {},
					baseHttp: P.baseHttp,
					reqType: P.ids.data.reqType,
					isFormData: P.ids.data.isFormData
				});
				console.log(t, "预警信号"), e = t.data?.result?.output || [];
			}
			if (I.value = !1, e && e.length > 0) {
				B.value = e.map((e) => {
					let t = e.lat, n = e.lng || e.lon;
					if (!t || !n) {
						let e = (Math.random() - .5) * .8, r = (Math.random() - .5) * 1.2;
						t = Number((41.17 + e).toFixed(4)), n = Number((80.29 + r).toFixed(4));
					}
					return {
						...e,
						icon: q(e.headline || "", e.severity || ""),
						lat: t,
						lng: n,
						lon: n
					};
				});
				let t = { mapMarker: {
					clickOpen: !0,
					drawArrObj: [],
					spotObject: [{
						offsetX: -12,
						offsetY: -12,
						spotArrone: B.value.map((e) => ({
							clickOpen: !0,
							data: e,
							lng: e.lng,
							lat: e.lat,
							htmlString: `<img src="${e.icon}" alt="${e.headline}" style="width:26px;height:26px;" class="warnIcon" />`,
							otherData: { markId: "warningSignal" }
						}))
					}]
				} };
				console.log("预警信号标记数据:", t), console.log("spotArrone长度:", t.mapMarker.spotObject[0].spotArrone.length), console.log("第一个标记:", t.mapMarker.spotObject[0].spotArrone[0]), F("addMarker", t);
			}
		}, X = (e) => {
			F("changeMapView", e);
		}, Q = (e) => {
			F("view", e), V.value = !0, W.value = {
				...e,
				_guidelines: st(e.headline)
			};
		}, ot = () => {
			F("close", "WarningSignal");
		}, $ = {
			暴雨: {
				红色: {
					standard: "3小时内降雨量将达100毫米以上，或者已达100毫米以上且降雨可能持续。",
					guide: "1、政府及相关部门按照职责做好防暴雨应急和抢险工作；2、停止集会、停课、停业（除特殊行业外）；3、做好山洪、滑坡、泥石流等灾害的防御和抢险工作。"
				},
				橙色: {
					standard: "3小时内降雨量将达50毫米以上，或者已达50毫米以上且降雨可能持续。",
					guide: "1、政府及相关部门按照职责做好防暴雨应急工作；2、切断有危险的室外电源，暂停户外作业；3、处于危险地带的单位应当停课、停业。"
				},
				黄色: {
					standard: "6小时内降雨量将达50毫米以上，或者已达50毫米以上且降雨可能持续。",
					guide: "1、政府及相关部门按照职责做好防暴雨工作；2、交通管理部门应当根据路况采取交通管制措施。"
				},
				蓝色: {
					standard: "12小时内降雨量将达50毫米以上，或者已达50毫米以上且降雨可能持续。",
					guide: "1、政府及相关部门按照职责做好防暴雨准备工作；2、学校、幼儿园采取适当措施保证学生安全。"
				}
			},
			大风: {
				红色: {
					standard: "6小时内可能受大风影响，平均风力可达12级以上，或者阵风13级以上并可能持续。",
					guide: "1、政府及相关部门做好防大风应急工作；2、人员停留在防风安全地方不要随意外出。"
				},
				橙色: {
					standard: "6小时内可能受大风影响，平均风力可达10级以上，或者阵风11级以上并可能持续。",
					guide: "1、政府及相关部门做好防大风应急工作；2、房屋抗风能力较弱的单位应停课停业。"
				},
				黄色: {
					standard: "12小时内可能受大风影响，平均风力可达8级以上，或者阵风9级以上并可能持续。",
					guide: "1、政府及相关部门做好防大风工作；2、停止露天活动和高空等户外危险作业。"
				},
				蓝色: {
					standard: "24小时内可能受大风影响，平均风力可达6级以上，或者阵风7级以上并可能持续。",
					guide: "1、政府及相关部门做好防大风工作；2、关好门窗加固围板棚架广告牌等搭建物。"
				}
			},
			雷电: {
				红色: {
					standard: "2小时内发生雷电活动的可能性非常大，或已有强烈雷电活动且可能持续。",
					guide: "1、政府及相关部门做好防雷应急抢险工作；2、人员尽量躲入有防雷设施的建筑物或汽车内。"
				},
				橙色: {
					standard: "2小时内发生雷电活动的可能性很大，或已受雷电活动影响且可能持续。",
					guide: "1、政府及相关部门落实防雷应急措施；2、人员留在室内关好门窗。"
				},
				黄色: {
					standard: "6小时内可能发生雷电活动，可能会造成雷电灾害事故。",
					guide: "1、政府及相关部门做好防雷工作；2、密切关注天气尽量避免户外活动。"
				},
				蓝色: {
					standard: "6小时内可能发生雷电活动，可能会造成雷电灾害事故。",
					guide: "1、政府及相关部门做好防雷工作；2、密切关注天气尽量避免户外活动。"
				}
			},
			高温: {
				红色: {
					standard: "24小时内最高气温将升至40℃以上。",
					guide: "1、有关部门和单位采取防暑降温应急措施；2、停止户外露天作业（除特殊行业外）。"
				},
				橙色: {
					standard: "24小时内最高气温将升至37℃以上。",
					guide: "1、有关部门和单位落实防暑降温保障措施；2、尽量避免高温时段进行户外活动。"
				},
				黄色: {
					standard: "连续三天日最高气温将在35℃以上。",
					guide: "1、有关部门和单位做好防暑降温准备工作；2、午后尽量减少户外活动。"
				},
				蓝色: {
					standard: "48小时内最高气温将升至35℃以上。",
					guide: "1、有关部门和单位做好防暑降温准备工作；2、午后尽量减少户外活动。"
				}
			},
			沙尘暴: { 橙色: {
				standard: "预计未来12小时内可能出现沙尘暴天气，能见度可能低于1公里。",
				guide: "1、政府及相关部门做好防沙尘暴工作；2、关闭门窗避免外出。"
			} }
		};
		function st(e) {
			if (!e) return null;
			let t = "", n = "";
			for (let n in $) if (e.includes(n)) {
				t = n;
				break;
			}
			for (let t of [
				"红色",
				"橙色",
				"黄色",
				"蓝色"
			]) if (e.includes(t)) {
				n = t;
				break;
			}
			return t && n && $[t]?.[n] ? $[t][n] : null;
		}
		return (n, r) => {
			let i = e;
			return H((L(), M("div", Ke, [
				N("div", qe, [N("div", Je, [N("div", null, z(t.title), 1), N("div", {
					class: "closeBtn",
					onClick: ot,
					title: "关闭"
				})]), r[1] ||= N("img", {
					class: "WarningSignal__head-line",
					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",
					alt: ""
				}, null, -1)]),
				N("div", Ye, [N("div", Xe, [r[3] ||= ze("<table class=\"data-table\" data-v-419fdb4f><thead data-v-419fdb4f><tr data-v-419fdb4f><th style=\"width:50px;text-align:center;\" data-v-419fdb4f>预警图标</th><th style=\"text-align:center;\" data-v-419fdb4f>预警标题</th><th style=\"width:100px;text-align:center;white-space:nowrap;\" data-v-419fdb4f>预警时间</th><th style=\"width:40px;text-align:center;\" data-v-419fdb4f>操作</th></tr></thead></table>", 1), N("div", Z, [N("table", Ze, [N("tbody", null, [(L(!0), M(k, null, Ue(B.value, (e, t) => (L(), M("tr", {
					key: t,
					onClick: (t) => X(e)
				}, [
					N("td", $e, [N("img", {
						src: e.icon,
						style: {
							width: "24px",
							height: "24px"
						}
					}, null, 8, et)]),
					N("td", {
						style: {
							overflow: "hidden",
							"text-overflow": "ellipsis",
							"white-space": "nowrap"
						},
						title: e.headline
					}, z(e.headline), 9, tt),
					N("td", nt, z(e.send_time), 1),
					N("td", rt, [N("span", {
						class: "view-btn",
						onClick: U((t) => Q(e), ["stop"])
					}, "查看", 8, it)])
				], 8, Qe))), 128)), !B.value || !B.value.length ? (L(), M("tr", at, [...r[2] ||= [N("td", {
					colspan: "4",
					class: "empty-state"
				}, "暂无数据", -1)]])) : j("", !0)])])])])]),
				H(Be(Ge, {
					class: "warnPop",
					onClosePop: r[0] ||= (e) => V.value = !1,
					warnPopData: W.value
				}, null, 8, ["warnPopData"]), [[We, V.value]])
			])), [[i, I.value]]);
		};
	}
}), [["__scopeId", "data-v-419fdb4f"]]);
//#endregion
export { Q as t };
