Skip to content

Commit

Permalink
fix:角色列表下拉框搜索卡住修复
Browse files Browse the repository at this point in the history
  • Loading branch information
QwQ-wuwuwu committed Jun 26, 2024
1 parent a41b67b commit 7e058ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/components/bs-ui/select/multi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const MultiSelect = ({
</div> : <div className="flex flex-wrap">
{
options.filter(option => (values as string[]).includes(option.value)).map(option =>
<Badge onPointerDown={(e) => e.stopPropagation()} key={option.value} className="flex whitespace-normal items-center gap-1 select-none bg-primary/20 text-primary hover:bg-primary/15 m-[2px]">
<Badge onPointerDown={(e) => e.stopPropagation()} key={option.value} className="flex whitespace-normal items-center gap-1 select-none bg-primary/20 text-primary hover:bg-primary/15 m-[2px] break-all">
{option.label}
{lockedValues.includes(option.value) || <Cross1Icon className="h-3 w-3" onClick={() => handleDelete(option.value)}></Cross1Icon>}
</Badge>
Expand Down
9 changes: 5 additions & 4 deletions src/frontend/src/pages/LogPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,13 @@ export default function index() {
</TableRow>
))}
</TableBody>
<TableFooter>
{!logs.length && <TableRow>
{!logs.length && <TableFooter>
<TableRow>
<TableCell colSpan={9} className="text-center text-gray-400">{t('build.empty')}</TableCell>
</TableRow>}
</TableFooter>
</TableRow>
</TableFooter>}
</Table>
{!logs.length && <div className="h-[700px]"></div>}
</div>
{/* 分页 */}
{/* <Pagination count={10}></Pagination> */}
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/pages/SystemPage/components/Roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ export default function Roles() {
loadData()
}, [state.group])

const [keyWord, setKeyWord] = useState('');
const [keyWord, setKeyWord] = useState('')
const options = useMemo(() => {
if (!keyWord || !state.group) return state.groups
return state.groups.filter(group => group.label.toLowerCase().indexOf(keyWord.toLowerCase()) !== -1 || group.value === state.group)
return state.groups.filter(group => group.label.toUpperCase().includes(keyWord.toUpperCase()) || group.value === state.group)
}, [keyWord, state.group])

if (state.role) {
Expand Down Expand Up @@ -154,7 +154,7 @@ export default function Roles() {
</SelectTrigger>
<SelectContent className="max-w-[180px] break-all">
<SearchInput inputClassName="h-8 mb-2" placeholder={t('log.selectUserGroup')}
onChange={(e) => setKeyWord(e.target.value)} iconClassName="w-4 h-4" />
onChange={e => setKeyWord(e.target.value)} onKeyDown={e => e.stopPropagation()} iconClassName="w-4 h-4" />
<SelectGroup>
{options.map(el => (
<SelectItem key={el.value} value={el.value}>{el.label}</SelectItem>
Expand Down

0 comments on commit 7e058ec

Please sign in to comment.