<template>
	<div>
		<el-select v-model="inputValue" placeholder="请选择" style="width:100%;" :size="size" @change="curSelect" clearable  > 
			<el-option v-for="item in options" :key="item.dicCode" :label="item.dicName" :value="item.dicCode">
			</el-option>
		</el-select>
	</div>
</template>

<script>
	import axios from '@/axios';

	export default {
		props: {
			type: '',
			size: '',
			inputValue:  {
          type: String
       },
		},
		data() {
			return {
				options: [],
				invalue: '',
				obj: {}
			};
		},
		methods: {
			getTableData() {
				var url = 'Common/querySelector.do'
				var param = {
					type: this.type,
				}
				axios.get(url, param).then(response => {
					this.options = response.data.data
				});
			},
			curSelect(value) {
				//console.log(value);
				let obj = {};
				obj = this.options.find((item) => { 
					return item.dicCode === value; 
				});
				//console.log(obj.dicName); 
				  this.$emit('receviceFromSelector', obj.dicCode,obj.dicName);
			}
		},
		mounted() {
			this.getTableData()
			
		}
	}
</script>

<style>

</style>
