<template>
    <view style="background-color: #f0f0f0;"> <!-- f0f0f0 -->
        <view style="padding-bottom: 3px;">
            <uni-row class="padding-top padding-left">
                {{title}}
            </uni-row>
            
			<view v-if = "ttype =='EF'" style="margin:10px; background-color: #ffffff;">
				<uni-row >
				    <uni-row class="padding-left padding-top5">
				        {{eventListByReportTypeLegIdData[0]?eventListByReportTypeLegIdData[0].msgType:'--' }} = Report Type
				    </uni-row>
				    <uni-row class="padding-left">
				        {{ eventListByReportTypeLegIdData[0]&&eventListByReportTypeLegIdData[0].partNumber?eventListByReportTypeLegIdData[0].partNumber.join('，'):'--' }} = CMC or LDI Part Number
				    </uni-row>
				    <uni-row class="padding-left ">
				        {{ eventListByReportTypeLegIdData[0]?eventListByReportTypeLegIdData[0].computorSource:'--' }} = CMC Computer Source
				    </uni-row>
				</uni-row>
			</view>
			
			<view v-if = "ttype == 'FS'" style="margin:10px; background-color: #ffffff;">
				<uni-row v-if="faultInformation" >
				    <uni-row class="padding-left padding-top5">
				        {{ faultInformation?faultInformation.msgType:'--' }} = Report Type
				    </uni-row>
				    <uni-row class="padding-left">
				        {{ faultInformation&&faultInformation.partNumber?faultInformation.partNumber.join('，'):'--' }} = CMC or LDI Part Number
				    </uni-row>
				    <uni-row class="padding-left">
				        {{ faultInformation?faultInformation.computorSource:'--' }} = CMC Computer Source
				    </uni-row>
				</uni-row>
			</view>
        </view>
    </view>
</template>

<script>
    export default {
        name:'middle',
        data() {
            return {
				faultInformation:{}
            }
        },
        props: {
			ttype :{
			    type: String,
			    default: '',
			},
            title :{
                type: String,
                default: '',
            },
			//当前故障
            eventListByReportTypeLegIdData :{
                type: Array,
                default: []
            },
			
        },
        onLoad(option) {
			//this.faultInformation1()
        },
        methods: {
			faultInformation1() {
	
			      const plfItem = this.eventListByReportTypeLegIdData?.find(item => item.msgType === 'PLF') ?? {};
				  this.faultInformation = plfItem
				  
			},
        },
        created() {
           
			this.faultInformation1()
        }
    }
</script>

<style scoped lang="scss">
    .padding-top {
        padding-top: 10px;
    }

    .padding-left {
        padding-left: 10px;
    }
	
    .padding-top5 {
        padding-top: 5px;
    }
</style>
