Commit d532670f authored by XieZhiXiong's avatar XieZhiXiong

chore: 替换组件

parent 7b971734
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36 * @Date: 2020-09-15 17:48:36
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-18 15:08:09 * @LastEditTime: 2021-07-05 18:18:12
* @Description: 内外部流转记录组件 * @Description: 内外部流转记录组件
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -10,8 +10,7 @@ import { ...@@ -10,8 +10,7 @@ import {
Steps, Steps,
Tooltip, Tooltip,
} from 'antd'; } from 'antd';
import MellowCard, { MellowCardProps } from '@/components/MellowCard'; import ButtonTabs, { ButtonTabsProps } from '../ButtonTabs';
import ButtonSwitch from '@/components/ButtonSwitch';
import styles from './index.less'; import styles from './index.less';
export interface StepsItem { export interface StepsItem {
...@@ -33,7 +32,7 @@ export interface StepsItem { ...@@ -33,7 +32,7 @@ export interface StepsItem {
status?: 'wait' | 'process' | 'finish' | 'error', status?: 'wait' | 'process' | 'finish' | 'error',
} }
interface AuditProcessProp extends MellowCardProps { interface AuditProcessProp extends Omit<ButtonTabsProps, 'options'> {
/** /**
* 当前外部流程步骤 * 当前外部流程步骤
*/ */
...@@ -104,7 +103,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -104,7 +103,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
].filter(Boolean); ].filter(Boolean);
const titleRender = (stepTitle: string, stepLength: number) => { const titleRender = (stepTitle: string, stepLength: number) => {
if(stepLength <= 6) { if (stepLength <= 6) {
return <span>{stepTitle}</span> return <span>{stepTitle}</span>
} }
return ( return (
...@@ -115,18 +114,15 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -115,18 +114,15 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
} }
return ( return (
<MellowCard <ButtonTabs
title="流转进度" options={options}
extra={( extra="流转进度"
<ButtonSwitch defaultValue="inner"
options={options} onChange={handleRadioChange}
onChange={handleRadioChange} value={radioValue}
value={radioValue}
/>
)}
{...rest} {...rest}
> >
{radioValue === 'outer' ? ( <ButtonTabs.Item activeKey="outer">
<div className={styles.steps}> <div className={styles.steps}>
<Steps progressDot current={outerVerifyCurrent}> <Steps progressDot current={outerVerifyCurrent}>
{outerVerifySteps && outerVerifySteps.map(item => ( {outerVerifySteps && outerVerifySteps.map(item => (
...@@ -139,8 +135,8 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -139,8 +135,8 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
))} ))}
</Steps> </Steps>
</div> </div>
) : null} </ButtonTabs.Item>
{radioValue === 'inner' ? ( <ButtonTabs.Item activeKey="inner">
<div className={styles.steps}> <div className={styles.steps}>
<Steps progressDot current={innerVerifyCurrent}> <Steps progressDot current={innerVerifyCurrent}>
{innerVerifySteps && innerVerifySteps.map(item => ( {innerVerifySteps && innerVerifySteps.map(item => (
...@@ -153,8 +149,8 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -153,8 +149,8 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
))} ))}
</Steps> </Steps>
</div> </div>
) : null} </ButtonTabs.Item>
</MellowCard> </ButtonTabs>
) )
}; };
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import PolymericTable from '@/components/PolymericTable'; import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard, { MellowCardProps } from '@/components/MellowCard'; import ButtonTabs, { ButtonTabsProps } from '../ButtonTabs';
import ButtonSwitch from '@/components/ButtonSwitch';
const PAGE_SIZE = 10; const PAGE_SIZE = 10;
...@@ -35,7 +34,7 @@ export interface FetchListParams { ...@@ -35,7 +34,7 @@ export interface FetchListParams {
pageSize: number, pageSize: number,
} }
interface IProps extends MellowCardProps { interface IProps extends Omit<ButtonTabsProps, 'options'> {
/** /**
* 外部流转记录数据源,与 fetchOuterList 不能共存 * 外部流转记录数据源,与 fetchOuterList 不能共存
* 如果两个同时存在 outerDataSource 优先 * 如果两个同时存在 outerDataSource 优先
...@@ -202,18 +201,15 @@ const FlowRecords: React.FC<IProps> = (props: IProps) => { ...@@ -202,18 +201,15 @@ const FlowRecords: React.FC<IProps> = (props: IProps) => {
].filter(Boolean); ].filter(Boolean);
return ( return (
<MellowCard <ButtonTabs
title="流转记录" options={options}
extra={( extra="流转记录"
<ButtonSwitch defaultValue="inner"
options={options} onChange={handleRadioChange}
onChange={handleRadioChange} value={radioValue}
value={radioValue}
/>
)}
{...rest} {...rest}
> >
{radioValue === 'outer' ? ( <ButtonTabs.Item activeKey="outer">
<PolymericTable <PolymericTable
rowKey={outerRowkey} rowKey={outerRowkey}
dataSource={outerList ? outerList.data : []} dataSource={outerList ? outerList.data : []}
...@@ -230,8 +226,8 @@ const FlowRecords: React.FC<IProps> = (props: IProps) => { ...@@ -230,8 +226,8 @@ const FlowRecords: React.FC<IProps> = (props: IProps) => {
)} )}
onPaginationChange={handleOuterPaginationChange} onPaginationChange={handleOuterPaginationChange}
/> />
) : null} </ButtonTabs.Item>
{radioValue === 'inner' ? ( <ButtonTabs.Item activeKey="inner">
<PolymericTable <PolymericTable
rowKey={innerRowkey} rowKey={innerRowkey}
dataSource={innerList ? innerList.data : []} dataSource={innerList ? innerList.data : []}
...@@ -248,8 +244,8 @@ const FlowRecords: React.FC<IProps> = (props: IProps) => { ...@@ -248,8 +244,8 @@ const FlowRecords: React.FC<IProps> = (props: IProps) => {
)} )}
onPaginationChange={handleInnerPaginationChange} onPaginationChange={handleInnerPaginationChange}
/> />
) : null} </ButtonTabs.Item>
</MellowCard> </ButtonTabs>
); );
}; };
......
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