<template>
  <table class="" style="width: 100%" border="1" cellspacing="1">
    <tbody> </tbody>
    <colgroup>
      <col class="bg0" width="15%" />
      <col width="40%" />
      <col class="bg0" width="15%" />
      <col />
    </colgroup>
    <tbody v-if="lableFirst == '地块调查'">
      <tr class="ant-table-cell ant-table-cell-ellipsis">
        <td class="ant-table-cell ant-table-cell-ellipsis bgColor">{{ textLable }}调查开始日期</td>
        <td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.fbsj }}</td>
        <td class="ant-table-cell ant-table-cell-ellipsis bgColor">{{ textLable }}调查完成日期</td>
        <td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.wcsj }}</td>
      </tr>
      <tr class="ant-table-cell ant-table-cell-ellipsis">
        <td class="ant-table-cell ant-table-cell-ellipsis bgColor">公示</td>
        <td class="ant-table-cell ant-table-cell-ellipsis"> {{ data.gsfs == 1 ? '网址' : data.gsfs == 3 ? '其它' : '未知' }}</td>
        <td class="ant-table-cell ant-table-cell-ellipsis bgColor">{{ data.gsfs == 1 ? '公示网址' : data.gsfs == 3 ? '公示信息' : '' }}</td>
        <td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.gswz }}</td>
      </tr>
      <!-- <img :src="baseUploadUrl + data.gspic" class="w-20 h-20" /> -->
      <!-- <a-image style="display: inline-block;" :width="200" :src="baseUploadUrl + data.gspic"/> -->
      <!-- <tr class="ant-table-cell ant-table-cell-ellipsis">
                <td class="ant-table-cell ant-table-cell-ellipsis bgColor">
                    {{ data.gsfs == 1 ? "公示截图" : data.gsfs == 3 ? '照片' : '未知' }}</td>
                <td class="ant-table-cell ant-table-cell-ellipsis">
                    <a-button @click="down(data.gspic,data.gsfs == 1?'公示截图':data.gsfs==3?'照片' : '未知')" preIcon="ant-design:vertical-align-bottom-outlined"
                        type="primary">
                        下载
                    </a-button>
                </td>
                <td class="ant-table-cell ant-table-cell-ellipsis bgColor">调查报告</td>
                <td class="ant-table-cell ant-table-cell-ellipsis">
                    <a-button @click="down(data.dcbglj, '调查报告')" preIcon="ant-design:vertical-align-bottom-outlined"
                        type="primary">
                        下载
                    </a-button>
                </td>
            </tr> -->
      <tr class="ant-table-cell ant-table-cell-ellipsis">
        <td class="ant-table-cell ant-table-cell-ellipsis bgColor">是否为超标地块</td>
        <td class="ant-table-cell ant-table-cell-ellipsis" colspan="1">{{ data?.sfwrdk == 1 ? '是' : '否' }}</td>
        <td class="ant-table-cell ant-table-cell-ellipsis bgColor" v-if="wrdkjbxxb?.dclx == '1'">是否只进行书面调查<span style="font-size:12px;color:red;">(书面调查为【是】,不上传检测数据,【否】需上传检测数据和检测报告)</span></td>
        <td class="ant-table-cell ant-table-cell-ellipsis" v-if="wrdkjbxxb?.dclx == '1'" colspan="2">{{ data?.jxsmdc == '1' ? '是' : '否' }}</td>
      </tr>
      <!-- <tr class="ant-table-cell ant-table-cell-ellipsis">
       
      </tr> -->
      <!-- <tr class="ant-table-cell ant-table-cell-ellipsis" style="display: table-row;">
                <td class="ant-table-cell ant-table-cell-ellipsis bgColor">调查方式</td>
                <td class="ant-table-cell ant-table-cell-ellipsis" colspan="3">{{ data?.cbdcfs ? '委托第三方调查' : '自行组织调查' }}
                </td>
            </tr> -->
    </tbody>
  </table>
</template>

<script lang="ts" setup>
  import { defineProps } from 'vue';
  import { useGlobSetting } from '/@/hooks/setting';
  import { downloadFile } from '/@/api/common/api';
  const globSetting = useGlobSetting();
  const baseUploadUrl = globSetting.uploadUrl;
  defineProps({
    data: {
      type: Object,
      default: () => {},
    },
    wrdkjbxxb: {
      type: Object,
      default: () => {},
    },
    lableFirst: {
      type: String,
      default: '地块调查',
    },
    textLable: {
      type: String,
      default: '初步',
    },
  });
  function down(url, name) {
    let fileExtension = url.split('.').pop();
    downloadFile('/sys/common/static' + url, `${name}.${fileExtension}`);
  }
</script>

<style scoped>
  table {
    border-collapse: collapse;
    border: 1px #dfe6ec solid;
  }

  tbody tr td {
    padding: 6px;
    height: 40px;
  }

  .bgColor {
    background-color: rgba(244, 247, 249, 0.8);
    text-align: center;
  }
</style>
