<template>
  <div>
    <layout-card>
      <!-- 内容，可能是一个加载中的提示或其他内容 -->
      <div v-if="loading">加载中...</div>
      <div v-else>文件已尝试打开，请检查您的下载文件夹或弹出窗口设置。</div>
    </layout-card>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import { infoStaffingView } from "@/request/traffic_safety_staffing.js";

const route = useRoute();
const STAFFING_ID = route.query.STAFFING_ID;
const loading = ref(true); // 用于指示文件是否正在加载

onMounted(async () => {
  const response = await infoStaffingView({ STAFFING_ID });
  loading.value = false; // 加载完成
  window.open(response.pd.ATTACHMENT_ROUTE, "_blank");
});
</script>

<style scoped></style>
