Skip to content

Commit

Permalink
[INLONG-9723][Dashboard] Module audit id query item optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
bluewang committed Feb 22, 2024
1 parent f58de13 commit 735dcc8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions inlong-dashboard/src/ui/components/HighSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface HighSelectProps extends Omit<SelectProps<any>, 'options'> {
requestParams?: unknown;
requestAuto?: boolean;
requestTrigger?: ('onOpen' | 'onSearch')[];
filterOption?: boolean;
};
asyncValueLabel?: string;
useInput?: boolean;
Expand Down Expand Up @@ -168,6 +169,11 @@ const HighSelect: React.FC<HighSelectProps> = ({
onSearch={options?.requestTrigger?.includes('onSearch') ? onSearch : rest.onSearch}
onDropdownVisibleChange={onDropdownVisibleChange}
onChange={onSelectChange}
filterOption={
options.filterOption
? (input, option) => (option?.label ?? '').toString().includes(input)
: options.filterOption
}
value={
useInput && diyState
? '__DIYState'
Expand Down
22 changes: 16 additions & 6 deletions inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,20 @@ export const getFormContent = initialValues => [
name: 'inlongGroupId',
props: {
dropdownMatchSelectWidth: false,
showSearch: true,
options: {
requestAuto: true,
requestService: {
requestTrigger: ['onOpen', 'onSearch'],
requestService: keyword => ({
url: '/group/list',
method: 'POST',
data: {
keyword,
pageNum: 1,
pageSize: 1000,
pageSize: 100,
inlongGroupMode: 0,
},
},
}),
requestParams: {
formatResult: result =>
result?.list.map(item => ({
Expand All @@ -78,17 +81,20 @@ export const getFormContent = initialValues => [
name: 'inlongStreamId',
props: values => ({
dropdownMatchSelectWidth: false,
showSearch: true,
options: {
requestAuto: true,
requestService: {
requestTrigger: ['onOpen', 'onSearch'],
requestService: keyword => ({
url: '/stream/list',
method: 'POST',
data: {
keyword,
pageNum: 1,
pageSize: 1000,
pageSize: 100,
inlongGroupId: values.inlongGroupId,
},
},
}),
requestParams: {
formatResult: result =>
result?.list.map(item => ({
Expand Down Expand Up @@ -127,9 +133,11 @@ export const getFormContent = initialValues => [
name: 'benchmark',
props: {
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
filterOption: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
Expand All @@ -150,9 +158,11 @@ export const getFormContent = initialValues => [
name: 'compared',
props: {
allowClear: true,
showSearch: true,
dropdownMatchSelectWidth: false,
options: {
requestAuto: true,
filterOption: true,
requestService: {
url: '/audit/getAuditBases',
method: 'GET',
Expand Down

0 comments on commit 735dcc8

Please sign in to comment.