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 @@