41 lines
1.1 KiB
TypeScript
Executable File
41 lines
1.1 KiB
TypeScript
Executable File
// apps/web/src/components/models/term/system-type-select.tsx
|
|
import { Select } from "antd";
|
|
import { api } from "@nice/client";
|
|
import React from "react";
|
|
|
|
interface FixTypeSelectProps {
|
|
value?: string;
|
|
onChange?: (value: string) => void;
|
|
placeholder?: string;
|
|
disabled?: boolean;
|
|
className?: string;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
export default function FixTypeSelect({ value,onChange,placeholder = "选择故障状态",disabled = false,className,style,}: FixTypeSelectProps) {
|
|
// 故障状态是固定的,直接定义选项
|
|
const options = [
|
|
{ label: "已修复", value: "normal" },
|
|
{ label: "维修中", value: "maintenance" },
|
|
{ label: "未修复", value: "broken" },
|
|
];
|
|
return (
|
|
<Select
|
|
value={value}
|
|
onChange={onChange}
|
|
options={options}
|
|
placeholder={placeholder}
|
|
disabled={disabled}
|
|
className={className}
|
|
style={style}
|
|
showSearch
|
|
filterOption={(input, option) =>
|
|
(option?.label?.toString() || "")
|
|
.toLowerCase()
|
|
.includes(input.toLowerCase())
|
|
}
|
|
allowClear
|
|
/>
|
|
);
|
|
}
|