fix: 修改镜像、代码配置审核
This commit is contained in:
parent
701f9bb522
commit
094d8aab48
|
|
@ -1,4 +1,4 @@
|
|||
import BasicInfo from '@/components/BasicInfo';
|
||||
import BasicInfo, { type BasicInfoData } from '@/components/BasicInfo';
|
||||
import KFModal from '@/components/KFModal';
|
||||
import SubAreaTitle from '@/components/SubAreaTitle';
|
||||
import { ApprovalData, ApprovalType } from '@/pages/System/Approval';
|
||||
|
|
@ -16,46 +16,108 @@ interface ApprovalModalProps extends Omit<ModalProps, 'onOk'> {
|
|||
function ApprovalModal({ record, onOk, ...rest }: ApprovalModalProps) {
|
||||
const [form] = Form.useForm();
|
||||
const content = parseJsonText(record.content);
|
||||
const recordTypeName = record.type === ApprovalType.Dataset ? '数据集' : '模型';
|
||||
let recordTypeName = '';
|
||||
const dataType = record.type;
|
||||
switch (dataType) {
|
||||
case ApprovalType.Dataset:
|
||||
recordTypeName = '数据集';
|
||||
break;
|
||||
case ApprovalType.Model:
|
||||
recordTypeName = '模型';
|
||||
break;
|
||||
case ApprovalType.IMAGE:
|
||||
recordTypeName = '图片';
|
||||
break;
|
||||
case ApprovalType.CODE:
|
||||
recordTypeName = '代码';
|
||||
break;
|
||||
default:
|
||||
recordTypeName = '未知';
|
||||
break;
|
||||
}
|
||||
|
||||
const items =
|
||||
record.type === ApprovalType.Dataset
|
||||
? [
|
||||
{
|
||||
label: '数据集名称',
|
||||
value: content.name,
|
||||
},
|
||||
{
|
||||
label: '数据集分类',
|
||||
value: content.dataType,
|
||||
},
|
||||
{
|
||||
label: '研究方向',
|
||||
value: content.dataTag,
|
||||
},
|
||||
{
|
||||
label: '数据集描述',
|
||||
value: content.description,
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
label: '模型名称',
|
||||
value: content.name,
|
||||
},
|
||||
{
|
||||
label: '模型框架',
|
||||
value: content.model_type,
|
||||
},
|
||||
{
|
||||
label: '模型能力',
|
||||
value: content.model_tag,
|
||||
},
|
||||
{
|
||||
label: '模型描述',
|
||||
value: content.description,
|
||||
},
|
||||
];
|
||||
let items: BasicInfoData[] = [];
|
||||
switch (dataType) {
|
||||
case ApprovalType.Dataset:
|
||||
items = [
|
||||
{
|
||||
label: '数据集名称',
|
||||
value: content.name,
|
||||
},
|
||||
{
|
||||
label: '数据集分类',
|
||||
value: content.dataType,
|
||||
},
|
||||
{
|
||||
label: '数据集标签',
|
||||
value: content.dataTag,
|
||||
},
|
||||
{
|
||||
label: '数据集描述',
|
||||
value: content.description,
|
||||
},
|
||||
];
|
||||
break;
|
||||
case ApprovalType.Model:
|
||||
items = [
|
||||
{
|
||||
label: '模型名称',
|
||||
value: content.name,
|
||||
},
|
||||
{
|
||||
label: '模型类型',
|
||||
value: content.model_type,
|
||||
},
|
||||
{
|
||||
label: '模型标签',
|
||||
value: content.model_tag,
|
||||
},
|
||||
{
|
||||
label: '模型描述',
|
||||
value: content.description,
|
||||
},
|
||||
];
|
||||
break;
|
||||
case ApprovalType.IMAGE:
|
||||
items = [
|
||||
{
|
||||
label: '镜像名称',
|
||||
value: content.name,
|
||||
},
|
||||
{
|
||||
label: '镜像描述',
|
||||
value: content.description,
|
||||
},
|
||||
{
|
||||
label: '版本数量',
|
||||
value: content.versionCount,
|
||||
},
|
||||
];
|
||||
break;
|
||||
case ApprovalType.CODE:
|
||||
items = [
|
||||
{
|
||||
label: '代码名称',
|
||||
value: content.codeRepoName,
|
||||
},
|
||||
{
|
||||
label: '代码地址',
|
||||
value: content.gitUrl,
|
||||
format: (value) => ({
|
||||
value: value,
|
||||
url: value,
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: '代码分支',
|
||||
value: content.gitBranch,
|
||||
},
|
||||
];
|
||||
break;
|
||||
default:
|
||||
items = [];
|
||||
break;
|
||||
}
|
||||
|
||||
// 审批通过
|
||||
const agreeApproval = async (remark?: string) => {
|
||||
|
|
@ -128,16 +190,12 @@ function ApprovalModal({ record, onOk, ...rest }: ApprovalModalProps) {
|
|||
</Button>,
|
||||
]}
|
||||
>
|
||||
<SubAreaTitle
|
||||
title="基本信息"
|
||||
image={require('@/assets/img/mirror-basic.png')}
|
||||
style={{ marginBottom: '15px' }}
|
||||
></SubAreaTitle>
|
||||
<SubAreaTitle title="基本信息" style={{ marginBottom: '15px' }}></SubAreaTitle>
|
||||
<BasicInfo
|
||||
datas={items}
|
||||
labelWidth={80}
|
||||
labelAlign="justify"
|
||||
style={{ marginBottom: 20, width: '100%' }}
|
||||
style={{ marginBottom: 25, width: '100%' }}
|
||||
></BasicInfo>
|
||||
<Form name="form" layout="vertical" form={form} autoComplete="off">
|
||||
<Form.Item
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import tableCellRender, { TableCellValueType } from '@/utils/table';
|
|||
import { useNavigate } from '@umijs/max';
|
||||
import {
|
||||
Button,
|
||||
Divider,
|
||||
Select,
|
||||
Table,
|
||||
Typography,
|
||||
|
|
@ -170,7 +169,7 @@ function ApprovalList() {
|
|||
key: 'operation',
|
||||
render: (_: any, record: ApprovalData) => (
|
||||
<div className="table-operation-column">
|
||||
<Button
|
||||
{/* <Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="view"
|
||||
|
|
@ -185,10 +184,10 @@ function ApprovalList() {
|
|||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
</Button> */}
|
||||
{record.status === ApprovalStatus.Pending ? (
|
||||
<>
|
||||
<Divider type="vertical" className="table-operation-divider" />{' '}
|
||||
{/* <Divider type="vertical" className="table-operation-divider" />{' '} */}
|
||||
<Button type="link" size="small" key="audit" onClick={() => approval(record)}>
|
||||
审核
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue