From 6d80327ef8af472bfc259e7fd2bd45510584ba31 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 19 Dec 2023 11:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B4=BB=E5=8A=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Sidebar.vue | 4 + src/router/index.js | 9 + src/utils/api/index.js | 33 ++- src/views/activityList/index.vue | 258 ++++++++++++++++++++ src/views/homePage/components/tableMain.vue | 222 +++++++++++++---- 5 files changed, 469 insertions(+), 57 deletions(-) create mode 100644 src/views/activityList/index.vue diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index a2f3c3c..4c4cca7 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -29,6 +29,10 @@ export default { path: "/upgradation", name: "上传Apk", }, + { + path: "/activity", + name: "活动列表", + }, ], }; }, diff --git a/src/router/index.js b/src/router/index.js index a5830f9..36a1d2d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -50,6 +50,15 @@ const routes = [ keepAlive: true, }, }, + { + path: "/activity", + component: () => import("../views/activityList/index.vue"), + name: "activity", + meta: { + title: "活动列表", + keepAlive: true, + }, + }, ], }, ]; diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 84f477c..ea11b73 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -40,18 +40,7 @@ export function getqueryProtocolApi(data) { }, }); } -//获取活动列表 -export function getqueryActivityApi(data) { - return request({ - url: "api/queryActivity.php", - method: "get", - params: data, - headers: { - "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", - }, - }); -} //运维,快心跳 export function getdoActionApi(data) { return request({ @@ -134,3 +123,25 @@ export function getupdUpgradeApi(data) { }, }); } + +//新建活动和删除活动 + +export function updActivityApi(data) { + return request({ + url: "api/updActivity.php", + method: "post", + data, + }); +} + +//获取活动列表和详细列表 +export function getqueryActivityApi(data) { + return request({ + url: "api/queryActivity.php", + method: "get", + params: data, + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); +} diff --git a/src/views/activityList/index.vue b/src/views/activityList/index.vue new file mode 100644 index 0000000..cc77cf8 --- /dev/null +++ b/src/views/activityList/index.vue @@ -0,0 +1,258 @@ + + + + + 活动名称: + + *请输入活动名称 + + + 装置列表: + + + *请输入活动名称 + + 上传活动列表 + + + + + + + + + + + + 详情 + 删除 + + + + + + + + diff --git a/src/views/homePage/components/tableMain.vue b/src/views/homePage/components/tableMain.vue index 1dddc0a..e6c8d1b 100644 --- a/src/views/homePage/components/tableMain.vue +++ b/src/views/homePage/components/tableMain.vue @@ -95,7 +95,7 @@ 离线 - + - + - + {{ - scope.row.raw_report.hasOwnProperty("msgs") - ? scope.row.raw_report.msgs.numberOfHb + scope.row.raw_report.msgs.hasOwnProperty("numberOfHb") + ? Number(scope.row.raw_report.msgs.numberOfHb) : "" }} @@ -218,20 +223,30 @@ }} - + {{ - scope.row.raw_report.hasOwnProperty("msgs") - ? scope.row.raw_report.msgs.success + scope.row.raw_report.msgs.hasOwnProperty("success") + ? Number(scope.row.raw_report.msgs.success) : "" }} - + {{ - scope.row.raw_report.hasOwnProperty("msgs") - ? scope.row.raw_report.msgs.failure + scope.row.raw_report.msgs.hasOwnProperty("failure") + ? Number(scope.row.raw_report.msgs.failure) : "" }} @@ -326,19 +341,19 @@ - + {{ - scope.row.raw_report.hasOwnProperty("msgs") + scope.row.raw_report.msgs.hasOwnProperty("simcard1") ? scope.row.raw_report.msgs.simcard1 : "" }} - + {{ - scope.row.raw_report.hasOwnProperty("msgs") + scope.row.raw_report.msgs.hasOwnProperty("simcard2") ? scope.row.raw_report.msgs.simcard2 : "" }} @@ -354,8 +369,68 @@ }} - + + + {{ + scope.row.raw_report.msgs.hasOwnProperty("i1Version") + ? scope.row.raw_report.msgs.i1Version + : "" + }} + + + + + {{ + scope.row.raw_report.msgs.hasOwnProperty("maintainVersion") + ? scope.row.raw_report.msgs.maintainVersion + : "" + }} + + + + {{ + scope.row.raw_report.msgs.hasOwnProperty("cameraService") + ? scope.row.raw_report.msgs.cameraService + : "" + }} + + + + + {{ + scope.row.raw_report.msgs.hasOwnProperty("aiVersion") + ? scope.row.raw_report.msgs.aiVersion + : "" + }} + + + + + {{ + scope.row.raw_report.msgs.hasOwnProperty("mcu") + ? scope.row.raw_report.msgs.mcu + : "" + }} + + + + + - + --> CMA服务器 - 版本I1版本 + 运维版本 + Camera版本 + AI版本 + MCU版本 @@ -686,17 +767,22 @@ export default { kxtNumber: 0, nowTime: new Date().getTime() / 1000, - gycheck: false, - dccheck: true, - xtcheck: true, + gycheck: true, + dccheck: false, + xtcheck: false, // xtcs: false, // xtzq: false, - pzcheck: true, - wlcheck: true, - cqcheck: true, - cmacheck: false, + pzcheck: false, + wlcheck: false, + cqcheck: false, simcheck: false, - bbcheck: true, + cmacheck: true, + // bbcheck: true, + i1check: true, + ywbbcheck: true, + Cameracheck: false, + AIcheck: false, + MCUcheck: false, //运维操作列表 operateOptions: [ { id: 1, name: "安卓重启" }, @@ -879,7 +965,22 @@ export default { Number(b.raw_report.msgs.networkError) ); }, - + sortSuccess(a, b) { + return ( + Number(a.raw_report.msgs.success) - Number(b.raw_report.msgs.success) + ); + }, + sortFailure(a, b) { + return ( + Number(a.raw_report.msgs.failure) - Number(b.raw_report.msgs.failure) + ); + }, + sortnumberOfHb(a, b) { + return ( + Number(a.raw_report.msgs.numberOfHb) - + Number(b.raw_report.msgs.numberOfHb) + ); + }, // sortSignature1(a, b) { // return ( // Number(a.raw_report.msgs.signature1.split("/")[0]) - @@ -1268,7 +1369,13 @@ export default { localStorage.setItem("cqcheck", this.cqcheck); localStorage.setItem("cmacheck", this.cmacheck); localStorage.setItem("simcheck", this.simcheck); - localStorage.setItem("bbcheck", this.bbcheck); + localStorage.setItem("i1check", this.i1check); + localStorage.setItem("ywbbcheck", this.ywbbcheck); + localStorage.setItem("Cameracheck", this.Cameracheck); + localStorage.setItem("AIcheck", this.AIcheck); + localStorage.setItem("MCUcheck", this.MCUcheck); + + this.adjustTableHeight(); }, loadLocalStorage() { this.checkAllKXT = localStorage.getItem("checkAllKXT", this.checkAllKXT) @@ -1279,13 +1386,13 @@ export default { : false; this.gycheck = localStorage.getItem("gycheck") ? JSON.parse(localStorage.getItem("gycheck")) - : false; + : true; this.dccheck = localStorage.getItem("dccheck") ? JSON.parse(localStorage.getItem("dccheck")) - : true; + : false; this.xtcheck = localStorage.getItem("xtcheck") ? JSON.parse(localStorage.getItem("xtcheck")) - : true; + : false; // this.xtcs = localStorage.getItem("xtcs") // ? JSON.parse(localStorage.getItem("xtcs")) // : false; @@ -1294,22 +1401,36 @@ export default { // : false; this.pzcheck = localStorage.getItem("pzcheck") ? JSON.parse(localStorage.getItem("pzcheck")) - : true; + : false; this.wlcheck = localStorage.getItem("wlcheck") ? JSON.parse(localStorage.getItem("wlcheck")) - : true; + : false; this.cqcheck = localStorage.getItem("cqcheck") ? JSON.parse(localStorage.getItem("cqcheck")) - : true; - this.cmacheck = localStorage.getItem("cmacheck") - ? JSON.parse(localStorage.getItem("cmacheck")) : false; this.simcheck = localStorage.getItem("simcheck") ? JSON.parse(localStorage.getItem("simcheck")) : false; - this.bbcheck = localStorage.getItem("bbcheck") - ? JSON.parse(localStorage.getItem("bbcheck")) + this.cmacheck = localStorage.getItem("cmacheck") + ? JSON.parse(localStorage.getItem("cmacheck")) + : true; + + this.i1check = localStorage.getItem("i1check") + ? JSON.parse(localStorage.getItem("i1check")) + : true; + this.ywbbcheck = localStorage.getItem("ywbbcheck") + ? JSON.parse(localStorage.getItem("ywbbcheck")) : true; + this.Cameracheck = localStorage.getItem("Cameracheck") + ? JSON.parse(localStorage.getItem("Cameracheck")) + : false; + this.AIcheck = localStorage.getItem("AIcheck") + ? JSON.parse(localStorage.getItem("AIcheck")) + : false; + this.MCUcheck = localStorage.getItem("MCUcheck") + ? JSON.parse(localStorage.getItem("MCUcheck")) + : false; + console.log( "规约:" + this.gycheck, "电池:" + this.dccheck, @@ -1322,6 +1443,15 @@ export default { "版本:" + this.bbcheck ); }, + adjustTableHeight() { + // 通过调用 window.resize 事件重新触发表格布局和渲染 + const resizeEvent = new Event("resize"); + window.dispatchEvent(resizeEvent); + // 或者使用 Vue 的 nextTick 方法来确保 DOM 更新完成后再执行调整操作 + this.$nextTick(() => { + this.$refs.ywMultipleTable.doLayout(); // 调用 el-table 的 doLayout 方法重新布局 + }); + }, }, };
*请输入活动名称