Commit f4852530 by zhaochengxiang

bug fix

parent 411ef2c3
......@@ -285,10 +285,10 @@ export const UsersItem = ({ loading, users, value, onChange, readonly = false })
useDebounceEffect(() => {
setOptions(
(users??[])
.filter(item => !searchValue || (item.name??'').indexOf(searchValue)!==-1)
.filter(item => !searchValue || (item.name??'').indexOf(searchValue)!==-1 || (item.dname??'').indexOf(searchValue)!==-1)
.map(item => ({
label: item.name,
value: item.id,
value: item.name,
}))
)
}, [searchValue, users], { wait: 300 })
......@@ -298,7 +298,7 @@ export const UsersItem = ({ loading, users, value, onChange, readonly = false })
{
readonly ? <span>{value?.map(item => item.name).toString()}</span> : <Select loading={loading} mode='multiple' allowClear
placeholder='请选择用户'
value={(options??[]).length>0?value?.map(item => item.id):[]}
value={(options??[]).length>0?value?.map(item => item.name):[]}
searchValue={searchValue}
onSearch={(val) => {
setSearchValue(val)
......@@ -309,7 +309,7 @@ export const UsersItem = ({ loading, users, value, onChange, readonly = false })
filterOption={false}
options={options}
onChange={(val) => {
onChange?.((users??[]).filter(item => (val??[]).indexOf(item.id) !== -1))
onChange?.((users??[]).filter(item => (val??[]).indexOf(item.name) !== -1))
}}
/>
}
......
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