Commit cbd723a9 authored by 卢均锐's avatar 卢均锐

chore: 采购竞价不需要缓存的列表的加入props keepAlive=false

parent 9ac7e002
...@@ -91,7 +91,7 @@ const LowestQuotationRecord: React.FC<TableCommonLayoutProps> = (props: any) => ...@@ -91,7 +91,7 @@ const LowestQuotationRecord: React.FC<TableCommonLayoutProps> = (props: any) =>
const _returnBadge = (number) => { const _returnBadge = (number) => {
const _number = Number(number ?? 0); const _number = Number(number ?? 0);
switch (_number) { switch (_number) {
case 0: case 0:
return '-'; return '-';
case 1: case 1:
return <img src={level1} alt='第一名' />; return <img src={level1} alt='第一名' />;
...@@ -119,6 +119,7 @@ const LowestQuotationRecord: React.FC<TableCommonLayoutProps> = (props: any) => ...@@ -119,6 +119,7 @@ const LowestQuotationRecord: React.FC<TableCommonLayoutProps> = (props: any) =>
<h5 className={selfStyles.content}>{effect?.reportPrice ? `¥ ${priceFormat(effect?.reportPrice)}` : '-'}</h5> <h5 className={selfStyles.content}>{effect?.reportPrice ? `¥ ${priceFormat(effect?.reportPrice)}` : '-'}</h5>
</div> </div>
<StandardTable <StandardTable
keepAlive={false}
currentRef={currentRef} currentRef={currentRef}
columns={columns} columns={columns}
tableProps={{ rowKew: 'id' }} tableProps={{ rowKew: 'id' }}
......
...@@ -126,6 +126,7 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => { ...@@ -126,6 +126,7 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => {
title={layoutTitle} title={layoutTitle}
> >
<StandardTable <StandardTable
keepAlive={false}
currentRef={currentRef} currentRef={currentRef}
columns={column ? column : columns} columns={column ? column : columns}
tableProps={{ rowKey: 'id' }} tableProps={{ rowKey: 'id' }}
......
...@@ -10,152 +10,153 @@ import { Context } from '../context'; ...@@ -10,152 +10,153 @@ import { Context } from '../context';
import style from './index.less'; import style from './index.less';
const TYPE = { const TYPE = {
1: '发布至平台', 1: '发布至平台',
2: '系统匹配', 2: '系统匹配',
3: '邀请会员', 3: '邀请会员',
} }
const ColStyle = { const ColStyle = {
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
border: '1px solid #1fbf87', border: '1px solid #1fbf87',
paddingTop: ' 6px', paddingTop: ' 6px',
paddingBottom: '6px', paddingBottom: '6px',
margin: '5px', margin: '5px',
borderRadius: '4px', borderRadius: '4px',
} }
const TextStyle = { const TextStyle = {
color: '#1fbf87', color: '#1fbf87',
marginLeft: '10px', marginLeft: '10px',
} }
export interface DemandLayoutIProps { export interface DemandLayoutIProps {
storeList?: any, storeList?: any,
title?: string, title?: string,
bidId: number, bidId: number,
number: string, number: string,
fetch?: () => Promise<unknown> fetch?: () => Promise<unknown>
} }
const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => { const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
const { storeList, title, bidId, number, fetch } = props; const { storeList, title, bidId, number, fetch } = props;
const tableRef = useRef<any>({}); const tableRef = useRef<any>({});
const context = useContext(Context); const context = useContext(Context);
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
key: 'number', key: 'number',
dataIndex: 'number', dataIndex: 'number',
render: (text: any, record: any, index: number) => <>{index + 1}</> render: (text: any, record: any, index: number) => <>{index + 1}</>
}, },
{ {
title: '会员名称', title: '会员名称',
key: 'memberName', key: 'memberName',
dataIndex: 'memberName', dataIndex: 'memberName',
}, },
{ {
title: '会员类型', title: '会员类型',
key: 'memberTypeName', key: 'memberTypeName',
dataIndex: 'memberTypeName', dataIndex: 'memberTypeName',
}, },
{ {
title: '会员角色', title: '会员角色',
key: 'roleName', key: 'roleName',
dataIndex: 'roleName', dataIndex: 'roleName',
}, },
{ {
title: '会员等级', title: '会员等级',
key: 'levelTag', key: 'levelTag',
dataIndex: 'levelTag', dataIndex: 'levelTag',
}, },
{ {
title: '是否归属会员', title: '是否归属会员',
key: 'membershipOrNot', key: 'membershipOrNot',
dataIndex: 'membershipOrNot', dataIndex: 'membershipOrNot',
render: (text: any) => (<StatusTag type={text ? 'success' : 'danger'} title={text ? '是' : '否'} />) render: (text: any) => (<StatusTag type={text ? 'success' : 'danger'} title={text ? '是' : '否'} />)
}, },
{ {
title: ( title: (
<> <>
<span>需求发送</span> <span>需求发送</span>
<Tooltip placement="top" title='打开开关,审核通过后,将发送需求至选择的归属会员'> <Tooltip placement="top" title='打开开关,审核通过后,将发送需求至选择的归属会员'>
<QuestionCircleOutlined <QuestionCircleOutlined
style={{ style={{
marginLeft: '5px', marginLeft: '5px',
fontSize: '14px', fontSize: '14px',
color: '#909399' color: '#909399'
}} }}
/> />
</Tooltip> </Tooltip>
</> </>
), ),
key: 'state', key: 'state',
dataIndex: 'state', dataIndex: 'state',
render: (text: any) => ( render: (text: any) => (
<Switch checked={text} disabled={true} /> <Switch checked={text} disabled={true} />
) )
}, },
{ {
title: '操作', title: '操作',
key: 'operate', key: 'operate',
dataIndex: 'operate', dataIndex: 'operate',
render: (_text: any, _record: any) => ( render: (_text: any, _record: any) => (
<Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank"> <Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
进入店铺 进入店铺
</Typography.Link> </Typography.Link>
) )
}, },
] ]
/** 列表数据 */ /** 列表数据 */
const fetchData = (params?: any) => { const fetchData = (params?: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fetch({ id: bidId, number: number, ...params }).then(res => { fetch({ id: bidId, number: number, ...params }).then(res => {
resolve(res.data) resolve(res.data)
}) })
}) })
} }
return ( return (
<Card <Card
id='demandLayout' id='demandLayout'
title='需求对接' title='需求对接'
> >
<div className={style.list}> <div className={style.list}>
<h5 className={style.listLable} style={{ flex: '0 0 100px' }}>{title}</h5> <h5 className={style.listLable} style={{ flex: '0 0 100px' }}>{title}</h5>
<h5 className={style.listContent}>{TYPE[context.type]}</h5> <h5 className={style.listContent}>{TYPE[context.type]}</h5>
</div> </div>
{context.type === 1 {context.type === 1
&& ( && (
<Row gutter={[16, 16]}> <Row gutter={[16, 16]}>
{storeList.map(item => ( {storeList.map(item => (
<Col <Col
span={6} span={6}
key={item.id} key={item.id}
style={ColStyle} style={ColStyle}
> >
<Image width={32} height={32} src={item.logoUrl} /> <Image width={32} height={32} src={item.logoUrl} />
<span style={TextStyle}>{item.name}</span> <span style={TextStyle}>{item.name}</span>
</Col> </Col>
))} ))}
</Row> </Row>
)} )}
{context.type !== 1 {context.type !== 1
&& ( && (
<StandardTable <StandardTable
currentRef={tableRef} keepAlive={false}
columns={columns} currentRef={tableRef}
tableProps={{ rowKew: 'id' }} columns={columns}
fetchTableData={(params: any) => fetchData(params)} tableProps={{ rowKew: 'id' }}
/> fetchTableData={(params: any) => fetchData(params)}
)} />
</Card> )}
) </Card>
)
} }
DemandLayout.defaultProps = { DemandLayout.defaultProps = {
title: '发布方式' title: '发布方式'
} }
export default DemandLayout; export default DemandLayout;
...@@ -123,6 +123,7 @@ const QuotationDetailsDrawer:React.FC<QuotationDetailsDrawerProps> = (props: any ...@@ -123,6 +123,7 @@ const QuotationDetailsDrawer:React.FC<QuotationDetailsDrawerProps> = (props: any
} }
> >
<StandardTable <StandardTable
keepAlive={false}
currentRef={tableRef} currentRef={tableRef}
columns={columns} columns={columns}
tableProps={{ rowKew: 'id' }} tableProps={{ rowKew: 'id' }}
......
...@@ -101,6 +101,7 @@ const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => { ...@@ -101,6 +101,7 @@ const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => {
title={layoutTitle} title={layoutTitle}
> >
<StandardTable <StandardTable
keepAlive={false}
currentRef={currentRef} currentRef={currentRef}
columns={columns} columns={columns}
tableProps={{ rowKew: 'id' }} tableProps={{ rowKew: 'id' }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment