From 38bdc42267894e6137a35c8a4abc949a509ae76d Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Fri, 10 Mar 2023 14:53:02 +0800 Subject: [PATCH] 学生画像班主任和任课教师接口区分 --- src/views/portrait/detail.vue | 4 +++- src/views/portrait/index.vue | 162 +++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------- 2 files changed, 42 insertions(+), 124 deletions(-) diff --git a/src/views/portrait/detail.vue b/src/views/portrait/detail.vue index 176765b..3e67395 100644 --- a/src/views/portrait/detail.vue +++ b/src/views/portrait/detail.vue @@ -309,6 +309,8 @@ export default { let subjectList = this.role == "ROLE_PERSONAL" ? this.$request.pSubjectList + : this.role == "ROLE_BANZHUREN" + ? this.$request.cTSubjectList : this.$request.tSubjectList; const { data, status, info } = await subjectList({ classId: this.classId, @@ -390,7 +392,7 @@ export default { this.loading = false; if (status === 0) { this.count = 0; - this.tableData = data.list || []; + this.tableData = data?.list || []; if (this.type == 1) { this.radarChartData.indicator = []; this.radarChartData.num = [ diff --git a/src/views/portrait/index.vue b/src/views/portrait/index.vue index a7aece9..f9fe830 100644 --- a/src/views/portrait/index.vue +++ b/src/views/portrait/index.vue @@ -21,40 +21,32 @@ > -
- - - ~ - - -
-

- 今天 - 本周 - 本月 - 本季度 -

- 筛选 + + + + + +
@@ -66,8 +58,10 @@

- {{ item.studentName }} - {{ item.clickerSn }} + {{ item.studentName }} +

{{ gradeName(item.grade) }}

最近活跃:{{ item.modifiedTime }}

@@ -96,15 +90,14 @@ export default { query: { //搜索条件 classId: "", - startDay: "", - endDay: "", - day: "", + studentName: "", + studentCode: "", }, date: "", classList: [], tableData: [], page: 1, - size: 20, + size: 999, total: 0, }; }, @@ -113,23 +106,13 @@ export default { this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; await this._QueryClassList(); - await this.setDate(1); - let startDay = this.query?.startDay; - if (!startDay) { - this.query.startDay = new Date(); - this.query.endDay = new Date(); - } + await this._QueryData(); }, activated() { const that = this; BusEvent.$on("keepAlive", async function () { await that._QueryClassList(); - await that.setDate(1); - let startDay = that.query?.startDay; - if (!startDay) { - that.query.startDay = new Date(); - that.query.endDay = new Date(); - } + await that._QueryData(); }); }, methods: { @@ -149,82 +132,16 @@ export default { }, changeclass() { this.page = 1; + this.query.studentName = ""; + this.query.studentCode = ""; this._QueryData(); }, - setDate(index) { - const that = this; - this.date = index == this.date ? "" : index; - let aYear = new Date().getFullYear(); - let aMonth = new Date().getMonth() + 1; - that.query.day = ""; - that.query.startDay = ""; - that.query.endDay = ""; - switch (index) { - case 1: - that.query.day = formatDate(new Date(), "yyyy-MM-dd"); - that.query.startDay = that.query.day; - that.query.endDay = that.query.day; - that.tabIndex = 1; - break; - case 2: - let day = new Date().getDay(); - if (day == 0) { - //中国式星期天是一周的最后一天 - day = 7; - } - day--; - let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day; - that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd"); - that.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); - break; - case 3: - aMonth = aMonth < 10 ? "0" + aMonth : aMonth; - that.query.startDay = `${aYear}-${aMonth}-01`; - that.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); - break; - case 4: - if (aMonth > 0 && aMonth < 4) { - aMonth = "1"; - } else if (aMonth > 3 && aMonth < 7) { - aMonth = "4"; - } else if (aMonth > 6 && aMonth < 10) { - aMonth = "7"; - } else { - aMonth = "10"; - } - - aMonth = aMonth < 10 ? "0" + aMonth : aMonth; - that.query.startDay = `${aYear}-${aMonth}-01`; - that.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); - break; - } - this.page = 1; - this._QueryData(); - }, - handleChangeTimeStart(val) { - this.query.day = ""; - this.date = ""; - if (this.query.endDay) { - if (new Date(val).getTime() > new Date(this.query.endDay).getTime()) { - this.$message.error("任务结束时间不能任务开始时间前面,请重新设置"); - this.query.startDay = ""; - } - } - }, - handleChangeTimeEnd(val) { - this.query.day = ""; - this.date = ""; - if (this.query.startDay) { - if (new Date(val).getTime() < new Date(this.query.startDay).getTime()) { - this.$message.error("任务结束时间不能任务开始时间前面,请重新设置"); - this.query.endDay = ""; - } - } - }, async _QueryClassList() { let fetchClassList = this.role == "ROLE_PERSONAL" ? this.$request.pClassList + : this.role == "ROLE_BANZHUREN" + ? this.$request.cTClassList : this.$request.fetchClassList; const { data, status, info } = await fetchClassList(); @@ -254,7 +171,6 @@ export default { : this.$request.tStudentList; const { data, status, info } = await studentList({ ...query, - page: this.page, size: this.size, }); this.loading = false; -- libgit2 0.21.4