Commit 225894e8 by zhaochengxiang

使用employeenumber

parent bb49d941
...@@ -1264,10 +1264,10 @@ const UserItem = ({ loading, users, value, onChange, readonly=false, terms = [], ...@@ -1264,10 +1264,10 @@ const UserItem = ({ loading, users, value, onChange, readonly=false, terms = [],
const tmp = (value??'').split(',') const tmp = (value??'').split(',')
const newUserInfo = [] const newUserInfo = []
tmp.map(item => { tmp.map(item => {
const index = (users??[]).findIndex(_item => _item.username === item) const index = (users??[]).findIndex(_item => _item.employeenumber === item)
if (index !== -1) { if (index !== -1) {
const currentUser = users[index] const currentUser = users[index]
newUserInfo.push(`${currentUser.username}(${currentUser.chinesename})`) newUserInfo.push(`${currentUser.employeenumber}(${currentUser.chinesename})`)
} }
}) })
...@@ -1280,10 +1280,10 @@ const UserItem = ({ loading, users, value, onChange, readonly=false, terms = [], ...@@ -1280,10 +1280,10 @@ const UserItem = ({ loading, users, value, onChange, readonly=false, terms = [],
useDebounceEffect(() => { useDebounceEffect(() => {
setOptions( setOptions(
(users??[]) (users??[])
.filter(item => !searchValue || (item.username??'').toLowerCase().indexOf(searchValue.toLowerCase())!==-1 || (item.chinesename??'').toLowerCase().indexOf(searchValue.toLowerCase())!==-1) .filter(item => !searchValue || (item.employeenumber??'').toLowerCase().indexOf(searchValue.toLowerCase())!==-1 || (item.chinesename??'').toLowerCase().indexOf(searchValue.toLowerCase())!==-1)
.map(item => ({ .map(item => ({
label: `${item.username}(${item.chinesename})`, label: `${item.employeenumber}(${item.chinesename})`,
value: item.username, value: item.employeenumber,
})) }))
) )
}, [searchValue, users], { wait: 300 }) }, [searchValue, users], { wait: 300 })
......
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