From a25572301d99a8fd6740dc70c33b44d702c765c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E6=89=8D=E5=8D=93?= <2284808383@qq.com>
Date: Sun, 7 Apr 2024 17:36:32 +0800
Subject: [PATCH 1/6] password
---
package-lock.json | 2 +-
src/pages/login/index.vue | 40 ++---------
src/pages/password/index.vue | 121 +++++++++++++--------------------
src/pages/students/student.vue | 2 +-
vite.config.js | 2 +-
5 files changed, 56 insertions(+), 111 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index bc6aac9..1cac93f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1605,7 +1605,7 @@
},
"node_modules/pinia-plugin-persistedstate": {
"version": "3.2.1",
- "resolved": "https://registry.npmmirror.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz",
+ "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz",
"integrity": "sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==",
"peerDependencies": {
"pinia": "^2.0.0"
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index 81cfd46..e29b870 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -74,12 +74,8 @@ const rules = reactive({
message: "必须填写",
},
{
- min: 10,
- message: "输入不正确",
- },
- {
- max: 10,
- message: "输入不正确",
+ pattern: /^\d{10}$/, // 正则表达式只允许10位数字
+ message: "学号必须是10位数字",
},
],
password: [
@@ -92,36 +88,17 @@ const rules = reactive({
message: "请输入 8 位密码",
},
{
- pattern: /[A-Z]+/,
- message: "密码必须包含大写字母",
+ pattern: /^(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,}$/u,
+ message: "密码必须包含至少一个大写字母,并由字母和数字组成",
},
],
});
-const onReset = () => {
- // 清空表单数据
- formData.account = "";
- formData.password = "";
- MessagePlugin.success("重置成功");
-};
-// const onSubmit = () => {
-// this.$refs.form.validateResult((valid,errors) => {
-// console.log(valid);
-// if (valid) {
-// MessagePlugin.success("提交成功");
-// } else {
-// MessagePlugin.error("提交失败");
-// console.log("Errors: ", errors);
-// return false;
-// }
-// });
-// };
-
const onSubmit = async () => {
try {
const validateResult = await this.$refs.form.validate();
if (validateResult.result) {
- await reqUser();
+ await reqUser(formData.account, formData.password);
MessagePlugin.success("提交成功");
await router.push("/");
} else {
@@ -135,18 +112,13 @@ const onSubmit = async () => {
}
};
-// const Login = async () => {
-// await reqUser();
-// };
-
onMounted(() => {
reqUser();
});
function handleForgotPasswordClick() {
- router.push("/password-reset")
+ router.push("/password-reset");
}
-
\ No newline at end of file
diff --git a/vite.config.js b/vite.config.js
index 7f06cc0..4aba0e9 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -11,7 +11,7 @@ export default defineConfig({
server: {
proxy: {
"/api": {
- target: "http://192.168.1.10:8000",
+ target: "http://192.168.1.10:8080",
changeOrigin: true,
},
},
From fbbf731322b56c25847d3ae351a0d55b66587858 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E6=89=8D=E5=8D=93?= <2284808383@qq.com>
Date: Sun, 7 Apr 2024 18:09:58 +0800
Subject: [PATCH 2/6] password
---
src/pages/login/index.vue | 22 +++++++++++++---------
src/pages/password/index.vue | 12 ++++++------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index e29b870..fde06e5 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -54,7 +54,9 @@
import { MessagePlugin } from "tdesign-vue-next";
import { reactive, ref, onMounted } from "vue";
import { reqUser } from "@/api/login";
-import router from "@/router";
+// import router from "@/router";
+import { useRouter } from "vue-router";
+import axios from 'axios';
// import { TForm, TFormItem, TInput, TButton } from "tdesign-vue-next";
// import { DesktopIcon, LockOnIcon } from "tdesign-icons-vue";
@@ -62,7 +64,9 @@ const INITIAL_DATA = {
account: "",
password: "",
};
-const from = ref();
+
+const from = ref(null);
+const router = useRouter();
const formData = reactive({
...INITIAL_DATA,
});
@@ -94,15 +98,19 @@ const rules = reactive({
],
});
+onMounted(() => {
+ reqUser();
+});
+
const onSubmit = async () => {
try {
- const validateResult = await this.$refs.form.validate();
- if (validateResult.result) {
+ const validateResult = await from.value?.validate();
+ if (validateResult?.result) {
await reqUser(formData.account, formData.password);
MessagePlugin.success("提交成功");
await router.push("/");
} else {
- const firstError = validateResult.errors[0]?.message || "未知错误";
+ const firstError = validateResult?.errors[0]?.message || "未知错误";
console.log("Errors: ", validateResult.errors);
MessagePlugin.warning(firstError);
}
@@ -112,10 +120,6 @@ const onSubmit = async () => {
}
};
-onMounted(() => {
- reqUser();
-});
-
function handleForgotPasswordClick() {
router.push("/password-reset");
}
diff --git a/src/pages/password/index.vue b/src/pages/password/index.vue
index 3c37111..21617fb 100644
--- a/src/pages/password/index.vue
+++ b/src/pages/password/index.vue
@@ -88,7 +88,7 @@ const rules = reactive({
message: "请输入 8 位密码",
},
{
- pattern: /^(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,}$/u,
+ pattern: /^(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,}$/u,
message: "密码必须包含至少一个大写字母,并由字母和数字组成",
},
],
@@ -120,13 +120,13 @@ const onReset = () => {
const onSubmit = async () => {
try {
- const validateResult = await this.$refs.form.validate();
- if (validateResult.result) {
- await reqUser(formData.account, formData.password, formData.rePassword);
+ const validateResult = await from.value?.validate();
+ if (validateResult?.result) {
+ await reqUser(formData.account, formData.password,formData.rePassword);
MessagePlugin.success("提交成功");
- await router.push("/login");
+ await router.push("/");
} else {
- const firstError = validateResult.errors[0]?.message || "未知错误";
+ const firstError = validateResult?.errors[0]?.message || "未知错误";
console.log("Errors: ", validateResult.errors);
MessagePlugin.warning(firstError);
}
From 10a46e041c59c6b9fa2e7e8da21c76183a09e255 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E6=89=8D=E5=8D=93?= <2284808383@qq.com>
Date: Mon, 8 Apr 2024 12:00:15 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20feat:=E5=AD=A6=E7=94=9F?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/password.js | 7 ++
src/api/students.js | 7 ++
src/pages/login/index.vue | 1 -
src/pages/password/index.vue | 3 +-
src/pages/students/student.vue | 169 ++++++++++++++++++++++++++-------
5 files changed, 150 insertions(+), 37 deletions(-)
create mode 100644 src/api/password.js
create mode 100644 src/api/students.js
diff --git a/src/api/password.js b/src/api/password.js
new file mode 100644
index 0000000..f25a618
--- /dev/null
+++ b/src/api/password.js
@@ -0,0 +1,7 @@
+import request from "@/utils/request";
+// 统一管理接口
+const API = {
+ PASSWORD_URL: "/api/password",
+};
+
+export const reqPassword = () => request.post(API.PASSWORD_URL);
\ No newline at end of file
diff --git a/src/api/students.js b/src/api/students.js
new file mode 100644
index 0000000..b85d7e0
--- /dev/null
+++ b/src/api/students.js
@@ -0,0 +1,7 @@
+import request from "@/utils/request";
+// 统一管理接口
+const API = {
+ STUDENT_URL: "/api/student",
+};
+
+export const reqStudent = () => request.post(API.STUDENT_URL);
\ No newline at end of file
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index fde06e5..e95ce92 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -54,7 +54,6 @@
import { MessagePlugin } from "tdesign-vue-next";
import { reactive, ref, onMounted } from "vue";
import { reqUser } from "@/api/login";
-// import router from "@/router";
import { useRouter } from "vue-router";
import axios from 'axios';
// import { TForm, TFormItem, TInput, TButton } from "tdesign-vue-next";
diff --git a/src/pages/password/index.vue b/src/pages/password/index.vue
index 8ac5613..cc769b8 100644
--- a/src/pages/password/index.vue
+++ b/src/pages/password/index.vue
@@ -46,6 +46,7 @@
import { MessagePlugin } from "tdesign-vue-next";
import { reactive } from "vue";
import router from "@/router";
+import {reqPassword} from "@/api/password"
const INITIAL_DATA = {
account: "",
@@ -122,7 +123,7 @@ const onSubmit = async () => {
try {
const validateResult = await from.value?.validate();
if (validateResult?.result) {
- await reqUser(formData.account, formData.password,formData.rePassword);
+ await reqPassword(formData.account, formData.password, formData.rePassword);
MessagePlugin.success("提交成功");
await router.push("/");
} else {
diff --git a/src/pages/students/student.vue b/src/pages/students/student.vue
index 4695d9e..dad652e 100644
--- a/src/pages/students/student.vue
+++ b/src/pages/students/student.vue
@@ -1,47 +1,146 @@
-
- students
-
-
-
-
- 小尺寸
- 中尺寸
- 大尺寸
-
-
-
-
- 显示斑马纹
- 显示表格边框
- 显示悬浮效果
- 宽度自适应
- 显示表头
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
-
-
+
+ 显示斑马纹
+ 显示表格边框
+ 显示悬浮效果
+ 宽度自适应
+ 显示表头
-
+
+
+
+
+
From ec8e9d314c65ceabeb1bc0c47a523ce0050a4c9a Mon Sep 17 00:00:00 2001
From: ycy <2861518472@qq.com>
Date: Mon, 8 Apr 2024 12:02:00 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=A6=84=20refactor:=20=E7=A5=A8?=
=?UTF-8?q?=E6=8D=AE=E9=A2=86=E7=94=A8=E4=BB=A3=E7=A0=81=E9=87=8D=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
mock/modules/ycy.js | 8 +-
src/layout/components/LayoutAside.vue | 3 +
src/pages/finance-bill-manage/billCancel.vue | 8 +-
.../finance-bill-manage/billQuitneck.vue | 389 ++++++++++++++++++
src/pages/finance-bill-manage/billReceipt.vue | 149 ++++++-
src/pages/finance-bill-manage/billStock.vue | 12 +-
src/router/modules/financeBillManage.js | 9 +
src/stores/billReceipt.js | 8 +
src/stores/billStock.js | 2 -
9 files changed, 567 insertions(+), 21 deletions(-)
create mode 100644 src/pages/finance-bill-manage/billQuitneck.vue
diff --git a/mock/modules/ycy.js b/mock/modules/ycy.js
index da929f9..323e6ba 100644
--- a/mock/modules/ycy.js
+++ b/mock/modules/ycy.js
@@ -21,7 +21,7 @@ const ReceiptList = Mock.mock([
billserial: "@integer(100000000,199999999)1",
proposer: "孙东宇",
billType: "@integer(0,4)",
- receiptNum: "@integer(1,10)张",
+ receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
@@ -34,7 +34,7 @@ const ReceiptList = Mock.mock([
billserial: "@integer(100000000,199999999)1",
proposer: "杨春宇",
billType: "@integer(0,4)",
- receiptNum: "@integer(1,10)张",
+ receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
@@ -47,7 +47,7 @@ const ReceiptList = Mock.mock([
billserial: "@integer(100000000,199999999)1",
proposer: "吕才卓",
billType: "@integer(0,4)",
- receiptNum: "@integer(1,10)张",
+ receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
@@ -60,7 +60,7 @@ const ReceiptList = Mock.mock([
billserial: "@integer(100000000,199999999)1",
proposer: "刘欣宇",
billType: "@integer(0,4)",
- receiptNum: "@integer(1,10)张",
+ receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
diff --git a/src/layout/components/LayoutAside.vue b/src/layout/components/LayoutAside.vue
index 7af3ebd..3085f7c 100644
--- a/src/layout/components/LayoutAside.vue
+++ b/src/layout/components/LayoutAside.vue
@@ -14,6 +14,9 @@
票据领用管理
+
+ 票据退领管理
+
diff --git a/src/pages/finance-bill-manage/billCancel.vue b/src/pages/finance-bill-manage/billCancel.vue
index 1926e73..d63ec30 100644
--- a/src/pages/finance-bill-manage/billCancel.vue
+++ b/src/pages/finance-bill-manage/billCancel.vue
@@ -66,7 +66,7 @@