From 5667c74ea1841ec862b22887fa82425374963031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 8 Nov 2024 10:04:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E5=B9=BF=E6=92=AD=EF=BC=8C?= =?UTF-8?q?=E6=83=85=E6=8A=A5=E6=9D=BF=E3=80=82=E6=96=B0=E5=A2=9E=E5=85=A8?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/service/board/index.vue | 35 ++++++++- .../pages/service/broadcast/index.vue | 76 +++++++++++++------ 2 files changed, 85 insertions(+), 26 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue index 49c3d9b7..ef075a2c 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue @@ -63,6 +63,15 @@
+ + + + 全选 +
- +
@@ -197,7 +206,7 @@
- + @@ -331,6 +340,7 @@ export default { this.editDialog.tpl = null; } }, + // boardSizeDic: function (newVal, oldVal) { // console.log(newVal, 'selectedSize') // if (newVal.length == 0) { @@ -398,6 +408,25 @@ export default { }, }, methods: { + handleCheckAllChange(val) { + this.checkedDeviceIds = val ? this.getAllDeviceIds() : []; + + this.isIndeterminate = false; + }, + getAllDeviceIds() { + // 使用 Object.values 遍历对象 + return Object.values(this.boardSizeDic).reduce((acc, item) => { + acc.push(...item.list.filter(itm => itm.iotDeviceId && !itm.iotDeviceId.includes('null') && !(itm.deviceState === 0 || itm.deviceState === null)).map(itm => itm.iotDeviceId)); + return acc; + }, []); + }, + updateCheckAllStatus() { + const allDeviceIds = this.getAllDeviceIds(); + const checkedCount = this.checkedDeviceIds.length; + this.checkAll = checkedCount === allDeviceIds.length; + this.isIndeterminate = checkedCount > 0 && checkedCount < allDeviceIds.length; + }, + ____boardTxtStyle() { return { color: "#F00", @@ -1304,7 +1333,7 @@ export default { // } ::v-deep .sortable-chosen:not(th) { - + //background-color: rgba(5, 175, 227, 0.1) !important; } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/broadcast/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/broadcast/index.vue index aece3769..37dbe875 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/broadcast/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/broadcast/index.vue @@ -60,7 +60,16 @@