index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <div class="login-container">
  3. <div class="nav-header">安防综合管理平台</div>
  4. <el-form class="login-form" auto-complete="on" label-position="left">
  5. <div class="title-container">
  6. <h3 class="title">用户登录</h3>
  7. </div>
  8. <el-form-item prop="username" width="460px">
  9. <span class="svg-container">
  10. <svg-icon icon-class="user" />
  11. </span>
  12. <el-input
  13. ref="username"
  14. placeholder="请输入用户名"
  15. name="username"
  16. type="text"
  17. />
  18. </el-form-item>
  19. <el-form-item prop="password">
  20. <span class="svg-container">
  21. <svg-icon icon-class="password" />
  22. </span>
  23. <el-input ref="password" placeholder="请输入密码" name="password" />
  24. </el-form-item>
  25. <el-form-item
  26. prop="verificationCode"
  27. style="width: 66%; position: relative"
  28. >
  29. <img src="../../assets/code-verify.png" alt="" class="code-verify" />
  30. <span class="svg-container">
  31. <svg-icon icon-class="code" />
  32. </span>
  33. <el-input
  34. ref="verificationCode"
  35. placeholder="请输入验证码"
  36. name="verificationCode"
  37. />
  38. </el-form-item>
  39. <el-button
  40. class="login-button"
  41. style="width: 100%; margin-bottom: 30px; border-radius: 23px"
  42. >登 录</el-button
  43. >
  44. </el-form>
  45. </div>
  46. </template>
  47. <script>
  48. import { validUsername } from "@/utils/validate";
  49. export default {
  50. // name: 'Login',
  51. data() {
  52. return {};
  53. },
  54. watch: {},
  55. methods: {
  56. // }
  57. },
  58. };
  59. </script>
  60. <style lang="scss">
  61. /* 修复input 背景不协调 和光标变色 */
  62. /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
  63. $bg: #283443;
  64. $light_gray: #fff;
  65. $cursor: #fff;
  66. @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
  67. .login-container .el-input input {
  68. color: $cursor;
  69. }
  70. }
  71. /* reset element-ui css */
  72. .login-container {
  73. .el-input {
  74. display: inline-block;
  75. height: 47px;
  76. width: 85%;
  77. input {
  78. background: transparent;
  79. border: 0px;
  80. -webkit-appearance: none;
  81. border-radius: 0px;
  82. padding: 12px 5px 12px 15px;
  83. color: $light_gray;
  84. height: 47px;
  85. caret-color: $cursor;
  86. &:-webkit-autofill {
  87. box-shadow: 0 0 0px 1000px $bg inset !important;
  88. -webkit-text-fill-color: $cursor !important;
  89. }
  90. }
  91. }
  92. .el-form-item {
  93. border: 1px solid rgba(255, 255, 255, 0.1);
  94. background: rgba(0, 0, 0, 0.1);
  95. border-radius: 5px;
  96. color: #454545;
  97. }
  98. }
  99. </style>
  100. <style lang="scss" scoped>
  101. $bg: #2d3a4b;
  102. $dark_gray: #889aa4;
  103. $light_gray: #eee;
  104. .login-container {
  105. min-width:1280px;
  106. min-height: 100%;
  107. width: 100%;
  108. // background-color: $bg;
  109. background-image: url("../../assets/login-bg.png");
  110. background-size: cover;
  111. background-repeat: no-repeat;
  112. overflow: hidden;
  113. display: flex;
  114. // justify-content:center;
  115. align-items: center;
  116. .login-form {
  117. width: 30%;
  118. min-width: 400px;
  119. max-width: 100%;
  120. padding: 35px;
  121. margin-left: 60%;
  122. position: relative;
  123. background-image: url("../../assets/login-form-bg.png");
  124. background-size: 100% 100%;
  125. background-repeat: no-repeat;
  126. overflow: hidden;
  127. // border:1px dashed #000
  128. }
  129. .login-form::before {
  130. position: absolute;
  131. top: 0;
  132. left: 0;
  133. width: 10px;
  134. height: 10px;
  135. border-left: 2px solid #02a6b5;
  136. border-top: 2px solid #02a6b5;
  137. content: "";
  138. }
  139. .login-form::after {
  140. position: absolute;
  141. top: 0;
  142. right: 0;
  143. width: 10px;
  144. height: 10px;
  145. border-right: 2px solid #02a6b5;
  146. border-top: 2px solid #02a6b5;
  147. content: "";
  148. }
  149. .tips {
  150. font-size: 14px;
  151. color: #fff;
  152. margin-bottom: 10px;
  153. span {
  154. &:first-of-type {
  155. margin-right: 16px;
  156. }
  157. }
  158. }
  159. .svg-container {
  160. padding: 6px 5px 6px 15px;
  161. color: $dark_gray;
  162. vertical-align: middle;
  163. width: 30px;
  164. display: inline-block;
  165. }
  166. .title-container {
  167. position: relative;
  168. .title {
  169. font-size: 26px;
  170. color: $light_gray;
  171. margin: 0px auto 40px auto;
  172. text-align: center;
  173. font-weight: bold;
  174. }
  175. }
  176. .show-pwd {
  177. position: absolute;
  178. right: 10px;
  179. top: 7px;
  180. font-size: 16px;
  181. color: $dark_gray;
  182. cursor: pointer;
  183. user-select: none;
  184. }
  185. }
  186. .login-button {
  187. background: #5d88f9;
  188. font-size: 20px;
  189. color: #fff;
  190. border: none;
  191. }
  192. .login-button:hover {
  193. opacity: 0.7;
  194. }
  195. .code-verify {
  196. top: 3px;
  197. position: absolute;
  198. right: -108px;
  199. width: 82px;
  200. }
  201. // 头部导航样式
  202. .nav-header {
  203. min-width:1280px;
  204. position: absolute;
  205. top: 0;
  206. left: 0;
  207. width: 100%;
  208. color: #fff;
  209. text-align: center;
  210. font-size: 40px;
  211. line-height: 80px;
  212. background: url(../../assets/nav-header-bg.png);
  213. background-size: 100% 100%;
  214. background-repeat: no-repeat;
  215. }
  216. @media (max-width: 1440px) {
  217. .nav-header {
  218. font-size: 30px;
  219. line-height: 60px;
  220. }
  221. }
  222. </style>