提交 dd4cfc9f 作者: 翁进城
...@@ -8,6 +8,7 @@ import { CouponManageAPI } from './modules/couponManage'; ...@@ -8,6 +8,7 @@ import { CouponManageAPI } from './modules/couponManage';
import { MakeManageAPI } from './modules/makeManage'; import { MakeManageAPI } from './modules/makeManage';
import { CategoryManageAPI } from './modules/categoryManage'; import { CategoryManageAPI } from './modules/categoryManage';
import { SystemManageAPI } from './modules/systemManage'; import { SystemManageAPI } from './modules/systemManage';
import { CustomManageAPI } from './modules/customManage';
export { export {
CommonAPI, CommonAPI,
...@@ -20,4 +21,5 @@ export { ...@@ -20,4 +21,5 @@ export {
MakeManageAPI, MakeManageAPI,
CategoryManageAPI, CategoryManageAPI,
SystemManageAPI, SystemManageAPI,
CustomManageAPI,
}; };
import { InterListFunction } from '~/api/interface';
// 客户列表
export type listAppUserType = InterListFunction<
{
companyAuthStatus?: number;
endTime?: string;
keyword?: string;
phoneNum?: string;
startTime?: string;
},
{
id: number;
accountType: number;
uid: string;
accountNo: null;
phoneNum: string;
userName: null;
nickName: string;
userImg: string;
userSex: number;
email: null;
source: null;
accountStatus: number;
remark: null;
portType: number;
createTime: string;
companyAuthStatus: number;
cooperationTagId: null;
companyName: null;
tagName: null;
}
>;
import axios from '../request';
import { listAppUserType } from '~/api/interface/customManageType';
export class CustomManageAPI {
// 客户列表
static listAppUser: listAppUserType = (params) =>
axios.post('/userapp/user-account/listAppUser', params);
}
import { useState } from 'react'; import { useEffect, useState } from 'react';
import SearchBox from '~/components/search-box'; import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd'; import { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal'; import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal';
import { InterListType, InterReqType } from '~/api/interface';
import { listAppUserType } from '~/api/interface/customManageType';
import { CustomManageAPI } from '~/api';
// 表格数据类型 // 表格数据类型
type TableType = any; type TableType = InterListType<listAppUserType>;
// 请求数据的类型
type ReqType = InterReqType<listAppUserType>;
// 搜索表单的数据
let query: ReqType = {};
//来源列表
const portTypeList = [
{ value: 100, label: '自然流' },
{ value: 200, label: '海报' },
{ value: 300, label: '抖音' },
{ value: 400, label: '公众号' },
{ value: 500, label: '社群' },
{ value: 600, label: '招投标' },
];
function CustomListView() { function CustomListView() {
// 是否打开变更弹窗 // 是否打开变更弹窗
const [isChangeVisModal, setIsChangeVisModal] = useState<boolean>(false); const [isChangeVisModal, setIsChangeVisModal] = useState<boolean>(false);
// 表格分页配置 // 表格分页配置
const [pagination] = useState({ const [pagination, setPagination] = useState({
total: 0, total: 0,
pageSize: 10, pageSize: 10,
current: 1, current: 1,
totalPage: 0, totalPage: 0,
}); });
// 表格数据 // 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]); const [tableData, setTableData] = useState<TableType>([]);
// 需要编辑的数据 // 需要编辑的数据
const [editData] = useState<TableType[0]>(); const [editData] = useState<TableType[0]>();
// 加载列表
const getTableList = async (value = {}) => {
// 只需要修改这个地方的接口即可
const res = await CustomManageAPI.listAppUser({
pageNo: pagination.current,
pageSize: pagination.pageSize,
...value,
...query,
});
if (res && res.code === '200') {
const { list, pageNo, totalCount, pageSize, totalPage } = res.result; // 解构
setPagination({
total: totalCount,
current: pageNo,
pageSize,
totalPage,
});
setTableData(list);
// console.log('加载列表 --->', list);
}
};
// 翻页
const paginationChange = (pageNo: number, pageSize: number) => {
getTableList({ pageNo, pageSize }).then();
};
// 表单提交
const onFinish = (data: ReqType) => {
pagination.current = 1;
query = data;
getTableList(data).then();
};
// componentDidMount
useEffect(() => {
query = {};
getTableList().then();
}, []);
// 表格结构 // 表格结构
const columns: ColumnsType<TableType[0]> = [ const columns: ColumnsType<TableType[0]> = [
{ {
title: '用户UID', title: '用户UID',
dataIndex: 'userName', dataIndex: 'uid',
align: 'center', align: 'center',
render: (_text, _record) => `--`, width: '100px',
render: (text) => `UID${text}`,
}, },
{ {
title: '用户名称', title: '用户名称',
dataIndex: 'userName', dataIndex: 'userName',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (text, record) => text || record.nickName,
}, },
{ {
title: '手机号', title: '手机号',
dataIndex: 'userName', dataIndex: 'phoneNum',
align: 'center', align: 'center',
render: (_text, _record) => `--`,
}, },
{ {
title: '认证企业', title: '认证企业',
dataIndex: 'userName', dataIndex: 'companyName',
align: 'center', align: 'center',
render: (_text, _record) => `--`,
}, },
{ {
title: '企业认证', title: '企业认证',
dataIndex: 'userName', dataIndex: 'companyAuthStatus',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (text) => (text === 0 ? '未认证' : '已认证'),
}, },
{ {
title: '电子签约认证', title: '电子签约认证',
dataIndex: 'userName', dataIndex: 'userName',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (_text) => `未认证`,
}, },
{ {
title: '用户来源', title: '用户来源',
dataIndex: 'userName', dataIndex: 'portType',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (text) => portTypeList.find((i) => i.value === text)?.label || text,
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'userName', dataIndex: 'createTime',
align: 'center', align: 'center',
render: (_text, _record) => `--`,
}, },
{ {
title: '账号类型', title: '账号类型',
dataIndex: 'userName', dataIndex: 'phoneNum',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (text) => (text ? '普通用户' : '游客用户'),
}, },
{ {
title: '渠道等级', title: '渠道等级',
dataIndex: 'remark', dataIndex: 'cooperationTagId',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (text) => text,
}, },
{ {
title: '上级推荐人', title: '上级推荐人',
dataIndex: 'remark', dataIndex: 'remark',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (_text) => `--`,
}, },
{ {
title: '推荐伙伴', title: '推荐伙伴',
dataIndex: 'remark', dataIndex: 'remark',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (_text) => `--`,
}, },
{ {
title: '相关运营', title: '相关运营',
dataIndex: 'remark', dataIndex: 'remark',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (_text) => `--`,
}, },
{ {
title: '相关销售', title: '相关销售',
dataIndex: 'remark', dataIndex: 'remark',
align: 'center', align: 'center',
render: (_text, _record) => `--`, render: (_text) => `--`,
}, },
{ {
title: '操作', title: '操作',
...@@ -113,7 +163,7 @@ function CustomListView() { ...@@ -113,7 +163,7 @@ function CustomListView() {
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
width: '150px', width: '150px',
render: (_text, _record) => ( render: (_text) => (
<> <>
<Button <Button
type={'link'} type={'link'}
...@@ -151,14 +201,7 @@ function CustomListView() { ...@@ -151,14 +201,7 @@ function CustomListView() {
name: 'form', name: 'form',
type: 'Select', type: 'Select',
placeholder: '请选择相关来源', placeholder: '请选择相关来源',
options: [ options: portTypeList,
{ value: 1, label: '自然流' },
{ value: 2, label: '海报' },
{ value: 3, label: '抖音' },
{ value: 4, label: '公众号' },
{ value: 5, label: '社群' },
{ value: 6, label: '招投标' },
],
}, },
{ {
label: '创建时间', label: '创建时间',
...@@ -187,7 +230,7 @@ function CustomListView() { ...@@ -187,7 +230,7 @@ function CustomListView() {
], ],
}, },
]} ]}
searchData={(e: any) => console.log('提交数据 --->', e)} searchData={onFinish}
/> />
<Table <Table
size='small' size='small'
...@@ -201,8 +244,7 @@ function CustomListView() { ...@@ -201,8 +244,7 @@ function CustomListView() {
current: pagination.current, current: pagination.current,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
// onChange: (page: number, pageSize: number) => onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
// paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`, showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}} }}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }} // rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
......
...@@ -18,7 +18,6 @@ import { ...@@ -18,7 +18,6 @@ import {
RedEnvelopeOutlined, RedEnvelopeOutlined,
SettingOutlined, SettingOutlined,
UserOutlined, UserOutlined,
SisternodeOutlined,
SendOutlined, SendOutlined,
RocketOutlined, RocketOutlined,
AppstoreAddOutlined, AppstoreAddOutlined,
...@@ -343,6 +342,82 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -343,6 +342,82 @@ export const routerList: Array<RouteObjectType> = [
], ],
}, },
{ {
path: '/categoryManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
meta: {
id: 18000,
icon: <ReconciliationOutlined />,
title: '分类管理',
},
children: [
{
path: '/categoryManage/jobServicesCategory/1',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18100,
title: '作业服务分类',
icon: <SendOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/2',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18200,
title: '设备租赁分类',
icon: <RocketOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/3',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18300,
title: '飞手培训分类',
icon: <AppstoreAddOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/4',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18400,
title: '产品商城分类',
icon: <AppstoreOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/0',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18500,
title: '通用分类',
icon: <CoffeeOutlined />,
},
},
{
path: '/categoryManage/detail/:id',
element: withLoadingComponent(<CategoryDetail />),
meta: {
id: 18600,
title: '分类详情',
icon: '',
hidden: true,
},
},
{
path: '/categoryManage/DirectoryManage',
element: withLoadingComponent(<DirectoryManage />),
meta: {
id: 18700,
title: '目录管理',
icon: <UnorderedListOutlined />,
},
},
],
},
{
path: '/customManage', path: '/customManage',
element: <LayoutView />, element: <LayoutView />,
errorElement: <ErrorPage />, errorElement: <ErrorPage />,
...@@ -550,77 +625,22 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -550,77 +625,22 @@ export const routerList: Array<RouteObjectType> = [
], ],
}, },
{ {
path: '/categoryManage', path: '/systemManage',
element: <LayoutView />, element: <LayoutView />,
errorElement: <ErrorPage />, errorElement: <ErrorPage />,
meta: { meta: {
id: 18000, id: 28000,
icon: <ReconciliationOutlined />, icon: <SettingOutlined />,
title: '分类管理', title: '系统管理',
}, },
children: [ children: [
{ {
path: '/categoryManage/jobServicesCategory/1', path: '/systemManage/accountManage',
element: withLoadingComponent(<CategoryManage />), element: withLoadingComponent(<AccountManageView />),
meta: {
id: 18100,
title: '作业服务分类',
icon: <SendOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/2',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18200,
title: '设备租赁分类',
icon: <RocketOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/3',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18300,
title: '飞手培训分类',
icon: <AppstoreAddOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/4',
element: withLoadingComponent(<CategoryManage />),
meta: {
id: 18400,
title: '产品商城分类',
icon: <AppstoreOutlined />,
},
},
{
path: '/categoryManage/jobServicesCategory/0',
element: withLoadingComponent(<CategoryManage />),
meta: { meta: {
id: 18500, id: 28100,
title: '通用分类', title: '账号管理',
icon: <CoffeeOutlined />, icon: <UserOutlined />,
},
},
{
path: '/categoryManage/detail/:id',
element: withLoadingComponent(<CategoryDetail />),
meta: {
id: 18600,
title: '分类详情',
icon: '',
hidden: true,
},
},
{
path: '/categoryManage/DirectoryManage',
element: withLoadingComponent(<DirectoryManage />),
meta: {
id: 18700,
title: '目录管理',
icon: <UnorderedListOutlined />,
}, },
}, },
], ],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论