<template>
  <div class="app-container">
    <el-form class="login-form to-right" :model="ruleForm">
      <h3 class="title">延吉市自然灾害综合风险</h3>
      <h3 class="sub-title">普查成果应用平台</h3>
      <div class="login-container">
        <h4>请登录</h4>
        <div class="el-form-item is-success is-required">
          <el-form-item prop="pass">
            <el-input prefix-icon="el-icon-user-solid" type="text"
                      v-model="ruleForm.pass"
                      placeholder="请输入用户名"></el-input>
          </el-form-item>
          <el-form-item prop="checkPass">
            <el-input prefix-icon="el-icon-s-tools" show-password type="password"
                      placeholder="请输入密码" v-model="ruleForm.checkPass"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" style="width: 100%;" @click="login">提交</el-button>
          </el-form-item>
        </div>
      </div>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'Login',
  data() {
    return {
      ruleForm: {
        pass: "",
        checkPass: "",
      },
    }
  },
  components: {},
  methods: {
    login() {
      if (this.ruleForm.pass == "admin" && this.ruleForm.checkPass == "admin123") {
        this.$router.push('/index')
      }else{
        this.$message.error(`账号或密码错误!`);
      }
    }
  },
}
</script>
<style scoped>
.app-container {
  background: url("../assets/images/yj-dlbg.png") no-repeat center;
  background-size: 100% 100%;
  width: 100%;
  height: 100vh;
}

.login-form {
  border-radius: 6px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding-top: 11%;
}

.login-form h3 {
  font-family: "myfont4";
  text-shadow: 0 0 15px rgb(0 246 255 / 70%);
}

.title {
  margin: 0px auto 10px auto;
  text-align: center;
  color: #fff;
  font-family: zk;
  font-size: 38px;
}

.to-right {
  margin-left: 30%;
}

.sub-title {
  text-align: center;
  color: #fff;
  font-family: zk;
  font-size: 38px;
  margin: 0px auto 20px auto;
}

.login-form .login-container {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  width: 450px;
  padding: 30px;
  -webkit-box-shadow: 0 0 20px rgb(255 255 255 / 50%);
  box-shadow: 0 0 20px rgb(255 255 255 / 50%);
  text-align: left;
}

.login-form .login-container h4 {
  border-bottom: #3e6bfb 1px solid;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  display: inline-block;
  margin-top: 0;
  padding-bottom: 5px;
  margin-bottom: 20px;
  text-align: left;
}

.el-form-item {
  margin-bottom: 1rem;
}

.el-form-item__content {
  line-height: 40px;
  position: relative;
  font-size: 14px;
}

.login-form .el-input {
  height: 38px;
  margin-bottom: 15px;
}
</style>