|
@@ -1,31 +1,44 @@
|
|
|
<template>
|
|
|
- <div class="tw-h-screen tw-flex tw-justify-center tw-items-center">
|
|
|
- <div class="tw-flex" style="width: 860px; height: 558px">
|
|
|
- <div style="width: 400px" class="left-panel">
|
|
|
- <div class="tw-text-2xl">欢迎登录,<br />考试成绩综合分析系统</div>
|
|
|
- <div style="font-size: 12px">武汉启明泰和软件服务有限公司技术支持</div>
|
|
|
+ <div class="login login-home">
|
|
|
+ <div class="login-box">
|
|
|
+ <div class="login-theme">
|
|
|
+ <h1>研究生成绩分析</h1>
|
|
|
+ <p>Copyright ©启明泰和 Rights Reserved.</p>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="tw-bg-white" style="padding: 0 70px 0 90px">
|
|
|
- <div style="padding: 80px 0"><img class="qm-logo-img" /></div>
|
|
|
-
|
|
|
- <div style="width: 300px">
|
|
|
- <a-form-item>
|
|
|
- <a-input v-model:value="accountValue" placeholder="请输入用户名" />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item>
|
|
|
- <a-input-password
|
|
|
- v-model:value="password"
|
|
|
- placeholder="请输入密码"
|
|
|
- @keypress.enter="login"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
-
|
|
|
- <div class="tw-text-red-500 tw-pb-4">
|
|
|
- {{ errorInfo }}
|
|
|
- </div>
|
|
|
-
|
|
|
- <qm-button type="primary" @click="login">立即登录</qm-button>
|
|
|
+ <div class="login-body" @keyup.enter="submit">
|
|
|
+ <div class="login-title">
|
|
|
+ <h2>输入信息</h2>
|
|
|
+ <p>请输入账号与密码</p>
|
|
|
+ </div>
|
|
|
+ <div class="login-form">
|
|
|
+ <a-form ref="formRef" :model="formData" :rules="rules">
|
|
|
+ <a-form-item name="accountValue">
|
|
|
+ <a-input
|
|
|
+ v-model:value="formData.accountValue"
|
|
|
+ size="large"
|
|
|
+ placeholder="请输入你的账号"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item name="password">
|
|
|
+ <a-input-password
|
|
|
+ v-model:value="formData.password"
|
|
|
+ placeholder="请输入你的密码"
|
|
|
+ size="large"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ size="large"
|
|
|
+ block
|
|
|
+ :loading="loading"
|
|
|
+ @click="submit"
|
|
|
+ >登录</a-button
|
|
|
+ >
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -37,10 +50,11 @@ import { loginByUsername } from "@/api/loginPage";
|
|
|
import { useRouteQuery } from "@vueuse/router";
|
|
|
import { useRouter } from "vue-router";
|
|
|
import { useMainStore } from "@/store";
|
|
|
+import { reactive } from "vue";
|
|
|
+import type { Rule } from "ant-design-vue/es/form";
|
|
|
+import type { FormInstance } from "ant-design-vue";
|
|
|
const store = useMainStore();
|
|
|
|
|
|
-let accountValue = $ref("");
|
|
|
-let password = $ref("");
|
|
|
let rootOrgId = $(useRouteQuery("rootOrgId"));
|
|
|
const router = useRouter();
|
|
|
if (!rootOrgId) {
|
|
@@ -48,12 +62,24 @@ if (!rootOrgId) {
|
|
|
}
|
|
|
|
|
|
let errorInfo = $ref("");
|
|
|
+let loading = $ref(false);
|
|
|
+const formRef = $ref<FormInstance>();
|
|
|
+const formData = reactive({
|
|
|
+ accountValue: "",
|
|
|
+ password: "",
|
|
|
+});
|
|
|
|
|
|
-async function login() {
|
|
|
+const rules: Record<string, Rule[]> = {
|
|
|
+ accountValue: [
|
|
|
+ { required: true, message: "请输入你的账号", trigger: "change" },
|
|
|
+ ],
|
|
|
+ password: [{ required: true, message: "请输入你的密码", trigger: "change" }],
|
|
|
+};
|
|
|
+async function submit() {
|
|
|
try {
|
|
|
const res = await loginByUsername({
|
|
|
- accountValue,
|
|
|
- password,
|
|
|
+ accountValue: formData.accountValue,
|
|
|
+ password: formData.password,
|
|
|
rootOrgId: parseInt(rootOrgId?.toString() ?? "1"),
|
|
|
});
|
|
|
console.log(res);
|
|
@@ -69,21 +95,3 @@ async function login() {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.left-panel {
|
|
|
- width: 400px;
|
|
|
- padding: 58px 100px 30px 60px;
|
|
|
- color: white;
|
|
|
- background-image: url(./left.png);
|
|
|
-
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
-}
|
|
|
-
|
|
|
-.qm-logo-img {
|
|
|
- content: url(@/assets/qm-logo.png);
|
|
|
- height: 120px;
|
|
|
-}
|
|
|
-</style>
|