You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

179 lines
4.5 KiB

import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form';
import { getDictOptions } from '@/utils/dict';
import { useRender } from '@/hooks/component/useRender';
import { uploadDocument } from '@/api/documentReview/DocumentTasks';
import { useUserStore } from '@/store/modules/user';
import { RoleEnum } from '@/enums/roleEnum';
const { roleList } = useUserStore();
export const formSchemas: FormSchema[] = [
{
label: '任务名称',
field: 'taskNameList',
component: 'Select',
componentProps: {
options: getDictOptions('scheme_review'),
mode: 'multiple',
},
},
{
label: '文档名称',
field: 'documentName',
component: 'Input',
},
// {
// label: '预计时间',
// field: 'estimatedCompletionTime',
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// },
{
label: '状态',
field: 'progressStatus',
component: 'Select',
componentProps: {
options: getDictOptions('document_task_status'),
},
},
];
const { renderDict } = useRender();
export const columns: BasicColumn[] = [
{
title: '文档名称',
dataIndex: 'documentName',
},
{
title: '模型所属区域',
dataIndex: 'taskRegion',
customRender: ({ value }) => renderDict(value, 'model_region'),
},
{
title: '模型所属行业',
dataIndex: 'taskIndustry',
customRender: ({ value }) => renderDict(value, 'model_industry'),
},
{
title: '上传时间',
dataIndex: 'createTime',
},
{
title: '提交人',
dataIndex: 'createUser',
auth: 'documentReview:DocumentTasks:tableShow',
},
{
title: '进度',
dataIndex: 'progress',
},
];
export const childColumns: BasicColumn[] = [
{
title: '任务名称',
dataIndex: 'taskName',
customRender: ({ value,record }) => renderDict(value, record.taskType),
},
{
title: '任务类型',
dataIndex: 'taskType',
ifShow: false,
customRender: ({ value }) => renderDict(value, 'task_type'),
},
{
title: '任务耗时',
dataIndex: 'taskDuration',
},
{
title: '状态',
dataIndex: 'progressStatus',
customRender: ({ value }) => renderDict(value, 'document_task_status'),
},
];
export const modalSchemas: FormSchema[] = [
{
label: '模型所属区域',
field: 'taskRegion',
required: true,
component: 'Select',
// componentProps: {
// options: taskRegionPermission(),
// defaultValue:"normal",
// },
componentProps: () => {
const isSuperAdmin = roleList.includes(RoleEnum.SUPER_ADMIN);
let options = getDictOptions('model_region');
if (!isSuperAdmin) {
// 如果不是超级管理员,移除 label 带有 '#' 的项
options = options.filter((option) => !option.label.includes('#'));
}
return {
options: options,
defaultValue: 'normal',
};
},
},
{
label: '模型所属行业',
field: 'taskIndustry',
required: true,
component: 'Select',
componentProps: {
options: getDictOptions('model_industry'),
defaultValue: 'normal',
},
},
{
label: '任务名称',
field: 'taskNameList',
required: true,
component: 'Select',
componentProps: () => {
const isSuperAdmin = roleList.includes(RoleEnum.SUPER_ADMIN);
let options = getDictOptions('scheme_review');
return {
options: options,
mode: 'multiple',
};
},
},
{
label: '文档名称',
field: 'ossId',
required: true,
component: 'Upload',
componentProps: {
accept: ['.docx', '.doc', '.wps'],
maxSize: 500,
multiple: false,
resultField: 'ossId',
api: uploadDocument,
beforeUploadPrompt:"严禁在本互联网非涉密平台处理、传输国家秘密。请再次确认您上传的文件资料不涉及国家秘密。"
},
},
// {
// label: '预计时间',
// field: 'estimatedCompletionTime',
// required: true,
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// },
// {
// label: '状态',
// field: 'progressStatus',
// required: true,
// component: 'Select',
// componentProps: {
// options: getDictOptions('document_task_status')
// },
// },
];