Commit 50148a7f authored by 卢均锐's avatar 卢均锐

feat:采购竞价静态页面分离组件

parent ed8fad19
import React, { useState, useMemo } from 'react';
import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons';
const areaItem = (props: any) => {
const { data } = props;
const [showMore, setShowMore] = useState<any>(false);
// const showDataSource = showMore ? data['inviteTenderAreaList'] : [...data['inviteTenderAreaList']].splice(0, 3)
const showDataSource = useMemo(() => {
return showMore ? data['inviteTenderAreaList'] : [...data['inviteTenderAreaList']].splice(0, 3)
}, [showMore, data])
const toogleMore = () => {
setShowMore(!showMore);
}
return (
<>
{showDataSource.map((_item, _i) => <p key={`address${_i}`}>{_item.provinceName + '/' + (_item.cityName || '')}</p>)}
{
data.length > 3 &&
<p onClick={toogleMore} style={{ cursor: 'pointer' }} className="commonPickColor">
展开{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</p>
}
</>
)
}
export default areaItem
\ No newline at end of file
import React from 'react';
import { Typography } from 'antd';
import { LinkOutlined } from '@ant-design/icons';
const FilesItem = (props: any) => {
const { files } = props;
if (files && files.length > 0) {
return (
files.map((item, index) => {
return (
<div key={index}>
<Typography.Link href={item.url} target="_blank">
<LinkOutlined />
{item.name}
</Typography.Link>
</div>
)
})
)
}else{
return '无'
}
}
export default FilesItem
\ No newline at end of file
......@@ -9,6 +9,9 @@ import Card from '../../../card';
import { Context } from '../context';
import selfStyles from './index.less';
import AreaItem from './areaItem';
import FilesItem from './filesItem';
import MsgItem from './msgItem';
import ResultItem from './resultItem';
import PieItem from './pieItem';
......@@ -30,8 +33,18 @@ export interface BidCommonLayoutProps {
const BidCommonLayout: React.FC<BidCommonLayoutProps> = (props: any) => {
const { layoutId, title, effect, layoutType, extra, checkDetailFunc } = props;
const _returnItem = (data) => {
switch (data.type) {
case 'text':
return data.extra
case 'area':
return <AreaItem />
case 'files':
return <FilesItem />
}
}
const _returnChild = (child, key) => {
if (child.type === 'text') {
if (child.type === 'text' || child.type === 'area' || child.type === 'files') {
return (
<div className={selfStyles.baseItem} key={key}>
<h5 className={selfStyles.label}>
......@@ -39,10 +52,10 @@ const BidCommonLayout: React.FC<BidCommonLayoutProps> = (props: any) => {
{child.label}<QuestionCircleOutlined style={ICON_STYLE} />
</Tooltip> : `${child.label}: `}
</h5>
<h5 className={selfStyles.content}>{child.extra}</h5>
<h5 className={selfStyles.content}>{_returnItem(child)}</h5>
</div>
)
}else if(child.type === 'pie'){
} else if (child.type === 'pie') {
return (
<div className={selfStyles.pieItem} key={key}>
<PieItem />
......@@ -87,7 +100,7 @@ const BidCommonLayout: React.FC<BidCommonLayoutProps> = (props: any) => {
</div>
<div className={selfStyles.baseItem}>
<h5 className={selfStyles.label}>附件: </h5>
<h5 className={selfStyles.content}></h5>
<h5 className={selfStyles.content}><FilesItem /></h5>
</div>
</Col>
</Row>
......
......@@ -5,3 +5,6 @@ export const Context = createContext<any>({})
/**招标详情 Context */
export const BidDetailContext = createContext<any>({})
/**采购竞价单详情 Context */
export const PurchaseBidContext = createContext<any>({})
......@@ -9,10 +9,12 @@ const LOGSTATESTYPE = {
/** 外部流转 */
EXTERNALSTATES: 1,
/** 内部流转 */
INTERIORSTATES: 2
INTERIORSTATES: 2,
/** 竞价结果内部流转 */
EXMAINEINERIORSTATES: 3
}
export interface ProgressProps {}
export interface ProgressProps { }
const ProgressLayout: React.FC<ProgressProps> = () => {
const context = useContext(Context);
......@@ -28,6 +30,7 @@ const ProgressLayout: React.FC<ProgressProps> = () => {
>
{context.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{context.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
{context.examineInteriorLogStates && <Radio.Button value={LOGSTATESTYPE.EXMAINEINERIORSTATES}>竞价结果内部流转</Radio.Button>}
</Radio.Group>
}
>
......@@ -42,15 +45,24 @@ const ProgressLayout: React.FC<ProgressProps> = () => {
description={item.operationalProcess}
status={item.isExecute ? 'finish' : 'wait'}
/>
)) :
context.interiorLogStates && context.interiorLogStates.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
description={item.operationalProcess}
status={item.isExecute ? 'finish' : 'wait'}
/>
))
)) : (logStatesStatus === LOGSTATESTYPE.INTERIORSTATES ?
context.interiorLogStates && context.interiorLogStates.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
description={item.operationalProcess}
status={item.isExecute ? 'finish' : 'wait'}
/>
)) :
context.examineInteriorLogStates && context.examineInteriorLogStates.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
description={item.operationalProcess}
status={item.isExecute ? 'finish' : 'wait'}
/>
))
)
}
</Steps>
</Card>
......
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