Commit 3b3d7fe0 by zhaochengxiang

bug fix

parent eaf8f9a8
......@@ -777,6 +777,14 @@ const AssetAction = (props) => {
return <IndexCode value={item.value||''} terms={terms} />;
}
if (item.selectMode==='单选' || item.selectMode==='多选') {
const tmp = (item.optional??'').split(',')
if ((tmp??[]).indexOf('用户列表')!==-1) {
return <UserItem readonly={true} loading={loadingUsers} users={users} multiple={item.selectMode==='多选'} />
}
}
return <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>;
}
......@@ -1220,7 +1228,7 @@ const DepartmentItem = ({ loading, departments, value, onChange, multiple = fals
}
return undefined
}, [value])
}, [value, options])
return (
<Select loading={loading} showSearch allowClear
......@@ -1253,14 +1261,20 @@ const UserItem = ({ loading, users, value, onChange, readonly=false, terms = [],
const userInfo = React.useMemo(() => {
if (value) {
const index = (users??[]).findIndex(item => item.username === value)
const tmp = (value??'').split(',')
const newUserInfo = []
tmp.map(item => {
const index = (users??[]).findIndex(_item => _item.username === item)
if (index !== -1) {
const currentUser = users[index]
return `${currentUser.username}(${currentUser.chinesename})`
const currentUser = users[index]
newUserInfo.push(`${currentUser.username}(${currentUser.chinesename})`)
}
})
return newUserInfo.toString()
}
return value
return ''
}, [value, users])
useDebounceEffect(() => {
......@@ -1286,7 +1300,7 @@ const UserItem = ({ loading, users, value, onChange, readonly=false, terms = [],
}
return undefined
}, [value])
}, [value, options])
return (
<React.Fragment>
......
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