<template>
  <div :class="classObj">
    <p class="location">0{{extend}}{{locationContent}}</p>
    <div class="a">
      <p class="bold">{{containerNo}}</p>
    </div>
    <p class="position">{{locationNo}}</p>
  </div>

</template>

<script>
  export default {
    data() {
      return {};
    },
    props: {
      type: {
        type: Number,
        default: 0
      },
      containerNo: {
        type: String,
        default: ""
      },
      extend: {
        type: String,
        default: ""
      },
      locationNo: {
        type: String,
        default: ""
      }
    },
    computed: {
      classObj() {
        return {
          orderstyle: this.type == 0,
          unorderstyle: this.type == 1,
        };
      },
      locationContent() {
        if (this.type == 0) {
          return "订单位" 
        } else {
          return "拣选位"
        }
      }
    },
    methods: {
      leavePallet() {
        alert(1)
      }
    }
  };
</script>

<style>
  .orderstyle {
    border-radius: 8px;
    height: 60px;
    width: 120px;
    border: 2px solid #2078eb;
    position: relative;
    margin: 10px;
  }

  .location {
    float: right;
    margin-right: 2px;
  }

  .position {
    float: left;
    bottom: 0px;
    margin-left: 2px;
    position: absolute;
  }

  .orderstyle .a {
    position: absolute;
    left: 50%;
    top: 50%;
    display: table-cell;
    vertical-align: middle;
    transform: translate(-50%, -50%);
  }

  .unorderstyle {
    border-radius: 8px;
    height: 60px;
    width: 120px;
    border: 2px solid #de7a16;
    position: relative;
    margin: 10px;
  }

  .unorderstyle .a {
    position: absolute;
    left: 50%;
    top: 50%;
    display: table-cell;
    vertical-align: middle;
    transform: translate(-50%, -50%);
  }

  p {
    text-align: center;
    margin: 0px;
  }

  .bold {
    font-size: 15px;
  }
</style>
