diff --git a/src/pages/System/SuperAdmin/AddSupderAdmin.tsx b/src/pages/System/SuperAdmin/AddSupderAdmin.tsx index 01a4e15..43fdaf3 100644 --- a/src/pages/System/SuperAdmin/AddSupderAdmin.tsx +++ b/src/pages/System/SuperAdmin/AddSupderAdmin.tsx @@ -26,7 +26,7 @@ const AddSupderAdmin = (props: PropTypes) => { const values = await form.validateFields(); const result = await addSupderAdminAPI(values); if (result.code === 200) { - message.success(`套餐${editRow?.id ? '修改' : '添加'}成功`); + message.success(`管理员${editRow?.id ? '修改' : '添加'}成功`); handleOnCancel(); tableRef.current?.reload(); } diff --git a/src/pages/System/SuperAdmin/index.tsx b/src/pages/System/SuperAdmin/index.tsx index 9679802..b9372d0 100644 --- a/src/pages/System/SuperAdmin/index.tsx +++ b/src/pages/System/SuperAdmin/index.tsx @@ -1,14 +1,15 @@ -import { getSupderAdminListAPI } from '@/services/system/supderAdmin'; +import { delSuperAdminAPI, getSupderAdminListAPI } from '@/services/system/supderAdmin'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; -import { Button } from 'antd'; +import { App, Button, message } from 'antd'; import { useRef, useState } from 'react'; import AddSupderAdmin from './AddSupderAdmin'; const Page = () => { + const { modal } = App.useApp(); const tableRef = useRef(); const [createModalVisible, setCreateModalVisible] = useState(false); - const [editRow] = useState>(); + const [editRow, setEditRow] = useState>(); const columns: ProColumns[] = [ { @@ -53,6 +54,49 @@ const Page = () => { align: 'center', hideInSearch: true, }, + { + title: '操作', + dataIndex: 'option', + valueType: 'option', + align: 'center', + render: (_: React.ReactNode, record: SuperAdmin.SuperAdminItem) => ( +
+ + +
+ ), + }, ]; return ( diff --git a/src/services/system/supderAdmin/index.ts b/src/services/system/supderAdmin/index.ts index 98700b1..728a33e 100644 --- a/src/services/system/supderAdmin/index.ts +++ b/src/services/system/supderAdmin/index.ts @@ -10,3 +10,7 @@ export const getSupderAdminListAPI = ( export const addSupderAdminAPI = (data: Record): Promise => { return request.post(`/system/superAdmin`, data); }; + +export const delSuperAdminAPI = (id: string): Promise => { + return request.delete(`/system/superAdmin/${id}`); +};