| | |
| | | disabled?: boolean; |
| | | modelValue?: number; |
| | | placeholder?: string; |
| | | label?: string; |
| | | excludeIds?: number[]; |
| | | }>(), |
| | | { |
| | | allowClear: true, |
| | | disabled: false, |
| | | modelValue: undefined, |
| | | placeholder: '请选择物料', |
| | | label: undefined, |
| | | }, |
| | | ); |
| | | const emit = defineEmits<{ |
| | |
| | | const hovering = ref(false); // 是否悬停 |
| | | const selectedItem = ref<MdmItemApi.Item>(); // 当前选中物料 |
| | | |
| | | const displayLabel = computed(() => selectedItem.value?.name ?? ''); // 选择器展示名称 |
| | | const displayLabel = computed(() => selectedItem.value?.name ?? props.label ?? ''); // 选择器展示名称 |
| | | const showClear = computed( |
| | | () => |
| | | props.allowClear && |
| | |
| | | const selectedIds = ( |
| | | props.modelValue === null ? [] : [props.modelValue] |
| | | ) as number[]; |
| | | dialogRef.value?.open(selectedIds, { multiple: false }); |
| | | dialogRef.value?.open(selectedIds, { multiple: false, excludeIds: props.excludeIds }); |
| | | } |
| | | |
| | | /** 回填选中的物料 */ |