|
@@ -41,6 +41,7 @@ const getKey = (
|
|
|
keywords: string,
|
|
|
dept: string,
|
|
|
authType: number,
|
|
|
+ creator: string,
|
|
|
) => {
|
|
|
if (!pageIndex || previousPageData.has_more) {
|
|
|
const params: any = { url: 'apps', params: { page: pageIndex + 1, limit: 30, name: keywords, is_created_by_me: isCreatedByMe } }
|
|
@@ -53,9 +54,11 @@ const getKey = (
|
|
|
if (tags.length)
|
|
|
params.params.tag_ids = tags
|
|
|
if (dept)
|
|
|
- params.params.creatorDept = dept
|
|
|
+ params.params.creator_dept = dept
|
|
|
if (authType)
|
|
|
- params.params.authType = authType
|
|
|
+ params.params.auth_type = authType
|
|
|
+ if (creator)
|
|
|
+ params.params.creator = creator
|
|
|
return params
|
|
|
}
|
|
|
return null
|
|
@@ -95,8 +98,17 @@ const Apps = () => {
|
|
|
{ name: '授权编辑', value: '3' },
|
|
|
{ name: '授权可见', value: '4' },
|
|
|
]
|
|
|
+ const [creator, setCreator] = useState('')
|
|
|
+ const [searchCreator, setSearchCreator] = useState('')
|
|
|
+ const { run: handleSearchCreator } = useDebounceFn(() => {
|
|
|
+ setSearchCreator(creator)
|
|
|
+ }, { wait: 500 })
|
|
|
+ const handleCreatorChange = (value: string) => {
|
|
|
+ setCreator(value)
|
|
|
+ handleSearchCreator()
|
|
|
+ }
|
|
|
const { data, isLoading, setSize, mutate } = useSWRInfinite(
|
|
|
- (pageIndex: number, previousPageData: AppListResponse) => getKey(pageIndex, previousPageData, activeTab, isCreatedByMe, tagIDs, searchKeywords, dept, authType),
|
|
|
+ (pageIndex: number, previousPageData: AppListResponse) => getKey(pageIndex, previousPageData, activeTab, isCreatedByMe, tagIDs, searchKeywords, dept, authType, searchCreator),
|
|
|
fetchAppList,
|
|
|
{ revalidateFirstPage: true },
|
|
|
)
|
|
@@ -168,6 +180,15 @@ const Apps = () => {
|
|
|
options={options}
|
|
|
/>
|
|
|
<div className='flex items-center gap-2'>
|
|
|
+ <Input
|
|
|
+ showLeftIcon
|
|
|
+ showClearIcon
|
|
|
+ wrapperClassName='w-[200px]'
|
|
|
+ value={creator}
|
|
|
+ onChange={e => handleCreatorChange(e.target.value)}
|
|
|
+ onClear={() => handleCreatorChange('')}
|
|
|
+ placeholder="请输入创建人"
|
|
|
+ />
|
|
|
<SimpleSelect
|
|
|
wrapperClassName="h-[32px] w-[200px]"
|
|
|
defaultValue={authType}
|