LoginDataCenter.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="login-container">
  3. <!-- 标题 -->
  4. <h1 class="title">数据管理中心</h1>
  5. <!-- 登录框(切图外框) -->
  6. <div class="login-frame">
  7. <div class="flex center">
  8. <LoginForm />
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script setup>
  14. import { ref } from 'vue';
  15. import LoginForm from './LoginFormDataCenter.vue';
  16. // 响应式数据
  17. const username = ref('');
  18. const password = ref('');
  19. // 登录方法
  20. const handleLogin = () => {
  21. if (!username.value) {
  22. alert('请输入用户名');
  23. return;
  24. }
  25. if (!password.value) {
  26. alert('请输入密码');
  27. return;
  28. }
  29. // 这里可对接接口,示例仅打印
  30. console.log('登录信息:', { username: username.value, password: password.value });
  31. };
  32. // 忘记密码
  33. const handleForgotPwd = () => {
  34. alert('跳转到忘记密码页面');
  35. };
  36. </script>
  37. <style scoped>
  38. .login-container {
  39. width: 100%;
  40. height: 100%;
  41. background: url('@/assets/images/vent/loginDataCenter/dataCenterBg.png') no-repeat center;
  42. background-size: 100% 100%;
  43. overflow: hidden;
  44. position: relative;
  45. }
  46. /* 标题样式 */
  47. .title {
  48. position: absolute;
  49. top: 24vh;
  50. left: 20%;
  51. transform: translateX(-50%);
  52. color: #e2e8f0;
  53. font-size: 24px;
  54. font-weight: 800;
  55. font-style: italic;
  56. letter-spacing: 5px;
  57. margin: 0;
  58. }
  59. /* 登录框外框(切图) */
  60. .login-frame {
  61. position: absolute;
  62. top: 55%;
  63. left: 20%;
  64. transform: translate(-50%, -50%);
  65. width: 38%;
  66. height: 40%;
  67. background: url('@/assets/images/vent/loginDataCenter/loginForm.png') no-repeat center;
  68. background-size: 100% 100%;
  69. }
  70. /* 登录表单 */
  71. .login-form {
  72. width: 80%;
  73. display: flex;
  74. flex-direction: column;
  75. }
  76. .input-item {
  77. width: 100%;
  78. }
  79. .input-item:focus {
  80. border-color: #3b82f6;
  81. box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
  82. }
  83. .input-item::placeholder {
  84. color: #94a3b8;
  85. }
  86. .forgot-pwd {
  87. text-align: right;
  88. }
  89. .forgot-pwd a {
  90. color: #94a3b8;
  91. font-size: 0.8rem;
  92. text-decoration: none;
  93. transition: color 0.3s;
  94. }
  95. .forgot-pwd a:hover {
  96. color: #3b82f6;
  97. }
  98. .login-btn {
  99. width: 100%;
  100. padding: 0.8rem;
  101. background: #3b82f6;
  102. border: none;
  103. border-radius: 4px;
  104. color: #fff;
  105. font-size: 1rem;
  106. font-weight: bold;
  107. cursor: pointer;
  108. transition: all 0.3s;
  109. box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  110. }
  111. .login-btn:hover {
  112. background: #2563eb;
  113. box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
  114. }
  115. </style>