<template>
  <TreeSelectComponent
    :value="props.value"
    :record="props.record"
    :formData="props.formData"
    :disabled="props.disabled"
    :readonly="props.readonly"
    :isDesgin="props.isDesgin"
    :placeholder="props.record?.placeholderContent || props.placeholder"
    @onChange="onChange"
    @onClick="onClick"
    @onBlur="onBlur"
    @onFocus="onFocus"
    @update:value="updateValue"
  ></TreeSelectComponent>
</template>

<script setup name="FormTreeSelect">
const props = defineProps({
  value: {
    type: String,
    default: ''
  },
  //当前行配置
  record: {
    type: Object,
    default: {}
  },
  // 当前行数据
  formData: {
    type: Object,
    default: {}
  },
  //是否禁用
  disabled: {
    type: Boolean,
    default: false
  },
  placeholder: {
    type: String,
    default: '请选择'
  },
  // 是否只读
  readonly: {
    type: Boolean,
    default: false
  },
  // 是否是设计
  isDesgin: {
    type: Boolean,
    default: false
  }
});

const emits = defineEmits(['update:value', 'onBlur', 'onClick', 'onChange', 'onFocus']);

const onChange = record => {
  emits('onChange', record);
};
const onBlur = record => {
  emits('onBlur', record);
};
const onClick = record => {
  emits('onClick', record);
};
const onFocus = record => {
  emits('onFocus', record);
};

const updateValue = value => {
  emits('update:value', value);
};
</script>

<style></style>
