<template>
  <!-- 切换公司 -->
  <vxe-modal v-model="value" @confirm="confirmEvent" width="600" show-footer>
    <template #title>
      <span>选择公司</span>
    </template>
    <template #default>
      <vxe-table ref="xTable" show-overflow auto-resize height="300" :rowConfig="{ isCurrent: true, isHover: true }"
        :data="data">
        <vxe-column type="seq" width="60"></vxe-column>
        <vxe-column field="title" title="公司名"></vxe-column>
        <vxe-column field="desc" title="描述"></vxe-column>
      </vxe-table>
    </template>
  </vxe-modal>

</template>
<script>

export default {
  name: "switchCompany",
  props: {
    value: {
      type: Boolean,
      default: false
    },
    data: {
      type: Array
    }
  },
  data() {
    return {
    };
  },
  methods: {
    // 确认事件
    confirmEvent() {
      let row = this.$refs.xTable.getCurrentRecord();
      this.$emit("confirm", { row });
    }

  }
};
</script>
  