<template>
  <el-table :data="deptList" height="100%" border stripe>
    <el-table-column align="center" prop="name" label="选择分局">
      <template #default="{ row }">
        <el-link type="primary" @click="selectDept(row)"> {{ row.name }}</el-link>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
const _ = require('lodash');
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'dept',
  props: { deptList: { type: Array, default: () => [] } },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    selectDept(row) {
      this.$emit('select', _.pick(row, ['name', 'id']));
    },
  },
};
</script>

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