lixuliang
2024-07-30 424829bc2904cf8445509ceeb666ced6883f5775
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<template>
  <div class="container">
    <vue-particles
      :particleOpacity="0.7"
      :particlesNumber="80"
      shapeType="circle"
      :particleSize="4"
      :linesWidth="1"
      :lineLinked="true"
      :lineOpacity="0.4"
      :linesDistance="80"
      :moveSpeed="2"
      :hoverEffect="true"
      hoverMode="grab"
      :clickEffect="false"
      clickMode="bubble"
    >
    </vue-particles>
    <div class="MapMenu">
      <iframe
        id="ifream"
        style="border: none"
        width="100%"
        height="100%"
        v-bind:src="reportUrl"
      ></iframe>
    </div>
    <div class="title_img">
      <!-- <img src="../assets/img/lg_03.png" alt /> -->
    </div>
    <div class="login">
      <div class="login_title">
        <span>用户登录</span>
      </div>
      <el-form :model="loginForm" :rules="rules" ref="loginForm" class="loginForm">
        <el-form-item prop="uid">
          <el-input
            v-model="loginForm.uid"
            placeholder="输入登录账号"
            class="nobr"
            size="meddle"
            autocomplete="off"
          >
            <i slot="prefix" class="el-icon-user"></i>
          </el-input>
        </el-form-item>
 
        <el-form-item prop="pwd">
          <el-input
            show-password
            v-model="loginForm.pwd"
            placeholder="请输入登录密码"
            class="nobr"
            autocomplete="off"
          >
            <i slot="prefix" class="el-icon-lock"></i>
          </el-input>
        </el-form-item>
 
        <!-- <el-form-item required>
          <el-col :span="18">
            <el-form-item prop="validCode">
              <el-input v-model="loginForm.validCode" placeholder="请输入验证码(忽略大小写)" class="nobr"></el-input>
            </el-form-item>
          </el-col>
 
          <el-col :span="6" align="right">
            <validCode v-model="validCode" ref="refresh" @sendData="getCode"></validCode>
          </el-col>
        </el-form-item> -->
        <!-- <el-form-item>
          <img src="../assets/img/zhengshu.png" alt />
          <span style="color: black">证书安装与添加信任站点</span>
        </el-form-item>
        <el-form-item>
          <img src="../assets/img/document.png" alt />
          <span style="color: black">使用帮助文档</span>
        </el-form-item> -->
        <el-form-item>
          <el-button
            type="primary"
            class="nobr loginbtn"
            style
            :loading="loading"
            @click="submitForm('loginForm')"
          >登录</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
 
<script>
import validCode from "./verificationCode.vue";
 
export default {
  name: "login",
  components: { validCode },
  data() {
    let validUserName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("用户名不能为空"));
      } else {
        callback();
      }
    };
 
    let validPassword = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("密码不能为空"));
      } else {
        callback();
      }
    };
 
    const checkValidCode = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入验证码"));
      } else if (value.toUpperCase() !== this.validCode.toUpperCase()) {
        callback(new Error("验证码不正确"));
      } else {
        callback();
      }
    };
    // loginForm: {
    //     uid: "admin",
    //     pwd: "Admin@1234_lf",
    //   }
    return {
      validCode: "",
      loading: false,
      loginForm: {
        uid: "",
        pwd: ""
      },
      rules: {
        uid: [{ validator: validUserName, trigger: "blur" }],
        pwd: [{ validator: validPassword, trigger: "blur" }],
        validCode: [{ validator: checkValidCode, trigger: "blur" }],
        showSessionId: "",
        reportUrl: ""
      }
    };
  },
  created() {
    this.startURL();
  },
  methods: {
    getCode(data) {
      this.validCode = data; //在data中定义一个 validCode:'',用来记录验证码。
    },
    startURL() {
      var url = window.location.href;
      var testurl = "";
      if (url.indexOf("web") != -1) {
        testurl = "/web";
      }
      this.reportUrl =
        window.location.origin + testurl + "/static/mapscreen/index.html";
    },
    // 账号密码登录
    submitForm(formName) {
      this.$router.push("/index");
     
    }
  }
};
</script>
 
<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
 
  background: url("../assets/img/login.jpg") no-repeat center;
  background-size: 100% 100%;
  .MapMenu {
    width: 100%;
    height: 100%;
    top: 5%;
    left: 1%;
    position: absolute;
  }
}
.title_img {
  position: absolute;
  left: 20%;
  top: 8%;
  width: 20%;
  /* transform: translateX(-50%); */
}
.title_img img {
  width: 100%;
}
.main_img {
  position: absolute;
  left: 17%;
  top: 12%;
  /* transform: translateX(-50%); */
}
.main_img img {
  width: 100%;
}
.login {
  width: 372px;
  height: 400px;
  position: absolute;
  left: 75%;
  top: 45%;
  transform: translate(-50%, -40%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}
 
.login_title {
  margin-top: 47px;
  margin-left: 48px;
  font-size: 25px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #3b4d6e;
  /* background-color: #bfa; */
}
.loginForm {
  margin-top: 61px;
  margin-left: 48px;
  /* background-color: #bfa; */
  width: 280px;
}
.el-form-item {
  /* margin-bottom: 12px; */
  height: 41px;
}
.el-input /deep/ .el-input__inner {
  /* background: rgba(80, 152, 255, 0.24); */
  border-color: rgba(0, 0, 0, 0.1);
  color: #000;
}
 
.el-input /deep/ .el-input-group__prepend {
  border: 0;
  padding: 0 !important;
}
.loginbtn {
  width: 280px;
  height: 50px;
  background: #3b4d6e;
  border-radius: 5px;
}
</style>