<script setup>
import { useRouter, useRoute } from 'vue-router';

/* 返回上一级页面 */
const router = useRouter()

const route = useRoute()
const resourceRecord = route.query.resourceRecord ? JSON.parse(route.query.resourceRecord) : ''

import AttachmentS3 from '@/components/AttachmentS3.vue';

</script>

<template>
  <div class="page-container">
    <van-sticky>
      <van-nav-bar title="保养记录查询" />
    </van-sticky>

    <div class="scroll-container">
      <van-form>
        <van-field
          readonly
          v-model="resourceRecord.resourceName"
          label="物资名称"
        />
        <van-field
          readonly
          v-model="resourceRecord.repairDate"
          label="保养日期"
        />
        <van-field
          readonly
          v-model="resourceRecord.repairResult"
          label="保养内容及恢复情况"
        />

        <van-field label="保养文件">
          <template #input>
            <AttachmentS3 :f-id="resourceRecord.reviewFile" :readonly="true" />
          </template>
        </van-field>
      </van-form>
    </div>

  </div>
</template>

<style scoped>
.page-container {
  height: 100vh; /* 关键：外层容器高度设为视口高度 */
  display: flex;
  flex-direction: column;

}
/*  overflow-y: auto; !* 启用垂直滚动 *!*/


.scroll-container {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}

/* 可选：隐藏滚动条（视觉优化） */
.scroll-container::-webkit-scrollbar {
  display: none;
}

</style>
