This commit is contained in:
ditiqi 2025-02-25 22:31:42 +08:00
parent 0caf57cdff
commit 76ef17163c
1 changed files with 3 additions and 10 deletions

View File

@ -15,11 +15,9 @@ interface TermSelectProps {
defaultValue?: string | string[];
value?: string | string[];
onChange?: (value: string | string[]) => void;
placeholder?: string;
multiple?: boolean;
taxonomyId?: string;
disabled?: boolean;
className?: string;
domainId?: string;
dropdownStyle?: React.CSSProperties;
style?: React.CSSProperties;
@ -34,7 +32,6 @@ export default function TermSelect({
defaultValue,
value,
onChange,
className,
placeholder = "选择分类",
multiple = false,
taxonomyId,
@ -45,7 +42,8 @@ export default function TermSelect({
style,
disabled = false,
dropdownRender,
}: TermSelectProps) {
...treeSelectProps
}: TermSelectProps & TreeSelectProps) {
const utils = api.useUtils();
const [listTreeData, setListTreeData] = useState<
Omit<DefaultOptionType, "label">[]
@ -179,9 +177,6 @@ export default function TermSelect({
<TreeSelect
treeDataSimpleMode
disabled={disabled}
showSearch={showSearch}
allowClear
style={style}
// ref={selectRef}
dropdownStyle={{
width: "300px", // 固定宽度
@ -189,11 +184,8 @@ export default function TermSelect({
maxWidth: "600px", // 最大宽度
...dropdownStyle,
}}
dropdownRender={dropdownRender}
defaultValue={defaultValue}
value={value}
open={open}
className={className}
placeholder={placeholder}
onChange={handleChange}
loadData={onLoadData}
@ -204,6 +196,7 @@ export default function TermSelect({
onClear={() => handleChange(multiple ? [] : undefined)}
onTreeExpand={handleExpand}
onDropdownVisibleChange={handleDropdownVisibleChange}
{...treeSelectProps}
/>
);
}