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

<script>
export default {
  name: "productInfo",
  data() {
    return {
      prodChecked: true,
      sampleChecked: true,
    };
  },
  methods: {
    prodCheckChanged() {
      if (this.prodChecked) {
        this.$emit("addLayer");
      } else {
        this.$emit("removeLayer");
      }
    },
    sampleCheckChanged() {
      if (this.sampleChecked) {
        this.$emit("addSample");
      } else {
        this.$emit("removeSample");
      }
    },
  },
};
</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;
}
.iconbox div {
  width: 160px;
  height: 75px;
  border-radius: 5px;
}
.box {
  height: 55px;
  width: 160px;
  background-color: white;
  margin-left: 3px;
  border-radius: 5px;
  align-items: center;
  padding: 10px 15px;
}
</style>
