diff --git a/mock/modules/lcz.js b/mock/modules/lcz.js new file mode 100644 index 0000000..19e4c97 --- /dev/null +++ b/mock/modules/lcz.js @@ -0,0 +1,70 @@ +import Mock from "mockjs" + +const student = Mock.mock({ + "list|100": [ + { + "Id|+1": 1, + "name": "@cname", + "gender":`@pick(['男', '女'])`, + "studentId": "@integer(1000000000,9999999999)", + "department":`@pick(['机电工程系', '护理分院','建筑系','材料科学与工程系','环境科学与工程系'])`, + "major":`@pick(['机械制造与自动化', '材料科学与工程', '环境科学与工程', '建筑工程', '护理学'])`, + "classes":`@pick(['机制1班', '材料1班', '环境1班', '建筑1班','护理1班'])`, + "status":`@pick(['休学', '退学', '复学'])`, + }, + ], + }); + + export default [ + { + url:'/api-list', + method:'get', + response: () => { + return { + code: 200, + data: student + } + } + }, + { + url: '/api-student', + method: 'post', + response: (req) => { + if (req.body.name !== '') { + return student.list.filter(item => item.name.includes(req.body.name)) + } + else if (req.body.studentId !== '') { + const studentId = Number(req.body.studentId) + if (!isNaN(studentId)) { + return student.list.filter(item => item.studentId === studentId) + } else { + return { + code: 400, + message: 'Invalid student number format' + } + } + } + else if (req.body.name !== '') { + return student.list.filter(item => item.name.includes(req.body.name)) + } + else if (req.body.gender !== '') { + return student.list.filter(item => item.gender.includes(req.body.gender)) + } + else if (req.body.department !== '') { + return student.list.filter(item => item.grade.includes(req.body.department)) + } + else if (req.body.major !== '') { + return student.list.filter(item => item.major.includes(req.body.major)) + } + else if (req.body.classes !== '') { + return student.list.filter(item => item.classes.includes(req.body.classes)) + } + else if (req.body.status !== '') { + return student.list.filter(item => item.major.includes(req.body.status)) + } + return { + code: 200, + } + } + } + ] \ No newline at end of file diff --git a/package.json b/package.json index a027f07..beb66d2 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "axios": "^1.6.8", "dayjs": "^1.11.10", "echarts": "^5.5.0", + "exceljs": "^4.4.0", + "file-saver": "^2.0.5", "less": "^4.2.0", "mockjs": "^1.1.0", "pinia": "^2.1.7", diff --git a/src/api/login.js b/src/api/login.js index 9efab9a..3bde586 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -5,4 +5,4 @@ const API = { }; export const reqUser = () => request.post(API.LOGIN_URL); -export const reqUserone = (data) => request.post(API.LOGIN_URL, data); \ No newline at end of file +// export const reqUserone = (data) => request.post(API.LOGIN_URL, data); \ No newline at end of file diff --git a/src/api/students.js b/src/api/students.js index b85d7e0..0bc246a 100644 --- a/src/api/students.js +++ b/src/api/students.js @@ -1,7 +1,8 @@ -import request from "@/utils/request"; -// 统一管理接口 -const API = { - STUDENT_URL: "/api/student", -}; +import request from '@/utils/request' -export const reqStudent = () => request.post(API.STUDENT_URL); \ No newline at end of file +export function getList() { + return request.get('/api-list') +} +export function getStudents(studentData) { + return request.post('/api-student', studentData) +} \ No newline at end of file diff --git a/src/pages/finance-bill-manage/detailReport.vue b/src/pages/finance-bill-manage/detailReport.vue index e25e79e..578b0b7 100644 --- a/src/pages/finance-bill-manage/detailReport.vue +++ b/src/pages/finance-bill-manage/detailReport.vue @@ -29,6 +29,9 @@