合并代码
This commit is contained in:
@ -17,7 +17,12 @@ interface Qualification {
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
const QualificationTab: React.FC = () => {
|
||||
interface QualificationTabProps {
|
||||
viewType?: boolean;
|
||||
}
|
||||
|
||||
const QualificationTab: React.FC<QualificationTabProps> = (props) => {
|
||||
const { viewType = false } = props;
|
||||
const intl = useIntl();
|
||||
const [data, setData] = useState<Qualification[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@ -69,30 +74,35 @@ const QualificationTab: React.FC = () => {
|
||||
|
||||
const columns: ColumnsType<Qualification> = [
|
||||
{ title: 'page.workbench.certificateType', dataIndex: 'certificateType', ellipsis: true },
|
||||
{ title: 'page.workbench.certificateName', dataIndex: 'name', ellipsis: true },
|
||||
{ title: 'page.workbench.certificateCode', dataIndex: 'code', ellipsis: true },
|
||||
{ title: 'page.workbench.certificateName', dataIndex: 'name', ellipsis: true },
|
||||
{ title: 'page.workbench.certificateCode', dataIndex: 'code', ellipsis: true },
|
||||
{ title: 'page.workbench.typeLevel', dataIndex: 'typeLevel' },
|
||||
{ title: 'page.workbench.authority', dataIndex: 'authority', ellipsis: true },
|
||||
{ title: 'page.workbench.dateTime', dataIndex: 'dateTime', ellipsis: true },
|
||||
{ title: 'page.workbench.termOfValidity', dataIndex: 'termOfValidity', ellipsis: true },
|
||||
{ title: 'page.workbench.updateTime', dataIndex: 'updateTime', ellipsis: true },
|
||||
{
|
||||
title: 'page.workbench.attachments.action',
|
||||
dataIndex: 'option',
|
||||
width: 120,
|
||||
render: (_: any, record: Qualification) => (
|
||||
<>
|
||||
<a style={{ marginRight: 8 }} onClick={() => handleView(record)}>查看</a>
|
||||
<a onClick={() => handleEdit(record)}>修改</a>
|
||||
</>
|
||||
),
|
||||
},
|
||||
{ title: 'page.workbench.authority', dataIndex: 'authority', ellipsis: true },
|
||||
{ title: 'page.workbench.dateTime', dataIndex: 'dateTime', ellipsis: true },
|
||||
{ title: 'page.workbench.termOfValidity', dataIndex: 'termOfValidity', ellipsis: true },
|
||||
{ title: 'page.workbench.updateTime', dataIndex: 'updateTime', ellipsis: true },
|
||||
|
||||
...(viewType ? [] : [
|
||||
{
|
||||
title: 'page.workbench.attachments.action',
|
||||
dataIndex: 'option',
|
||||
width: 120,
|
||||
render: (_: any, record: Qualification) => (
|
||||
<>
|
||||
<a style={{ marginRight: 8 }} onClick={() => handleView(record)}>查看</a>
|
||||
<a onClick={() => handleEdit(record)}>修改</a>
|
||||
</>
|
||||
),
|
||||
}
|
||||
]),
|
||||
];
|
||||
|
||||
return (
|
||||
<div style={{ padding: '0 30px 0 0' }}>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<Button type="primary" onClick={handleAdd}>新增资质</Button>
|
||||
{!viewType && (
|
||||
<Button type="primary" onClick={handleAdd}>新增资质</Button>
|
||||
)}
|
||||
</div>
|
||||
<Table
|
||||
rowKey="id"
|
||||
|
Reference in New Issue
Block a user