<template>
	<view>
		<view>
			<select-cy :value="tvalinfo" placeholder="请选择机队" name="name" :options="datalist" :showClearIcon="true"
				:zindex="zindex" @change="change_select_cy"></select-cy>
		</view>
	</view>

</template>

<script>
	import {
		ftmAirlinelist,
		ftmFleetlistAll2,
	} from '@/utils/requestahm.js';

	export default {

		data() {
			return {

				//模拟初始数据
				// tval: [

				// ],
				tvalinfo: [],
				// //模拟数据列表
				datalist: [

				],
			}
		},
		props: {
			tval: {
				type: Array,
				default: [],
			},
			zindex: Number,
		},
		watch: {
			// tvalinfo:{
			// 	handler(newValue, oldValue) {
			// 		this.getDate()
			// 		 console.log("reportType被监视了",newValue,oldValue);

			// 	}
			// }
		},
		methods: {
			async getDate() {
				console.log(ftmAirlinelist,ftmFleetlistAll2)
				this.datalist = []
				var ftmFleetlistAll = await ftmFleetlistAll2({

				})

				let param = {}
				for (var i = 0; i < ftmFleetlistAll.data.length; i++) {
					param = {
						label: ftmFleetlistAll.data[i].name, //+'('+ftmFleetlistAll.data[i].num+')',
						value: ftmFleetlistAll.data[i].name, //+'('+ftmFleetlistAll.data[i].num+')',
					}
					this.datalist.push(param)
				}
			},
			// onchangeafter(){
			// 	let gg ='88'
			// 	return  gg
			// },
			//下拉框改变
			change_select_cy(item, value) {

				this.tvalinfo = value;
				this.$emit('changevalue', this.tvalinfo)
			},

		},
		mounted() {
			if (this.tval.length > 0) {
				this.tvalinfo = this.tval
			}
			this.getDate()
		}
	}
</script>

<style>
</style>