login.vue 3.3 KB

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