<template>
  <!-- 地块调查 风险评估 
       最后一列操作列不要 action
    -->
  <a-table :columns="participantsColumns.slice(0, -1)" :data-source="localData" :pagination="false" bordered size="middle">
    <template #headerCell="{ column }">
      <span :class="{ required: dcjdPsfs === 1 && !['mail', 'memo'].includes(column.dataIndex) }">
        {{ column.title }}
      </span>
    </template>
  </a-table>
</template>
<script lang="ts" setup>
  import { ref, watch } from 'vue';
  import { participantsColumns } from '@/views/dkgl/investigate/data';
  const props = defineProps({
    data: {
      type: Object,
    },
    dcjdPsfs: {
      type: Number,
    },
  });
  const localData = ref([]);
  watch(
    () => props?.data,
    async (val: any) => {
      if (val) {
        localData.value = val.map((item) => ({ ...item }));
      }
    },
    { deep: true, immediate: true }
  );
</script>
