<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', 'bz'].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';
  import { decrypts } from '@/utils/checkTip';
  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 }));
        // localData.value.forEach(async (item: any) => {
        //   item.lxdh = await decrypts(item.lxdh, true);
        // });
      }
    },
    { deep: true, immediate: true }
  );
</script>
