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