feat:
This commit is contained in:
95
src/pages/table-list/anchor-group/index.tsx
Normal file
95
src/pages/table-list/anchor-group/index.tsx
Normal file
@ -0,0 +1,95 @@
|
||||
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
||||
import { PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useRef } from 'react';
|
||||
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { getAnchorGroupList } from '@/services/list';
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '已申请', value: 0 },
|
||||
{ label: '已申请未进群 ', value: 1 },
|
||||
{ label: '已进群 ', value: 2 },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const columns: ProColumns<API.AnchorGroupListItem>[] = [
|
||||
{
|
||||
title: '主播昵称',
|
||||
dataIndex: 'nickName',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '主播ID',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '主播手机号',
|
||||
dataIndex: 'userPhone',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '群ID',
|
||||
dataIndex: 'blGroupId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '群名称',
|
||||
dataIndex: 'imGroupNick',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '加群状态',
|
||||
dataIndex: 'status',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
return STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '绑定时间',
|
||||
dataIndex: 'created',
|
||||
valueType: 'dateTime',
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
// search: {
|
||||
// transform: (created: string) => dayjs(created).valueOf().toString(),
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '绑定人',
|
||||
dataIndex: 'creator',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.AnchorGroupListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getAnchorGroupList}
|
||||
columns={columns}
|
||||
/>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
147
src/pages/table-list/anchor/index.tsx
Normal file
147
src/pages/table-list/anchor/index.tsx
Normal file
@ -0,0 +1,147 @@
|
||||
import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProFormSelect, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import { CITY_CODE_TO_NAME_MAP, CITY_OPTIONS } from '@/constants/city';
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { getAnchorList, updateAnchorInfo } from '@/services/list';
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '封禁', value: 1 },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.AnchorListItem>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const columns: ProColumns<API.AnchorListItem>[] = [
|
||||
{
|
||||
title: '主播昵称',
|
||||
dataIndex: 'nickName',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '主播ID',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '主播手机号',
|
||||
dataIndex: 'userPhone',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '注册时间',
|
||||
dataIndex: 'created',
|
||||
valueType: 'dateTime',
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
// search: {
|
||||
// transform: (created: string) => dayjs(created).valueOf().toString(),
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '最后登录时间',
|
||||
dataIndex: 'lastLoginDate',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '账号状态',
|
||||
dataIndex: 'status',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
return STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '城市',
|
||||
dataIndex: 'city',
|
||||
valueType: 'textarea',
|
||||
renderText(cityCode: string) {
|
||||
return CITY_CODE_TO_NAME_MAP.get(cityCode);
|
||||
},
|
||||
renderFormItem() {
|
||||
return (
|
||||
<Select
|
||||
showSearch
|
||||
allowClear
|
||||
options={CITY_OPTIONS}
|
||||
filterOption={(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
render: (_, record) => (
|
||||
<a
|
||||
key="config"
|
||||
onClick={() => {
|
||||
handleUpdateModalOpen(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</a>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.AnchorListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getAnchorList}
|
||||
columns={columns}
|
||||
/>
|
||||
<ModalForm
|
||||
title="更新主播信息"
|
||||
width="400px"
|
||||
formRef={formRef}
|
||||
open={updateModalOpen}
|
||||
onOpenChange={handleUpdateModalOpen}
|
||||
onFinish={async data => {
|
||||
const params: API.UpdateAnchorParams = {
|
||||
userId: currentRow!.userId,
|
||||
status: data.status,
|
||||
};
|
||||
console.log('update confirm', data, params);
|
||||
try {
|
||||
await updateAnchorInfo(params);
|
||||
actionRef.current?.reload();
|
||||
formRef.current?.resetFields();
|
||||
} catch (e) {}
|
||||
handleUpdateModalOpen(false);
|
||||
}}
|
||||
>
|
||||
<ProFormSelect
|
||||
name="status"
|
||||
label="账号状态"
|
||||
options={STATUS_OPTIONS}
|
||||
rules={[{ required: true, message: '必填项' }]}
|
||||
/>
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
228
src/pages/table-list/declaration/index.tsx
Normal file
228
src/pages/table-list/declaration/index.tsx
Normal file
@ -0,0 +1,228 @@
|
||||
import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProFormSelect, ProFormTextArea, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import { CITY_CODE_TO_NAME_MAP, CITY_OPTIONS } from '@/constants/city';
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { DeclarationType } from '@/constants/product';
|
||||
import { getDeclarationList, updateDeclarationInfo } from '@/services/list';
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '待处理', value: 0 },
|
||||
{ label: '已处理', value: 1 },
|
||||
];
|
||||
|
||||
const TYPE_OPTIONS = [
|
||||
{ label: '直接联系', value: DeclarationType.Direct },
|
||||
{ label: '客服联系', value: DeclarationType.CS },
|
||||
];
|
||||
|
||||
const WE_COM_OPTIONS = [
|
||||
{ label: '未加', value: 0 },
|
||||
{ label: '已加', value: 1 },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.DeclarationListItem>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const columns: ProColumns<API.DeclarationListItem>[] = [
|
||||
{
|
||||
title: '主播昵称',
|
||||
dataIndex: 'nickName',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '主播ID',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '主播手机号',
|
||||
dataIndex: 'userPhone',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '通告标题',
|
||||
dataIndex: 'title',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '通告ID',
|
||||
dataIndex: 'jobId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '解锁时间',
|
||||
dataIndex: 'useDate',
|
||||
valueType: 'dateTime',
|
||||
renderText(time: string) {
|
||||
return dayjs(Number(time)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '职位发布人昵称',
|
||||
dataIndex: 'publisher',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '职位发布人ID',
|
||||
dataIndex: 'blPublisherId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '职位发布人微信',
|
||||
dataIndex: 'publisherAcctNo',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '报单类型',
|
||||
dataIndex: 'type',
|
||||
valueType: 'textarea',
|
||||
renderText(type: number) {
|
||||
return TYPE_OPTIONS.find(option => option.value === type)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select allowClear options={TYPE_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '报单时间',
|
||||
dataIndex: 'declarationDate',
|
||||
valueType: 'dateTime',
|
||||
renderText(time: string) {
|
||||
return dayjs(Number(time)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '报单处理状态',
|
||||
dataIndex: 'declaredStatus',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
const declaredStatus = Number(status);
|
||||
return STATUS_OPTIONS.find(option => option.value === declaredStatus)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '报单处理时间',
|
||||
dataIndex: 'declaredDate',
|
||||
valueType: 'dateTime',
|
||||
renderText(time: string) {
|
||||
return dayjs(Number(time)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '是否加企微',
|
||||
dataIndex: 'weComStatus',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
return WE_COM_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={WE_COM_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '通告所属城市',
|
||||
dataIndex: 'jobCityCode',
|
||||
valueType: 'textarea',
|
||||
renderText(cityCode: string) {
|
||||
return CITY_CODE_TO_NAME_MAP.get(cityCode);
|
||||
},
|
||||
renderFormItem() {
|
||||
return (
|
||||
<Select
|
||||
showSearch
|
||||
allowClear
|
||||
options={CITY_OPTIONS}
|
||||
filterOption={(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '报单备注信息',
|
||||
dataIndex: 'declaredMark',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<a
|
||||
key="config"
|
||||
onClick={() => {
|
||||
handleUpdateModalOpen(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</a>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.DeclarationListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getDeclarationList}
|
||||
columns={columns}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
<ModalForm
|
||||
title="更新报单信息"
|
||||
width="400px"
|
||||
formRef={formRef}
|
||||
open={updateModalOpen}
|
||||
onOpenChange={handleUpdateModalOpen}
|
||||
onFinish={async data => {
|
||||
const params: API.UpdateDeclarationParams = {
|
||||
id: currentRow!.id,
|
||||
weComStatus: data.weComStatus,
|
||||
};
|
||||
console.log('update confirm', data, params);
|
||||
try {
|
||||
await updateDeclarationInfo(params);
|
||||
actionRef.current?.reload();
|
||||
formRef.current?.resetFields();
|
||||
} catch (e) {}
|
||||
handleUpdateModalOpen(false);
|
||||
}}
|
||||
>
|
||||
<ProFormSelect
|
||||
name="weComStatus"
|
||||
label="是否加企微"
|
||||
options={WE_COM_OPTIONS}
|
||||
rules={[{ required: true, message: '必填项' }]}
|
||||
/>
|
||||
<ProFormTextArea name="declaredMark" label="报单备注" placeholder="输入备注信息" />
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
131
src/pages/table-list/group/index.tsx
Normal file
131
src/pages/table-list/group/index.tsx
Normal file
@ -0,0 +1,131 @@
|
||||
import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProFormSelect, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import { CITY_CODE_TO_NAME_MAP, CITY_OPTIONS } from '@/constants/city';
|
||||
import { getGroupList, updateGroupInfo } from '@/services/list';
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '暂停', value: 1 },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.GroupListItem>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const columns: ProColumns<API.GroupListItem>[] = [
|
||||
{
|
||||
title: '群名称',
|
||||
dataIndex: 'imGroupNick',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '群ID',
|
||||
dataIndex: 'id',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '所属城市',
|
||||
dataIndex: 'city',
|
||||
valueType: 'textarea',
|
||||
renderText(cityCode: string) {
|
||||
return CITY_CODE_TO_NAME_MAP.get(cityCode);
|
||||
},
|
||||
renderFormItem() {
|
||||
return (
|
||||
<Select
|
||||
showSearch
|
||||
allowClear
|
||||
options={CITY_OPTIONS}
|
||||
filterOption={(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '群状态',
|
||||
dataIndex: 'disable',
|
||||
valueType: 'textarea',
|
||||
renderText(disable: boolean) {
|
||||
return disable ? '暂停' : '正常';
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '机器人ID',
|
||||
dataIndex: 'robotId',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '机器人微信昵称',
|
||||
dataIndex: 'robotImNick',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '机器人微信账号',
|
||||
dataIndex: 'robotImNo',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
render: (_, record) => (
|
||||
<a
|
||||
key="config"
|
||||
onClick={() => {
|
||||
handleUpdateModalOpen(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</a>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.GroupListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getGroupList}
|
||||
columns={columns}
|
||||
/>
|
||||
<ModalForm
|
||||
title="更新群信息"
|
||||
width="400px"
|
||||
formRef={formRef}
|
||||
open={updateModalOpen}
|
||||
onOpenChange={handleUpdateModalOpen}
|
||||
onFinish={async formData => {
|
||||
const params: API.UpdateGroupParams = {
|
||||
id: currentRow!.id,
|
||||
city: formData.city?.value,
|
||||
disable: formData.disable,
|
||||
};
|
||||
console.log('update confirm', formData, params);
|
||||
try {
|
||||
await updateGroupInfo(params);
|
||||
actionRef.current?.reload();
|
||||
formRef.current?.resetFields();
|
||||
} catch (e) {}
|
||||
handleUpdateModalOpen(false);
|
||||
}}
|
||||
>
|
||||
<ProFormSelect.SearchSelect name="city" mode="single" label="所属城市" options={CITY_OPTIONS} />
|
||||
<ProFormSelect name="disable" label="群状态" options={STATUS_OPTIONS} />
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
209
src/pages/table-list/job/index.tsx
Normal file
209
src/pages/table-list/job/index.tsx
Normal file
@ -0,0 +1,209 @@
|
||||
import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProFormSelect, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import { CITY_CODE_TO_NAME_MAP, CITY_OPTIONS } from '@/constants/city';
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { getJobList, updateJobInfo } from '@/services/list';
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '暂停', value: 1 },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.JobListItem>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const columns: ProColumns<API.JobListItem>[] = [
|
||||
{
|
||||
title: '职位名称',
|
||||
dataIndex: 'title',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '职位描述',
|
||||
dataIndex: 'sourceText',
|
||||
valueType: 'textarea',
|
||||
colSize: 2,
|
||||
search: false,
|
||||
copyable: true,
|
||||
renderText(sourceText: string) {
|
||||
return sourceText?.substring(0, 30);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '职位ID',
|
||||
dataIndex: 'jobId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '城市',
|
||||
dataIndex: 'cityCode',
|
||||
valueType: 'textarea',
|
||||
renderText(cityCode: string) {
|
||||
return CITY_CODE_TO_NAME_MAP.get(cityCode);
|
||||
},
|
||||
renderFormItem() {
|
||||
return (
|
||||
<Select
|
||||
showSearch
|
||||
allowClear
|
||||
options={CITY_OPTIONS}
|
||||
filterOption={(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '所在群名称',
|
||||
dataIndex: 'imGroupNick',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '群ID',
|
||||
dataIndex: 'blGroupId',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '发布人昵称',
|
||||
dataIndex: 'publisher',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '发布人ID',
|
||||
dataIndex: 'blPublisherId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '发布人微信账号',
|
||||
dataIndex: 'publisherAcctNo',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '发布群数量',
|
||||
dataIndex: 'relateGroupCount',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '机器人ID',
|
||||
dataIndex: 'robotId',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '机器人微信昵称',
|
||||
dataIndex: 'robotImNick',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '机器人微信账号',
|
||||
dataIndex: 'robotImNo',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '通告状态',
|
||||
dataIndex: 'disable',
|
||||
valueType: 'textarea',
|
||||
renderText(disable: boolean) {
|
||||
return disable ? '暂停' : '正常';
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '小程序用户 id',
|
||||
dataIndex: 'appUid',
|
||||
valueType: 'textarea',
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'created',
|
||||
valueType: 'dateTime',
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'updated',
|
||||
valueType: 'dateTime',
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<a
|
||||
key="config"
|
||||
onClick={() => {
|
||||
handleUpdateModalOpen(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</a>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.JobListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getJobList}
|
||||
columns={columns}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
<ModalForm
|
||||
title="更新通告信息"
|
||||
width="400px"
|
||||
formRef={formRef}
|
||||
open={updateModalOpen}
|
||||
onOpenChange={handleUpdateModalOpen}
|
||||
onFinish={async formData => {
|
||||
const params: API.UpdateJobParams = {
|
||||
id: currentRow!.id,
|
||||
jobId: currentRow!.jobId,
|
||||
disable: Number(formData.disable) !== 0,
|
||||
};
|
||||
console.log('update confirm', formData, params);
|
||||
try {
|
||||
await updateJobInfo(params);
|
||||
actionRef.current?.reload();
|
||||
formRef.current?.resetFields();
|
||||
} catch (e) {}
|
||||
handleUpdateModalOpen(false);
|
||||
}}
|
||||
>
|
||||
<ProFormSelect name="disable" label="通告状态" options={STATUS_OPTIONS} />
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
198
src/pages/table-list/material/index.tsx
Normal file
198
src/pages/table-list/material/index.tsx
Normal file
@ -0,0 +1,198 @@
|
||||
import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProFormSelect, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import Previewer from '@/components/previewer';
|
||||
import { CITY_CODE_TO_NAME_MAP, CITY_OPTIONS } from '@/constants/city';
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { getMaterialList, updateMaterialInfo } from '@/services/list';
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '开放', value: true },
|
||||
{ label: '封禁', value: false },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.MaterialListItem>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const columns: ProColumns<API.MaterialListItem>[] = [
|
||||
{
|
||||
title: '视频',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
search: false,
|
||||
render(_dom, entity) {
|
||||
return <Previewer videos={entity.materialVideoInfoList} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '主播ID',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '模卡昵称',
|
||||
dataIndex: 'name',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '主播昵称',
|
||||
dataIndex: 'nickname',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '自身优势',
|
||||
dataIndex: 'advantages',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '模卡状态',
|
||||
dataIndex: 'isOpen',
|
||||
valueType: 'textarea',
|
||||
renderText(status: boolean) {
|
||||
return STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '主播模卡状态',
|
||||
dataIndex: 'userOpen',
|
||||
valueType: 'textarea',
|
||||
renderText(status: boolean) {
|
||||
return STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '后台模卡状态',
|
||||
dataIndex: 'adminOpen',
|
||||
valueType: 'textarea',
|
||||
renderText(status: boolean) {
|
||||
return STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '意向城市',
|
||||
dataIndex: 'cityCode',
|
||||
valueType: 'textarea',
|
||||
renderText(cityCode: string) {
|
||||
return CITY_CODE_TO_NAME_MAP.get(cityCode);
|
||||
},
|
||||
renderFormItem() {
|
||||
return (
|
||||
<Select
|
||||
showSearch
|
||||
allowClear
|
||||
options={CITY_OPTIONS}
|
||||
filterOption={(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '播过的品类',
|
||||
dataIndex: 'workedSecCategoryStr',
|
||||
valueType: 'textarea',
|
||||
search: false,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'created',
|
||||
valueType: 'dateTime',
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updated',
|
||||
valueType: 'dateTime',
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<a
|
||||
key="config"
|
||||
onClick={() => {
|
||||
handleUpdateModalOpen(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</a>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.MaterialListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getMaterialList}
|
||||
columns={columns}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
<ModalForm
|
||||
title="更新模卡信息"
|
||||
width="400px"
|
||||
formRef={formRef}
|
||||
open={updateModalOpen}
|
||||
onOpenChange={handleUpdateModalOpen}
|
||||
onFinish={async data => {
|
||||
const params: API.UpdateMaterialParams = {
|
||||
id: currentRow!.id,
|
||||
adminOpen: Number(data.adminOpen),
|
||||
};
|
||||
console.log('update confirm', data, params);
|
||||
try {
|
||||
await updateMaterialInfo(params);
|
||||
actionRef.current?.reload();
|
||||
formRef.current?.resetFields();
|
||||
} catch (e) {}
|
||||
handleUpdateModalOpen(false);
|
||||
}}
|
||||
>
|
||||
<ProFormSelect
|
||||
name="adminOpen"
|
||||
label="后台模卡状态"
|
||||
options={STATUS_OPTIONS as any}
|
||||
rules={[{ required: true, message: '必填项' }]}
|
||||
/>
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
195
src/pages/table-list/publisher/index.tsx
Normal file
195
src/pages/table-list/publisher/index.tsx
Normal file
@ -0,0 +1,195 @@
|
||||
import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProFormSelect, ProFormText, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
import { Select } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { getPublisherList, updatePublisherInfo } from '@/services/list';
|
||||
|
||||
const WX_STATUS_OPTIONS = [
|
||||
{ label: '为空', value: 0 },
|
||||
{ label: '不为空', value: 1 },
|
||||
];
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '暂停', value: 1 },
|
||||
];
|
||||
|
||||
const ADD_WX_STATUS_OPTIONS = [
|
||||
{ label: '待申请', value: 0 },
|
||||
{ label: '已申请', value: 1 },
|
||||
{ label: '不可添加', value: 2 },
|
||||
{ label: '被封号', value: 3 },
|
||||
];
|
||||
|
||||
const HAS_DECLARE_OPTIONS = [
|
||||
{ label: '有报单', value: true },
|
||||
{ label: '无报单', value: false },
|
||||
];
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.PublisherListItem>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const columns: ProColumns<API.PublisherListItem>[] = [
|
||||
{
|
||||
title: '发布人昵称',
|
||||
dataIndex: 'publisher',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '发布人ID',
|
||||
dataIndex: 'blPublisherId',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '账号状态',
|
||||
dataIndex: 'status',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
return STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '发布人微信账号',
|
||||
dataIndex: 'publisherAcctNo',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '发布人微信状态',
|
||||
dataIndex: 'publisherAcctStatus',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
const publisherAcctStatus = Number(status);
|
||||
return WX_STATUS_OPTIONS.find(option => option.value === publisherAcctStatus)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={WX_STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否申请好友',
|
||||
dataIndex: 'addAcctStatus',
|
||||
valueType: 'textarea',
|
||||
renderText(status: number) {
|
||||
return ADD_WX_STATUS_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={ADD_WX_STATUS_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '机器人微信昵称',
|
||||
dataIndex: 'robotImNick',
|
||||
valueType: 'textarea',
|
||||
},
|
||||
{
|
||||
title: '来源群',
|
||||
dataIndex: 'imGroupNick',
|
||||
valueType: 'textarea',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: '是否有报单',
|
||||
dataIndex: 'hasDeclareOrder',
|
||||
hideInTable: true,
|
||||
renderText(status: boolean) {
|
||||
return HAS_DECLARE_OPTIONS.find(option => option.value === status)?.label;
|
||||
},
|
||||
renderFormItem() {
|
||||
return <Select showSearch allowClear options={HAS_DECLARE_OPTIONS} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '最新报单时间',
|
||||
dataIndex: 'declareTime',
|
||||
valueType: 'dateTime',
|
||||
sorter: true,
|
||||
renderText(created: string) {
|
||||
return created ? dayjs(Number(created)).format(TIME_FORMAT) : '';
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '小程序用户 id',
|
||||
dataIndex: 'appUid',
|
||||
valueType: 'textarea',
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'created',
|
||||
valueType: 'dateTime',
|
||||
sorter: true,
|
||||
renderText(created: string) {
|
||||
return dayjs(Number(created)).format(TIME_FORMAT);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
render: (_, record) => (
|
||||
<a
|
||||
key="config"
|
||||
onClick={() => {
|
||||
handleUpdateModalOpen(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</a>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<API.PublisherListItem, API.PageParams>
|
||||
headerTitle="查询表格"
|
||||
actionRef={actionRef}
|
||||
rowKey="key"
|
||||
search={{ labelWidth: 120, collapsed: false, collapseRender: false }}
|
||||
request={getPublisherList}
|
||||
columns={columns}
|
||||
/>
|
||||
<ModalForm
|
||||
title="更新发布人信息"
|
||||
width="400px"
|
||||
formRef={formRef}
|
||||
open={updateModalOpen}
|
||||
onOpenChange={handleUpdateModalOpen}
|
||||
onFinish={async data => {
|
||||
const params: API.UpdatePublisherParams = {
|
||||
blPublisherId: currentRow!.blPublisherId,
|
||||
publisherAcctNo: data.publisherAcctNo,
|
||||
status: data.status,
|
||||
addAcctStatus: data.addAcctStatus,
|
||||
};
|
||||
console.log('update confirm', data, params);
|
||||
try {
|
||||
await updatePublisherInfo(params);
|
||||
actionRef.current?.reload();
|
||||
formRef.current?.resetFields();
|
||||
} catch (e) {}
|
||||
handleUpdateModalOpen(false);
|
||||
}}
|
||||
>
|
||||
<ProFormText width="md" name="publisherAcctNo" label="发布人微信账号" />
|
||||
<ProFormSelect name="status" label="账号状态" options={STATUS_OPTIONS} />
|
||||
<ProFormSelect name="addAcctStatus" label="是否申请好友" options={ADD_WX_STATUS_OPTIONS} />
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default TableList;
|
||||
Reference in New Issue
Block a user