master
Joe 2 years ago
parent 65a5ed19ef
commit 01e30072de

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

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

@ -7,7 +7,7 @@ import { handlePageQuery } from '@/utils/utils';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { Access, Link, useAccess } from '@umijs/max'; 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'; import React, { useRef } from 'react';
/** /**
@ -125,6 +125,19 @@ const TableList: React.FC<{}> = () => {
<Access accessible={access.businessSave}> <Access accessible={access.businessSave}>
<Link to={`/business/detail/${record.pbcId}?isEdit=1`}></Link> <Link to={`/business/detail/${record.pbcId}?isEdit=1`}></Link>
</Access> </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> </Space>
), ),
}, },
@ -151,7 +164,7 @@ const TableList: React.FC<{}> = () => {
span: 6, span: 6,
}} }}
pagination={{ pagination={{
pageSize: 20, defaultPageSize: 20,
showSizeChanger: true, showSizeChanger: true,
}} }}
scroll={{ scroll={{

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

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

@ -8,7 +8,7 @@ import { handlePageQuery } from '@/utils/utils';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { Access, useAccess } from '@umijs/max'; import { Access, useAccess } from '@umijs/max';
import { message, Switch } from 'antd'; import { Button, message, Popconfirm, Switch } from 'antd';
import React, { useRef } from 'react'; 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 ( return (
<PageContainer <PageContainer
@ -163,7 +183,7 @@ const TableList: React.FC<{}> = () => {
span: 6, span: 6,
}} }}
pagination={{ pagination={{
pageSize: 20, defaultPageSize: 20,
showSizeChanger: true, showSizeChanger: true,
}} }}
scroll={{ scroll={{

@ -3,9 +3,10 @@ import { PageContainer } from '@ant-design/pro-layout';
import Constants from '@/constants'; import Constants from '@/constants';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { handlePageQuery } from '@/utils/utils'; import { handlePageQuery } from '@/utils/utils';
import { getMessageDetailUsingGet, pbcUserMessagePageUsingPost } from '@/services/pop-b2b2c/pbcUserMessageController'; import { deleteUserMessageUsingGet, getMessageDetailUsingGet, pbcUserMessagePageUsingPost } from '@/services/pop-b2b2c/pbcUserMessageController';
import { Avatar, Button, Col, Drawer, Row, Image, Divider } from 'antd'; import { Avatar, Button, Col, Drawer, Row, Image, Divider, Space, Popconfirm, message } from 'antd';
import { UserOutlined } from '@ant-design/icons'; import { UserOutlined } from '@ant-design/icons';
import { Access, useAccess } from '@umijs/max';
/** /**
* *
@ -20,9 +21,34 @@ const fetchData = async (params: API.PageVO) => {
} as any; } 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 // eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => { const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const access: any = useAccess();
const [currentRow, setCurrentRow] = useState<API.PbcUserMessage>(); const [currentRow, setCurrentRow] = useState<API.PbcUserMessage>();
@ -65,22 +91,37 @@ const TableList: React.FC<{}> = () => {
fixed: 'right', fixed: 'right',
valueType: 'option', valueType: 'option',
render: (text, record) => ( render: (text, record) => (
<Button type="link" loading={loading} onClick={() => { <Space>
if (record.pbcId) { <Button type="link" loading={loading} onClick={() => {
handleLoading(true); if (record.pbcId) {
getMessageDetailUsingGet({id: record.pbcId}).then(res => { handleLoading(true);
handleLoading(false); getMessageDetailUsingGet({id: record.pbcId}).then(res => {
if (res.retcode) { handleLoading(false);
handleOpenDrawer(true); if (res.retcode) {
setCurrentRow(res.data); handleOpenDrawer(true);
} setCurrentRow(res.data);
}).catch(() => { }
handleLoading(false); }).catch(() => {
}) handleLoading(false);
} })
}}> }
}}>
</Button>
</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 span: 6
}} }}
pagination={{ pagination={{
pageSize: 20, defaultPageSize: 20,
showSizeChanger: true, showSizeChanger: true,
}} }}
scroll={{ scroll={{

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

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

@ -248,7 +248,7 @@ const TableList: React.FC<{}> = () => {
}, },
}} }}
pagination={{ pagination={{
pageSize: 20, defaultPageSize: 20,
showSizeChanger: true, showSizeChanger: true,
}} }}
scroll={{ 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 */ /** 根据商品id生成商品分享海报 分享海报 GET /b2b2c/pbcproduct/poster */
export async function posterUsingGet( export async function posterUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的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 */ /** frontPbcUserMessagePage 分页,按照搜索条件查询出留言记录分页,前端专用 POST /b2b2c/pbcusermesssage/frontPbcUserMessagePage */
export async function frontPbcUserMessagePageUsingPost( export async function frontPbcUserMessagePageUsingPost(
body: API.PageVO, body: API.PageVO,

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