<template>
  <div class="info">
    <div class="box">
      <div class="ckBox">
        <el-checkbox v-model="prodChecked" @change="prodCheckChanged" class="checkbox">待检验产品</el-checkbox>
        <el-checkbox v-model="sampleChecked" @change="sampleCheckChanged" class="checkbox">样本点</el-checkbox>
        <el-checkbox v-model="demChecked" @change="demCheckChanged" class="checkbox">高程图层</el-checkbox>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "productInfo",
  data() {
    return {
      prodChecked: true,
      sampleChecked: true,
      demChecked: false,
    };
  },
  methods: {
    prodCheckChanged() {
      if (this.prodChecked) {
        this.$emit("addLayer");
      } else {
        this.$emit("removeLayer");
      }
    },
    sampleCheckChanged() {
      if (this.sampleChecked) {
        this.$emit("addSample");
      } else {
        this.$emit("removeSample");
      }
    },
    demCheckChanged() {
      if (this.demChecked) {
        this.$emit("addDemLayer");
      } else {
        this.$emit("removeDemLayer");
      }
    },
  },
};
</script>

<style scoped>
.info {
  margin-left: 10px;
  display: inline-block;
  position: relative;
  left: 30px;
  top: 30px;
  background-color: transparent;
  z-index: 999;
  border-radius: 4px;
}

.box {
  width: 160px;
  background-color: white;
  border-radius: 5px;
  align-items: center;
}

.ckBox {
  margin-left: 10px;
}
</style>
