Commit 5b876107 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复内外部状态字段

parent e035996a
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 15:04:46
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 16:39:17
* @Description: 外部流转记录
*/
import React from 'react';
import { REPAIR_OUTER_STATUS } from '@/constants';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import StatusTag from '@/components/StatusTag';
import { REPAIR_OUTER_STATUS_TAG_MAP } from '../../constants';
interface OuterCirculationRecordProps {
dataSource: {
roleName: string,
status: number | string,
operate: string,
operateTime: string,
opinion: string,
}[];
onPaginationChange?: (page: number, size: number) => void;
};
const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({
dataSource = [],
onPaginationChange,
}) => {
const columns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'order',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.status]} title={text} />
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
ellipsis: true,
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const handlePaginationChange = (page, size) => {
if (onPaginationChange) {
onPaginationChange(page, size);
}
};
return (
<MellowCard
title="外部流转记录"
>
<PolymericTable
rowKey="operateTime"
dataSource={dataSource}
columns={columns}
loading={false}
pagination={null}
/>
</MellowCard>
);
};
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 15:04:46
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-24 10:55:51
* @Description: 外部流转记录
*/
import React from 'react';
import { REPAIR_OUTER_STATUS } from '@/constants';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import StatusTag from '@/components/StatusTag';
import { REPAIR_OUTER_STATUS_TAG_MAP } from '../../constants';
interface OuterCirculationRecordProps {
dataSource: {
roleName: string,
status: number | string,
operate: string,
operateTime: string,
opinion: string,
}[];
onPaginationChange?: (page: number, size: number) => void;
};
const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({
dataSource = [],
onPaginationChange,
}) => {
const columns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'order',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
ellipsis: true,
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const handlePaginationChange = (page, size) => {
if (onPaginationChange) {
onPaginationChange(page, size);
}
};
return (
<MellowCard
title="外部流转记录"
>
<PolymericTable
rowKey="operateTime"
dataSource={dataSource}
columns={columns}
loading={false}
pagination={null}
/>
</MellowCard>
);
};
export default OuterCirculationRecord;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-04 18:22:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 17:15:08
* @Description: 内、外部流转记录
*/
import React from 'react';
import {
Tabs,
Badge,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import styles from './index.less';
export interface InnerHistoryItem {
step: number;
operator: string;
department: string;
jobTitle: string;
status: string;
operate: string;
operateTime: string,
opinion: string;
};
export interface OuterHistoryItem {
roleName: string;
status: string;
operate: string;
operateTime: string;
opinion: string;
};
interface FlowRecordsProps {
outerHistory?: OuterHistoryItem[];
innerHistory: InnerHistoryItem[];
};
const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHistory }) => {
const outerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => (
<StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.status]} title={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const innerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'step',
align: 'center',
},
{
title: '操作人',
dataIndex: 'operator',
align: 'center',
},
{
title: '部门',
dataIndex: 'department',
align: 'center',
},
{
title: '职位',
dataIndex: 'jobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => (
<Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.status]} text={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
return (
<MellowCard>
<Tabs onChange={() => {}}>
{outerHistory ? (
<Tabs.TabPane tab="外部流转记录" key="1">
<PolymericTable
rowKey="operateTime"
dataSource={outerHistory}
columns={outerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
) : null}
<Tabs.TabPane tab="内部流转记录" key="2">
<PolymericTable
rowKey="operateTime"
dataSource={innerHistory}
columns={innerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
);
};
/*
* @Author: XieZhiXiong
* @Date: 2020-11-04 18:22:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-24 10:55:25
* @Description: 内、外部流转记录
*/
import React from 'react';
import {
Tabs,
Badge,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import styles from './index.less';
export interface InnerHistoryItem {
step: number;
operator: string;
department: string;
jobTitle: string;
status: string;
operate: string;
operateTime: string,
opinion: string;
};
export interface OuterHistoryItem {
roleName: string;
status: string;
operate: string;
operateTime: string;
opinion: string;
};
interface FlowRecordsProps {
outerHistory?: OuterHistoryItem[];
innerHistory: InnerHistoryItem[];
};
const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHistory }) => {
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={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const innerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'step',
align: 'center',
},
{
title: '操作人',
dataIndex: 'operator',
align: 'center',
},
{
title: '部门',
dataIndex: 'department',
align: 'center',
},
{
title: '职位',
dataIndex: 'jobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => (
<Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.status]} text={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
return (
<MellowCard>
<Tabs onChange={() => {}}>
{outerHistory ? (
<Tabs.TabPane tab="外部流转记录" key="1">
<PolymericTable
rowKey="operateTime"
dataSource={outerHistory}
columns={outerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
) : null}
<Tabs.TabPane tab="内部流转记录" key="2">
<PolymericTable
rowKey="operateTime"
dataSource={innerHistory}
columns={innerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
);
};
export default FlowRecords;
\ 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