Commit 228d5054 authored by 前端-许佳敏's avatar 前端-许佳敏

新增searchSelect只读状态

parent b6394fed
......@@ -26,7 +26,7 @@ const SelectContent = (props) => {
// 自定义搜索型下拉框
const SearchSelect = (props: ISchemaFieldComponentProps) => {
const ref = useRef<any>({})
const { schema, form, path, mutators } = props
const { schema, form, path, mutators, editable } = props
const dataSourceRef = useRef<any[]>([])
const pinyinRef = useRef<any[]>([])
// 可选参数 fetchSearch, select为search
......@@ -62,6 +62,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
}
useEffect(() => {
if (!editable) {
return ;
}
setLoading(true)
fetchSearch({
[fetchParams]: ''
......@@ -128,6 +131,7 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
filterOption={false}
loading={loading}
options={dataSource}
disabled={!editable}
// getPopupContainer={triggerNode => {
// return triggerNode
// }}
......
......@@ -22,7 +22,7 @@ import CustomRadio from './components/CustomRadio';
import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList';
import './index.less'
import { Checkbox } from '@formily/antd-components';
import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import VirtualChildren from './components/VirtualChildren'
import { useLinkComponentProps } from './linkages/linkComponentProps';
......@@ -92,7 +92,8 @@ export const componentExport = {
DateRangePicker: DatePicker.RangePicker,
TableTagList,
DateSelect,
VirtualChildren
VirtualChildren,
RadioGroup: Radio.Group
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, effects, expressionScope, ...reset } = props;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment