hejianhao
2025-04-01 be74b258ca3c50f753c7e9abcc17a27999ea8ab5
Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory
1个文件已修改
32 ■■■■ 已修改文件
src/views/login/index.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="login-page">
    <div class="login-content">
    <div class="login-content" :style="contentStyle">
      <div class="login-title">
        InnoLab
      </div>
@@ -20,7 +20,7 @@
        </div>
        <div class="login-btn">
          <el-button type="primary" class="login-btn-item" @click="login">登录</el-button>
          <el-button type="primary" class="login-btn-item" @click="login">立即登录</el-button>
        </div>
      </div>
@@ -32,14 +32,35 @@
  name: 'Login',
  data() {
    return {
      windowWidth: window.innerWidth,
      loginForm: {
        account: '',
        password: ''
      },
      viewWidth: ''
      viewWidth: '',
      scale: 1
    }
  },
  computed: {
    contentStyle() {
      return {
        transform: `scale(${this.scale})`,
        transformOrigin: 'center center'
      }
    }
  },
  watch: {
    viewWidth(newWidth) {
      if (newWidth <= 900) { // 小屏平板
        this.scale = 0.9
      } else if (newWidth <= 1200) { // 平板尺寸
        this.scale = 0.8
      } else {
        this.scale = 1
      }
    }
  },
  created() {
    // 初始化获取窗口宽度
    this.viewWidth = window.innerWidth
@@ -57,6 +78,7 @@
      console.log(this.viewWidth)
    },
    login() {
      this.$router.push('/')
      console.log(this.loginForm)
    }
  }
@@ -98,6 +120,7 @@
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
    .login-title {
      // width: 70%;
@@ -123,7 +146,6 @@
      width: 100%;
      .form-item {
        width: calc(100% - 80px);
        height: 60px;
        border-radius: 30px;
        border: 2px solid #DBDBDB;