提交 cbcd8259 作者: 龚洪江

功能:飞手中心

上级 57ecd804
......@@ -13,6 +13,7 @@ import { MallManageAPI } from './modules/mallManage';
import { ResourceManageAPI } from './modules/resourceManageAPI';
import { ForumManageAPI } from './modules/forumManageAPI';
import { PilotTrainAPI } from './modules/pilotTrainAPI';
import { FlyerCenterAPI } from './modules/flyerCenterAPI';
export {
CommonAPI,
......@@ -30,4 +31,5 @@ export {
ResourceManageAPI,
ForumManageAPI,
PilotTrainAPI,
FlyerCenterAPI,
};
......@@ -169,3 +169,13 @@ export type getUserAccountByPhoneNumType = InterFunction<
export type appletQRCodeType = InterFunction<{ page: string; scene: string }, string>;
//登录信息-获取
export type getLoginInfoType = InterFunction<{ randomLoginCode: string }, any>;
//地区-获取
type locationType = {
id: number;
name: string;
level: number;
childInfo: locationType[];
};
export type getSecondDistrictInfoType = InterFunction<any, locationType[]>;
import { InterFunction, InterItemFunction } from '~/api/interface';
//飞手列表
export type backListPilotType = InterItemFunction<
{
abilityId?: number;
accountNumber?: string;
areaNumber?: any;
auditStatus?: number;
id?: number;
licenseType?: string;
},
{
abilityUrl: string;
age: number;
areaNumber: number;
auditStatus: number;
createTime: string;
id: number;
individualResume: string;
licenseNumber: number;
licenseType: string;
licenseUrl: string;
phoneNum: number;
pilotAbility: {
abilityId: number;
abilityName: string;
id: number;
}[];
remark: string;
residentCity: string;
sex: number;
timeOfApplication: string;
updateTime: string;
userAccountId: number;
userName: number;
yearsOfWorking: number;
}[]
>;
//能力类型
export type abilityListType = InterFunction<any, { abilityId: number; abilityName: string }[]>;
......@@ -5,6 +5,7 @@ import {
batchRemoveBannerInfo,
exchangeBannerInfo,
getLoginInfoType,
getSecondDistrictInfoType,
getUserAccountByPhoneNumType,
insertBannerInfo,
insertModuleInfo,
......@@ -84,4 +85,7 @@ export class CommonAPI {
//获取登录信息
static getLoginInfo: getLoginInfoType = (params) =>
axios.get('/userapp/temp-auth/getLoginInfo', { params });
// 获取地域
static getSecondDistrictInfo: getSecondDistrictInfoType = () =>
axios.get('/pms/appDevice/getSecondDistrictInfo');
}
import { abilityListType, backListPilotType } from '~/api/interface/flyerCenterType';
import axios from '../request';
export class FlyerCenterAPI {
//飞手列表
static getBackListPilot: backListPilotType = (data) =>
axios.post('/userapp/pilot/backListPilot', data);
// 飞手能力类型
static getAbilityList: abilityListType = () => axios.get('/userapp/pilot/abilityList');
}
......@@ -20,7 +20,7 @@ const CustomVerification = () => {
placeholder: '请输入UID,姓名或手机号',
},
];
const tableColumns: ColumnsType<any> = [
const tableColumns: ColumnsType<listAuthType[0]> = [
{
title: 'UID',
align: 'center',
......
import SearchBox, { searchColumns as searchColumnsType } from '~/components/search-box';
import { Table } from 'antd';
import { Button, Table, Tag } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { CommonAPI, FlyerCenterAPI } from '~/api';
import { useEffect, useState } from 'react';
import { InterDataType, InterReqListType, PaginationProps } from '~/api/interface';
import { backListPilotType } from '~/api/interface/flyerCenterType';
import { getSecondDistrictInfoType } from '~/api/interface/commonType';
//飞手列表返回类型
type flyerListType = InterDataType<backListPilotType>['list'];
//飞手列表请求类型
type flyerListParameters = InterReqListType<backListPilotType>;
//地址返回数据
type locationType = InterDataType<getSecondDistrictInfoType>;
const FlyerList = () => {
const searchColumns: searchColumnsType[] = [
const [searchColumns, setSearchColumns] = useState<searchColumnsType[]>([
{
name: '',
name: 'accountNumber',
label: '账号',
placeholder: '请输入UID,姓名或手机号',
type: 'input',
},
{
name: '',
name: 'auditStatus',
label: '执照认证状态',
placeholder: '请选择执照认证状态',
type: 'select',
options: [],
options: [
{ id: 0, name: '审核中' },
{ id: 1, name: '已通过' },
{ id: 2, name: '未通过' },
],
},
{
name: '',
label: '场景培训认证',
placeholder: '请选择场景培训认证状态',
name: 'abilityId',
label: '能力认证',
placeholder: '请选择能力认证',
type: 'select',
options: [],
},
];
const tableColumns: ColumnsType<any> = [
{
name: 'areaNumber',
label: '常驻城市',
placeholder: '请选择常驻城市',
type: 'Cascader',
options: [],
},
]);
const tableColumns: ColumnsType<flyerListType[0]> = [
{
title: 'UID',
dataIndex: 'uid',
align: 'center',
},
{
title: '姓名',
align: 'center',
dataIndex: 'userName',
},
{
title: '执照认证状态',
align: 'center',
dataIndex: 'auditStatus',
render: (text: number) => (text === 0 ? '审核中' : text === 1 ? '已通过' : '未通过'),
},
{
title: '场景培训认证',
title: '能力认证',
align: 'center',
dataIndex: 'pilotAbility',
render: (text: flyerListType[0]['pilotAbility']) =>
text ? text.map((v) => <Tag key={v.abilityId}>{v.abilityName}</Tag>) : '',
},
{
title: '常驻城市',
align: 'center',
dataIndex: 'residentCity',
},
{
title: '手机号',
align: 'center',
dataIndex: 'phoneNum',
},
{
title: '申请认证时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '备注',
align: 'center',
dataIndex: 'remark',
},
{
title: '操作',
align: 'center',
render: (_text: string, record) => (
<>
<Button type='link' danger disabled={record.auditStatus !== 0}>
审批
</Button>
<Button type='link'>变更</Button>
<Button type='link'>详情</Button>
</>
),
},
];
const [tableData, setTableData] = useState<flyerListType>([]);
const [query, setQuery] = useState<flyerListParameters>();
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
pageSize: 10,
totalCount: 0,
});
//飞手列表
const getFlyerList = (query?: flyerListParameters) => {
FlyerCenterAPI.getBackListPilot({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
...query,
}).then(({ result }) => {
pagination.totalCount = result.totalCount;
setTableData(result.list || []);
setPagination(pagination);
});
};
//飞手能力列表
const getAbilityList = () => {
FlyerCenterAPI.getAbilityList().then(({ result }) => {
searchColumns[2].options = (result || []).map((v) => ({
id: v.abilityId,
name: v.abilityName,
}));
setSearchColumns([...searchColumns]);
});
};
//分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
pagination.pageSize = pageSize;
getFlyerList(query);
};
//筛选成功
const searchSuccess = (value: flyerListParameters) => {
pagination.pageNo = 1;
pagination.pageSize = 10;
setQuery({ ...value, areaNumber: value.areaNumber ? value.areaNumber[1] : undefined });
getFlyerList({ ...value, areaNumber: value.areaNumber ? value.areaNumber[1] : undefined });
};
//获取地域数据
const getSecondDistrictInfo = () => {
CommonAPI.getSecondDistrictInfo().then(({ result }) => {
const covertLocationData: any = (list: locationType) => {
return list.map((v) => ({
label: v.name,
value: v.id,
children: v.childInfo ? covertLocationData(v.childInfo) : [],
}));
};
searchColumns[3].options = covertLocationData(result);
setSearchColumns([...searchColumns]);
});
};
useEffect(() => {
getFlyerList();
getAbilityList();
getSecondDistrictInfo();
}, []);
return (
<div className='flyer-list'>
<SearchBox search={searchColumns} />
<Table bordered columns={tableColumns} />
<SearchBox search={searchColumns} searchData={searchSuccess} />
<Table
bordered
columns={tableColumns}
dataSource={tableData}
rowKey='id'
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
current: pagination.pageNo,
showSizeChanger: true,
showQuickJumper: true,
onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
/>
</div>
);
};
......
......@@ -20,7 +20,13 @@ export const authRouterList = async () => {
const getRouteList = (data: RouteObjectType[]) => {
return data.reduce((pre: RouteObjectType[], cur) => {
const Obj: RouteObjectType = { ...cur };
if (ids.includes(Obj.meta.id) || Obj.meta.hidden) {
if (
ids.includes(Obj.meta.id) ||
Obj.meta.hidden ||
['/customManage/customVerification', '/flyerCenter', '/flyerCenter/flyerList'].includes(
Obj.path as string,
)
) {
if (Obj.children) {
Obj.children = [...getRouteList(Obj.children)];
}
......
......@@ -986,7 +986,7 @@ export const routerList: Array<RouteObjectType> = [
errorElement: <ErrorPage />,
meta: {
id: 1510,
title: '飞手列表',
title: '飞手管理',
icon: <UserOutlined />,
},
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论