<template>
    <global-page title="支援申请详情">
        <view class="mocp-cell">
            <up-cell-group v-if="details">
                <up-cell title="创建时间" :value="details.createTime"></up-cell>
                <up-cell title="发起人" :value="details.sponsor"></up-cell>
                <up-cell title="接收人" :value="details.recipient || '-'"></up-cell>
                <up-cell title="状态">
                    <template #value>
                        <custom-state :value="useGetDictByValue('sa_state', details.state)" :size="28"></custom-state>
                    </template>
                </up-cell>
                <up-cell title="状态">
                    <template #value>
                        <global-tag :type="useGetDictByValue('sa_isSuccessType', details.isSuccess)">
                            {{ useGetDictByValue('sa_isSuccess', details.isSuccess) }}
                        </global-tag>
                    </template>
                </up-cell>
                <up-cell title="机号" :value="details.machineNumber || '-'"></up-cell>
                <up-cell title="机型" :value="details.model || '-'"></up-cell>
                <up-cell title="相关席位" :value="details.relevantSeatsName || '-'"></up-cell>
                <up-cell title="航司" :value="useGetDictByValue('', details.aviation, { data: getAirlineSelect() }) || '-'"></up-cell>
                <up-cell title="航站" :value="details.terminal || '-'"></up-cell>
                <up-cell title="ATA章节" :value="details.ata || '-'"></up-cell>
                <up-cell title="专业" :value="getParamNameByValue('MajorCategory', details.specialty) || '-'"></up-cell>
                <up-cell title="发动机型号" :value="details.engineModel || '-'"></up-cell>
                <up-cell title="任务需求" :label="details.supportNeeds || '-'"></up-cell>
            </up-cell-group>
        </view>
    </global-page>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import useSupportApplicationStore from 'mocp/store/support-application'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import { getAirlineSelect } from 'mocp/utils/permission'

const supportApplicationStore = useSupportApplicationStore()
const { details } = storeToRefs(supportApplicationStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
    background: #fff;
}
</style>
