login.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div id="login">
  3. <el-row>
  4. <el-col :span="24" class="style" :style="'background: url(' + loginBei + ')no-repeat center center;'">
  5. <el-col :span="24" class="login">
  6. <el-col :span="16" class="left">
  7. <el-image class="image" :src="logoUrl"></el-image>
  8. <p class="title">吉林省高等学校毕业生就业信息网</p>
  9. </el-col>
  10. <el-col :span="8" class="right">
  11. <el-col :span="24" class="title">
  12. 教师甄选登录系统
  13. </el-col>
  14. <el-col :span="24">
  15. <el-tabs v-model="activeName" type="border-card" :stretch="true">
  16. <el-tab-pane label="账号登录" name="first">
  17. <data-form
  18. :data="{}"
  19. :fields="fields"
  20. :rules="rules"
  21. @save="handleSave"
  22. :isNew="true"
  23. label-width="80px"
  24. :styles="{}"
  25. submitText="登陆"
  26. ></data-form>
  27. </el-tab-pane>
  28. <el-tab-pane label="扫码登录" name="second">
  29. 扫码登录
  30. </el-tab-pane>
  31. </el-tabs>
  32. </el-col>
  33. </el-col>
  34. </el-col>
  35. </el-col>
  36. </el-row>
  37. </div>
  38. </template>
  39. <script>
  40. import { mapState, createNamespacedHelpers } from 'vuex';
  41. import dataForm from '@frame/components/form';
  42. import _ from 'lodash';
  43. const { mapActions } = createNamespacedHelpers('login');
  44. export default {
  45. name: 'login',
  46. metaInfo: { title: '登陆' },
  47. props: {},
  48. components: { dataForm },
  49. data: () => ({
  50. loginBei: require('../../assets/bg.jpg'),
  51. activeName: 'first',
  52. fields: [
  53. { label: '手机号', required: true, model: 'mobile', options: { maxLength: 11, minLength: 11 } },
  54. { label: '密码', required: true, model: 'passwd', type: 'password' },
  55. ],
  56. rules: {
  57. mobile: [{ required: true, message: '请输入手机号' }],
  58. passwd: [{ required: true, message: '请输入密码' }],
  59. },
  60. form: {},
  61. logoUrl: require('../../assets/logo.png'),
  62. }),
  63. created() {},
  64. computed: {},
  65. methods: {
  66. ...mapActions(['login']),
  67. async handleSave({ data }) {
  68. let res = await this.login({ user: data, router: this.$router });
  69. },
  70. },
  71. };
  72. </script>
  73. <style lang="less" scoped>
  74. .style {
  75. width: 100%;
  76. height: 100vh;
  77. background: #5dac81;
  78. background-size: cover;
  79. text-align: center;
  80. }
  81. .login {
  82. position: absolute;
  83. top: 20%;
  84. left: 15%;
  85. width: 850px;
  86. height: 400px;
  87. background-color: #ffffff8f;
  88. border: 1px solid #3f7dff;
  89. border-radius: 10px;
  90. }
  91. .login .left .image {
  92. margin: 80px 0 0 0;
  93. }
  94. .login .left .title {
  95. font-size: 30px;
  96. padding: 15px 0;
  97. color: #1770c4;
  98. font-family: cursive;
  99. text-shadow: -1px 0 #fff, 0 1px #fff, 1px 0 #fff, 0 -1px #fff;
  100. font-weight: 600;
  101. }
  102. .login .right {
  103. height: 398px;
  104. background: #fff;
  105. border-top-right-radius: 10px;
  106. border-bottom-right-radius: 10px;
  107. }
  108. .login .right .title {
  109. font-size: 20px;
  110. padding: 20px 0;
  111. font-weight: bold;
  112. }
  113. .el-tabs {
  114. height: 330px;
  115. border-bottom-right-radius: 10px;
  116. }
  117. /deep/.el-tabs__header {
  118. margin: 0;
  119. }
  120. /deep/.el-tabs__nav-wrap::after {
  121. background-color: transparent;
  122. }
  123. /deep/.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  124. padding-left: 30px;
  125. }
  126. /deep/.el-tabs--top .el-tabs__item.is-top:last-child {
  127. padding-right: 30px;
  128. }
  129. /deep/.el-tabs__item {
  130. padding: 0 30px;
  131. }
  132. /deep/.el-tabs--border-card > .el-tabs__content {
  133. padding: 0;
  134. }
  135. </style>