提交 ee1f7d4a 作者: ZhangLingKun

功能:系统设置-账号管理(别删)

上级 00f915ce
......@@ -8,6 +8,7 @@ import { CouponManageAPI } from './modules/couponManage';
import { MakeManageAPI } from './modules/makeManage';
import { CategoryManageAPI } from './modules/categoryManage';
import { SystemManageAPI } from './modules/systemManage';
import { CustomManageAPI } from './modules/customManage';
export {
CommonAPI,
......@@ -20,4 +21,5 @@ export {
MakeManageAPI,
CategoryManageAPI,
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 { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
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() {
// 是否打开变更弹窗
const [isChangeVisModal, setIsChangeVisModal] = useState<boolean>(false);
// 表格分页配置
const [pagination] = useState({
const [pagination, setPagination] = useState({
total: 0,
pageSize: 10,
current: 1,
totalPage: 0,
});
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
const [tableData, setTableData] = useState<TableType>([]);
// 需要编辑的数据
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]> = [
{
title: '用户UID',
dataIndex: 'userName',
dataIndex: 'uid',
align: 'center',
render: (_text, _record) => `--`,
width: '100px',
render: (text) => `UID${text}`,
},
{
title: '用户名称',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
render: (text, record) => text || record.nickName,
},
{
title: '手机号',
dataIndex: 'userName',
dataIndex: 'phoneNum',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '认证企业',
dataIndex: 'userName',
dataIndex: 'companyName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '企业认证',
dataIndex: 'userName',
dataIndex: 'companyAuthStatus',
align: 'center',
render: (_text, _record) => `--`,
render: (text) => (text === 0 ? '未认证' : '已认证'),
},
{
title: '电子签约认证',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
render: (_text) => `未认证`,
},
{
title: '用户来源',
dataIndex: 'userName',
dataIndex: 'portType',
align: 'center',
render: (_text, _record) => `--`,
render: (text) => portTypeList.find((i) => i.value === text)?.label || text,
},
{
title: '创建时间',
dataIndex: 'userName',
dataIndex: 'createTime',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '账号类型',
dataIndex: 'userName',
dataIndex: 'phoneNum',
align: 'center',
render: (_text, _record) => `--`,
render: (text) => (text ? '普通用户' : '游客用户'),
},
{
title: '渠道等级',
dataIndex: 'remark',
dataIndex: 'cooperationTagId',
align: 'center',
render: (_text, _record) => `--`,
render: (text) => text,
},
{
title: '上级推荐人',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
render: (_text) => `--`,
},
{
title: '推荐伙伴',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
render: (_text) => `--`,
},
{
title: '相关运营',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
render: (_text) => `--`,
},
{
title: '相关销售',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
render: (_text) => `--`,
},
{
title: '操作',
......@@ -113,7 +163,7 @@ function CustomListView() {
align: 'center',
fixed: 'right',
width: '150px',
render: (_text, _record) => (
render: (_text) => (
<>
<Button
type={'link'}
......@@ -151,14 +201,7 @@ function CustomListView() {
name: 'form',
type: 'Select',
placeholder: '请选择相关来源',
options: [
{ value: 1, label: '自然流' },
{ value: 2, label: '海报' },
{ value: 3, label: '抖音' },
{ value: 4, label: '公众号' },
{ value: 5, label: '社群' },
{ value: 6, label: '招投标' },
],
options: portTypeList,
},
{
label: '创建时间',
......@@ -187,7 +230,7 @@ function CustomListView() {
],
},
]}
searchData={(e: any) => console.log('提交数据 --->', e)}
searchData={onFinish}
/>
<Table
size='small'
......@@ -201,8 +244,7 @@ function CustomListView() {
current: pagination.current,
showSizeChanger: true,
showQuickJumper: true,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
......
......@@ -18,7 +18,6 @@ import {
RedEnvelopeOutlined,
SettingOutlined,
UserOutlined,
SisternodeOutlined,
SendOutlined,
RocketOutlined,
AppstoreAddOutlined,
......@@ -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',
element: <LayoutView />,
errorElement: <ErrorPage />,
......@@ -550,77 +625,22 @@ export const routerList: Array<RouteObjectType> = [
],
},
{
path: '/categoryManage',
path: '/systemManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
meta: {
id: 18000,
icon: <ReconciliationOutlined />,
title: '分类管理',
id: 28000,
icon: <SettingOutlined />,
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 />),
path: '/systemManage/accountManage',
element: withLoadingComponent(<AccountManageView />),
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 />,
id: 28100,
title: '账号管理',
icon: <UserOutlined />,
},
},
],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论