From 2ab291e7bda4398dda454d12692d40ff36cb9086 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 3 Aug 2023 10:26:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 8 + src/layouts/navbar/index.vue | 1 + src/pages/achievement/info/course.vue | 737 ++++++++++++++++++ .../{teach/index.vue => info/project.vue} | 148 ++-- src/pages/achievement/list/course.vue | 275 +++++++ src/pages/achievement/list/index.vue | 442 +---------- src/pages/achievement/list/project.vue | 432 ++++++++++ src/pages/product/list/index.vue | 42 +- src/router/modules/achivement.js | 9 +- src/setting.js | 2 +- src/store/modules/achievement.js | 17 + 11 files changed, 1606 insertions(+), 507 deletions(-) create mode 100644 src/pages/achievement/info/course.vue rename src/pages/achievement/{teach/index.vue => info/project.vue} (88%) create mode 100644 src/pages/achievement/list/course.vue create mode 100644 src/pages/achievement/list/project.vue create mode 100644 src/store/modules/achievement.js diff --git a/src/api/index.js b/src/api/index.js index 8948ede..ddf2c7a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -112,8 +112,16 @@ export default { exportBankExperimentReport: `occupationlab/occupationlab/achievement/exportBankExperimentReport`, editExperimentalData: 'occupationlab/occupationlab/experimentalReport/editExperimentalData', practiceActivity: 'occupationlab/occupationlab/achievement/practiceActivity', + practiceByProduct: `occupationlab/occupationlab/achievement/practiceByProduct`, + allClassesInOurSchool: `occupationlab/occupationlab/achievement/allClassesInOurSchool`, + productReadScore: `occupationlab/occupationlab/achievement/productReadScore`, + productReadGradeDetails: `occupationlab/occupationlab/achievement/productReadGradeDetails`, exportAllActivity: `${host}occupationlab/occupationlab/achievement/exportAllData`, exportActivity: `${host}occupationlab/occupationlab/achievement/exportDataInBatches`, + exportDetailsOfStudentPracticeScores: `${host}occupationlab/occupationlab/achievement/exportDetailsOfStudentPracticeScores`, + exportDetailsOfStudentAssessmentResults: `${host}occupationlab/occupationlab/achievement/exportDetailsOfStudentAssessmentResults`, + exportProductPracticeResults: `${host}occupationlab/occupationlab/achievement/exportProductPracticeResults`, + exportProductAssessResults: `${host}occupationlab/occupationlab/achievement/exportProductAssessResults`, // 项目管理 getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统 diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index 1958e3d..af116e5 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -188,6 +188,7 @@ export default { this.setTabsName('1') this.setColumnId('') this.$store.commit('match/setCache', null) + this.$store.commit('achievement/setRow', null) if (path === '/screen') { let arr = this.$route.path.split("/"); let name = `/${arr[1]}/list` diff --git a/src/pages/achievement/info/course.vue b/src/pages/achievement/info/course.vue new file mode 100644 index 0000000..7f88582 --- /dev/null +++ b/src/pages/achievement/info/course.vue @@ -0,0 +1,737 @@ + + + + + \ No newline at end of file diff --git a/src/pages/achievement/teach/index.vue b/src/pages/achievement/info/project.vue similarity index 88% rename from src/pages/achievement/teach/index.vue rename to src/pages/achievement/info/project.vue index 692492a..1d66b58 100644 --- a/src/pages/achievement/teach/index.vue +++ b/src/pages/achievement/info/project.vue @@ -5,19 +5,28 @@
+ +
+ 班级 + + + + + + +
- - -
@@ -59,19 +68,25 @@ id="chart1">
- -
+ +
- + @tab-click="initData">
+
+
+
+ +
批量删除 @@ -257,12 +272,12 @@ import axios from 'axios'; export default { data () { return { - activeName: "", // 当前标签页 - classId: "", // 当前班级id - classList: [], // 班级标签页列表 - permissions: Number(this.$route.query.permissions), + classId: +this.$route.query.classId || '', // 当前班级id + classes: [], // 班级标签页列表 + permissions: +this.$route.query.permissions, experimentalName: this.$route.query.projectName, id: this.$route.query.id, + workNumber: this.$route.query.workNumber, keyword: "", searchTimer: null, listDataAll: [], @@ -302,46 +317,32 @@ export default { } }, mounted () { - // 考核才需要查询班级列表 - this.permissions ? - this.getSpliceClass() : - this.tabs.push({ - id: '1', - name: '活跃度' - }) - this.getData() + this.permissions || this.tabs.push({ + id: '1', + name: '活跃度' + }) + this.getClass() + if (this.workNumber) { + this.keyword = this.workNumber + window.scrollTo(0, document.documentElement.scrollHeight) + } else { + this.getData() + } }, methods: { - handleClick (tab, event) { // 处理点击标签页 - if (this.classId === tab.name) return; - this.classId = tab.name; - sessionStorage.setItem('activeName', tab.name) - this.getData(); - }, - // 获取拼接班级 - getSpliceClass () { - this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`).then(res => { - this.classList = res.list - const activeName = sessionStorage.getItem('activeName') - if (activeName && this.classList.some(item => item.id === activeName)) { - this.classId = activeName - this.activeName = activeName - } else { - this.classId = this.classList[0].id; - this.activeName = this.classList[0].id; - } - }).catch(err => { }) + // 获取班级下拉框数据 + async getClass () { + const { list } = this.permissions ? + await this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`) : + await this.$post(this.api.myClass) + this.classes = list }, - // tab切换 - tabChange () { - this.curTab == 1 && this.getActivity() - }, - // 获取表格数据 + // 成绩 async getData () { // 考核和练习调不同接口 const res = this.permissions ? await this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`) : - await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyword=${this.keyword}`) + await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}`) this.listDataAll = res.page.records this.total = res.page.total this.avgScore = (+res.avgScore).toFixed(2) @@ -358,14 +359,14 @@ export default { // 活跃度 async getActivity () { // 考核和练习调不同接口 - const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}`) + const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}`) this.activations = message.records this.totalActivation = message.total }, initData () { - this.$refs.table.clearSelection(); - this.page = 1; - this.getData(); + this.page = 1 + this.pageActivation = 1 + this.curTab == 0 ? this.getData() : this.getActivity() }, // 分页 handlePage () { @@ -374,6 +375,7 @@ export default { }, // 查看成绩报告 show (row) { + this.$store.commit('achievement/setRow', null) this.$router.push(`show?reportId=${row.reportId}`) }, // 导出(有勾选:就导勾选中的;没有勾选:就导全部) @@ -491,34 +493,13 @@ export default { util.downloadFileDirect(`活跃度.xls`, new Blob([res.data])) }, getChart () { // 初始化折线图 - const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + const xData = Array.from({ length: 101 }, (v, k) => k) + const yData = Array.from({ length: 101 }, (v, k) => 0) const list = this.listDataAll list.map(n => { - n.score; - if (n.score === 0) { - data[0]++; - } else if (n.score > 0 && n.score <= 10) { - data[1]++; - } else if (n.score > 10 && n.score <= 20) { - data[2]++; - } else if (n.score > 20 && n.score <= 30) { - data[3]++; - } else if (n.score > 30 && n.score <= 40) { - data[4]++; - } else if (n.score > 40 && n.score <= 50) { - data[5]++; - } else if (n.score > 50 && n.score <= 60) { - data[6]++; - } else if (n.score > 60 && n.score <= 70) { - data[7]++; - } else if (n.score > 70 && n.score <= 80) { - data[8]++; - } else if (n.score > 80 && n.score <= 90) { - data[9]++; - } else if (n.score > 90 && n.score <= 100) { - data[10]++; - } + yData[n.score]++ }) + console.log(333, xData, yData) let myChart = echarts.init(document.getElementById("chart")); myChart.setOption({ title: { text: "实验分数分布图" }, @@ -527,16 +508,19 @@ export default { name: "分数", type: "category", boundaryGap: false, - interval: 10, - data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100'] + interval: 5, + axisLabel: { + interval: 9, + }, + data: xData }, yAxis: { name: this.permissions ? "人数" : '成绩报告数量', type: "value", - interval: 1 + interval: 5 }, series: [{ - data, + data: yData, type: "line", areaStyle: {}, color: ["#8191fd"] diff --git a/src/pages/achievement/list/course.vue b/src/pages/achievement/list/course.vue new file mode 100644 index 0000000..26c4d65 --- /dev/null +++ b/src/pages/achievement/list/course.vue @@ -0,0 +1,275 @@ + + + + + \ No newline at end of file diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue index 68c1afb..9d63fbf 100644 --- a/src/pages/achievement/list/index.vue +++ b/src/pages/achievement/list/index.vue @@ -1,431 +1,69 @@ \ No newline at end of file diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue new file mode 100644 index 0000000..7931867 --- /dev/null +++ b/src/pages/achievement/list/project.vue @@ -0,0 +1,432 @@ + + + + + \ No newline at end of file diff --git a/src/pages/product/list/index.vue b/src/pages/product/list/index.vue index 6a1b169..6076f1a 100644 --- a/src/pages/product/list/index.vue +++ b/src/pages/product/list/index.vue @@ -49,23 +49,26 @@
学科专业
-
全部
-
不限
-
- {{ item.name }} - +
+
全部
+
不限
+
+ {{ item.name }} + +
@@ -378,7 +381,7 @@ export default { async getSubject () { // 学科类别 this.$get(this.api.courseDiscipline).then(({ list }) => { - list = list.filter(e => e.level > 1).slice(1) + list = list.filter(e => e.level > 1).slice(1) // 被引用了的才需要展示(level>1) const result = [] const promises = [] list.map((e, i) => { @@ -680,7 +683,7 @@ export default { color: #333; cursor: pointer; & + .el-cascader { - width: 50px; + width: 30px; } } } @@ -703,6 +706,7 @@ export default { .vals { display: inline-flex; flex-wrap: wrap; + align-items: center; width: 920px; } .caret { diff --git a/src/router/modules/achivement.js b/src/router/modules/achivement.js index 948eea9..07c36c5 100644 --- a/src/router/modules/achivement.js +++ b/src/router/modules/achivement.js @@ -19,11 +19,14 @@ export default { component: () => import("@/pages/achievement/list"), meta: { title: "成绩管理" } }, { - name: `${pre}teach`, - path: `teach`, - component: () => import("@/pages/achievement/teach"), + path: `course`, + component: () => import("@/pages/achievement/info/course"), meta: { title: "成绩管理" } }, { + path: `project`, + component: () => import("@/pages/achievement/info/project"), + meta: { title: "成绩管理" } + }, { name: `${pre}show`, path: `show`, component: () => import("@/pages/achievement/show"), diff --git a/src/setting.js b/src/setting.js index be0456c..1f5cb2c 100644 --- a/src/setting.js +++ b/src/setting.js @@ -26,7 +26,7 @@ if (isPro) { uploadURL = `http://121.37.12.51/` host = "http://121.37.12.51/"; // 中台测试服 // host = 'https://www.occupationlab.com/' // 正式服 - host = "http://192.168.31.152:9000/"; // 榕 + // host = "http://192.168.31.217:9000/"; // 榕 // host = 'http://192.168.31.51:9000/'; // 赓 } diff --git a/src/store/modules/achievement.js b/src/store/modules/achievement.js new file mode 100644 index 0000000..b05694b --- /dev/null +++ b/src/store/modules/achievement.js @@ -0,0 +1,17 @@ +/** + * 赛事相关 + * */ +export default { + namespaced: true, + state: { + row: null, + }, + mutations: { + setRow: (state, row) => { + state.row = row + }, + }, + actions: { + + } +}; \ No newline at end of file