kimi
2020-01-23 b8b9fa012c7faeda2a1618a96afa9d2e2c07fdb8
no message
2个文件已修改
96 ■■■■■ 已修改文件
src/views/Mine.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Mine.vue
@@ -51,7 +51,7 @@
                    <div class="card3_div" style="width: 40%; height: 34vh; overflow-y: auto;  border-right: 1px solid #333333;">
                        <el-table
                                :data="tableData"
                                height="250"
                                height="200"
                                highlight-current-row
                                @row-click="setActiveTableData"
                                style="width: 100%">
@@ -239,8 +239,8 @@
        color: #999;
    }
    .card2_body {
        height: 100px;
        line-height: 100px;
        height: 70px;
        line-height: 70px;
        font-size: 34px; 
        font-weight: bold; 
    }
src/views/login.vue
@@ -1,37 +1,39 @@
<template>
  <div class="login">
  <div class="login" ref="hello_div">
    <!-- <div class="img-container">
      <img :src="loginImg" alt="">
    </div> -->
    <el-form ref="loginForm" :model="loginForm" class="login-form" label-position="left">
      <el-form-item prop="loginName">
        <el-input
          v-model="loginForm.loginName"
          placeholder="输入用户名"
          name="loginName"
          type="text"
        >
        </el-input>
      </el-form-item>
      <el-form-item prop="password">
        <el-input
          :type="passwordType"
          v-model="loginForm.password"
          placeholder="输入密码"
          name="password"
          @keyup.enter.native="handleLogin"
        >
          <span slot="suffix" class="suffix-icon" :class="{eyeOpen: isOpen}" @click="showPwd">
            <svg-icon :icon-class="eyeIconClass" />
          </span>
        </el-input>
      </el-form-item>
      <el-button :loading="loading" class="loginButton" type="primary" @click.native.prevent="handleLogin">登录</el-button>
    </el-form>
        <div class="login_" ref="logon_div">
            <el-form ref="loginForm" :model="loginForm" class="login-form" label-position="left">
                <el-form-item prop="loginName">
                    <el-input
                        v-model="loginForm.loginName"
                        placeholder="输入用户名"
                        name="loginName"
                        type="text"
                    >
                    </el-input>
                </el-form-item>
                <el-form-item prop="password">
                    <el-input
                        :type="passwordType"
                        v-model="loginForm.password"
                        placeholder="输入密码"
                        name="password"
                        @keyup.enter.native="handleLogin"
                    >
                        <span slot="suffix" class="suffix-icon" :class="{eyeOpen: isOpen}" @click="showPwd">
                            <svg-icon :icon-class="eyeIconClass" />
                        </span>
                    </el-input>
                </el-form-item>
                <el-button :loading="loading" class="loginButton" type="primary" @click.native.prevent="handleLogin">登录</el-button>
            </el-form>
        </div>
  </div>
</template>
@@ -56,8 +58,31 @@
      isOpen: false // 根据状态显示不同样式类名
    }
  },
    mounted() {
        this.setWH();
    },
  methods: {
        setWH() {
            //获取屏幕宽度
            let hello_Width = this.$refs.hello_div.offsetWidth;
        //    let hello_Height = this.$refs.hello_div.offsetHeight;
            let hello_Height = document.documentElement.clientHeight;
            //获取登录元素宽度
            let logon_Width = this.$refs.logon_div.offsetWidth;
            let logon_Height = this.$refs.logon_div.offsetHeight;
            //设置登录元素的magin-left
            if (hello_Width>logon_Width) {
                let margin_left = (hello_Width - logon_Width)/2;
                this.$refs.logon_div.style['margin-left'] = margin_left + "px";
            }
            if (hello_Height>logon_Height) {
                let margin_top = (hello_Height - logon_Height)/2;
                this.$refs.logon_div.style['margin-top'] = margin_top + "px";
            }
        },
    // 忘记密码回调
   
    // 清除用户名
@@ -106,5 +131,10 @@
</script>
<style >
    .login_ {
        max-width: 350px;
        background-color: #f9f9fb;
        padding: 20px;
    }
</style>