<!--
 * @Author: gtz
 * @Date: 2022-07-28 10:22:30
 * @LastEditors: gtz
 * @LastEditTime: 2022-08-03 20:27:20
 * @Description: file content
 * @FilePath: \hf-pda\src\pages\material\components\materialPopup-batch.vue
-->
<template>
  <van-popup v-model="show" position="bottom" class="eqPopup">
    <van-picker
      title="选择设备"
      show-toolbar
      :columns="showList"
      @confirm="onConfirm"
      @cancel="onCancel"
    />
  </van-popup>
</template>

<script>

export default {
  name: 'eqPopup',
  props: {
    batchList: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      show: false
    }
  },
  computed: {
    showList: function () {
      return this.batchList.map(item => {
        return item.name
      })
    }
  },
  methods: {
    init () {
      this.show = true
    },
    onConfirm (val, index) {
      this.$emit('changeBatch', index)
      this.show = false
    },
    onCancel () {
      this.show = false
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
