<template>
  <div class="m-4">
    <a-descriptions bordered class="mt-4">
      <a-descriptions-item label="站点名称"> {{ detailInfo.siteName }}</a-descriptions-item>
      <a-descriptions-item label="站点状态">
        <a-tag
          :color="
            detailInfo.state == '未审核'
              ? 'orange'
              : detailInfo.state == '审核通过'
                ? 'green'
                : 'red'
          "
          size="mini"
          >{{ detailInfo.state }}</a-tag
        >
      </a-descriptions-item>
      <a-descriptions-item label="负责人">{{ detailInfo.director }}</a-descriptions-item>
      <a-descriptions-item label="负责人电话"> {{ detailInfo.phone }}</a-descriptions-item>
      <a-descriptions-item label="是否有人值守">
        <a-tag size="mini" v-if="detailInfo.isonduty">是</a-tag>
        <a-tag size="mini" color="red" v-else>否</a-tag>
      </a-descriptions-item>
      <a-descriptions-item label="是否接收进山消息推送">
        <a-tag size="mini" v-if="detailInfo.isreceive">是</a-tag>
        <a-tag size="mini" color="red" v-else>否</a-tag>
      </a-descriptions-item>
      <a-descriptions-item label="站点图片">{{ detailInfo.siteImg }}</a-descriptions-item>
      <a-descriptions-item label="站点地址">{{ detailInfo.siteAddress }}</a-descriptions-item>
    </a-descriptions>
    <a-descriptions bordered class="mt-4">
      <a-descriptions-item label="接收消息人员">
        <a-table :dataSource="dataSource" :columns="columns" />
      </a-descriptions-item>
    </a-descriptions>
    <div class="mt-4">
      <a-input style="width: 50%" v-model:value="form.content" placeholder="审核说明" />
      <a-button style="margin: 0 20px" type="primary" @click="examine(2)" danger>拒绝</a-button>
      <a-button type="primary" @click="examine(1)">通过</a-button>
    </div>
  </div>
</template>
<script setup lang="ts">
  import { ref } from 'vue';

  const detailInfo: any = ref({});
  const dataSource = ref([]);
  const columns = ref([
    {
      title: '人员名称',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '手机号',
      dataIndex: 'account',
      key: 'account',
    },
  ]);
  const form = ref({
    content: '',
  });

  const examine = (status: number) => {
    const params = {
      status,
    };
    console.log(params);
  };
</script>
