<template>
	<view>		
		<view >
			<select-cy ref="selectCyRefs" :value="tvalinfo" placeholder="ATA" name="name"
				:options="datalist" :showClearIcon="true" :zindex="zindex"
				@change="change_select_cy"></select-cy>
		</view>
	</view>
		
</template>

<script>
	import {
		getAtaListAll
	} from '@/utils/requestahm.js';
	
	export default {
	
		data() {
			return{				
				
				//模拟初始数据
				tvalinfo:[],
				// //模拟数据列表
				 datalist: [
				
				],
			}
		},
		props: {
			tval:{
				type:Array,
				default:[],
			},
			zindex:Number,			
		},
		methods:{
			async getDate(){
				//ata信息
				const ataitem = await getAtaListAll({
				
				})		
				if(ataitem.code == 200){
					let param = {}
					for (var i = 0; i < ataitem.data.length; i++) {
						param = {
							label: ataitem.data[i].ataId + '-' + ataitem.data[i].name,
							value: ataitem.data[i].ataId,							
						}
						this.datalist.push(param)
					}
				}else{
					param = {
						label: '暂无数据',
						value: '暂无数据',					
					}
					this.datalist.push(param)
				}
				
			},
			
			//下拉框改变
			change_select_cy(item, value) {
				this.tvalinfo = value;
				this.$emit('changevalue', this.tvalinfo)
			},
			
		},
		created() {
			if(this.tval.length>0){
				this.tvalinfo = this.tval 
			}
			this.getDate()
		}
	}
</script>

<style>
</style>