<template>
    <view class="globalDetailsModel detailsFollowingCrew detailsOtherInfo">
        <view class="font-700 flex">
            <image class="timeFlightIcon" :src="title == '起飞当日' ? fly02 : fly03" />
            <view>
                <text class="m-x-6">
                    {{ baseStore.getTerminalObject[title == '起飞当日' ? getDetailsCurrentMsg.depStn : getDetailsCurrentMsg.arrStn]
                    }}
                </text>
            </view>
        </view>
        <view class="flex waterCont">
            <image class="weatherIcon" :src="weatherIconFn(msg.weatherInfoTxt)" />
            <view>
                <view class="waterTp" v-html="msg.weatherInfoTxt"></view>
                <view>
                    <text class="waterTemp font-700">{{ msg.temperature }}°</text>
                    <text class="waterText">({{ title }})</text>
                </view>
            </view>
        </view>
        <view class="flex flex-between waterInfo">
            <view>
                <view class="flex waterInfoItem">
                    <image class="weatherSubIcon" :src="visibility" />
                    <text>能见度</text>
                </view>
                <view>{{ msg.visibility }}m</view>
            </view>
            <view>
                <view class="flex waterInfoItem">
                    <image class="weatherSubIcon" :src="windFs" />
                    <text>风速</text>
                </view>
                <view>{{ parseInt(msg.windFs) }} 米/秒</view>
            </view>
        </view>
    </view>

</template>

<script setup>
import { ref } from 'vue'
import useBaseStore from 'mocp/store/base'
import { parseInt } from 'lodash'
import fly02 from 'mocpStatic/image/flight-support/fly02.png'
import fly03 from 'mocpStatic/image/flight-support/fly03.png'
import PM from 'mocpStatic/image/flight-support/PM.png'
import visibility from 'mocpStatic/image/flight-support/visibility.png'
import windFs from 'mocpStatic/image/flight-support/windFs.png'
import useFlightSupportStore from 'mocp/store/flight-support'
import { storeToRefs } from 'pinia'
import { weatherIconFn } from '../utils/weatherIcon'

const flightSupportStore = useFlightSupportStore()
const {getDetailsCurrentMsg} = storeToRefs(flightSupportStore)

const baseStore = useBaseStore()
const {title, msg} = defineProps({
    title: {
        type: String,
        default: '起飞当日'
    },
    msg: {
        type: Object,
        default: () => ({})
    }
})


</script>
<style lang="scss" scoped>
@import '../constants/details';
</style>
