import React, { useRef, useState } from 'react'; import { PageContainer, ProFormSelect, ProFormText, ProTable } from '@ant-design/pro-components'; import type { ProColumns, ActionType } from '@ant-design/pro-components'; import { systemApi } from '@/services/system'; import { ActionBar, SearchBarPlus } from '@/components/ui'; const UserSearchPage: React.FC = () => { const [params, setParams] = useState>({}); const actionRef = useRef(); const columns: ProColumns[] = [ { dataIndex: 'index', valueType: 'indexBorder', width: 48 }, { title: '用户ID', dataIndex: 'id', width: 100 }, { title: '账号', dataIndex: 'username', render: (_, r) => }, { title: '用户昵称', dataIndex: 'nickname', render: (_, r) => }, { title: '手机号', dataIndex: 'mobile', render: (_, r) => }, { title: '性别', dataIndex: 'sex', render: (_, r) => }, { title: '类型', dataIndex: 'type', render: (_, r) => }, { title: '创建时间', dataIndex: 'createTime', valueType: 'dateTime', width: 180 }, ]; return ( actionRef.current?.reload?.()} onFinish={async (values) => { const { searchKey, searchValue } = values as any; let queryStr = ''; if (searchKey && searchValue) queryStr = searchKey === 'none' ? searchValue : `${searchKey}:${searchValue}`; setParams({ ...params, queryStr }); }}> actionRef={actionRef} rowKey="id" headerTitle="用户检索" request={(p) => systemApi.searchUsers({ ...p, ...params })} columns={columns} search={false} pagination={{ showSizeChanger: true, showQuickJumper: true }} /> ); }; export default UserSearchPage;