<template>
  <div class="position-info-wrapper">
    <div class="d-flex">
      <p class="info-title">投放信息</p>
      <slot name="extra" />
    </div>

    <div class="gap" />
    <j-table
      :show-selection="false"
      :show-index="false"
      :columns="columns"
      :data="positionData"
    >
      <template slot="type" slot-scope="{ row }">
        <dict-tag :options="dict.type[DictType.kindergarten_location_type]" :value="row.type" />
      </template>
    </j-table>
  </div>
</template>

<script>
import JTable from '@/components/Table/index.vue'
import DictType from '@/utils/dict/DictType'
export default {
  dicts: [DictType.kindergarten_location_type],
  components: {
    JTable
  },
  props: {
    positionData: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      DictType,
      columns: [
        { prop: 'type', label: '位置类型', customRender: 'type' },
        { prop: 'locationName', label: '投放位置' },
        { prop: 'code', label: '编号' },
        // { prop: 'detailCategoryName', label: '所在班级' },
        { prop: 'areaName', label: '所在区域' },
        { prop: 'num', label: '投放数量', formatter: ({ num }) => num ? Number(num) < 0 ? '若干' : num : '--' }
      ]
    }
  }
}
</script>

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