1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<template>
  <div class="background">
    <div class="title-content">
      飞羽大气环境走航监测污染溯源报告智能生成系统
    </div>
 
    <div class="flexbox flex-space-around">
      <div class="input-box flexbox">
        <div class="flexbox-col align-items" style="margin: auto">
          <div class="flexbox-col input-content flex-space-between">
            <el-form
              :model="formObj"
              ref="formRef"
              :rules="rules"
              label-position="top"
            >
              <el-form-item label="用户名" prop="userName">
                <el-input
                  size="default"
                  v-model="formObj.userName"
                  placeholder="用户名"
                  style="width: 200px"
                />
              </el-form-item>
              <el-form-item label="密码" prop="password">
                <el-input
                  size="default"
                  type="password"
                  show-password
                  v-model="formObj.password"
                  placeholder="密码"
                  style="width: 200px"
                />
              </el-form-item>
            </el-form>
          </div>
          <div class="btn-login" @click="login">登录</div>
        </div>
      </div>
 
      <img :src="underwayPng" alt="走航监测" class="img-1" />
    </div>
  </div>
</template>
 
<script>
import underwayPng3 from '@/assets/mipmap/underway-3.png';
import underwayPng2 from '@/assets/mipmap/underway-2.png';
import underwayPng from '@/assets/mipmap/underway.png';
import { ElMessage } from 'element-plus';
 
export default {
  data() {
    return {
      formObj: {},
      rules: {
        userName: [
          {
            required: true,
            message: '请输入用户名',
            trigger: 'blur'
          }
        ],
        password: [
          {
            required: true,
            message: '请输入密码',
            trigger: 'blur'
          }
        ]
      }
    };
  },
  computed: {
    underwayPng() {
      if (import.meta.env.VITE_DATA_MODE == 'jingan') {
        return underwayPng2;
      } else {
        return underwayPng3;
      }
    }
  },
  methods: {
    login() {
      this.$refs.formRef.validate((valid) => {
        if (valid) {
          if (
            (this.formObj.userName == 'jingan' &&
              this.formObj.password == 'jingan123') ||
            (this.formObj.userName == 'feiyu' &&
              this.formObj.password == 'fyhb123')
          ) {
            this.$router.replace('/index/hmode');
          } else {
            ElMessage({
              message: '用户名或密码错误',
              type: 'error'
            });
          }
        }
      });
    }
  }
};
</script>
<style scoped>
.background {
  background-color: #002378;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 768px;
  min-width: 1366px;
}
 
.title-content {
  /* position: absolute; */
  width: 100%;
  height: 200px;
  padding: 3vh 0 0 0;
  /* top: 80px;
    left: 0;
    right: 0; */
  color: white;
  font-size: 1.4rem;
  display: flex;
  justify-content: center;
  background-image: url('@/assets/mipmap/title_bg.png');
  background-size: contain;
  background-repeat: no-repeat;
}
 
.img-1 {
  min-height: 500px;
  height: 60vh;
  /* margin-left: 6vw; */
}
 
.input-box {
  width: 400px;
  height: 420px;
  /* background-color: aquamarine; */
  background-image: url('@/assets/mipmap/border.png');
  background-size: 100% 100%;
  color: white;
}
 
.input-content {
}
 
.input-content .text-box {
  width: 220px;
  height: 28px;
  font-size: 12px;
  border-radius: 6px;
}
 
.btn-login {
  margin-top: 20px;
  border-radius: 6px;
  padding: 8px 60px;
  box-shadow: 10px 10px 10px rgba(39, 39, 39, 0.473);
  background: -moz-linear-gradient(
    left,
    rgb(109, 213, 231),
    rgb(80, 166, 202),
    rgb(65, 141, 186),
    rgb(33, 90, 154),
    rgb(13, 56, 133),
    rgb(11, 53, 131)
  );
  background: -ms-linear-gradient(
    left,
    rgb(109, 213, 231),
    rgb(80, 166, 202),
    rgb(65, 141, 186),
    rgb(33, 90, 154),
    rgb(13, 56, 133),
    rgb(11, 53, 131)
  );
  background: -o-linear-gradient(
    left,
    rgb(109, 213, 231),
    rgb(80, 166, 202),
    rgb(65, 141, 186),
    rgb(33, 90, 154),
    rgb(13, 56, 133),
    rgb(11, 53, 131)
  );
  background: -webkit-linear-gradient(
    left,
    rgb(109, 213, 231),
    rgb(80, 166, 202),
    rgb(65, 141, 186),
    rgb(33, 90, 154),
    rgb(13, 56, 133),
    rgb(11, 53, 131)
  );
  cursor: pointer;
}
</style>