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 @@
-
+
@@ -113,41 +113,14 @@ export default {
type: 1, //集团管理员 表格切换
query: {
//搜索条件
- gradeName: "",
+ regionId: "",
startDay: "",
endDay: "",
day: "",
},
gradeList: [],
- tableData: [
- {
- sub: "科目一",
- keshi0: 1,
- celian0: 1,
- keshi1: 2,
- celian1: 2,
- },
- {
- sub: "科目一",
- keshi0: 3,
- celian0: 4,
- keshi1: 5,
- celian1: 6,
- },
- ],
- dataList: [
- //table循环用数据
- {
- name: "初一",
- keshi: 1,
- celian: 1,
- },
- {
- name: "初二",
- keshi: 2,
- celian: 2,
- },
- ],
+ tableData: [],
+ dataList: [],
};
},
created() {
@@ -155,7 +128,7 @@ export default {
(item) => item.roleName == this.$store.getters.info.showRoleName
)?.role;
this._QueryGradeList();
- // this.setDate(1);
+ this.setDate(1);
let startDay = this.query?.startDay;
if (!startDay) {
this.query.startDay = new Date();
@@ -164,10 +137,10 @@ export default {
},
methods: {
changeType(val) {
- if(val==1){
- this.query.gradeName = ""
+ if (val == 1) {
+ this.query.regionId = "";
}
- this._QueryData(val)
+ this._QueryData(val);
},
setDate(index) {
const that = this;
@@ -247,7 +220,7 @@ export default {
}
}
if (this.role == "ROLE_JITUAN") {
- if (this.query.gradeName == "") {
+ if (this.query.regionId == "") {
this.type = 1;
} else {
this.type = 2;
@@ -264,7 +237,18 @@ export default {
});
this.loading = false;
if (status === 0) {
- this.tableData = [...data.list] || [];
+ this.tableData = data.map((item)=>{
+ let params={}
+ item.dataList.map((items,index)=>{
+ params['examCount'+index] = items.examCount
+ params['periodCount'+index] = items.periodCount
+ })
+ return {
+ subjectName:item.subjectName,
+ ...params,
+ }
+ });
+ this.dataList = data[0]?.dataList
} else {
this.$message.error(info);
}
diff --git a/src/views/device/index.vue b/src/views/device/index.vue
index 3c5d1d0..b59bb67 100644
--- a/src/views/device/index.vue
+++ b/src/views/device/index.vue
@@ -90,10 +90,7 @@
@click="_QueryData(true)"
>
- 筛选
@@ -225,12 +222,9 @@
@click="_QueryData(true)"
>
- 筛选ƒ
+ >
@@ -505,7 +499,7 @@ export default {
diaAnswerEqu: false,
gradeList: [],
gradeListAll: [],
- props: { multiple: true, checkStrictly: false },
+ props: { multiple: true, checkStrictly: true },
type: 1,
query: {
classId: [],
@@ -693,20 +687,19 @@ export default {
? this.$request.gradeList
: this.$request.regionList;
const { data, status, info } = await gradeList();
- console.log(status);
if (status === 0) {
if (!!data.list) {
if (this.role != "ROLE_JITUAN") {
this.gradeList =
data.list?.map((item) => {
let gradeList = {
- value: item.grade,
+ value: item.gradeName,
label: item.gradeName,
};
gradeList.children =
item.classList?.map((items) => {
return {
- value: items.classCode,
+ value: Number(items.classCode),
label: items.className,
};
}) || [];
@@ -792,23 +785,11 @@ export default {
this.$message.error(info);
}
},
- // 设备列表信息
- async _QueryData(isRef) {
- this.loading = true;
- let query = {};
- let gradeNames = [];
- let classIds = [];
- this.query.classId.map((item) => {
- if (!gradeNames.includes(item[0])) {
- gradeNames.push(item[0]);
- }
- classIds.push(item[1]);
- });
+ setQuery(){//整理传参
+ let query = {}
if (this.query.sn) {
query.sn = this.query.sn;
} else {
- gradeNames.length ? (query.gradeNames = gradeNames) : "";
- classIds.length ? (query.classIds = classIds) : "";
if (this.type == 1) {
this.query.onlineStatus !== ""
? (query.onlineStatus = this.query.onlineStatus)
@@ -816,9 +797,51 @@ export default {
} else if (this.type == 2) {
this.query.type !== "" ? (query.type = this.query.type) : "";
}
+ if (this.role == "ROLE_JITUAN") {
+ query.regionIds = [];
+ query.schoolIds = [];
+ this.query.classId?.map((item) => {
+ 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]);
+ }
+ }
+ });
+ } else {
+ query.gradeNames = [];
+ query.classIds = [];
+ this.query.classId?.map((item) => {
+ if (item.length == 1) {
+ if(!query.gradeNames.includes(item[0])){
+ query.gradeNames.push(item[0]);
+ }
+ } else {
+ if (!query.classIds.includes(item[1])) {
+ query.classIds.push(item[1]);
+ }
+ if (query.gradeNames.includes(item[0])) {
+ query.gradeNames.remove(item[0]);
+ }
+ }
+ });
+ }
+ delete query.classId;
}
- if(isRef){
- this.page= 1
+ return query
+ },
+ // 设备列表信息
+ async _QueryData(isRef) {
+ this.loading = true;
+ let query = this.setQuery()
+ if (isRef) {
+ this.page = 1;
}
this.loading = true;
const deviceList =
diff --git a/src/views/device/log.vue b/src/views/device/log.vue
index 39bf65a..0bfee2c 100644
--- a/src/views/device/log.vue
+++ b/src/views/device/log.vue
@@ -7,20 +7,26 @@
- kooriookami
- 18100000000
- 苏州市
- 江苏省苏州市吴中区
- 江苏省苏州市吴中区
- 江苏省苏州市吴中区
+ {{
+ device.sn
+ }}
+ {{
+ device.electricity
+ }}
+ {{
+ device.pairingCode
+ }}
+
+ {{
+ item.className
+ }}
+
+ {{
+ device.latestReportTime
+ }}
+ {{
+ device.answerTimes
+ }}
+
+
+ {{
+ setOperationType(scoped.row.operationType)
+ }}
+
+
+
+
+
@@ -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 } =