<template>
    <global-page title="部件信息详情">
        <global-table :columns="columns" :data="details?.partList" :width="120">
            <template #installTime="{ row }">
                {{ timeStampFormat(row.installTime, { format: 'YYYY/MM/DD' }) }}
            </template>
            <template #localMaterials="{ row }">
                {{ useGetDictByValue('ta_localMaterials', row.localMaterials) }}
            </template>
        </global-table>
    </global-page>
</template>

<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { timeStampFormat } from 'mocp/utils/tool'
import useTechnicalAnalysisStore from 'mocp/store/technicalAnalysis'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'

const technicalAnalysisStore = useTechnicalAnalysisStore()
const { details } = storeToRefs(technicalAnalysisStore)
const columns = ref([
    { title: '件号', dataIndex: 'partNo', minWidth: 100 },
    { title: '序号', dataIndex: 'serialNo' },
    { title: '部件名称', dataIndex: 'partName' },
    { title: '部件性质', dataIndex: 'partNature' },
    { title: '部件情况', dataIndex: 'partSituation' },
    { title: '装机时间', dataIndex: 'installTime' },
    { title: 'CSN', dataIndex: 'csn' },
    { title: 'TSN', dataIndex: 'tsn' },
    { title: 'CSR', dataIndex: 'csr' },
    { title: 'TSR', dataIndex: 'tsr' },
    { title: '当地航材', dataIndex: 'localMaterials' },
    { title: '当地配置标准', dataIndex: 'localConf' },
    { title: '软时限', dataIndex: 'companyReliability' },
    { title: '航空集团平均使用时间', dataIndex: 'useAverageTime' },
    { title: '世界机队平均使用时间', dataIndex: 'worldFleet' }
])
</script>
<style lang="scss" scoped></style>
