import "./rolldown-runtime-Dd0fQ6-X.mjs";
import { a as e, n as t, r as n } from "./component-AqiMonitor-DoGm_NCt.mjs";
import { Fragment as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, getCurrentInstance as c, onMounted as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, vModelCheckbox as m, withDirectives as h } from "vue";
//#region src/components/RadarChart/RadarChart.vue?vue&type=script&setup=true&lang.ts
var g = {
	class: "RadarChart",
	"element-loading-background": "rgba(0, 0, 0, 0.4)"
}, _ = { class: "RadarChart__head" }, v = { class: "RadarChart__head-top" }, y = { class: "RadarChart__body" }, b = { class: "display-settings" }, x = { class: "setting-item" }, S = { class: "alarm-count" }, C = { class: "table-container" }, w = { class: "table-scroll-body" }, T = { class: "data-table" }, E = ["title"], D = { style: {
	width: "140px",
	"white-space": "nowrap"
} }, O = { style: {
	width: "80px",
	"text-align": "center"
} }, k = { key: 0 }, A = /* @__PURE__ */ t(/* @__PURE__ */ s({
	__name: "RadarChart",
	props: {
		appKey: {
			type: String,
			default: ""
		},
		appSalt: {
			type: String,
			default: ""
		},
		baseHttp: {
			type: String,
			default: ""
		},
		ids: {
			type: Object,
			default: () => ({})
		},
		title: {
			type: String,
			default: "雷达回波dBZ(近两小时)"
		}
	},
	emits: ["close"],
	setup(t, { emit: s }) {
		let A = c()?.appContext.config.globalProperties.$bus, j = t, M = s, N = d(!1), P = d([]), F = d(!0), I = d(0);
		l(() => {
			A?.on("toComponent", (e) => {
				e.componentName === "RadarChart" && L();
			}), L();
		});
		let L = async () => {
			await R();
		}, R = async () => {
			N.value = !0;
			let e = await n({
				appKey: j.appKey,
				appSalt: j.appSalt,
				id: j.ids.data.id,
				variables: {},
				baseHttp: j.baseHttp,
				reqType: j.ids.data.reqType,
				isFormData: j.ids.data.isFormData
			});
			N.value = !1, console.log(e, "雷达数据");
			let t = e.data?.result?.output || [];
			t && t.length > 0 && (P.value = t.map((e) => ({
				...e,
				areaName: e.area_name || e.areaName || "",
				alarmTime: e.alarm_time || e.alarmTime || "",
				dBZValue: e.dbz_value || e.dBZValue || ""
			})), I.value = P.value.filter((e) => Number(e.dBZValue) > 40).length);
		}, z = () => {
			M("close", "RadarChart");
		};
		return (n, s) => {
			let c = e;
			return h((u(), a("div", g, [o("div", _, [o("div", v, [o("div", null, p(t.title), 1), o("div", {
				class: "closeBtn",
				onClick: z,
				title: "关闭"
			})]), s[1] ||= o("img", {
				class: "RadarChart__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)]), o("div", y, [o("div", b, [
				s[3] ||= o("label", { class: "setting-label" }, "显示设置：", -1),
				o("div", x, [h(o("input", {
					type: "checkbox",
					id: "show-radar",
					class: "setting-checkbox",
					"onUpdate:modelValue": s[0] ||= (e) => F.value = e
				}, null, 512), [[m, F.value]]), s[2] ||= o("label", {
					for: "show-radar",
					class: "setting-checkbox-label"
				}, "显示雷达回波", -1)]),
				o("span", S, "阈值报警:" + p(I.value) + "(个)", 1)
			]), o("div", C, [s[5] ||= o("table", { class: "data-table" }, [o("thead", null, [o("tr", null, [
				o("th", { style: { "text-align": "center" } }, "区域名"),
				o("th", { style: {
					width: "140px",
					"text-align": "center"
				} }, "报警时间"),
				o("th", { style: {
					width: "80px",
					"text-align": "center"
				} }, "dBZ值")
			])])], -1), o("div", w, [o("table", T, [o("tbody", null, [(u(!0), a(r, null, f(P.value, (e, t) => (u(), a("tr", { key: t }, [
				o("td", {
					style: {
						overflow: "hidden",
						"text-overflow": "ellipsis",
						"white-space": "nowrap"
					},
					title: e.areaName
				}, p(e.areaName), 9, E),
				o("td", D, p(e.alarmTime), 1),
				o("td", O, p(e.dBZValue), 1)
			]))), 128)), !P.value || !P.value.length ? (u(), a("tr", k, [...s[4] ||= [o("td", {
				colspan: "4",
				class: "empty-state"
			}, "暂无数据", -1)]])) : i("", !0)])])])])])])), [[c, N.value]]);
		};
	}
}), [["__scopeId", "data-v-addcf1b8"]]);
//#endregion
export { A as t };
