<template>
  <div class="device-control">
    <div class="control-container">
      <a-checkbox-group v-model:value="deviceChoiceList" class="check-box">
        <a-row v-for="(item, index) in deviceControlData" :key="index" class="row-box">
          <a-col :span="24">
            <a-checkbox :value="item.id">{{ item.strinstallpos }}</a-checkbox>
          </a-col>
        </a-row>
      </a-checkbox-group>
      <a-button class="device-control-btn" type="primary" @click="confirmChoice">确定</a-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

let props = defineProps({
  deviceControlData: {
    type: Array,
    default: () => {
      return []
    }
  }
})
const deviceChoiceList = ref([]);
const $emit = defineEmits(['confirmChoice'])

function confirmChoice() {
  $emit('confirmChoice', deviceChoiceList.value)
}

</script>

<style lang="less" scoped>
@import '/@/design/theme.less';

@{theme-deepblue} {
  .door-content-r {
    --image-left-bd: url('@/assets/images/themify/deepblue/home-container/configurable/wind-door/left-bd.png');
  }
}

.device-control {
  --image-left-bd: url('@/assets/images/home-container/configurable/wind-door/left-bd.png');
  width: 200px;
  height: 280px;
  background-image: var(--image-left-bd);
  background-size: 100% 100%;
  position: absolute;
  right: 35px;
  top: 70px;

  .control-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    margin: 4px;
    padding: 5px 8px;
    box-sizing: border-box;
    background-color: rgba(54, 198, 254, .5);
  }

  .check-box {
    width: 100%;
    height: 230px;
    overflow: hidden;
    overflow-y: auto;
  }

  .row-box {
    margin: 10px 0px;
  }

  .zxm-checkbox-wrapper {
    color: #fff;
  }
  .device-control-btn{
    position: absolute;
    bottom: 5px;
  }
}
</style>
