From 21dfdeae42638efda117a313af013e4d57b39001 Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Mon, 27 Feb 2023 13:57:09 +0800 Subject: [PATCH] 平台管理员 --- src/api/apis/apis.js | 42 ++++++++++++++++++++++++++++++++++++++++++ src/router/permission.js | 3 +++ src/store/index.js | 48 ++++++++++++++++++++++++------------------------ src/views/admin/account/index.vue | 478 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- src/views/admin/clientVersion/components/upLoad.vue | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/admin/clientVersion/components/upLoadImg.vue | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/admin/clientVersion/index.vue | 235 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ src/views/admin/device/index.vue | 202 +++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/views/admin/device/log.vue | 2 +- src/views/index/mainIndex.vue | 7 +++---- src/views/layout/header/header.vue | 13 +++++++++++-- src/views/personal/examinationPaper/add.vue | 1 - src/views/standard/examinationPaper/add.vue | 3 +-- src/views/standard/examinationPaper/edit.vue | 2 +- 14 files changed, 1009 insertions(+), 227 deletions(-) create mode 100644 src/views/admin/clientVersion/components/upLoad.vue create mode 100644 src/views/admin/clientVersion/components/upLoadImg.vue diff --git a/src/api/apis/apis.js b/src/api/apis/apis.js index b1023c8..d768ca8 100644 --- a/src/api/apis/apis.js +++ b/src/api/apis/apis.js @@ -1120,4 +1120,46 @@ export default { data }); }, + + /** 平台管理 */ + //账户管理 + tenantPage(data) { + return service({ + url: setUpUrls.tenantPage, + method: "POST", + data + }); + }, + //修改账号 + updateTenant(data) { + return service({ + url: setUpUrls.updateTenant, + method: "POST", + data + }); + }, + //新增租户账号 + addTenant(data) { + return service({ + url: setUpUrls.addTenant, + method: "POST", + data + }); + }, + //授课端版本管理 + versionPage(data) { + return service({ + url: setUpUrls.versionPage, + method: "POST", + data + }); + }, + //新增授课端版本 + addVersion(data) { + return service({ + url: setUpUrls.addVersion, + method: "POST", + data + }); + }, }; diff --git a/src/router/permission.js b/src/router/permission.js index 9e09e79..271a6af 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -34,6 +34,9 @@ router.beforeEach((to, from, next) => { "portrait", "dataSync", "down", + "account", + "device", + "clientVersion" ]); //end diff --git a/src/store/index.js b/src/store/index.js index 585695a..6b2cb19 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -40,9 +40,9 @@ const store = new Vuex.Store({ }, setRouters: (state, routers) => { let addrouterList = [] - if(state.info.showRole == 'ROLE_PINGTAI'){ + if(state.info.showRole == 'ROLE_PERSONAL'){ addrouterList = [...addroutersPersonal] - }else if(state.info.showRole == 'ROLE_ADMIN'){ + }else if(state.info.showRole == 'ROLE_PINGTAI'){ addrouterList = [...addRoutersAdmin] }else{ addrouterList = [...addrouters] @@ -80,33 +80,33 @@ const store = new Vuex.Store({ const userInfo = { ...response.data }; if (userInfo.permissions && userInfo.permissions.length) { userInfo.showRoleName = response.data.permissions[0]?.roleName; - // userInfo.showRole = response.data.permissions[0]?.role; + userInfo.showRole = response.data.permissions[0]?.role; // 开发用,测试删除 - userInfo.showRole = "ROLE_PINGTAI"; + // userInfo.showRole = "ROLE_PERSONAL"; commit("setToken", "isLogin"); commit("setInfo", { ...userInfo }); - // commit("setRouters", [ - // ...userInfo.permissions[0]?.authorityRouter, - // ]); + commit("setRouters", [ + ...userInfo.permissions[0]?.authorityRouter, + ]); //start 开发用,测试删除 - commit("setRouters", [ - "setUpStudent", - "examinationPaper", - "examinationPaperAdd", - "examinationPaperEdit", - "examinationPaperRecycle", - "ask", - "askAnalysis", - "test", - "testAnalysis", - "portrait", - "dataSync", - "down", + // commit("setRouters", [ + // "setUpStudent", + // "examinationPaper", + // "examinationPaperAdd", + // "examinationPaperEdit", + // "examinationPaperRecycle", + // "ask", + // "askAnalysis", + // "test", + // "testAnalysis", + // "portrait", + // "dataSync", + // "down", - "account", - "device", - "clientVersion" - ]); + // "account", + // "device", + // "clientVersion" + // ]); //end state.addRouters.forEach((res) => { diff --git a/src/views/admin/account/index.vue b/src/views/admin/account/index.vue index bba74da..95d52d2 100644 --- a/src/views/admin/account/index.vue +++ b/src/views/admin/account/index.vue @@ -1,22 +1,486 @@ - - + \ No newline at end of file diff --git a/src/views/admin/clientVersion/components/upLoad.vue b/src/views/admin/clientVersion/components/upLoad.vue new file mode 100644 index 0000000..c3e73a1 --- /dev/null +++ b/src/views/admin/clientVersion/components/upLoad.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/views/admin/clientVersion/components/upLoadImg.vue b/src/views/admin/clientVersion/components/upLoadImg.vue new file mode 100644 index 0000000..250ab1a --- /dev/null +++ b/src/views/admin/clientVersion/components/upLoadImg.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/admin/clientVersion/index.vue b/src/views/admin/clientVersion/index.vue index 8e19534..a722087 100644 --- a/src/views/admin/clientVersion/index.vue +++ b/src/views/admin/clientVersion/index.vue @@ -1,22 +1,245 @@ - \ No newline at end of file diff --git a/src/views/admin/device/index.vue b/src/views/admin/device/index.vue index 9be41bc..ceb95ab 100644 --- a/src/views/admin/device/index.vue +++ b/src/views/admin/device/index.vue @@ -10,7 +10,6 @@ 基站管理 答题器管理 - 授课端管理
@@ -24,32 +23,20 @@
-
- - { - let children = formatGradeNameClass(res.data?.list).sort( - (a, b) => { - return a.grade - b.grade; - } - ); - console.log(); - - const nodes = [...children]; - // 通过调用resolve将子节点数据返回,通知组件数据加载完成 - resolve(nodes); - }); - } else { - resolve(node); - } - }); - - this.stationReport(); - this._QueryGradeList(); - this._QueryData(); - this.showSchool(); + // this.stationReport(); + // this._QueryData(); }, activated() { const that = this; @@ -383,16 +305,13 @@ export default { that.page = 1; that.total = 0; that.count = 0; - that.query.classId = []; - that.query.onlineStatus = ""; - that.query.sn = ""; - that.query.type = ""; - that.stationReport(); - that._QueryData(); + that.query.school = ""; + that.query.zuhu = ""; + // that.stationReport(); + // that._QueryData(); }); }, methods: { - linkTo(obj, type) { this.$router.push({ path: "/deviceLog", @@ -402,87 +321,10 @@ export default { }, }); }, - clickPieChart(obj) { - this.query.onlineStatus = - obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; - this.query.sn = ""; - this.query.classId = []; - this.page = 1; - this._QueryData(false); - }, - clickScatterChart(obj) { - this.query.type = - obj.name == "1日内" - ? 1 - : obj.name == "3日内" - ? 2 - : obj.name == "7日内" - ? 3 - : obj.name == "1月内" - ? 4 - : obj.name == "3月内" - ? 5 - : 6; - this.query.sn = ""; - this.query.classId = []; - this.page = 1; - this._QueryData(false); - }, changePage(page) { this.page = page; this._QueryData(false); }, - - async showSchool() { - const { data, status, info } = await this.$request.schoolList(); - if (status === 0) { - let gradeListAll = data.list?.map((item) => { - return { - value: item.id, - label: item.schoolName, - }; - }); - this.schoolAll = [ - { - value: 0, - label: "全部", - children: [...gradeListAll], - }, - ]; - this.gradeList = [...this.schoolAll, ...this.gradeList]; - } else { - this.$message.error(info); - } - }, - - - // 查找班级 - async _QueryGradeList() { - this.loading = true; - const { data, status, info } = await this.$request.gradeList(); - if (status === 0) { - if (!!data.list) { - this.gradeList = - data.list?.map((item) => { - let gradeList = { - value: item.id, - label: item.regionName, - }; - gradeList.children = - item.schoolList?.map((items) => { - return { - value: items.id, - label: items.schoolName, - }; - }) || []; - return gradeList; - }) || []; - this.gradeList = [...this.schoolAll, ...this.gradeList]; - } - } else { - this.$message.error(info); - } - }, // 基站统计数据 async stationReport() { const { data, status, info } = await this.$request.stationReport(); @@ -595,13 +437,16 @@ export default { // 设备列表信息 async _QueryData(isRef) { this.loading = true; - let query = this.setQuery(); + let query = {...this.query}; + if(query.zuhu){ + delete query.school + } if (isRef) { this.page = 1; } this.loading = true; this.tableData = []; - const { data, status, info } = await this.$request.deviceList({ + const { data, status, info } = await this.$request.pDeviceList({ ...query, deviceType: this.type, page: this.page, @@ -646,7 +491,6 @@ export default { } .content { background: #f8f8f8; - border: 1px solid #e2e2e2; border-radius: 10px; overflow: hidden; :deep(.fa-edit) { diff --git a/src/views/admin/device/log.vue b/src/views/admin/device/log.vue index eb6ecea..6619819 100644 --- a/src/views/admin/device/log.vue +++ b/src/views/admin/device/log.vue @@ -267,7 +267,7 @@ export default { this._QueryData(); }, async _QueryDetail() { - const { data, status, info } = await this.$request.deviceDetail({ + const { data, status, info } = await this.$request.pDeviceDetail({ deviceId: this.id, }); if (status === 0) { diff --git a/src/views/index/mainIndex.vue b/src/views/index/mainIndex.vue index 11c7ab9..b618840 100644 --- a/src/views/index/mainIndex.vue +++ b/src/views/index/mainIndex.vue @@ -158,7 +158,7 @@ -