Commit d4b9eb45d8f01a06972acc0a85d97d747d466a23
1 parent
0761e2ba
设备异常信息
Showing
6 changed files
with
208 additions
and
54 deletions
src/api/apis/apis.js
@@ -1516,4 +1516,42 @@ export default { | @@ -1516,4 +1516,42 @@ export default { | ||
1516 | data, | 1516 | data, |
1517 | }); | 1517 | }); |
1518 | }, | 1518 | }, |
1519 | + // 未分班学生名单导出 | ||
1520 | + exportNoClassStudent() { | ||
1521 | + return service({ | ||
1522 | + url: setUpUrls.exportNoClassStudent, | ||
1523 | + method: "POST", | ||
1524 | + responseType: 'arraybuffer', | ||
1525 | + }); | ||
1526 | + }, | ||
1527 | + // 未分配教师名单导出 | ||
1528 | + exportNoClassTeacher() { | ||
1529 | + return service({ | ||
1530 | + url: setUpUrls.exportNoClassTeacher, | ||
1531 | + method: "POST", | ||
1532 | + responseType: 'arraybuffer', | ||
1533 | + }); | ||
1534 | + }, | ||
1535 | + // 学校查询异常设备总数 | ||
1536 | + abnormalDeviceCount() { | ||
1537 | + return service({ | ||
1538 | + url: setUpUrls.abnormalDeviceCount, | ||
1539 | + method: "POST", | ||
1540 | + }); | ||
1541 | + }, | ||
1542 | + // 集团查询异常设备总数 | ||
1543 | + tenantAbnormalDeviceCount() { | ||
1544 | + return service({ | ||
1545 | + url: setUpUrls.tenantAbnormalDeviceCount, | ||
1546 | + method: "POST", | ||
1547 | + }); | ||
1548 | + }, | ||
1549 | + // 设备异常备注 | ||
1550 | + abnormalRemark(data) { | ||
1551 | + return service({ | ||
1552 | + url: setUpUrls.abnormalRemark, | ||
1553 | + method: "POST", | ||
1554 | + data | ||
1555 | + }); | ||
1556 | + }, | ||
1519 | }; | 1557 | }; |
src/api/urls/apis.js
@@ -392,4 +392,14 @@ export default { | @@ -392,4 +392,14 @@ export default { | ||
392 | tenantSectionAndGradeList: "/api_html/tenant/sectionAndGradeList", | 392 | tenantSectionAndGradeList: "/api_html/tenant/sectionAndGradeList", |
393 | //集团查询科目列表 | 393 | //集团查询科目列表 |
394 | tenantSubjectList: "/api_html/tenant/subjectList", | 394 | tenantSubjectList: "/api_html/tenant/subjectList", |
395 | + //未分班学生名单导出 | ||
396 | + exportNoClassStudent: "/api_html/school/manager/exportNoClassStudent", | ||
397 | + //未分班教师名单导出 | ||
398 | + exportNoClassTeacher: "/api_html/school/manager/exportNoClassTeacher", | ||
399 | + //学校查询异常设备总数 | ||
400 | + abnormalDeviceCount: "/api_html/school/manager/abnormalDeviceCount", | ||
401 | + //集团查询异常设备总数 | ||
402 | + tenantAbnormalDeviceCount: "/api_html/tenant/abnormalDeviceCount", | ||
403 | + //设备异常备注 | ||
404 | + abnormalRemark: "/api_html/school/manager/abnormalRemark", | ||
395 | } | 405 | } |
src/views/layout/aside/aside.vue
@@ -100,10 +100,10 @@ export default { | @@ -100,10 +100,10 @@ export default { | ||
100 | let name = ""; | 100 | let name = ""; |
101 | let navTitle = function (path, routerARR) { | 101 | let navTitle = function (path, routerARR) { |
102 | for (let i = 0; i < routerARR.length; i++) { | 102 | for (let i = 0; i < routerARR.length; i++) { |
103 | - if (routerARR[i].children.length > 0 || routerARR[i].path === path) { | 103 | + if (routerARR[i].children?.length > 0 || routerARR[i].path === path) { |
104 | if ( | 104 | if ( |
105 | routerARR[i].path === path && | 105 | routerARR[i].path === path && |
106 | - routerARR[i].children.length < 1 | 106 | + routerARR[i].children?.length < 1 |
107 | ) { | 107 | ) { |
108 | name = routerARR[i].name; | 108 | name = routerARR[i].name; |
109 | break; | 109 | break; |
src/views/standard/device/error.vue
@@ -13,35 +13,71 @@ | @@ -13,35 +13,71 @@ | ||
13 | align="center" | 13 | align="center" |
14 | width="160" | 14 | width="160" |
15 | ></el-table-column> | 15 | ></el-table-column> |
16 | + <el-table-column prop="abnormalSource" label="设备类型" align="center"> | ||
17 | + <template slot-scope="scoped"> | ||
18 | + {{ | ||
19 | + scoped.row.abnormalSource == 0 | ||
20 | + ? "无" | ||
21 | + : scoped.row.abnormalSource == 1 | ||
22 | + ? "云平台" | ||
23 | + : scoped.row.abnormalSource == 2 | ||
24 | + ? "授课端" | ||
25 | + : scoped.row.abnormalSource == 3 | ||
26 | + ? "出厂工具" | ||
27 | + : "发卡工具" | ||
28 | + }} | ||
29 | + </template> | ||
30 | + </el-table-column> | ||
31 | + <el-table-column label="异常类型" align="center"> | ||
32 | + <template slot-scope="scoped"> | ||
33 | + {{ | ||
34 | + scoped.row.status == 0 | ||
35 | + ? "正常" | ||
36 | + : scoped.row.status == 1 | ||
37 | + ? "低电量异常" | ||
38 | + : scoped.row.status == 2 | ||
39 | + ? "配对码异常" | ||
40 | + : "关联班级异常" | ||
41 | + }} | ||
42 | + </template></el-table-column | ||
43 | + > | ||
44 | + <template v-if="type == 1"> | ||
45 | + <el-table-column | ||
46 | + prop="pairingCode" | ||
47 | + label="配对码" | ||
48 | + align="center" | ||
49 | + ></el-table-column> | ||
50 | + <el-table-column label="关联班级" align="center"> | ||
51 | + <template slot-scope="scoped"> | ||
52 | + <p v-for="(item, index) in scoped.row.classList" :key="index"> | ||
53 | + {{ item.className }} | ||
54 | + </p> | ||
55 | + </template> | ||
56 | + </el-table-column> | ||
57 | + </template> | ||
16 | <el-table-column | 58 | <el-table-column |
17 | - prop="type" | ||
18 | - label="设备类型" | ||
19 | - align="center" | ||
20 | - ></el-table-column> | ||
21 | - <el-table-column | ||
22 | - prop="operationTime" | ||
23 | - label="异常类型" | ||
24 | - align="center" | ||
25 | - ></el-table-column> | ||
26 | - <el-table-column | ||
27 | - prop="operationTime" | 59 | + prop="modifiedTime" |
28 | label="最早发现时间" | 60 | label="最早发现时间" |
29 | align="center" | 61 | align="center" |
30 | width="200" | 62 | width="200" |
31 | ></el-table-column> | 63 | ></el-table-column> |
32 | <el-table-column | 64 | <el-table-column |
33 | - prop="operationTime" | ||
34 | - label="异常后答题次数" | 65 | + prop="answerTimes" |
66 | + label="答题次数" | ||
35 | align="center" | 67 | align="center" |
36 | ></el-table-column> | 68 | ></el-table-column> |
37 | <el-table-column | 69 | <el-table-column |
38 | - prop="operationTime" | 70 | + prop="abnormalRemark" |
39 | label="状态" | 71 | label="状态" |
40 | align="center" | 72 | align="center" |
41 | ></el-table-column> | 73 | ></el-table-column> |
42 | - <el-table-column label="操作" align="center" width="200" | 74 | + <el-table-column label="操作" align="center" width="100" |
43 | ><template slot-scope="scoped"> | 75 | ><template slot-scope="scoped"> |
44 | - <el-link>处理</el-link></template | 76 | + <el-link |
77 | + :disabled="scoped.row.abnormalRemark" | ||
78 | + @click="openDia(scoped.row)" | ||
79 | + >处理</el-link | ||
80 | + ></template | ||
45 | ></el-table-column | 81 | ></el-table-column |
46 | > | 82 | > |
47 | </el-table> | 83 | </el-table> |
@@ -58,6 +94,24 @@ | @@ -58,6 +94,24 @@ | ||
58 | </el-pagination> | 94 | </el-pagination> |
59 | </div> | 95 | </div> |
60 | </div> | 96 | </div> |
97 | + <el-dialog title="备注" :visible.sync="diaNotes" width="400"> | ||
98 | + <el-form ref="formClass" label-width="100px"> | ||
99 | + <el-form-item label="处理备注:" prop="studentName"> | ||
100 | + <el-col :span="12"> | ||
101 | + <el-input | ||
102 | + type="textarea" | ||
103 | + :rows="3" | ||
104 | + maxlength="200" | ||
105 | + v-model="ntoes" | ||
106 | + /> | ||
107 | + </el-col> | ||
108 | + </el-form-item> | ||
109 | + </el-form> | ||
110 | + <div class="dialog-footer" slot="footer"> | ||
111 | + <el-button @click="_SaveNotes" type="primary">确 定</el-button> | ||
112 | + <el-button @click="diaNotes = false">取 消</el-button> | ||
113 | + </div> | ||
114 | + </el-dialog> | ||
61 | </div> | 115 | </div> |
62 | </template> | 116 | </template> |
63 | 117 | ||
@@ -65,6 +119,12 @@ | @@ -65,6 +119,12 @@ | ||
65 | export default { | 119 | export default { |
66 | data() { | 120 | data() { |
67 | return { | 121 | return { |
122 | + role: "", | ||
123 | + loading: false, | ||
124 | + diaNotes: false, | ||
125 | + ntoes: "", | ||
126 | + deviceId: "", | ||
127 | + type: 1, | ||
68 | tableData: [], | 128 | tableData: [], |
69 | total: 0, | 129 | total: 0, |
70 | page: 1, | 130 | page: 1, |
@@ -72,20 +132,49 @@ export default { | @@ -72,20 +132,49 @@ export default { | ||
72 | }; | 132 | }; |
73 | }, | 133 | }, |
74 | created() { | 134 | created() { |
75 | - this._QueryData() | 135 | + this.type = this.$route.query.type; |
136 | + this.role = | ||
137 | + this.$store.getters.info.showRole || | ||
138 | + this.$store.getters.info.permissions[0].role; | ||
139 | + this._QueryData(); | ||
76 | }, | 140 | }, |
77 | methods: { | 141 | methods: { |
78 | changePage(page) { | 142 | changePage(page) { |
79 | this.page = page; | 143 | this.page = page; |
80 | this._QueryData(); | 144 | this._QueryData(); |
81 | }, | 145 | }, |
146 | + openDia(obj) { | ||
147 | + this.diaNotes = true; | ||
148 | + this.deviceId = obj.id; | ||
149 | + this.ntoes = ""; | ||
150 | + }, | ||
151 | + async _SaveNotes() { | ||
152 | + if (!this.ntoes.trim()) { | ||
153 | + this.$message.warning("请填写备注内容!"); | ||
154 | + return; | ||
155 | + } | ||
156 | + const { status, info } = await this.$request.abnormalRemark({ | ||
157 | + deviceId: this.deviceId, | ||
158 | + abnormalRemark: this.ntoes, | ||
159 | + }); | ||
160 | + if (status === 0) { | ||
161 | + this.ntoes = ""; | ||
162 | + this.diaNotes = false; | ||
163 | + this._QueryData(); | ||
164 | + } else { | ||
165 | + this.$message.error(info); | ||
166 | + } | ||
167 | + }, | ||
82 | async _QueryData() { | 168 | async _QueryData() { |
83 | this.loading = true; | 169 | this.loading = true; |
84 | - const { | ||
85 | - data = {}, | ||
86 | - status, | ||
87 | - info, | ||
88 | - } = await this.$request.pDeviceLogList({ | 170 | + const deviceList = |
171 | + this.role != "ROLE_JITUAN" | ||
172 | + ? this.$request.deviceList | ||
173 | + : this.$request.tenantDeviceList; | ||
174 | + this.tableData = []; | ||
175 | + const { data, status, info } = await deviceList({ | ||
176 | + status: 1, | ||
177 | + deviceType: this.type, | ||
89 | page: this.page, | 178 | page: this.page, |
90 | size: this.size, | 179 | size: this.size, |
91 | }); | 180 | }); |
src/views/standard/device/index.vue
@@ -48,8 +48,14 @@ | @@ -48,8 +48,14 @@ | ||
48 | <el-radio-button :label="3">授课端管理</el-radio-button> | 48 | <el-radio-button :label="3">授课端管理</el-radio-button> |
49 | </el-radio-group> | 49 | </el-radio-group> |
50 | </div> | 50 | </div> |
51 | - <p v-show="type == 1" class="error-tips"> | ||
52 | - 有{{}}条设备异常信息,<router-link to="/deviceError" | 51 | + <p |
52 | + v-show="(type == 1 && stationCount) || (type == 2 && clickerCount)" | ||
53 | + class="error-tips" | ||
54 | + > | ||
55 | + 有{{ | ||
56 | + type == 1 ? stationCount : clickerCount | ||
57 | + }}条设备异常信息,<router-link | ||
58 | + :to="{ path: '/deviceError', query: { type: type } }" | ||
53 | >点击查看>></router-link | 59 | >点击查看>></router-link |
54 | > | 60 | > |
55 | </p> | 61 | </p> |
@@ -693,6 +699,8 @@ export default { | @@ -693,6 +699,8 @@ export default { | ||
693 | size: 20, | 699 | size: 20, |
694 | isBack: false, //是否是日志页面回来 | 700 | isBack: false, //是否是日志页面回来 |
695 | upgradeFlag: false, | 701 | upgradeFlag: false, |
702 | + stationCount: 0, //异常基站数量 | ||
703 | + clickerCount: 0, //异常答题器数量 | ||
696 | }; | 704 | }; |
697 | }, | 705 | }, |
698 | created() { | 706 | created() { |
@@ -700,12 +708,12 @@ export default { | @@ -700,12 +708,12 @@ export default { | ||
700 | this.role = | 708 | this.role = |
701 | this.$store.getters.info.showRole || | 709 | this.$store.getters.info.showRole || |
702 | this.$store.getters.info.permissions[0].role; | 710 | this.$store.getters.info.permissions[0].role; |
711 | + this._QueryErrorTotal(); | ||
703 | if (this.role == "ROLE_JITUAN") { | 712 | if (this.role == "ROLE_JITUAN") { |
704 | (this.props.lazy = true), | 713 | (this.props.lazy = true), |
705 | (this.props.lazyLoad = function (node, resolve) { | 714 | (this.props.lazyLoad = function (node, resolve) { |
706 | const { level } = node; | 715 | const { level } = node; |
707 | if (level == 2) { | 716 | if (level == 2) { |
708 | - console.log(node); | ||
709 | api | 717 | api |
710 | .tenantClassList({ | 718 | .tenantClassList({ |
711 | schoolId: node.data.value, | 719 | schoolId: node.data.value, |
@@ -716,8 +724,6 @@ export default { | @@ -716,8 +724,6 @@ export default { | ||
716 | return a.grade - b.grade; | 724 | return a.grade - b.grade; |
717 | } | 725 | } |
718 | ); | 726 | ); |
719 | - console.log(); | ||
720 | - | ||
721 | const nodes = [...children]; | 727 | const nodes = [...children]; |
722 | // 通过调用resolve将子节点数据返回,通知组件数据加载完成 | 728 | // 通过调用resolve将子节点数据返回,通知组件数据加载完成 |
723 | resolve(nodes); | 729 | resolve(nodes); |
@@ -738,7 +744,6 @@ export default { | @@ -738,7 +744,6 @@ export default { | ||
738 | activated() { | 744 | activated() { |
739 | const that = this; | 745 | const that = this; |
740 | this.isBack = this.$route.query.back ? this.$route.query.back : false; | 746 | this.isBack = this.$route.query.back ? this.$route.query.back : false; |
741 | - console.log(this.$route.query.back); | ||
742 | if (!this.isBack) { | 747 | if (!this.isBack) { |
743 | that.type = 1; | 748 | that.type = 1; |
744 | that.page = 1; | 749 | that.page = 1; |
@@ -1246,6 +1251,21 @@ export default { | @@ -1246,6 +1251,21 @@ export default { | ||
1246 | this.$message.error(info); | 1251 | this.$message.error(info); |
1247 | } | 1252 | } |
1248 | }, | 1253 | }, |
1254 | + // 异常设备数量 | ||
1255 | + async _QueryErrorTotal() { | ||
1256 | + const abnormalDeviceCount = | ||
1257 | + this.role != "ROLE_JITUAN" | ||
1258 | + ? this.$request.abnormalDeviceCount | ||
1259 | + : this.$request.tenantAbnormalDeviceCount; | ||
1260 | + this.tableData = []; | ||
1261 | + const { data, status, info } = await abnormalDeviceCount(); | ||
1262 | + if (status == 0) { | ||
1263 | + this.stationCount = data?.stationCount; | ||
1264 | + this.clickerCount = data?.clickerCount; | ||
1265 | + } else { | ||
1266 | + this.$message.error(info); | ||
1267 | + } | ||
1268 | + }, | ||
1249 | }, | 1269 | }, |
1250 | }; | 1270 | }; |
1251 | </script> | 1271 | </script> |
@@ -1262,8 +1282,8 @@ export default { | @@ -1262,8 +1282,8 @@ export default { | ||
1262 | .down { | 1282 | .down { |
1263 | padding: 0 0 16px 20px; | 1283 | padding: 0 0 16px 20px; |
1264 | } | 1284 | } |
1265 | -.error-tips{ | ||
1266 | - margin-bottom:12px; | 1285 | +.error-tips { |
1286 | + margin-bottom: 12px; | ||
1267 | } | 1287 | } |
1268 | .content { | 1288 | .content { |
1269 | background: #f8f8f8; | 1289 | background: #f8f8f8; |
src/views/standard/setUp/archived.vue
@@ -94,9 +94,8 @@ | @@ -94,9 +94,8 @@ | ||
94 | <p class="down-txt" slot="down"> | 94 | <p class="down-txt" slot="down"> |
95 | 通过Excel名单导入任课老师名单模板,点击 | 95 | 通过Excel名单导入任课老师名单模板,点击 |
96 | <el-link type="primary" @click="downTeacherExcel" | 96 | <el-link type="primary" @click="downTeacherExcel" |
97 | - >导出分班后任课老师</el-link | ||
98 | - > | ||
99 | - 。 | 97 | + >导出未分配教师</el-link |
98 | + >。 | ||
100 | </p> | 99 | </p> |
101 | </up-load> | 100 | </up-load> |
102 | </div> | 101 | </div> |
@@ -148,12 +147,14 @@ | @@ -148,12 +147,14 @@ | ||
148 | </template> | 147 | </template> |
149 | 148 | ||
150 | <script> | 149 | <script> |
150 | +import { downloadFile } from "utils"; | ||
151 | export default { | 151 | export default { |
152 | data() { | 152 | data() { |
153 | return { | 153 | return { |
154 | loading: false, | 154 | loading: false, |
155 | loadingClass: false, | 155 | loadingClass: false, |
156 | - step: 0, | 156 | + loadingDown: false, |
157 | + step: 1, | ||
157 | gradeName: "", | 158 | gradeName: "", |
158 | gradeList: [], | 159 | gradeList: [], |
159 | classIds: [], | 160 | classIds: [], |
@@ -198,33 +199,29 @@ export default { | @@ -198,33 +199,29 @@ export default { | ||
198 | //导出学生名单 | 199 | //导出学生名单 |
199 | async downStudentExcel() { | 200 | async downStudentExcel() { |
200 | this.loadingDown = true; | 201 | this.loadingDown = true; |
201 | - let { data, info, status } = | ||
202 | - await this.$request.studentClickerTemplateUrl(); | 202 | + let data = await this.$request.exportNoClassStudent(); |
203 | this.loadingDown = false; | 203 | this.loadingDown = false; |
204 | - if (status == 0) { | ||
205 | - const a = document.createElement("a"); | ||
206 | - a.href = data.downloadUrl; | ||
207 | - document.body.appendChild(a); | ||
208 | - a.click(); | ||
209 | - a.remove(); | 204 | + if (data) { |
205 | + let blob = new Blob([data], { | ||
206 | + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
207 | + }); | ||
208 | + downloadFile("未分配学生名单.xlsx", blob); | ||
210 | } else { | 209 | } else { |
211 | - this.$message.error(info); | 210 | + this.$message.error("下载失败"); |
212 | } | 211 | } |
213 | }, | 212 | }, |
214 | //导出任课老师名单 | 213 | //导出任课老师名单 |
215 | async downTeacherExcel() { | 214 | async downTeacherExcel() { |
216 | this.loadingDown = true; | 215 | this.loadingDown = true; |
217 | - let { data, info, status } = | ||
218 | - await this.$request.teacherClickerTemplateUrl(); | 216 | + let data = await this.$request.exportNoClassTeacher(); |
219 | this.loadingDown = false; | 217 | this.loadingDown = false; |
220 | - if (status == 0) { | ||
221 | - const a = document.createElement("a"); | ||
222 | - a.href = data.downloadUrl; | ||
223 | - document.body.appendChild(a); | ||
224 | - a.click(); | ||
225 | - a.remove(); | 218 | + if (data) { |
219 | + let blob = new Blob([data], { | ||
220 | + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
221 | + }); | ||
222 | + downloadFile("未分配教师 名单.xlsx", blob); | ||
226 | } else { | 223 | } else { |
227 | - this.$message.error(info); | 224 | + this.$message.error("下载失败"); |
228 | } | 225 | } |
229 | }, | 226 | }, |
230 | //班级归档 | 227 | //班级归档 |