Commit b230f7cd authored by XieZhiXiong's avatar XieZhiXiong

chore: 删除无用组件

parent d09e4d13
import React, { useEffect, useState } from 'react';
import {
Tabs,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import styles from './index.less';
export interface OuterHistoryItem {
roleName: string;
status: string;
operate: string;
operateTime: string;
opinion: string;
};
export interface OuterHistoryData {
data: OuterHistoryItem[],
totalCount: number,
};
export interface FlowRecordsProps {
/**
* 获取外部流转记录
*/
fetchOuterHistory?: (params: { [key: string]: any }) => Promise<OuterHistoryData>;
/**
* 外部状态map
*/
outerStatusMap: {[key: string]: any};
};
const PAGE_SIZE = 10;
const FlowRecords: React.FC<FlowRecordsProps> = ({
fetchOuterHistory,
outerStatusMap = {},
}) => {
const [outerPage, setOuterPage] = useState(1);
const [outerSize, setOuterSize] = useState(PAGE_SIZE);
const [outerLoading, setOuterLoading] = useState(false);
const [outerData, setOuterData] = useState<OuterHistoryData>({ data: [], totalCount: 0 });
const outerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text, record) => (
<StatusTag type={outerStatusMap[record.status] || 'default'} title={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const getOuterHistory = params => {
if (fetchOuterHistory) {
setOuterLoading(true);
fetchOuterHistory(params).then(res => {
if (res) {
setOuterData(res);
}
}).finally(() => {
setOuterLoading(false);
});
}
};
useEffect(() => {
getOuterHistory({
current: outerPage,
pageSize: outerSize,
});
} ,[]);
const handleOuterPaginationChange = (current, pageSize) => {
setOuterPage(current);
setOuterSize(pageSize);
getOuterHistory({
current,
pageSize,
});
};
return (
<MellowCard>
<Tabs onChange={() => {}}>
{outerData.data && outerData.data.length > 0 ? (
<Tabs.TabPane tab="外部流转记录" key="1">
<PolymericTable
rowKey="step"
dataSource={outerData.data}
columns={outerColumns}
loading={outerLoading}
pagination={{
current: outerPage,
pageSize: outerSize,
total: outerData.totalCount,
}}
onPaginationChange={handleOuterPaginationChange}
/>
</Tabs.TabPane>
) : null}
</Tabs>
</MellowCard>
);
};
export default FlowRecords;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 11:38:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-11 16:52:13
* @Description: 商品列表
*/
import React from 'react';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
interface HistoryListHistoryListProps {
dataSource: {
[key: string]: any,
}[];
// 标题
title?: string;
// 表格列
columns: EditableColumns[];
// rowKey
rowKey?: string;
// 目标路径
target?: string;
// loading
loading?: boolean;
};
const ProductList: React.FC<HistoryListHistoryListProps> = ({
dataSource = [],
title = '标题',
columns = [],
rowKey = 'id',
target,
loading = false,
}) => {
return (
<MellowCard
title={title}
>
<PolymericTable
rowKey={rowKey}
dataSource={dataSource}
columns={columns}
loading={loading}
pagination={null}
/>
</MellowCard>
);
};
export default ProductList;
\ No newline at end of file
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