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

新增searchSelect只读状态

parent b6394fed
...@@ -26,7 +26,7 @@ const SelectContent = (props) => { ...@@ -26,7 +26,7 @@ const SelectContent = (props) => {
// 自定义搜索型下拉框 // 自定义搜索型下拉框
const SearchSelect = (props: ISchemaFieldComponentProps) => { const SearchSelect = (props: ISchemaFieldComponentProps) => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const { schema, form, path, mutators } = props const { schema, form, path, mutators, editable } = props
const dataSourceRef = useRef<any[]>([]) const dataSourceRef = useRef<any[]>([])
const pinyinRef = useRef<any[]>([]) const pinyinRef = useRef<any[]>([])
// 可选参数 fetchSearch, select为search // 可选参数 fetchSearch, select为search
...@@ -62,6 +62,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => { ...@@ -62,6 +62,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
} }
useEffect(() => { useEffect(() => {
if (!editable) {
return ;
}
setLoading(true) setLoading(true)
fetchSearch({ fetchSearch({
[fetchParams]: '' [fetchParams]: ''
...@@ -128,6 +131,7 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => { ...@@ -128,6 +131,7 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
filterOption={false} filterOption={false}
loading={loading} loading={loading}
options={dataSource} options={dataSource}
disabled={!editable}
// getPopupContainer={triggerNode => { // getPopupContainer={triggerNode => {
// return triggerNode // return triggerNode
// }} // }}
......
...@@ -22,7 +22,7 @@ import CustomRadio from './components/CustomRadio'; ...@@ -22,7 +22,7 @@ import CustomRadio from './components/CustomRadio';
import SearchSelect from './components/SearchSelect'; import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList'; import TableTagList from './components/TableTagList';
import './index.less' import './index.less'
import { Checkbox } from '@formily/antd-components'; import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect'; import DateSelect from './components/DateSelect';
import VirtualChildren from './components/VirtualChildren' import VirtualChildren from './components/VirtualChildren'
import { useLinkComponentProps } from './linkages/linkComponentProps'; import { useLinkComponentProps } from './linkages/linkComponentProps';
...@@ -92,7 +92,8 @@ export const componentExport = { ...@@ -92,7 +92,8 @@ export const componentExport = {
DateRangePicker: DatePicker.RangePicker, DateRangePicker: DatePicker.RangePicker,
TableTagList, TableTagList,
DateSelect, DateSelect,
VirtualChildren VirtualChildren,
RadioGroup: Radio.Group
} }
const NiceForm: React.FC<NiceFormProps> = props => { const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, effects, expressionScope, ...reset } = 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