Commit 82b4c02f authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加 内部流转组件

parent d49ce389
/*
* @Author: XieZhiXiong
* @Date: 2021-06-23 18:04:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-23 18:04:15
* @Description: 内部流转记录
*/
import React, { HTMLAttributes } from 'react';
import { Badge } from 'antd';
import FlowRecords from '@/components/FlowRecords';
import { EditableColumns } from '@/components/PolymericTable/interface';
export type DataSourceItem = {
/**
* 记录Id
*/
id: number
/**
* 操作时间
*/
createTime: string
/**
* 操作人员姓名
*/
operatorName: string
/**
* 操作人员组织机构名称
*/
operatorOrgName: string
/**
* 操作人员职位
*/
operatorJobTitle: string
/**
* 操作方法
*/
operation: string
/**
* 内部状态枚举
*/
innerStatus: number
/**
* 会员内部状态名称
*/
innerStatusName: string
/**
* 操作说明(审核意见)
*/
remark: string
}
export interface IProps extends HTMLAttributes<HTMLDivElement> {
/**
* 数据源
*/
dataSource: DataSourceItem[],
}
const InnerFlowRecords: React.FC<IProps> = (props) => {
const { dataSource = [], ...restProps } = props;
const columns: EditableColumns<DataSourceItem>[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (text, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'operatorName',
align: 'center',
},
{
title: '部门',
dataIndex: 'operatorOrgName',
align: 'center',
},
{
title: '职位',
dataIndex: 'operatorJobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'innerStatusName',
align: 'center',
render: (text, record) => (
<Badge color="red" text={text} />
),
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'createTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
ellipsis: true,
},
];
return (
<FlowRecords
innerColumns={columns}
innerRowkey="id"
innerDataSource={dataSource}
{...restProps}
/>
);
};
export default InnerFlowRecords;
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