From a0cb27afe467ea9a4982bc653d85bf527d0825a1 Mon Sep 17 00:00:00 2001 From: QDKF Date: Wed, 3 Sep 2025 19:19:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=20=E5=9F=BA=E7=A1=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E8=AF=BE=E5=A0=82=E6=8A=A5=E5=91=8A=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + pnpm-lock.yaml | 61 +++ src/main.ts | 32 ++ src/router/index.ts | 2 +- .../teacher/course/StatisticsManagement.vue | 36 -- .../statistics/StatisticsManagement.vue | 432 ++++++++++++++++++ .../teacher/statistics/tab/BasicData.vue | 295 ++++++++++++ .../statistics/tab/ClassroomReport.vue | 429 +++++++++++++++++ .../statistics/tab/LearningMonitor.vue | 34 ++ .../statistics/tab/LearningStatistics.vue | 34 ++ .../teacher/statistics/tab/StudentGrades.vue | 34 ++ 11 files changed, 1354 insertions(+), 37 deletions(-) delete mode 100644 src/views/teacher/course/StatisticsManagement.vue create mode 100644 src/views/teacher/statistics/StatisticsManagement.vue create mode 100644 src/views/teacher/statistics/tab/BasicData.vue create mode 100644 src/views/teacher/statistics/tab/ClassroomReport.vue create mode 100644 src/views/teacher/statistics/tab/LearningMonitor.vue create mode 100644 src/views/teacher/statistics/tab/LearningStatistics.vue create mode 100644 src/views/teacher/statistics/tab/StudentGrades.vue diff --git a/package.json b/package.json index fee3e47..0a8629c 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,13 @@ "axios": "^1.11.0", "ckplayer": "^3.1.2", "dplayer": "^1.27.1", + "echarts": "5.6.0", "naive-ui": "^2.42.0", "naive-ui-editor": "^1.0.6", "pinia": "^3.0.3", "quill": "^2.0.3", "vue": "^3.5.17", + "vue-echarts": "7.0.3", "vue-i18n": "^9.14.5", "vue-quill-editor": "^3.0.6", "vue-router": "^4.5.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d33fd18..4cd483b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: dplayer: specifier: ^1.27.1 version: 1.27.1 + echarts: + specifier: 5.6.0 + version: 5.6.0 naive-ui: specifier: ^2.42.0 version: 2.42.0(vue@3.5.18(typescript@5.9.2)) @@ -44,6 +47,9 @@ importers: vue: specifier: ^3.5.17 version: 3.5.18(typescript@5.9.2) + vue-echarts: + specifier: 7.0.3 + version: 7.0.3(@vue/runtime-core@3.5.18)(echarts@5.6.0)(vue@3.5.18(typescript@5.9.2)) vue-i18n: specifier: ^9.14.5 version: 9.14.5(vue@3.5.18(typescript@5.9.2)) @@ -930,6 +936,9 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + echarts@5.6.0: + resolution: {integrity: sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==} + electron-to-chromium@1.5.199: resolution: {integrity: sha512-3gl0S7zQd88kCAZRO/DnxtBKuhMO4h0EaQIN3YgZfV6+pW+5+bf2AdQeHNESCoaQqo/gjGVYEf2YM4O5HJQqpQ==} @@ -1478,6 +1487,9 @@ packages: treemate@0.3.11: resolution: {integrity: sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==} + tslib@2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + type@2.7.3: resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==} @@ -1582,6 +1594,27 @@ packages: vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} + vue-demi@0.13.11: + resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + + vue-echarts@7.0.3: + resolution: {integrity: sha512-/jSxNwOsw5+dYAUcwSfkLwKPuzTQ0Cepz1LxCOpj2QcHrrmUa/Ql0eQqMmc1rTPQVrh2JQ29n2dhq75ZcHvRDw==} + peerDependencies: + '@vue/runtime-core': ^3.0.0 + echarts: ^5.5.1 + vue: ^2.7.0 || ^3.1.1 + peerDependenciesMeta: + '@vue/runtime-core': + optional: true + vue-i18n@9.14.5: resolution: {integrity: sha512-0jQ9Em3ymWngyiIkj0+c/k7WgaPO+TNzjKSNq9BvBQaKJECqn9cd9fL4tkDhB5G1QBskGl9YxxbDAhgbFtpe2g==} engines: {node: '>= 16'} @@ -1635,6 +1668,9 @@ packages: resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==} engines: {node: '>=18'} + zrender@5.6.1: + resolution: {integrity: sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==} + snapshots: '@ampproject/remapping@2.3.0': @@ -2504,6 +2540,11 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 + echarts@5.6.0: + dependencies: + tslib: 2.3.0 + zrender: 5.6.1 + electron-to-chromium@1.5.199: {} entities@4.5.0: {} @@ -3061,6 +3102,8 @@ snapshots: treemate@0.3.11: {} + tslib@2.3.0: {} + type@2.7.3: {} typescript@5.9.2: {} @@ -3152,6 +3195,20 @@ snapshots: vscode-uri@3.1.0: {} + vue-demi@0.13.11(vue@3.5.18(typescript@5.9.2)): + dependencies: + vue: 3.5.18(typescript@5.9.2) + + vue-echarts@7.0.3(@vue/runtime-core@3.5.18)(echarts@5.6.0)(vue@3.5.18(typescript@5.9.2)): + dependencies: + echarts: 5.6.0 + vue: 3.5.18(typescript@5.9.2) + vue-demi: 0.13.11(vue@3.5.18(typescript@5.9.2)) + optionalDependencies: + '@vue/runtime-core': 3.5.18 + transitivePeerDependencies: + - '@vue/composition-api' + vue-i18n@9.14.5(vue@3.5.18(typescript@5.9.2)): dependencies: '@intlify/core-base': 9.14.5 @@ -3209,3 +3266,7 @@ snapshots: yallist@3.1.1: {} yoctocolors@2.1.1: {} + + zrender@5.6.1: + dependencies: + tslib: 2.3.0 diff --git a/src/main.ts b/src/main.ts index 58457e9..0e9af04 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,6 +14,35 @@ import '@/assets/fonts/庞门正道标题体3.0.ttf' import '@/assets/fonts/DouyinSansBold.otf' import '@/assets/fonts/Alibaba_PuHuiTi_2.0_55_Regular_85_Bold.ttf' +// ECharts 全局注册 +import VChart from 'vue-echarts' +import { use } from 'echarts/core' +import { CanvasRenderer } from 'echarts/renderers' +import { LineChart, BarChart, PieChart, ScatterChart } from 'echarts/charts' +import { + TitleComponent, + TooltipComponent, + LegendComponent, + GridComponent, + DataZoomComponent, + GraphicComponent +} from 'echarts/components' + +// 注册 ECharts 组件 +use([ + CanvasRenderer, + LineChart, + BarChart, + PieChart, + ScatterChart, + TitleComponent, + TooltipComponent, + LegendComponent, + GridComponent, + DataZoomComponent, + GraphicComponent +]) + // Naive UI import { create, @@ -173,6 +202,9 @@ app.use(router) app.use(i18n) app.use(naive) +// 全局注册 VChart 组件 +app.component('v-chart', VChart) + // 初始化用户认证状态 const userStore = useUserStore() diff --git a/src/router/index.ts b/src/router/index.ts index ae250f7..f3afad8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -52,7 +52,7 @@ import FileViewer from '@/views/teacher/course/FileViewer.vue' import FolderBrowser from '@/views/teacher/course/FolderBrowser.vue' import CertificateManagement from '@/views/teacher/certificate/CertificateManagement.vue' import DiscussionManagement from '@/views/teacher/course/DiscussionManagement.vue' -import StatisticsManagement from '@/views/teacher/course/StatisticsManagement.vue' +import StatisticsManagement from '@/views/teacher/statistics/StatisticsManagement.vue' import NotificationManagement from '@/views/teacher/course/NotificationManagement.vue' import GeneralManagement from '@/views/teacher/course/GeneralManagement.vue' diff --git a/src/views/teacher/course/StatisticsManagement.vue b/src/views/teacher/course/StatisticsManagement.vue deleted file mode 100644 index 210f3a7..0000000 --- a/src/views/teacher/course/StatisticsManagement.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/views/teacher/statistics/StatisticsManagement.vue b/src/views/teacher/statistics/StatisticsManagement.vue new file mode 100644 index 0000000..1e5360d --- /dev/null +++ b/src/views/teacher/statistics/StatisticsManagement.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/src/views/teacher/statistics/tab/BasicData.vue b/src/views/teacher/statistics/tab/BasicData.vue new file mode 100644 index 0000000..c6bd68c --- /dev/null +++ b/src/views/teacher/statistics/tab/BasicData.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/src/views/teacher/statistics/tab/ClassroomReport.vue b/src/views/teacher/statistics/tab/ClassroomReport.vue new file mode 100644 index 0000000..6668bef --- /dev/null +++ b/src/views/teacher/statistics/tab/ClassroomReport.vue @@ -0,0 +1,429 @@ + + + + + diff --git a/src/views/teacher/statistics/tab/LearningMonitor.vue b/src/views/teacher/statistics/tab/LearningMonitor.vue new file mode 100644 index 0000000..cd0dfc2 --- /dev/null +++ b/src/views/teacher/statistics/tab/LearningMonitor.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/src/views/teacher/statistics/tab/LearningStatistics.vue b/src/views/teacher/statistics/tab/LearningStatistics.vue new file mode 100644 index 0000000..a8a3268 --- /dev/null +++ b/src/views/teacher/statistics/tab/LearningStatistics.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/src/views/teacher/statistics/tab/StudentGrades.vue b/src/views/teacher/statistics/tab/StudentGrades.vue new file mode 100644 index 0000000..65a96ca --- /dev/null +++ b/src/views/teacher/statistics/tab/StudentGrades.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file