From 6161a2fa8d98a0c24071fc9961b47d5ba7d1e1a7 Mon Sep 17 00:00:00 2001 From: hebo Date: Tue, 18 Nov 2025 15:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/zwApi.ts | 3 + src/api/statistics/studentScaleApi.ts | 101 ++ src/api/statistics/teacherAnalyticsApi.ts | 1 + src/pages.json | 35 + src/pages/base/service/index.vue | 20 +- src/pages/statistics/teacher/detail.vue | 83 ++ src/pages/statistics/teacher/index.vue | 219 ++++- src/pages/statistics/xs/classDetail.vue | 280 ++++++ src/pages/statistics/xs/gradeDetail.vue | 311 ++++++ src/pages/statistics/xs/index.vue | 909 ++++++++++++++++++ src/pages/statistics/xs/parentDetail.vue | 178 ++++ src/pages/statistics/xs/studentList.vue | 316 ++++++ src/pages/statistics/zb/overview.vue | 6 +- src/pages/view/routine/ShiTangXunCha/add.vue | 233 +---- .../view/routine/ShiTangXunCha/detail.vue | 147 ++- src/pages/view/routine/ShiTangXunCha/edit.vue | 270 ++---- src/pages/view/routine/qd/index.vue | 29 +- src/pages/view/routine/qd/publish.vue | 7 +- src/static/base/home/xsgm.png | Bin 0 -> 10262 bytes src/store/modules/teacherAnalytics.ts | 3 + 20 files changed, 2736 insertions(+), 415 deletions(-) create mode 100644 src/api/statistics/studentScaleApi.ts create mode 100644 src/pages/statistics/xs/classDetail.vue create mode 100644 src/pages/statistics/xs/gradeDetail.vue create mode 100644 src/pages/statistics/xs/index.vue create mode 100644 src/pages/statistics/xs/parentDetail.vue create mode 100644 src/pages/statistics/xs/studentList.vue create mode 100644 src/static/base/home/xsgm.png diff --git a/src/api/base/zwApi.ts b/src/api/base/zwApi.ts index 62165b6..6ef4d56 100644 --- a/src/api/base/zwApi.ts +++ b/src/api/base/zwApi.ts @@ -34,3 +34,6 @@ export const findAllZw = () => { + + + diff --git a/src/api/statistics/studentScaleApi.ts b/src/api/statistics/studentScaleApi.ts new file mode 100644 index 0000000..3406139 --- /dev/null +++ b/src/api/statistics/studentScaleApi.ts @@ -0,0 +1,101 @@ +import { get } from "@/utils/request"; + +export interface StudentCountStatistics { + totalCount: number; + followedCount: number; + unfollowedCount: number; +} + +export interface ParentIndustryStatisticsItem { + industry: string; + count: number; +} + +export interface StudentSourceStatisticsItem { + sourceName: string; + sourceCode: string; + count: number; +} + +export interface StudentStatusStatisticsItem { + statusName: string; + statusCode: string; + count: number; +} + +/** + * 学生人数统计(总人数、已关注、未关注) + */ +export const getStudentCountStatisticsApi = () => { + return get("/api/xs/statistics/studentCount"); +}; + +/** + * 家长情况统计(总人数、按行业分类) + */ +export const getParentIndustryStatisticsApi = () => { + return get("/api/xs/statistics/parentIndustry"); +}; + +/** + * 学生来源统计 + */ +export const getStudentSourceStatisticsApi = () => { + return get("/api/xs/statistics/studentSource"); +}; + +/** + * 学生状态统计 + */ +export const getStudentStatusStatisticsApi = () => { + return get("/api/xs/statistics/studentStatus"); +}; + +/** + * 学生规模统计仪表盘(统一接口,返回所有统计数据) + */ +export interface StudentScaleDashboard { + studentCount: StudentCountStatistics; + parentIndustry: ParentIndustryStatisticsItem[]; + studentSource: StudentSourceStatisticsItem[]; + studentStatus: StudentStatusStatisticsItem[]; +} + +export const getStudentScaleDashboardApi = () => { + return get("/api/xs/statistics/dashboard"); +}; + +/** + * 年级统计(学生人数、来源、状态) + */ +export const getGradeStatisticsApi = (params: { type: string; code: string }) => { + return get("/api/xs/gradeStatistics", params); +}; + +/** + * 班级统计(学生人数、来源、状态) + */ +export const getClassStatisticsApi = (params: { type: string; code: string; njId: string }) => { + return get("/api/xs/classStatistics", params); +}; + +/** + * 学生明细列表 + */ +export const getStudentListApi = (params: { + type: string; + code: string; + subType?: string; + njId?: string; + bjId?: string; +}) => { + return get("/api/xs/studentList", params); +}; + +/** + * 家长明细列表(按行业) + */ +export const getParentListApi = (params: { industry: string }) => { + return get("/api/xs/parentList", params); +}; + diff --git a/src/api/statistics/teacherAnalyticsApi.ts b/src/api/statistics/teacherAnalyticsApi.ts index 7512e21..35daa2f 100644 --- a/src/api/statistics/teacherAnalyticsApi.ts +++ b/src/api/statistics/teacherAnalyticsApi.ts @@ -48,6 +48,7 @@ export interface TeacherAnalyticsDashboardResponse { position?: TeacherDistributionItem[]; political?: TeacherDistributionItem[]; workingYears?: TeacherDistributionItem[]; + zdqk?: TeacherDistributionItem[]; } export interface TeacherAnalyticsListRequest extends TeacherAnalyticsFilter { diff --git a/src/pages.json b/src/pages.json index d346650..a79346b 100644 --- a/src/pages.json +++ b/src/pages.json @@ -297,6 +297,41 @@ "enablePullDownRefresh": false } }, + { + "path": "pages/statistics/xs/index", + "style": { + "navigationBarTitleText": "学生规模", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/statistics/xs/gradeDetail", + "style": { + "navigationBarTitleText": "年级统计", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/statistics/xs/classDetail", + "style": { + "navigationBarTitleText": "班级统计", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/statistics/xs/studentList", + "style": { + "navigationBarTitleText": "学生明细", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/statistics/xs/parentDetail", + "style": { + "navigationBarTitleText": "家长明细", + "enablePullDownRefresh": false + } + }, { "path": "pages/statistics/zb/pdfPreview", "style": { diff --git a/src/pages/base/service/index.vue b/src/pages/base/service/index.vue index 3325e95..31b04dd 100644 --- a/src/pages/base/service/index.vue +++ b/src/pages/base/service/index.vue @@ -527,6 +527,14 @@ const sections = reactive([ }, { id: "analysis2", + icon: "xsgm", + text: "学生规模", + show: true, + permissionKey: "analysis-xsgm", + path: "/pages/statistics/xs/index", + }, + { + id: "analysis3", icon: "jctj", text: "就餐统计", show: true, @@ -534,7 +542,7 @@ const sections = reactive([ path: "/pages/statistics/jc/index", }, { - id: "analysis3", + id: "analysis4", icon: "jlb", text: "俱乐部统计", show: true, @@ -542,7 +550,7 @@ const sections = reactive([ path: "/pages/statistics/jlb/index", }, { - id: "analysis4", + id: "analysis5", icon: "xqk", text: "兴趣课统计", show: true, @@ -550,7 +558,7 @@ const sections = reactive([ path: "/pages/statistics/xqk/index", }, { - id: "analysis5", + id: "analysis6", icon: "ky", text: "课业统计", show: true, @@ -558,15 +566,15 @@ const sections = reactive([ path: "/pages/statistics/ky/index", }, { - id: "analysis6", + id: "analysis7", icon: "zbtj", - text: "值班统计", + text: "值周统计", show: true, permissionKey: "analysis-zbtj", path: "/pages/statistics/zb/index", }, { - id: "analysis7", + id: "analysis8", icon: "qdtj", text: "签到统计", show: true, diff --git a/src/pages/statistics/teacher/detail.vue b/src/pages/statistics/teacher/detail.vue index 56f1146..f68b3f4 100644 --- a/src/pages/statistics/teacher/detail.vue +++ b/src/pages/statistics/teacher/detail.vue @@ -30,6 +30,17 @@ {{ teacher.jsxm }} 档案号:{{ teacher.jsdah }} + + + 请假类型:{{ teacher.qjlx }} + 开始时间:{{ formatDate(teacher.qjkstime) }} + 结束时间:{{ formatDate(teacher.qjjstime) }} + 请假事由:{{ teacher.qjsy }} + + + + 调出原因:{{ teacher.dcyy }} + @@ -67,6 +78,11 @@ interface Teacher { jsType?: string; zzmmId?: string; jsgl?: number; + qjlx?: string; // 请假类型 + qjkstime?: string; // 请假开始时间 + qjjstime?: string; // 请假结束时间 + qjsy?: string; // 请假事由 + dcyy?: string; // 调出原因 } const commonStore = useCommonStore(); @@ -165,6 +181,9 @@ const filteredTeachers = computed(() => { return teacher.zzmmId === filterValue.value; case 'workingYears': return filterByWorkingYears(teacher, filterValue.value); + case 'zdqk': + // 在岗情况过滤已在 fetchList 中处理,这里不需要再次过滤 + return true; default: return true; } @@ -190,6 +209,39 @@ const fetchList = async () => { })); return; } + + // 如果在岗情况过滤,调用专门的接口 + if (filterType.value === 'zdqk' && filterValue.value) { + const params: any = { + zdqkValue: filterValue.value, + }; + if (jsTypes.value.length > 0) { + params.jsTypes = jsTypes.value.join(','); + } + const res = await get("/api/js/statistics/zdqk/list", params); + const list = res?.result || res || []; + allTeachers.value = list.map((item: any) => ({ + id: item.id, + jsxm: item.jsxm, + jsdah: item.jsdah, + jsType: item.jsType, + lxdh: item.lxdh, + jsxbId: item.jsxbId, + age: item.age, + zhxlId: item.zhxlId, + latestZcdjId: item.latestZcdjId, + latestGwjbId: item.latestGwjbId, + zzmmId: item.zzmmId, + jsgl: item.jsgl, + qjlx: item.qjlx, + qjkstime: item.qjkstime, + qjjstime: item.qjjstime, + qjsy: item.qjsy, + dcyy: item.dcyy, + })); + return; + } + const res = await commonStore.getAllJs(); if (res?.resultCode === 1 && Array.isArray(res.result)) { allTeachers.value = res.result; @@ -230,6 +282,20 @@ const parseGender = (jsxbId?: string) => { return jsxbId; }; +// 格式化日期 +const formatDate = (dateStr?: string) => { + if (!dateStr) return '-'; + try { + const date = new Date(dateStr); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + } catch (e) { + return dateStr; + } +}; + onLoad((options: any) => { if (options.filterType) { filterType.value = decodeURIComponent(options.filterType); @@ -409,6 +475,23 @@ onLoad((options: any) => { line-height: 1.2; } +.leave-info { + margin-top: 12rpx; + padding: 16rpx; + background: #fef3c7; + border-radius: 8rpx; + border-left: 4rpx solid #f59e0b; + display: flex; + flex-direction: column; + gap: 8rpx; +} + +.leave-item { + font-size: 24rpx; + color: #92400e; + line-height: 1.4; +} + .item-right { flex-shrink: 0; padding-left: 16rpx; diff --git a/src/pages/statistics/teacher/index.vue b/src/pages/statistics/teacher/index.vue index 6c17608..2118b9f 100644 --- a/src/pages/statistics/teacher/index.vue +++ b/src/pages/statistics/teacher/index.vue @@ -66,6 +66,47 @@ + + + 在岗情况 + + + + + + + 加载中... + 暂无数据 + + + + + + {{ item.label }} + + + + {{ item.count }}人 + | + {{ item.percent }} + + > + + + + + + + +