diff --git a/src/api/apis/apis.js b/src/api/apis/apis.js index f120f12..3169355 100644 --- a/src/api/apis/apis.js +++ b/src/api/apis/apis.js @@ -186,6 +186,22 @@ export default { data, }); }, + // 查询设备详情 + deviceDetail(data) { + return service({ + url: setUpUrls.deviceDetail, + method: "POST", + data, + }); + }, + // 分页查询设备日志列表 + deviceLogList(data) { + return service({ + url: setUpUrls.deviceLogList, + method: "POST", + data, + }); + }, // 修改设备自动升级状态 modifyUpgradeFlag(data) { return service({ diff --git a/src/api/urls/apis.js b/src/api/urls/apis.js index 79b1088..cf0b885 100644 --- a/src/api/urls/apis.js +++ b/src/api/urls/apis.js @@ -46,6 +46,10 @@ export default { keyboardReport: "/api_html/school/manager/keyboardReport", // 分页查询设备列表 deviceList: "/api_html/school/manager/deviceList", + // 查询设备详情 + deviceDetail: "/api_html/school/manager/deviceDetail", + // 分页查询设备日志列表 + deviceLogList: "/api_html/school/manager/deviceLogList", // 修改设备自动升级状态 modifyUpgradeFlag: "/api_html/school/manager/modifyUpgradeFlag", // 修改基站信息 diff --git a/src/main.js b/src/main.js index 7d2d5f4..a02acdc 100755 --- a/src/main.js +++ b/src/main.js @@ -28,6 +28,13 @@ Vue.use(permission) NProgress.inc(0.2) NProgress.configure({ easing: "ease", speed: 500, showSpinner: false }) + +Array.prototype.remove = function (val) { + var index = this.indexOf(val); + if (index > -1) { + this.splice(index, 1); + } +}; /* eslint-disable no-new */ new Vue({ el: "#app", diff --git a/src/views/analysis/index.vue b/src/views/analysis/index.vue index c0828e1..44e2955 100644 --- a/src/views/analysis/index.vue +++ b/src/views/analysis/index.vue @@ -10,8 +10,8 @@
- + @@ -68,7 +110,7 @@ import { formatDate } from "utils"; export default { data() { return { - id:'', + id: "", date: "", //今天-昨天-本周 query: { //搜索条件 @@ -76,11 +118,24 @@ export default { endDay: "", day: "", }, + tableData: [], + device: { + sn: "", + electricity: "", + pairingCode: "", + classList: [], + latestReportTime: "", + answerTimes: "", + }, + total: 0, + page: 1, + size: 20, }; }, created() { - this.id = this.$route.query.id - // await this.setDate(1); + this.id = this.$route.query.id; + this._QueryDetail(); + this.setDate(1); let startDay = this.query?.startDay; if (!startDay) { this.query.startDay = new Date(); @@ -88,6 +143,36 @@ export default { } }, methods: { + setOperationType(type) { + let txt; + switch (type) { + case 0: + txt = "连接异常"; + break; + case 1: + txt = "问"; + break; + case 2: + txt = "测"; + break; + case 3: + txt = "考"; + break; + case 4: + txt = "抢答"; + break; + case 5: + txt = "抽答"; + break; + case 6: + txt = "再答"; + break; + case 7: + txt = "签到"; + break; + } + return txt; + }, setDate(index) { const that = this; this.date = index == this.date ? "" : index; @@ -156,21 +241,50 @@ export default { } } }, + changePage(page) { + this.page = page; + this._QueryData(); + }, + async _QueryDetail() { + const { data, status, info } = await this.$request.deviceDetail({ + deviceId: this.id, + }); + if (status === 0) { + this.device = { ...data }; + for (let key in this.device) { + this.device[key] = data[key]; + } + } else { + this.$message.error(info); + } + }, async _QueryData() { this.loading = true; //多课时对比 let query = {}; for (let key in this.query) { if (this.query[key] != "") { - query[key] = this.query[key]; + if (key == "day" || key == "startDay" || key == "endDay") { + query[key] = this.query[key].split("-").join(""); + } else { + query[key] = this.query[key]; + } } } - const { data, status, info } = await this.$request.fetchQuizList({ + const { + data = {}, + status, + info, + } = await this.$request.deviceLogList({ ...query, - id:this.id + deviceId: Number(this.id), + page: this.page, + size: this.size, }); this.loading = false; if (status === 0) { + this.tableData = [...data?.list] || []; + this.total = data.count; } else { this.$message.error(info); } @@ -183,4 +297,7 @@ export default { .page-content { padding: 20px; } +.table-box{ + padding:0 20px; +} \ No newline at end of file diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 5fec8c9..c2ca3fc 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -91,14 +91,14 @@ export default { disableClick: true, passwordType: "password", loginForm: { - username: "13610050254", - password: "Pw050254#", + // username: "13610050254", + // password: "Pw050254#", // username: "18946034886", // password: "Pw034886#", // username: "18332123505", // password: "Pw123505#", - // username: "15911715665", - // password: "Csiy88888", + username: "15911715665", + password: "Csiy88888", }, loginRules: { username: [ diff --git a/src/views/setUp/account.vue b/src/views/setUp/account.vue index 0306e77..5a6372e 100644 --- a/src/views/setUp/account.vue +++ b/src/views/setUp/account.vue @@ -337,7 +337,7 @@ export default { tenantRoleList: [], regionList: [], schoolList: [], - props: { multiple: true, checkStrictly: false }, + props: { multiple: true, checkStrictly: true }, roleList: [], query: { schoolId: [], @@ -553,7 +553,7 @@ export default { this.$message.error(info); } }, - async _QueryData(type) { + setQuery(type) {//整理请求参数 let query = {}; if (type == 1) { query.roleId = this.query.roleId; @@ -579,15 +579,25 @@ export default { query.regionIds = []; query.schoolIds = []; query.schoolId?.map((item) => { - if (!query.regionIds.includes(item[0])) { - query.regionIds.push(item[0]); - } - if (!query.schoolIds.includes(item[1])) { - query.schoolIds.push(item[1]); + if (item.length == 1) { + if (!query.regionIds.includes(item[0])) { + query.regionIds.push(item[0]); + } + } else { + if (!query.schoolIds.includes(item[1])) { + query.schoolIds.push(item[1]); + } + if (query.regionIds.includes(item[0])) { + query.regionIds.remove(item[0]); + } } }); delete query.schoolId; } + return query; + }, + async _QueryData(type) { + let query = this.setQuery(type); this.loading = true; this.tableData = []; const { data, status, info } =