master
Joe 2 years ago
parent 65a5ed19ef
commit 01e30072de

@ -42,6 +42,7 @@ export default function access(initialState: { currentUser?: API.PbcUsersVO | un
contentSave: false,
message: false,
messageQuery: false,
messageDelete: false,
};
for (let i = 0; i < currentUser?.currentAuthority.length; i++) {
const element = currentUser?.currentAuthority[i];

@ -112,7 +112,7 @@ const TableList: React.FC<{}> = () => {
}}
params={{ pbcBusinessApprovalResult: tabActiveKey }}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -7,7 +7,7 @@ import { handlePageQuery } from '@/utils/utils';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Access, Link, useAccess } from '@umijs/max';
import { message, Space, Switch } from 'antd';
import { Button, message, Popconfirm, Space, Switch } from 'antd';
import React, { useRef } from 'react';
/**
@ -125,6 +125,19 @@ const TableList: React.FC<{}> = () => {
<Access accessible={access.businessSave}>
<Link to={`/business/detail/${record.pbcId}?isEdit=1`}></Link>
</Access>
<Access key="remove" accessible={access.businessUpdateState}>
<Popconfirm
title={`确定需要删除该商家?`}
onConfirm={async () => {
const success = await handleUpdateState(record.pbcId || 0, 0);
if (success) actionRef.current?.reload();
}}
>
<Button size="small" type="link" danger>
</Button>
</Popconfirm>
</Access>
</Space>
),
},
@ -151,7 +164,7 @@ const TableList: React.FC<{}> = () => {
span: 6,
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -164,7 +164,10 @@ const Welcome: React.FC = () => {
label=" "
radioType="button"
fieldProps={{
buttonStyle: "solid"
buttonStyle: "solid",
onChange: () => {
getData()
}
}}
options={[
{

@ -111,7 +111,7 @@ const TableList: React.FC<{}> = () => {
span: 6
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -8,7 +8,7 @@ import { handlePageQuery } from '@/utils/utils';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Access, useAccess } from '@umijs/max';
import { message, Switch } from 'antd';
import { Button, message, Popconfirm, Switch } from 'antd';
import React, { useRef } from 'react';
/**
@ -127,6 +127,26 @@ const TableList: React.FC<{}> = () => {
);
},
},
{
title: '操作',
fixed: 'right',
valueType: 'option',
render: (text, record) => (
<Access key="remove" accessible={access.memberUpdateState}>
<Popconfirm
title={`确定需要删除该会员?`}
onConfirm={async () => {
const success = await handleUpdateState(record.pbcId || 0, 0);
if (success) actionRef.current?.reload();
}}
>
<Button size="small" type="link" danger>
</Button>
</Popconfirm>
</Access>
),
},
];
return (
<PageContainer
@ -163,7 +183,7 @@ const TableList: React.FC<{}> = () => {
span: 6,
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -3,9 +3,10 @@ import { PageContainer } from '@ant-design/pro-layout';
import Constants from '@/constants';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { handlePageQuery } from '@/utils/utils';
import { getMessageDetailUsingGet, pbcUserMessagePageUsingPost } from '@/services/pop-b2b2c/pbcUserMessageController';
import { Avatar, Button, Col, Drawer, Row, Image, Divider } from 'antd';
import { deleteUserMessageUsingGet, getMessageDetailUsingGet, pbcUserMessagePageUsingPost } from '@/services/pop-b2b2c/pbcUserMessageController';
import { Avatar, Button, Col, Drawer, Row, Image, Divider, Space, Popconfirm, message } from 'antd';
import { UserOutlined } from '@ant-design/icons';
import { Access, useAccess } from '@umijs/max';
/**
*
@ -20,9 +21,34 @@ const fetchData = async (params: API.PageVO) => {
} as any;
};
/**
*
* @param id
*/
const handleRemove = async (fields: API.PbcUserMessage) => {
const hide = message.loading('正在删除');
if (!fields.pbcId) return false;
try {
const msg = await deleteUserMessageUsingGet({ id: fields.pbcId });
hide();
if (msg.retcode) {
message.success('删除成功,即将刷新');
} else {
message.error(msg.retmsg ?? '删除失败,请重试');
}
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
const access: any = useAccess();
const [currentRow, setCurrentRow] = useState<API.PbcUserMessage>();
@ -65,6 +91,7 @@ const TableList: React.FC<{}> = () => {
fixed: 'right',
valueType: 'option',
render: (text, record) => (
<Space>
<Button type="link" loading={loading} onClick={() => {
if (record.pbcId) {
handleLoading(true);
@ -81,6 +108,20 @@ const TableList: React.FC<{}> = () => {
}}>
</Button>
<Access key="remove" accessible={access.messageDelete}>
<Popconfirm
title={`确定需要删除该留言?`}
onConfirm={async () => {
const success = await handleRemove(record);
if (success) actionRef.current?.reload();
}}
>
<Button size="small" type="link" danger>
</Button>
</Popconfirm>
</Access>
</Space>
),
},
];
@ -113,7 +154,7 @@ const TableList: React.FC<{}> = () => {
span: 6
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -155,7 +155,7 @@ const TableList: React.FC<{}> = () => {
span: 6,
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -178,7 +178,7 @@ const TableList: React.FC<{}> = () => {
},
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -248,7 +248,7 @@ const TableList: React.FC<{}> = () => {
},
}}
pagination={{
pageSize: 20,
defaultPageSize: 20,
showSizeChanger: true,
}}
scroll={{

@ -126,6 +126,14 @@ export async function getProductPageForHotProductUsingPost(
);
}
/** gogoYaya POST /b2b2c/pbcproduct/gogoYaya */
export async function gogoYayaUsingPost(options?: { [key: string]: any }) {
return request<string>('/b2b2c/pbcproduct/gogoYaya', {
method: 'POST',
...(options || {}),
});
}
/** 根据商品id生成商品分享海报 分享海报 GET /b2b2c/pbcproduct/poster */
export async function posterUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)

@ -17,6 +17,21 @@ export async function changeUnreadStateUsingGet(
});
}
/** 删除留言 删除留言 GET /b2b2c/pbcusermesssage/deleteUserMessage */
export async function deleteUserMessageUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.deleteUserMessageUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>('/b2b2c/pbcusermesssage/deleteUserMessage', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** frontPbcUserMessagePage 分页,按照搜索条件查询出留言记录分页,前端专用 POST /b2b2c/pbcusermesssage/frontPbcUserMessagePage */
export async function frontPbcUserMessagePageUsingPost(
body: API.PageVO,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save