<template>
	<view>
		<view>
			<view>
				<select-cy :value="tvalinfo" placeholder="优先级" name="name" :options="datalist" :showClearIcon="true"
					:zindex="zindex" @change="change_select_cy"></select-cy>
			</view>
		</view>
	</view>

</template>

<script>
	import {
		qStatus
	} from '@/utils/requestahm.js';
	export default {
		name: 'selectLeg',
		data() {
			return {
				zindex: 99,
				// //模拟初始数据
				tvalinfo: [],
				// //模拟数据列表
				datalist: [
					{
						code: 3,
						label: '高',
						value: '高',							
					},
					{
						code: 2,
						label: '中',
						value: '中',							
					},
					{
						code: 1,
						label: '低',
						value: '低',							
					},
					{
						code: 0,
						label: '无',
						value: '无',							
					},
					
				],
				listitem: [],
			}
		},
		props: {
			tval: {
				type: Array,
				default: [],
			},

		},
		watch: {

		},
		methods: {
			
			//下拉框改变
			change_select_cy(item, value) {
				this.tvalinfo = value;
				let itemtval = []
				let itemtval2 = []
				let itemtvalLast = []

				if (this.tvalinfo.length > 0) {
					for (var j = 0; j < this.tvalinfo.length; j++) {
						for (var i = 0; i < this.datalist.length; i++) {
							if (this.tvalinfo[j] == this.datalist[i].label) {
								itemtval.push(this.datalist[i].code)
							}
							
						}
					}
				}
								
				this.$emit('changevalue', value)
				this.$emit('changevalueitem', itemtval)
			},
		},
		created() {
			if (this.tval.length > 0) {
				this.tvalinfo = this.tval
			}
			
		}
	}
</script>

<style>
</style>
