<template>
	<view>
		<uni-data-select v-model="selectValue" :localdata="selectData" @change="change"></uni-data-select>
	</view>
</template>

<script>
	import {
		getDictItemStore
	} from '@/js_sdk/util/dictTools.js'

	export default {
		components: {
			 
		},  
		data() {
			return {
				title: "", //选择器的标题
				selectData: [],
				selectValue: "",  

			}
		},
		props: {
			sqlCondition: {
				type: String,
				default: ""
			},

			value: {
				type: String,
				default: ""
			}

		},
		watch: {
			sqlCondition: {
				immediate: true,
				deep: true,
				handler(val) {
					console.log("val:" + val)
					this.selectData = getDictItemStore(val)

				}
			},
			value: {
				immediate: true,
				deep: true,
				handler(val) {
					this.selectValue = val;
				}
			},
		},
		mounted() {
			// this.selectData = getDictItemStore(this.sqlCondition)
			// console.log(this.value, this.sqlCondition)
		},
		methods: {

			onnodeclick() {

			},
			change(e) {
				if (this.sqlCondition == "cyzf") {
					this.$emit('change', JSON.stringify(e))
					this.$emit('input', JSON.stringify(e))
				} else {
					this.$emit('input', e)
				}

			}

		},
	}
</script>

<style>
</style>