Commit 38bdc42267894e6137a35c8a4abc949a509ae76d

Authored by 梁保满
1 parent 757a21e3

学生画像班主任和任课教师接口区分

src/views/portrait/detail.vue
@@ -309,6 +309,8 @@ export default { @@ -309,6 +309,8 @@ export default {
309 let subjectList = 309 let subjectList =
310 this.role == "ROLE_PERSONAL" 310 this.role == "ROLE_PERSONAL"
311 ? this.$request.pSubjectList 311 ? this.$request.pSubjectList
  312 + : this.role == "ROLE_BANZHUREN"
  313 + ? this.$request.cTSubjectList
312 : this.$request.tSubjectList; 314 : this.$request.tSubjectList;
313 const { data, status, info } = await subjectList({ 315 const { data, status, info } = await subjectList({
314 classId: this.classId, 316 classId: this.classId,
@@ -390,7 +392,7 @@ export default { @@ -390,7 +392,7 @@ export default {
390 this.loading = false; 392 this.loading = false;
391 if (status === 0) { 393 if (status === 0) {
392 this.count = 0; 394 this.count = 0;
393 - this.tableData = data.list || []; 395 + this.tableData = data?.list || [];
394 if (this.type == 1) { 396 if (this.type == 1) {
395 this.radarChartData.indicator = []; 397 this.radarChartData.indicator = [];
396 this.radarChartData.num = [ 398 this.radarChartData.num = [
src/views/portrait/index.vue
@@ -21,40 +21,32 @@ @@ -21,40 +21,32 @@
21 > 21 >
22 </el-option> 22 </el-option>
23 </el-select> 23 </el-select>
24 - <div class="d1">  
25 - <el-date-picker  
26 - v-model="query.startDay"  
27 - type="date"  
28 - @change="handleChangeTimeStart"  
29 - placeholder="选择日期时间"  
30 - value-format="yyyy-MM-dd"  
31 - >  
32 - </el-date-picker>  
33 - ~  
34 - <el-date-picker  
35 - v-model="query.endDay"  
36 - type="date"  
37 - placeholder="选择日期时间"  
38 - @change="handleChangeTimeEnd"  
39 - value-format="yyyy-MM-dd"  
40 - >  
41 - </el-date-picker>  
42 - </div>  
43 - <p class="p1">  
44 - <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"  
45 - >今天</span  
46 - >  
47 - <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"  
48 - >本周</span  
49 - >  
50 - <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"  
51 - >本月</span  
52 - >  
53 - <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"  
54 - >本季度</span  
55 - >  
56 - </p>  
57 - <el-button type="primary" round @click="_QueryData()">筛选</el-button> 24 + <el-input
  25 + placeholder="请输入学生姓名"
  26 + v-model="query.studentName"
  27 + class="input-with-select"
  28 + maxlength="30"
  29 + @keyup.enter.native="(query.studentCode = ''), _QueryData()"
  30 + >
  31 + <el-button
  32 + slot="append"
  33 + icon="el-icon-search"
  34 + @click="(query.studentCode = ''), _QueryData()"
  35 + ></el-button>
  36 + </el-input>
  37 + <el-input
  38 + placeholder="请输入学生学号"
  39 + v-model="query.studentCode"
  40 + class="input-with-select"
  41 + maxlength="30"
  42 + @keyup.enter.native="(query.studentName = ''), _QueryData()"
  43 + >
  44 + <el-button
  45 + slot="append"
  46 + icon="el-icon-search"
  47 + @click="(query.studentName = ''), _QueryData()"
  48 + ></el-button>
  49 + </el-input>
58 </div> 50 </div>
59 </div> 51 </div>
60 <div class="page-content"> 52 <div class="page-content">
@@ -66,8 +58,10 @@ @@ -66,8 +58,10 @@
66 </div> 58 </div>
67 <div class="info"> 59 <div class="info">
68 <p class="p1"> 60 <p class="p1">
69 - {{ item.studentName }} <i class="fa fa-calculator"></i>  
70 - {{ item.clickerSn }} 61 + {{ item.studentName }}
  62 + <template v-if="item.clickerSn"
  63 + ><i class="fa fa-calculator"></i> {{ item.clickerSn }}</template
  64 + >
71 </p> 65 </p>
72 <p class="p2">{{ gradeName(item.grade) }}</p> 66 <p class="p2">{{ gradeName(item.grade) }}</p>
73 <p class="p3">最近活跃:{{ item.modifiedTime }}</p> 67 <p class="p3">最近活跃:{{ item.modifiedTime }}</p>
@@ -96,15 +90,14 @@ export default { @@ -96,15 +90,14 @@ export default {
96 query: { 90 query: {
97 //搜索条件 91 //搜索条件
98 classId: "", 92 classId: "",
99 - startDay: "",  
100 - endDay: "",  
101 - day: "", 93 + studentName: "",
  94 + studentCode: "",
102 }, 95 },
103 date: "", 96 date: "",
104 classList: [], 97 classList: [],
105 tableData: [], 98 tableData: [],
106 page: 1, 99 page: 1,
107 - size: 20, 100 + size: 999,
108 total: 0, 101 total: 0,
109 }; 102 };
110 }, 103 },
@@ -113,23 +106,13 @@ export default { @@ -113,23 +106,13 @@ export default {
113 this.$store.getters.info.showRole || 106 this.$store.getters.info.showRole ||
114 this.$store.getters.info.permissions[0].role; 107 this.$store.getters.info.permissions[0].role;
115 await this._QueryClassList(); 108 await this._QueryClassList();
116 - await this.setDate(1);  
117 - let startDay = this.query?.startDay;  
118 - if (!startDay) {  
119 - this.query.startDay = new Date();  
120 - this.query.endDay = new Date();  
121 - } 109 + await this._QueryData();
122 }, 110 },
123 activated() { 111 activated() {
124 const that = this; 112 const that = this;
125 BusEvent.$on("keepAlive", async function () { 113 BusEvent.$on("keepAlive", async function () {
126 await that._QueryClassList(); 114 await that._QueryClassList();
127 - await that.setDate(1);  
128 - let startDay = that.query?.startDay;  
129 - if (!startDay) {  
130 - that.query.startDay = new Date();  
131 - that.query.endDay = new Date();  
132 - } 115 + await that._QueryData();
133 }); 116 });
134 }, 117 },
135 methods: { 118 methods: {
@@ -149,82 +132,16 @@ export default { @@ -149,82 +132,16 @@ export default {
149 }, 132 },
150 changeclass() { 133 changeclass() {
151 this.page = 1; 134 this.page = 1;
  135 + this.query.studentName = "";
  136 + this.query.studentCode = "";
152 this._QueryData(); 137 this._QueryData();
153 }, 138 },
154 - setDate(index) {  
155 - const that = this;  
156 - this.date = index == this.date ? "" : index;  
157 - let aYear = new Date().getFullYear();  
158 - let aMonth = new Date().getMonth() + 1;  
159 - that.query.day = "";  
160 - that.query.startDay = "";  
161 - that.query.endDay = "";  
162 - switch (index) {  
163 - case 1:  
164 - that.query.day = formatDate(new Date(), "yyyy-MM-dd");  
165 - that.query.startDay = that.query.day;  
166 - that.query.endDay = that.query.day;  
167 - that.tabIndex = 1;  
168 - break;  
169 - case 2:  
170 - let day = new Date().getDay();  
171 - if (day == 0) {  
172 - //中国式星期天是一周的最后一天  
173 - day = 7;  
174 - }  
175 - day--;  
176 - let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day;  
177 - that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd");  
178 - that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");  
179 - break;  
180 - case 3:  
181 - aMonth = aMonth < 10 ? "0" + aMonth : aMonth;  
182 - that.query.startDay = `${aYear}-${aMonth}-01`;  
183 - that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");  
184 - break;  
185 - case 4:  
186 - if (aMonth > 0 && aMonth < 4) {  
187 - aMonth = "1";  
188 - } else if (aMonth > 3 && aMonth < 7) {  
189 - aMonth = "4";  
190 - } else if (aMonth > 6 && aMonth < 10) {  
191 - aMonth = "7";  
192 - } else {  
193 - aMonth = "10";  
194 - }  
195 -  
196 - aMonth = aMonth < 10 ? "0" + aMonth : aMonth;  
197 - that.query.startDay = `${aYear}-${aMonth}-01`;  
198 - that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");  
199 - break;  
200 - }  
201 - this.page = 1;  
202 - this._QueryData();  
203 - },  
204 - handleChangeTimeStart(val) {  
205 - this.query.day = "";  
206 - this.date = "";  
207 - if (this.query.endDay) {  
208 - if (new Date(val).getTime() > new Date(this.query.endDay).getTime()) {  
209 - this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");  
210 - this.query.startDay = "";  
211 - }  
212 - }  
213 - },  
214 - handleChangeTimeEnd(val) {  
215 - this.query.day = "";  
216 - this.date = "";  
217 - if (this.query.startDay) {  
218 - if (new Date(val).getTime() < new Date(this.query.startDay).getTime()) {  
219 - this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");  
220 - this.query.endDay = "";  
221 - }  
222 - }  
223 - },  
224 async _QueryClassList() { 139 async _QueryClassList() {
225 let fetchClassList = 140 let fetchClassList =
226 this.role == "ROLE_PERSONAL" 141 this.role == "ROLE_PERSONAL"
227 ? this.$request.pClassList 142 ? this.$request.pClassList
  143 + : this.role == "ROLE_BANZHUREN"
  144 + ? this.$request.cTClassList
228 : this.$request.fetchClassList; 145 : this.$request.fetchClassList;
229 146
230 const { data, status, info } = await fetchClassList(); 147 const { data, status, info } = await fetchClassList();
@@ -254,7 +171,6 @@ export default { @@ -254,7 +171,6 @@ export default {
254 : this.$request.tStudentList; 171 : this.$request.tStudentList;
255 const { data, status, info } = await studentList({ 172 const { data, status, info } = await studentList({
256 ...query, 173 ...query,
257 - page: this.page,  
258 size: this.size, 174 size: this.size,
259 }); 175 });
260 this.loading = false; 176 this.loading = false;