<template>
  <div id="adminLogin">
    <el-row>
      <el-col :span="24">
        <el-col :span="5" class="info"> </el-col>
        <el-col :span="13" class="login">
          <el-col :span="24" class="title">
            管理登录
          </el-col>
          <el-col :span="24" class="form">
            <el-form ref="form" :model="form" :rules="rules" label-width="120px">
              <el-form-item label="手机号" prop="phone">
                <el-input v-model="form.phone" placeholder="请输入手机号" :minlength="11" :maxlength="11"></el-input>
              </el-form-item>
              <el-form-item label="登录密码" prop="passwd">
                <el-input v-model="form.passwd" placeholder="请输入登录密码" show-password></el-input>
              </el-form-item>
              <el-form-item label="用户类别" prop="role">
                <el-radio v-model="form.role" label="0">管理员</el-radio>
                <el-radio v-model="form.role" label="1">合作机构&业务管理员</el-radio>
              </el-form-item>
              <el-col :span="24" class="btn">
                <el-button type="primary" @click="onSubmit">登录</el-button>
              </el-col>
            </el-form>
          </el-col>
        </el-col>
        <el-col :span="6" class="info"> </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'adminLogin',
  props: {},
  components: {},
  data: function() {
    return {
      form: {},
      rules: {
        phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
        passwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
        role: [{ required: true, message: '请输入用户类别', trigger: 'blur' }],
      },
    };
  },
  created() {},
  methods: {
    onSubmit() {
      console.log(this.form);
    },
  },
  computed: {
    ...mapState(['user']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.info {
  height: 800px;
}
.login {
  padding: 15px 0;
  .title {
    text-align: center;
    font-size: 40px;
    padding: 40px 0;
  }
  .form {
    .btn {
      text-align: center;
    }
  }
}
</style>
