import "./rolldown-runtime-Dd0fQ6-X.mjs";
import { D as e, O as t, k as n, m as r } from "./component-HighWayFreeze-C_Y5P0wN.mjs";
import { n as i, r as a } from "./component-AqiMonitor-DoGm_NCt.mjs";
import { i as o, n as s, r as c } from "./component-YCHome-CJTR9axy.mjs";
import { i as l, n as u } from "./component-ImageGeneration-Ch_ajmOP.mjs";
import { n as d } from "./component-LithiumBatteryMiningArea-Dj1DMKuU.mjs";
import { Fragment as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, onMounted as _, openBlock as v, reactive as y, ref as b, renderList as x, unref as S, withCtx as C, withKeys as w } from "vue";
//#region src/components/YCLoginNew/YCLoginNew.vue?vue&type=script&setup=true&lang.ts
var T = { class: "YCLoginNew" }, E = { class: "particles" }, D = { class: "login-container" }, O = { class: "login-wrapper" }, k = { class: "login-box" }, A = { class: "login-header" }, j = { class: "header-icon" }, M = { class: "input-icon-box" }, N = { class: "input-icon-box" }, P = /* @__PURE__ */ i(/* @__PURE__ */ g({
	__name: "YCLoginNew",
	props: {
		appKey: {
			type: String,
			default: ""
		},
		appSalt: {
			type: String,
			default: ""
		},
		baseHttp: {
			type: String,
			default: ""
		},
		ids: {
			type: Object,
			default: () => ({})
		}
	},
	setup(i, { emit: g }) {
		let P = i, F = g, I = b(), L = b(!1), R = y({
			username: "",
			password: ""
		}), z = {
			username: [{
				required: !0,
				message: "请输入手机号",
				trigger: "blur"
			}],
			password: [{
				required: !0,
				message: "请输入密码",
				trigger: "blur"
			}]
		};
		_(() => {
			B();
		});
		let B = async () => {}, V = () => {
			I.value && I.value.validate(async (e) => {
				if (e) {
					L.value = !0;
					let e = {
						name: R.username,
						pwd: R.password
					}, t = (await a({
						appKey: P.appKey,
						appSalt: P.appSalt,
						id: P.ids.data.id,
						variables: { str: d.encode(JSON.stringify(e)) },
						baseHttp: P.baseHttp,
						reqType: P.ids.data.reqType,
						isFormData: P.ids.data.isFormData
					})).data.result.output;
					if (L.value = !1, !t || t.length === 0) {
						s({
							message: "账号或密码错误",
							type: "error",
							zIndex: 6e3,
							duration: 1500
						});
						return;
					}
					s({
						message: "登录成功！",
						type: "success",
						zIndex: 6e3,
						duration: 1500
					}), window.localStorage.setItem("user", JSON.stringify(t)), setTimeout(() => {
						t.length > 1 ? F("toPage", "/home") : F("toPage", t[0].web_page);
					}, 1e3);
				}
			});
		};
		return (i, a) => {
			let s = r, d = l, g = o, _ = u, y = c;
			return v(), p("div", T, [
				a[11] ||= m("div", { class: "glow-bg" }, null, -1),
				a[12] ||= m("div", { class: "glow-bg-2" }, null, -1),
				m("div", E, [(v(), p(f, null, x(20, (e) => m("div", {
					class: "particle",
					key: e
				})), 64))]),
				m("div", D, [
					a[9] ||= m("div", { class: "page-header" }, [m("h1", {
						class: "main-title",
						"data-text": "宜春市气象服务平台"
					}, "宜春市气象服务平台"), m("p", { class: "sub-title" }, "专业气象服务 · 守护您的生产与生活")], -1),
					a[10] ||= m("div", { class: "divider-line" }, null, -1),
					m("div", O, [
						a[5] ||= m("div", { class: "corner top-left" }, null, -1),
						a[6] ||= m("div", { class: "corner top-right" }, null, -1),
						a[7] ||= m("div", { class: "corner bottom-left" }, null, -1),
						a[8] ||= m("div", { class: "corner bottom-right" }, null, -1),
						m("div", k, [m("div", A, [
							m("div", j, [h(s, { size: 32 }, {
								default: C(() => [h(S(t))]),
								_: 1
							})]),
							a[2] ||= m("h2", { class: "title" }, "系统登录", -1),
							a[3] ||= m("p", { class: "en-title" }, "SYSTEM LOGIN", -1)
						]), h(y, {
							model: R,
							rules: z,
							ref_key: "loginFormRef",
							ref: I,
							onKeyup: w(V, ["enter"]),
							class: "login-form"
						}, {
							default: C(() => [
								h(g, { prop: "username" }, {
									default: C(() => [h(d, {
										modelValue: R.username,
										"onUpdate:modelValue": a[0] ||= (e) => R.username = e,
										placeholder: "请输入手机号",
										clearable: "",
										size: "large",
										class: "custom-input"
									}, {
										prefix: C(() => [m("div", M, [h(s, null, {
											default: C(() => [h(S(n))]),
											_: 1
										})])]),
										_: 1
									}, 8, ["modelValue"])]),
									_: 1
								}),
								h(g, { prop: "password" }, {
									default: C(() => [h(d, {
										modelValue: R.password,
										"onUpdate:modelValue": a[1] ||= (e) => R.password = e,
										type: "password",
										placeholder: "请输入密码",
										"show-password": "",
										size: "large",
										class: "custom-input"
									}, {
										prefix: C(() => [m("div", N, [h(s, null, {
											default: C(() => [h(S(e))]),
											_: 1
										})])]),
										_: 1
									}, 8, ["modelValue"])]),
									_: 1
								}),
								h(g, { class: "btn-item" }, {
									default: C(() => [h(_, {
										class: "login-btn",
										type: "primary",
										onClick: V,
										loading: L.value,
										size: "large"
									}, {
										default: C(() => [...a[4] ||= [m("span", { class: "btn-text" }, "登 录", -1), m("div", { class: "btn-glow" }, null, -1)]]),
										_: 1
									}, 8, ["loading"])]),
									_: 1
								})
							]),
							_: 1
						}, 8, ["model"])])
					])
				])
			]);
		};
	}
}), [["__scopeId", "data-v-425fab99"]]);
//#endregion
export { P as t };
