<template>
  <a-layout-content>
    <a-row  >
      <a-col :span="8">
        查验结果：{{formState.cyjgxx}}
      </a-col>
      <a-col :span="8">
        查验次数：{{formState.inspectionAmount}}
      </a-col>
      <a-col :span="8">
        查验时间：{{formState.verify_time}}
      </a-col>
    </a-row>
  </a-layout-content>
</template>
<script lang="ts" setup>
import {ref,onMounted } from 'vue';
import request  from "../../utils/request.ts";
const props = defineProps({ filePath: String });
import {baseURL} from "../../utils/baseurl.ts";

const fileType = ref<string>('img')
onMounted(() => {
  alert(props.filePath)
  if(props.filePath){
    fileType.value = props.filePath.split('.').pop() ==='pdf'?'pdf':'img'
    request.get('/verify?filePath='+encodeURIComponent(props.filePath)).then((res) => {
      console.log(res)
      if(res.data){
        formState.value = res.data
      }else{
        formState.value.cyjgxx ="失败"
      }
    })
    fileUrl.value =  baseURL+"/"+props.filePath
  }
})

//
const fileUrl = ref('')

let formState = ref({
  inspectionAmount: "",
  cyjgxx: "",
  verify_time: "",
});

</script>
<style scoped>
.pdf{
  width: 100%;
  height: 100%;
}
</style>
