<template>
  <div id="loginManage">
    <div class="login-box">
      <!--<div class="login-title">-->
      <!--<div class="login-logo">LOGO</div>-->
      <!--<div class="title-name">工业互联网标识数据交互中间件及资源池服务平台</div>-->
      <!--</div>-->
      <div class="login-content">
        <div class="content-title">知识图谱构建平台</div>
        <el-form ref="form" :model="form" label-width="0px">
          <el-form-item label="">
            <el-input placeholder="账号" v-model="form.username">
              <template slot="prepend"><i class="el-icon-user"></i></template>
            </el-input>
          </el-form-item>
          <el-form-item label="">
            <el-input type="password" placeholder="密码" v-model="form.password">
              <template slot="prepend"><i class="el-icon-lock"></i></template>
            </el-input>
          </el-form-item>
          <label style="float: left;color: #a8a8a8;margin-bottom: 25px">如果忘记密码，请联系系统管理员！</label>
          <el-form-item>
            <el-button type="primary" style="width: 100%" @click="login()">登录</el-button>
          </el-form-item>
        </el-form>
        <!--<div style="text-align: center;width: 100%;margin-top: 25px;color: #333333;cursor: pointer"-->
        <!--@click="register">注册-->
        <!--</div>-->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      form: {
        username: 'admin',
        password: '123456',
        type: 'admin'
      },
    }
  },
  mounted() {
  },
  methods: {
    login() {
      this.$store.dispatch('user/login', this.form).then((res) => {
        this.$router.push('/graphModel');
      }).catch((res) => {
        console.log(res);
      })
    },
    register() {
      this.$router.push('/register');
    }
  }
}
</script>

<style scoped lang="scss">
#loginManage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../assets/image/manage-bg.jpg") no-repeat;
  background-size: cover;
  overflow-y: auto;

  .login-box {
    width: 300px;
    margin: 250px auto 0 auto;
    height: 500px;
    /*display: flex;*/
  }

  .login-title {
    flex: 1;
    background: #6486aa4d;

    .login-logo {
      font-size: 40px;
      color: #ffffff;
      font-weight: bold;
      margin-bottom: 30px;
      margin-top: 150px;
      margin-left: 210px;
    }

    .title-name {
      font-size: 36px;
      color: #ffffff;
      /*text-align: center;*/
      margin-left: 210px;
    }
  }

  .login-content {
    width: 300px;
    height: auto;
    padding: 80px 60px;
    background: #FFFFFF;
    border-radius: 3px;
  }

  .content-title {
    font-size: 20px;
    text-align: center;
    font-weight: bold;
    color: #409EFF;
    margin-bottom: 60px;
  }

}
</style>
