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

<script setup name="FormSelectRole">
const props = defineProps({
  value: {
    type: String,
    default: ''
  },
  record: {
    type: Object,
    default: {}
  },
  //是否禁用
  disabled: {
    type: Boolean,
    default: false
  },
  placeholder: {
    type: String,
    default: '请选择'
  },
  // 是否只读
  readonly: {
    type: Boolean,
    default: false
  },
  // ref
  formRef: {
    type: Object,
    default: null
  },
});

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

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

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

<style></style>
