<template>
  <ele-modal
    width="80%"
    :visible="visible"
    :maskClosable="false"
    :maxable="maxable"
    title="历史项目"
    :body-style="{ paddingBottom: '28px' }"
    @update:visible="updateVisible"
  >
    <a-card v-for="(item, index) in data?.projectList" :key="index">
      <a-descriptions :title="item.projectName">
        <a-descriptions-item label="项目地址">{{ item.projectRegion + item.projectAddress }}</a-descriptions-item>
        <a-descriptions-item label="主管部门">{{ item.competentDepartment }}</a-descriptions-item>
        <a-descriptions-item label="租赁单位">{{ item.companyName }}</a-descriptions-item>
        <a-descriptions-item label="承租单位">{{ item.customerName }}</a-descriptions-item>
      </a-descriptions>
    </a-card>
  </ele-modal>

</template>

<script lang="ts" setup>
import { ref } from "vue";
import { TowerEquipment } from "@/api/tower/equipment/model";
import { WORKSHEET_WORK_TYPE } from "@/api/tower/worksheet/model";

const props = defineProps<{
  // 弹窗是否打开
  visible: boolean;
  // 修改回显的数据
  data?: TowerEquipment | null;
}>();

const emit = defineEmits<{
  (e: "update:visible", visible: boolean): void;
}>();

const maxable = ref(true);

const updateVisible = (value: boolean) => {
  emit("update:visible", value);
};
</script>
