|
@@ -33,16 +33,21 @@
|
|
|
<div class="sceneCard-control">
|
|
|
<div style="display: inline-block;width: 50%;text-align: left">
|
|
|
<a-space>
|
|
|
- <a-popconfirm title="确定要执行吗?" ok-text="是" cancel-text="否" @confirm="allPowerOff">
|
|
|
- <a-button style="font-size: 12px" size="small"><a-icon type="poweroff" />全开</a-button>
|
|
|
+ <a-popconfirm title="确定要执行吗?" ok-text="是" cancel-text="否" @confirm="allPowerOn">
|
|
|
+ <a-button style="font-size: 12px" size="small"
|
|
|
+ ><a-icon type="poweroff" />{{ selectedRowKeys.length > 0 ? "选中" : "" }}全开</a-button
|
|
|
+ >
|
|
|
</a-popconfirm>
|
|
|
<a-popconfirm title="确定要执行吗?" ok-text="是" cancel-text="否" @confirm="allPowerOff">
|
|
|
- <a-button style="font-size: 12px" size="small" @click="allPowerOn"><a-icon type="poweroff" />全关</a-button>
|
|
|
+ <a-button style="font-size: 12px" size="small"
|
|
|
+ ><a-icon type="poweroff" />{{ selectedRowKeys.length > 0 ? "选中" : "" }}全关</a-button
|
|
|
+ >
|
|
|
</a-popconfirm>
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
style="font-size: 12px"
|
|
|
+ :disabled="selectedRowKeys.length == 0"
|
|
|
@click="
|
|
|
() => {
|
|
|
this.showBatchCL = true;
|
|
@@ -73,13 +78,17 @@
|
|
|
|
|
|
<a-alert type="success" show-icon v-if="selectedRowKeys.length > 0" closeText="取消选择" @close="clearSelectRow">
|
|
|
<template #message>
|
|
|
- 已选择{{ selectedRowKeys.length }}台设备
|
|
|
+ 已选择<span style="font-size: 16px;font-weight: bold;color:#19b955;margin: 0 5px;">{{ selectedRowKeys.length }}</span
|
|
|
+ >台设备,设备总计:<span style="font-size: 16px;font-weight: bold;color:#000;margin: 0 5px;">{{
|
|
|
+ floorsDevicesAll()
|
|
|
+ }}</span
|
|
|
+ >台。
|
|
|
</template>
|
|
|
</a-alert>
|
|
|
</div>
|
|
|
|
|
|
<div class="airContainer">
|
|
|
- <div class="airContainer-left">
|
|
|
+ <!-- <div class="airContainer-left">
|
|
|
<div class="deviceFloorIndex">
|
|
|
<a-input-search placeholder="请输入楼层"></a-input-search>
|
|
|
<a-anchor :getContainer="getContainer" :target-offset="100" style="margin-top: 12px" @change="floorChange">
|
|
@@ -105,7 +114,7 @@
|
|
|
</div>
|
|
|
</a-anchor>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div class="airContainer-right" ref="airContainerRight">
|
|
|
<template v-for="item in floors">
|
|
|
<template v-if="showCard">
|
|
@@ -116,7 +125,13 @@
|
|
|
<div style="padding: 0 15px">
|
|
|
<a-row :gutter="[30, 12]">
|
|
|
<a-col v-for="device in item.devices" :key="device.id" :span="6">
|
|
|
- <deviceCardWater :click="handleCardClick" :item="device" :toggle="toggleOnline" />
|
|
|
+ <deviceCardWater
|
|
|
+ :click="handleCardClick"
|
|
|
+ :item="device"
|
|
|
+ :toggle="toggleOnline"
|
|
|
+ :domClick="domClick"
|
|
|
+ :activeList="selectedRowKeys"
|
|
|
+ />
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</div>
|
|
@@ -545,12 +560,19 @@ export default {
|
|
|
},
|
|
|
handleOk() {
|
|
|
this.showBatchCL = false;
|
|
|
- this.$message.success("设置成功");
|
|
|
+ // this.$message.success("设置成功");
|
|
|
},
|
|
|
handleCardClick() {
|
|
|
this.showBatchCL = true;
|
|
|
this.formData = {};
|
|
|
},
|
|
|
+ domClick(id) {
|
|
|
+ if (this.selectedRowKeys.indexOf(id) != -1) {
|
|
|
+ this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(id), 1);
|
|
|
+ } else {
|
|
|
+ this.selectedRowKeys.push(id);
|
|
|
+ }
|
|
|
+ },
|
|
|
search() {
|
|
|
let objarr = JSON.parse(JSON.stringify(this.oriFloors));
|
|
|
let app = this;
|
|
@@ -586,32 +608,49 @@ export default {
|
|
|
allPowerOn() {
|
|
|
let app = this;
|
|
|
this.$store.loadingStore().open();
|
|
|
+ let that = this;
|
|
|
setTimeout(function() {
|
|
|
app.floors.forEach(item => {
|
|
|
if (item.devices) {
|
|
|
item.devices.forEach(i => {
|
|
|
- i.online = false;
|
|
|
+ if (!that.selectedRowKeys || that.selectedRowKeys.length == 0 || that.selectedRowKeys.indexOf(i.id) != -1) {
|
|
|
+ i.online = true;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
app.$store.loadingStore().close();
|
|
|
app.$message.success("执行成功");
|
|
|
- }, 2000);
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
allPowerOff() {
|
|
|
let app = this;
|
|
|
this.$store.loadingStore().open();
|
|
|
+ let that = this;
|
|
|
setTimeout(function() {
|
|
|
app.floors.forEach(item => {
|
|
|
if (item.devices) {
|
|
|
item.devices.forEach(i => {
|
|
|
- i.online = true;
|
|
|
+ if (!that.selectedRowKeys || that.selectedRowKeys.length == 0 || that.selectedRowKeys.indexOf(i.id) != -1) {
|
|
|
+ i.online = false;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
app.$store.loadingStore().close();
|
|
|
app.$message.success("执行成功");
|
|
|
- }, 2000);
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ floorsDevicesAll() {
|
|
|
+ let size = 0;
|
|
|
+ this.floors.forEach(item => {
|
|
|
+ if (item.devices) {
|
|
|
+ item.devices.forEach(i => {
|
|
|
+ size++;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return size;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -644,7 +683,7 @@ export default {
|
|
|
}
|
|
|
.airContainer-right {
|
|
|
display: inline-block;
|
|
|
- width: 85%;
|
|
|
+ width: 100%;
|
|
|
height: 100%;
|
|
|
vertical-align: top;
|
|
|
padding: 12px 20px;
|