index.tsx 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import {
  2. PageContainer,
  3. ProDescriptionsItemProps,
  4. ProTable,
  5. } from '@ant-design/pro-components';
  6. import { Divider } from 'antd';
  7. import React, { useState } from 'react';
  8. import UpdateForm from './components/UpdateForm';
  9. const SubAccountManage: React.FC = () => {
  10. const [childAccountData, setChildAccountData] = useState<
  11. API.ChildAccountTableRow[]
  12. >([
  13. {
  14. index: 1,
  15. contactName: '子账号',
  16. contactMobile: '180****1123',
  17. updateBy: 'zd_001',
  18. updateTime: '2025-02.13 15:36:49',
  19. wechat: 'beautiful_world',
  20. receiveStatus: false,
  21. status: false,
  22. remark: '这是备注',
  23. },
  24. ]);
  25. const columns: ProDescriptionsItemProps<API.ChildAccountTableRow>[] = [
  26. {
  27. title: '序号',
  28. dataIndex: 'index',
  29. },
  30. {
  31. title: '姓名',
  32. dataIndex: 'contactName',
  33. },
  34. {
  35. title: '手机号',
  36. dataIndex: 'contactMobile',
  37. },
  38. {
  39. title: '创建人',
  40. dataIndex: 'updateBy',
  41. },
  42. {
  43. title: '创建时间',
  44. dataIndex: 'updateTime',
  45. },
  46. {
  47. title: '微信号',
  48. dataIndex: 'wechat',
  49. },
  50. {
  51. title: '接单状态',
  52. dataIndex: 'receiveStatus',
  53. valueEnum: {
  54. 1: { text: '开启', status: 'Open' },
  55. 0: { text: '关闭', status: 'Closed' },
  56. },
  57. },
  58. {
  59. title: '当前状态',
  60. dataIndex: 'status',
  61. valueEnum: {
  62. 1: { text: '启用', status: 'Open' },
  63. 0: { text: '禁用', status: 'Closed' },
  64. },
  65. },
  66. {
  67. title: '操作',
  68. dataIndex: 'option',
  69. valueType: 'option',
  70. render: (_, record) => {
  71. return (
  72. <>
  73. <UpdateForm />
  74. <Divider type="vertical"></Divider>
  75. <a>修改状态</a>
  76. </>
  77. );
  78. },
  79. },
  80. ];
  81. return (
  82. <PageContainer title="子账号管理">
  83. <ProTable<API.ChildAccountTableRow>
  84. headerTitle="子账号列表"
  85. rowKey="index"
  86. dataSource={childAccountData}
  87. columns={columns}
  88. search={false}
  89. ></ProTable>
  90. </PageContainer>
  91. );
  92. };
  93. export default SubAccountManage;