Commit d4b9eb45d8f01a06972acc0a85d97d747d466a23

Authored by 梁保满
1 parent 0761e2ba

设备异常信息

src/api/apis/apis.js
... ... @@ -1516,4 +1516,42 @@ export default {
1516 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 392 tenantSectionAndGradeList: "/api_html/tenant/sectionAndGradeList",
393 393 //集团查询科目列表
394 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 100 let name = "";
101 101 let navTitle = function (path, routerARR) {
102 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 104 if (
105 105 routerARR[i].path === path &&
106   - routerARR[i].children.length < 1
  106 + routerARR[i].children?.length < 1
107 107 ) {
108 108 name = routerARR[i].name;
109 109 break;
... ...
src/views/standard/device/error.vue
... ... @@ -13,35 +13,71 @@
13 13 align="center"
14 14 width="160"
15 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 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 60 label="最早发现时间"
29 61 align="center"
30 62 width="200"
31 63 ></el-table-column>
32 64 <el-table-column
33   - prop="operationTime"
34   - label="异常后答题次数"
  65 + prop="answerTimes"
  66 + label="答题次数"
35 67 align="center"
36 68 ></el-table-column>
37 69 <el-table-column
38   - prop="operationTime"
  70 + prop="abnormalRemark"
39 71 label="状态"
40 72 align="center"
41 73 ></el-table-column>
42   - <el-table-column label="操作" align="center" width="200"
  74 + <el-table-column label="操作" align="center" width="100"
43 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 81 ></el-table-column
46 82 >
47 83 </el-table>
... ... @@ -58,6 +94,24 @@
58 94 </el-pagination>
59 95 </div>
60 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 115 </div>
62 116 </template>
63 117  
... ... @@ -65,6 +119,12 @@
65 119 export default {
66 120 data() {
67 121 return {
  122 + role: "",
  123 + loading: false,
  124 + diaNotes: false,
  125 + ntoes: "",
  126 + deviceId: "",
  127 + type: 1,
68 128 tableData: [],
69 129 total: 0,
70 130 page: 1,
... ... @@ -72,20 +132,49 @@ export default {
72 132 };
73 133 },
74 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 141 methods: {
78 142 changePage(page) {
79 143 this.page = page;
80 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 168 async _QueryData() {
83 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 178 page: this.page,
90 179 size: this.size,
91 180 });
... ...
src/views/standard/device/index.vue
... ... @@ -48,8 +48,14 @@
48 48 <el-radio-button :label="3">授课端管理</el-radio-button>
49 49 </el-radio-group>
50 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 59 >点击查看&gt;&gt;</router-link
54 60 >
55 61 </p>
... ... @@ -693,6 +699,8 @@ export default {
693 699 size: 20,
694 700 isBack: false, //是否是日志页面回来
695 701 upgradeFlag: false,
  702 + stationCount: 0, //异常基站数量
  703 + clickerCount: 0, //异常答题器数量
696 704 };
697 705 },
698 706 created() {
... ... @@ -700,12 +708,12 @@ export default {
700 708 this.role =
701 709 this.$store.getters.info.showRole ||
702 710 this.$store.getters.info.permissions[0].role;
  711 + this._QueryErrorTotal();
703 712 if (this.role == "ROLE_JITUAN") {
704 713 (this.props.lazy = true),
705 714 (this.props.lazyLoad = function (node, resolve) {
706 715 const { level } = node;
707 716 if (level == 2) {
708   - console.log(node);
709 717 api
710 718 .tenantClassList({
711 719 schoolId: node.data.value,
... ... @@ -716,8 +724,6 @@ export default {
716 724 return a.grade - b.grade;
717 725 }
718 726 );
719   - console.log();
720   -
721 727 const nodes = [...children];
722 728 // 通过调用resolve将子节点数据返回,通知组件数据加载完成
723 729 resolve(nodes);
... ... @@ -738,7 +744,6 @@ export default {
738 744 activated() {
739 745 const that = this;
740 746 this.isBack = this.$route.query.back ? this.$route.query.back : false;
741   - console.log(this.$route.query.back);
742 747 if (!this.isBack) {
743 748 that.type = 1;
744 749 that.page = 1;
... ... @@ -1246,6 +1251,21 @@ export default {
1246 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 1271 </script>
... ... @@ -1262,8 +1282,8 @@ export default {
1262 1282 .down {
1263 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 1288 .content {
1269 1289 background: #f8f8f8;
... ...
src/views/standard/setUp/archived.vue
... ... @@ -94,9 +94,8 @@
94 94 <p class="down-txt" slot="down">
95 95 通过Excel名单导入任课老师名单模板,点击
96 96 <el-link type="primary" @click="downTeacherExcel"
97   - >导出分班后任课老师</el-link
98   - >
99   - 。
  97 + >导出未分配教师</el-link
  98 + >。
100 99 </p>
101 100 </up-load>
102 101 </div>
... ... @@ -148,12 +147,14 @@
148 147 </template>
149 148  
150 149 <script>
  150 +import { downloadFile } from "utils";
151 151 export default {
152 152 data() {
153 153 return {
154 154 loading: false,
155 155 loadingClass: false,
156   - step: 0,
  156 + loadingDown: false,
  157 + step: 1,
157 158 gradeName: "",
158 159 gradeList: [],
159 160 classIds: [],
... ... @@ -198,33 +199,29 @@ export default {
198 199 //导出学生名单
199 200 async downStudentExcel() {
200 201 this.loadingDown = true;
201   - let { data, info, status } =
202   - await this.$request.studentClickerTemplateUrl();
  202 + let data = await this.$request.exportNoClassStudent();
203 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 209 } else {
211   - this.$message.error(info);
  210 + this.$message.error("下载失败");
212 211 }
213 212 },
214 213 //导出任课老师名单
215 214 async downTeacherExcel() {
216 215 this.loadingDown = true;
217   - let { data, info, status } =
218   - await this.$request.teacherClickerTemplateUrl();
  216 + let data = await this.$request.exportNoClassTeacher();
219 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 223 } else {
227   - this.$message.error(info);
  224 + this.$message.error("下载失败");
228 225 }
229 226 },
230 227 //班级归档
... ...