import { n as e, r as t } from "./component-AqiMonitor-BUy1MSaP.mjs";
import { ElLoadingDirective as n, ElOption as r, ElRadio as i, ElRadioGroup as a, ElSelect as o } from "element-plus/es";
import { Fragment as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, isRef as h, normalizeClass as g, onBeforeUnmount as _, onMounted as v, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, withCtx as w, withDirectives as T } from "vue";
import "element-plus/es/components/loading/style/css";
import "element-plus/es/components/radio/style/css";
import "element-plus/es/components/radio-group/style/css";
import "element-plus/es/components/select/style/css";
import "element-plus/es/components/option/style/css";
//#region src/components/HighwayStations/HighwayStations.vue?vue&type=script&setup=true&lang.ts
var E = {
	class: "HighwayStations",
	"element-loading-background": "rgba(0, 0, 0, 0.4)"
}, D = { class: "HighwayStations-road" }, O = { class: "table-container" }, k = { class: "data-table" }, A = { key: 0 }, j = /* @__PURE__ */ e(/* @__PURE__ */ m({
	__name: "HighwayStations",
	props: {
		tokenInterface: {
			type: String,
			default: ""
		},
		tokenInterfaceParams: {
			type: Object,
			default: () => ({})
		},
		tokenInterfaceType: {
			type: String,
			default: "post"
		},
		tokenInterfaceIsFormData: {
			type: Boolean,
			default: !1
		},
		dataInterface: {
			type: String,
			default: ""
		},
		dataInterfaceParams: {
			type: Object,
			default: () => ({})
		},
		dataInterfaceType: {
			type: String,
			default: "post"
		},
		dataInterfaceIsFormData: {
			type: Boolean,
			default: !1
		}
	},
	setup(e, { emit: m }) {
		let j = m, M = e, N = b(""), P = b([]), F = b("降水"), I = b([]), L = b(!1), R = null;
		v(() => {
			z(), R = setInterval(() => {
				z();
			}, 1e3 * 60 * 10);
		}), _(() => {
			clearInterval(R);
		});
		let z = async () => {
			L.value = !0, P.value = (await t({
				url: M.dataInterface,
				method: M.dataInterfaceType,
				params: M.dataInterfaceParams,
				isFormData: M.dataInterfaceIsFormData,
				tokenInterface: M.tokenInterface,
				tokenInterfaceParams: M.tokenInterfaceParams,
				tokenInterfaceType: M.tokenInterfaceType,
				tokenInterfaceIsFormData: M.tokenInterfaceIsFormData
			}))?.ds || [], L.value = !1, P.value.unshift({ name: "全部" }), N.value = P.value[0]?.name || "", console.log(P.value), V(N.value);
		}, B = () => {
			j("close", "HighwayStations");
		}, V = (e) => {
			if (e === "全部") {
				let e = [];
				P.value.filter((e) => e.name !== "全部").forEach((t) => {
					console.log(t), e.push(...t.zdzds);
				}), I.value = e;
			} else I.value = P.value.find((t) => t.name === e)?.zdzds || [];
			H();
		}, H = () => {
			let e = {
				clickOpen: !1,
				spotObject: [{
					offsetX: -6,
					offsetY: -24,
					spotArrone: []
				}, {
					offsetX: -6,
					offsetY: -24,
					spotArrone: [],
					minZoom: 9
				}],
				drawArrObj: [],
				onlyLayerID: "station_highway"
			}, t = F.value === "降水" ? "rainfall_1h" : F.value === "温度" ? "temperature" : F.value === "能见度" ? "visibility" : "wind_speed", n = F.value === "降水" ? "mm" : F.value === "温度" ? "℃" : F.value === "能见度" ? "km" : "m/s";
			I.value.forEach((r) => {
				let i = "";
				r[t] !== null && r[t] !== 999999 && (i = t === "visibility" ? r[t] / 1e3 + "" : r[t]);
				let a = `
        <div style='display:flex;align-items:center;justify-content:center;flex-direction:column;position:relative;'>
          <div style='color:blue;font-size:14px;font-bold:true;transform:scale(0.9);text-shadow: 1px 0 #fff,-1px 0 #fff,0 1px #fff,0 -1px #fff,1px 1px #fff,-1px -1px #fff,1px -1px #fff,-1px 1px #fff;'>
            ${i}${n}
          </div>
          
        <div style='width:8px;height:8px;border-radius:50%;background:#fff;border:1px solid #ccc;padding:2px;display:flex;justify-content:space-around'>
          </div>
          
          <div style='color:#414445;font-size:12px;transform:translateX(-50%) scale(0.9);text-shadow: 1px 0 #fff,-1px 0 #fff,0 1px #fff,0 -1px #fff,1px 1px #fff,-1px -1px #fff,1px -1px #fff,-1px 1px #fff;position:absolute;bottom: -14px;left: 50%;white-space: nowrap;'>
            ${r.station_name}
          </div>
        </div>
        `, o = {
					lng: r.longitude,
					lat: r.latitude,
					htmlString: a,
					data: r,
					otherData: { markId: "station_highway" }
				};
				r.station_number.charAt(0) === "5" ? e.spotObject[0].spotArrone.push(o) : e.spotObject[1].spotArrone.push(o);
			}), j("addMarker", {
				mapMarker: e,
				removeMarker: "station_highway"
			});
		};
		return (e, t) => {
			let m = r, _ = o, v = i, b = a, j = n;
			return T((y(), u("div", E, [
				d("div", { class: "HighwayStations-head" }, [d("div", { class: "HighwayStations-head-top" }, [t[2] ||= d("div", null, "沿线自动站数据", -1), d("div", {
					class: "closeBtn",
					onClick: B
				})]), t[3] ||= d("img", {
					class: "HighwayStations-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)]),
				d("div", D, [t[4] ||= f(" 路线选择： ", -1), p(_, {
					modelValue: C(N),
					"onUpdate:modelValue": t[0] ||= (e) => h(N) ? N.value = e : N = e,
					placeholder: "请选择路线",
					teleported: !1,
					class: "dark-select",
					onChange: V
				}, {
					default: w(() => [(y(!0), u(s, null, x(C(P), (e) => (y(), c(m, {
						key: e.name,
						label: e.name,
						value: e.name
					}, null, 8, ["label", "value"]))), 128))]),
					_: 1
				}, 8, ["modelValue"])]),
				t[11] ||= d("div", null, "显示设置：", -1),
				p(b, {
					modelValue: C(F),
					"onUpdate:modelValue": t[1] ||= (e) => h(F) ? F.value = e : F = e,
					onChange: H
				}, {
					default: w(() => [
						p(v, {
							value: "降水",
							style: {
								color: "#ccc",
								"margin-right": "20px"
							}
						}, {
							default: w(() => [...t[5] ||= [f("降水(mm)", -1)]]),
							_: 1
						}),
						p(v, {
							value: "温度",
							style: {
								color: "#ccc",
								"margin-right": "20px"
							}
						}, {
							default: w(() => [...t[6] ||= [f("温度(℃)", -1)]]),
							_: 1
						}),
						p(v, {
							value: "能见度",
							style: {
								color: "#ccc",
								"margin-right": "20px"
							}
						}, {
							default: w(() => [...t[7] ||= [f("能见度(kkm)", -1)]]),
							_: 1
						}),
						p(v, {
							value: "大风",
							style: { color: "#ccc" }
						}, {
							default: w(() => [...t[8] ||= [f("大风(m/s)", -1)]]),
							_: 1
						})
					]),
					_: 1
				}, 8, ["modelValue"]),
				d("div", O, [d("table", k, [t[10] ||= d("thead", null, [d("tr", null, [
					d("th", null, "站名"),
					d("th", null, "降水"),
					d("th", null, "温度"),
					d("th", null, "能见度"),
					d("th", null, "大风")
				])], -1), d("tbody", null, [(y(!0), u(s, null, x(C(I), (e, t) => (y(), u("tr", { key: t }, [
					d("td", null, S(e.station_name || "--"), 1),
					d("td", { class: g({ active: C(F) === "降水" }) }, S(e.rainfall_1h !== null && e.rainfall_1h !== 999999 ? e.rainfall_1h : "--"), 3),
					d("td", { class: g({ active: C(F) === "温度" }) }, S(e.temperature !== null && e.temperature !== 999999 ? e.temperature : "--"), 3),
					d("td", { class: g({ active: C(F) === "能见度" }) }, S(e.visibility !== null && e.visibility !== 999999 ? e.visibility / 1e3 : "--"), 3),
					d("td", { class: g({ active: C(F) === "大风" }) }, S(e.wind_speed !== null && e.wind_speed !== 999999 ? e.wind_speed : "--"), 3)
				]))), 128)), C(I).length ? l("", !0) : (y(), u("tr", A, [...t[9] ||= [d("td", {
					colspan: "5",
					class: "empty-state"
				}, "暂无数据", -1)]]))])])])
			])), [[j, C(L)]]);
		};
	}
}), [["__scopeId", "data-v-99a6c0fb"]]);
//#endregion
export { j as t };
