// Login screen. Original logo (geometric registration-mark), original product name. const Login = ({ onLogin }) => { const [user, setUser] = React.useState("admin"); const [pass, setPass] = React.useState("••••••••"); const [company, setCompany] = React.useState("std"); const [companyOpen, setCompanyOpen] = React.useState(false); const [submitting, setSubmitting] = React.useState(false); const submit = (e) => { e && e.preventDefault(); if (!user || !pass) return; setSubmitting(true); setTimeout(() => onLogin({ user, company: XLY.COMPANIES.find(c => c.id === company)?.name }), 480); }; return (
{/* Logo + wordmark */}
{/* Three overlapping registration squares — print-press metaphor */} {/* registration cross */}
XLY-ERP
印刷制造管理平台
{/* User */}
setUser(e.target.value)} placeholder="请输入用户名" style={loginStyles.input} />
{/* Password */}
setPass(e.target.value)} placeholder="请输入密码" style={loginStyles.input} />
{/* Company picker */}
{companyOpen ? (
{XLY.COMPANIES.map((c, i) => { const sel = c.id === company; return (
{ setCompany(c.id); setCompanyOpen(false); }} style={{ padding: "9px 12px", color: "#fff", fontSize: 13, cursor: "pointer", background: sel ? "var(--accent)" : "transparent", borderTop: i === 0 ? "none" : "1px solid rgba(255,255,255,0.04)", }} onMouseEnter={(e) => { if (!sel) e.currentTarget.style.background = "rgba(255,255,255,0.06)"; }} onMouseLeave={(e) => { if (!sel) e.currentTarget.style.background = "transparent"; }} > {c.name}
); })}
) : null}
{/* Submit */}
{/* Footer */}
XLY 软件 · 印刷制造管理平台 · 版权所有 © 2017–2026
); }; const loginStyles = { fieldWrap: { display: "flex", alignItems: "center", height: 38, background: "rgba(255,255,255,0.95)", border: "1px solid rgba(255,255,255,0.15)", marginBottom: 10, }, fieldIcon: { width: 36, display: "inline-flex", alignItems: "center", justifyContent: "center", color: "rgba(0,0,0,0.5)" }, fieldDivider: { width: 1, height: 18, background: "rgba(0,0,0,0.12)" }, input: { flex: 1, height: "100%", border: "none", background: "transparent", paddingLeft: 10, paddingRight: 10, fontSize: 13, color: "#1a2332", outline: "none", fontFamily: "inherit", }, }; window.Login = Login;