LoginView.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <!-- 界面整体背景图 -->
  3. <div class="container">
  4. <!-- 界面左边背景图 -->
  5. <div class="left"></div>
  6. <!-- 界面右边背景图 -->
  7. <div class="right">
  8. <!-- 分为上下两部分,上面是标题,使用背景图片 -->
  9. <div class="right_top"></div>
  10. <!-- 登录界面 -->
  11. <div class="right_bottom">
  12. <!-- 登录标题 -->
  13. <h3 class="right_bottom_dl">登&nbsp;录</h3>
  14. <el-form
  15. ref="loginForm"
  16. :model="loginForm"
  17. :rules="LoginRules"
  18. class="login-form"
  19. style="width: 70%"
  20. hide-required-asterisk="false"
  21. >
  22. <!-- 账号密码登录 -->
  23. <el-form-item prop="username" label="账号">
  24. <el-input
  25. v-model="loginForm.username"
  26. type="text"
  27. placeholder="请输入手机号/邮箱"
  28. >
  29. </el-input>
  30. </el-form-item>
  31. <el-form-item prop="password" label="密码">
  32. <el-input
  33. v-model="loginForm.password"
  34. type="password"
  35. placeholder="请输入密码"
  36. @keyup.enter.native="getCode"
  37. >
  38. </el-input>
  39. </el-form-item>
  40. <el-checkbox v-model="loginForm.rememberMe" style="margin: 0 0 25px 0"
  41. >记住密码</el-checkbox
  42. >
  43. <!-- 下方的登录按钮 -->
  44. <el-form-item style="width: 100%">
  45. <el-button
  46. :loading="loading"
  47. size="medium"
  48. type="primary"
  49. style="width: 100%"
  50. @click.native.prevent="getCode"
  51. class="custom-style"
  52. >
  53. <span v-if="!loading">登 录</span>
  54. <span v-else>登 录 中...</span>
  55. </el-button>
  56. </el-form-item>
  57. </el-form>
  58. </div>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. loginForm: {
  67. username: "admin",
  68. password: "admin123",
  69. rememberMe: true,
  70. tenantName: "泸州公安局文库系统",
  71. },
  72. LoginRules: {
  73. username: [
  74. { required: true, trigger: "blur", message: "账号错误" }
  75. ],
  76. password: [
  77. { required: true, trigger: "blur", message: "密码错误" }
  78. ],
  79. },
  80. };
  81. },
  82. };
  83. </script>
  84. <style scoped lang='scss'>
  85. .container {
  86. background: url(../assets/img/dl_background.png);
  87. background-size: cover;
  88. height: 100%;
  89. width: 100%;
  90. display: flex;
  91. .left {
  92. background: url(../assets/img/dl_logo.png) no-repeat center/contain;
  93. height: calc(100vh * (894 / 1080));
  94. width: calc(100vw * (820 / 1920));
  95. margin-top: 93px;
  96. margin-left: 189px;
  97. }
  98. .right {
  99. height: calc(100vh * (780 / 1080));
  100. width: calc(100vw * (516 / 1920));
  101. // background: red;
  102. margin-top: 140px;
  103. margin-left: 193px;
  104. .right_top {
  105. background: url(../assets/img/dl_title.png) no-repeat center/contain;
  106. height: calc(100vh * (70 / 1080));
  107. width: calc(100vw * (497 / 1920));
  108. font-family: YouSheBiaoTiHei-Regular;
  109. }
  110. .right_bottom {
  111. background: url(../assets/img/dl_login.png) no-repeat center/contain;
  112. height: calc(100vh * (630 / 1080));
  113. width: calc(100vw * (482 / 1920));
  114. box-sizing: border-box;
  115. border: 1px solid rgba(0, 116, 223, 0.2);
  116. margin-top: 30px;
  117. .right_bottom_dl {
  118. width: 60px;
  119. height: 42px;
  120. font-size: 25px;
  121. font-family: PingFang SC-Medium, PingFang SC;
  122. font-weight: 500;
  123. color: #ffffff;
  124. line-height: 30px;
  125. margin-left: 45%;
  126. margin-top: 15%;
  127. }
  128. .login-form {
  129. margin-left: 60px;
  130. margin-top: -30px;
  131. }
  132. }
  133. }
  134. ::v-deep .el-input--medium .el-input__inner {
  135. background:#03486F;
  136. border: 1px solid #03486F;
  137. }
  138. }
  139. </style>