stu
This commit is contained in:
parent
cc69ee0489
commit
5f2bb4c9a8
|
@ -14,7 +14,7 @@
|
||||||
>
|
>
|
||||||
<h2 class="login-title">登录</h2>
|
<h2 class="login-title">登录</h2>
|
||||||
|
|
||||||
<t-form-item name="account">
|
<t-form-item label="账号" name="account">
|
||||||
<t-input
|
<t-input
|
||||||
clearable
|
clearable
|
||||||
v-model="formData.account"
|
v-model="formData.account"
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
<desktop-icon slot:string="prefix-icon"></desktop-icon>
|
<desktop-icon slot:string="prefix-icon"></desktop-icon>
|
||||||
</t-input>
|
</t-input>
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
<t-form-item name="password">
|
<t-form-item label="密码" name="password">
|
||||||
<t-input
|
<t-input
|
||||||
type="password"
|
type="password"
|
||||||
clearable
|
clearable
|
||||||
|
@ -45,59 +45,64 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { MessagePlugin } from "tdesign-vue-next";
|
import { MessagePlugin } from "tdesign-vue-next";
|
||||||
import { reactive,ref } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
|
// import {login} from "@/api/login";
|
||||||
// import { DesktopIcon, LockOnIcon } from "tdesign-icons-vue";
|
// import { DesktopIcon, LockOnIcon } from "tdesign-icons-vue";
|
||||||
|
|
||||||
const INITIAL_DATA = {
|
const INITIAL_DATA = {
|
||||||
account: "",
|
account: "",
|
||||||
password: "",
|
password: "",
|
||||||
};
|
};
|
||||||
const from = ref()
|
const from = ref();
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
...INITIAL_DATA,
|
...INITIAL_DATA,
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
account: [
|
account: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '必须填写',
|
message: "必须填写",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
min: 10,
|
min: 10,
|
||||||
message: '输入不正确',
|
message: "输入不正确",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
max: 10,
|
max: 10,
|
||||||
message: '输入不正确',
|
message: "输入不正确",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '密码必填',
|
message: "密码必填",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
len: 8,
|
len: 8,
|
||||||
message: '请输入 8 位密码',
|
message: "请输入 8 位密码",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: /[A-Z]+/,
|
pattern: /[A-Z]+/,
|
||||||
message: '密码必须包含大写字母',
|
message: "密码必须包含大写字母",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
});
|
||||||
|
|
||||||
const onReset = () => {
|
const onReset = () => {
|
||||||
MessagePlugin.success("重置成功");
|
MessagePlugin.success("重置成功");
|
||||||
};
|
};
|
||||||
const onSubmit = ({ validateResult, firstError }) => {
|
const onSubmit = () => {
|
||||||
if (validateResult === true) {
|
this.$refs.form.validateResult((valid,errors) => {
|
||||||
MessagePlugin.success("提交成功");
|
console.log(valid);
|
||||||
} else {
|
if (valid) {
|
||||||
console.log("Errors: ", validateResult);
|
MessagePlugin.success("提交成功");
|
||||||
MessagePlugin.warning(firstError);
|
} else {
|
||||||
}
|
MessagePlugin.error("提交失败");
|
||||||
|
console.log("Errors: ", errors);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
13
src/pages/students/student.vue
Normal file
13
src/pages/students/student.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
students
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,6 +1,7 @@
|
||||||
import { createRouter, createWebHistory } from "vue-router";
|
import { createRouter, createWebHistory } from "vue-router";
|
||||||
import FinanceBillManage from "./modules/financeBillManage";
|
import FinanceBillManage from "./modules/financeBillManage";
|
||||||
import Login from "@/pages/login/index.vue";
|
import Login from "@/pages/login/index.vue";
|
||||||
|
import Student from "@/pages/students/student.vue";
|
||||||
|
|
||||||
import Layout from "@/layout/index.vue";
|
import Layout from "@/layout/index.vue";
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
@ -27,6 +28,11 @@ const router = createRouter({
|
||||||
name: "login",
|
name: "login",
|
||||||
component: Login,
|
component: Login,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/student",
|
||||||
|
name: "student",
|
||||||
|
component: Student,
|
||||||
|
},
|
||||||
...FinanceBillManage,
|
...FinanceBillManage,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user