<script setup lang="ts">
import ContainerBox from '@/components/ContainerBox'
// @ts-expect-error ts-migrate(2322)  Type '{ fireCarIcon: { src: string; width: string; height: string; }; peopleIcon: { src: string; width: string; height: string; }; }' is not assignable to type '{ fireCarIcon: { src: string; width: string; height: string; }; peopleIcon: { src: string; width: string; height: string; }; }'.
import borderBgImage from '@/assets/images/border-bg.png'
import LineModule from './LineModule.vue'
import { useRoute } from 'vue-router'
import { fireRecord } from '@/api/detail'
const moduleTitle = "火场文书";


const $route = useRoute()
/**
 * 案件Id
 */
const caseId = $route.params.id 
const fireRecordData  = ref<{
    state: string,
    time: string,
    isImage: boolean,
    content: string ,
    dept: string
  }[]>()
fireRecord(caseId as string).then(res => copeResponse(res.data, data => {
  fireRecordData.value = data.map(item => ({
    state: item.wsnr_jyqk,
    time: item.gxsj,
    isImage: false,
    content: "",
    dept: item.fkjg_tywysbm
  }))
}))

</script>

<template>
  <container-box :background="borderBgImage" :title="moduleTitle" style="width:23.2vw;height:56.2vh;" >
    <LineModule v-for="(item,index) in fireRecordData" :end="index === fireRecordData.length - 1" :key="index"
      :state="item.state"
      :time="item.time"
      :isImage="item.isImage"
      :content="item.content"
      :dept="item.dept"
    />
  </container-box>
</template>

<style scoped lang="less">
</style>
