<template>
  <el-button @click="clickToConfirmTheData">确认</el-button>
  <el-table :data="props.data" ref="elTableRef" :height="400">
    <el-table-column type="selection"/>
    <el-table-column label="名称" prop="orderName"/>
    <el-table-column label="备注" prop="ybComment"/>
  </el-table>
</template>

<script setup name='Details'>
import {BizException, ExceptionEnum} from "@/utils/BizException";

const props = defineProps({
  data: Array,
  returnData: Function
})

const elTableRef = ref(null)
const clickToConfirmTheData = () => {
  let temp = elTableRef.value.getSelectionRows()
  if (temp.length === 0) {
    BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择数据')
  }
  props.returnData(temp, false)
}
</script>

<style scoped lang="scss">

</style>
