|
|
|
@ -11,9 +11,9 @@ import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
|
|
|
|
import ProDescriptions from '@ant-design/pro-descriptions';
|
|
|
|
|
import type { FormValueType } from './components/UpdateForm';
|
|
|
|
|
import UpdateForm from './components/UpdateForm';
|
|
|
|
|
import { queryTagList, saveExamination, removeExamination, queryExaminationList } from '../service';
|
|
|
|
|
import { querySubjectList, saveExamination, removeExamination, queryExaminationList } from '../service';
|
|
|
|
|
import type { TableListItem, TableListPagination } from './data';
|
|
|
|
|
import { DataItem } from '@antv/data-set/lib/transform/tag-cloud';
|
|
|
|
|
import type { DataItem } from '@antv/data-set/lib/transform/tag-cloud';
|
|
|
|
|
import RegistrationList from '../registration';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -89,7 +89,7 @@ const ExaminationList: React.FC = () => {
|
|
|
|
|
const [detailModalVisible, handleDetailModalVisible] = useState<boolean>(false);
|
|
|
|
|
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
|
|
|
|
|
//const [registrationModalVisible, handleRegistrationModalVisible] = useState<boolean>(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const actionRef = useRef<ActionType>();
|
|
|
|
|
const [currentRow, setCurrentRow] = useState<TableListItem>();
|
|
|
|
|
const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]);
|
|
|
|
@ -99,7 +99,7 @@ const ExaminationList: React.FC = () => {
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
key: 'index',
|
|
|
|
|
valueType: 'indexBorder',
|
|
|
|
|
valueType: 'indexBorder',
|
|
|
|
|
width: 48,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -108,37 +108,63 @@ const ExaminationList: React.FC = () => {
|
|
|
|
|
valueType: 'text',
|
|
|
|
|
hideInTable: false,
|
|
|
|
|
hideInForm: false,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
hideInSearch: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '创建日期',
|
|
|
|
|
dataIndex: 'create_time',
|
|
|
|
|
valueType: 'text',
|
|
|
|
|
valueType: 'text',
|
|
|
|
|
sorter: false,
|
|
|
|
|
hideInTable: false,
|
|
|
|
|
hideInForm: false,
|
|
|
|
|
hideInForm: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
renderText: (val: string) => `${val}`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报名开始日期',
|
|
|
|
|
title: '报名日期',
|
|
|
|
|
dataIndex: 'apply_start_time',
|
|
|
|
|
valueType: 'text',
|
|
|
|
|
valueType: 'datetimeRange',
|
|
|
|
|
sorter: false,
|
|
|
|
|
hideInTable: false,
|
|
|
|
|
hideInForm: false,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
renderText: (val: string) => `${val}`,
|
|
|
|
|
render: (dom, entity) => {
|
|
|
|
|
return entity.apply_start_time + " - " + entity.apply_end_time;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '考试开始时间',
|
|
|
|
|
valueType: 'text',
|
|
|
|
|
title: '考试时间',
|
|
|
|
|
valueType: 'datetimeRange',
|
|
|
|
|
dataIndex: 'examination_start_time',
|
|
|
|
|
sorter: false,
|
|
|
|
|
hideInTable: false,
|
|
|
|
|
hideInForm: false,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
renderText: (val: string) => `${val}`,
|
|
|
|
|
render: (dom, entity) => {
|
|
|
|
|
return entity.examination_start_time + " - " + entity.examination_end_time;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: '关联1主题',
|
|
|
|
|
dataIndex: 'subject_id',
|
|
|
|
|
valueType: 'text',
|
|
|
|
|
hideInTable: true,
|
|
|
|
|
hideInForm: false,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
request: async () => {
|
|
|
|
|
const { data: Items } = await querySubjectList({});
|
|
|
|
|
// console.log(Items, ')))');
|
|
|
|
|
|
|
|
|
|
const sinfo = []
|
|
|
|
|
for (let i = 0; i < Items.list.length; i++) {
|
|
|
|
|
// console.log(Items.list[i], ">>>")
|
|
|
|
|
sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id })
|
|
|
|
|
}
|
|
|
|
|
console.log(sinfo, 'sinfo');
|
|
|
|
|
|
|
|
|
|
return sinfo;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '试卷数量',
|
|
|
|
@ -227,12 +253,26 @@ const ExaminationList: React.FC = () => {
|
|
|
|
|
</Button>,
|
|
|
|
|
]}
|
|
|
|
|
request={async (value) => {
|
|
|
|
|
const _data = await queryExaminationList(value);
|
|
|
|
|
const { create_time } = value;
|
|
|
|
|
if (create_time) {
|
|
|
|
|
value.start_time = create_time[0]
|
|
|
|
|
value.end_time = create_time[1]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _data = await queryExaminationList(
|
|
|
|
|
{
|
|
|
|
|
...value,
|
|
|
|
|
page_number: value.current,
|
|
|
|
|
page_size: value.pageSize
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
console.log(_data, 'form _data')
|
|
|
|
|
return {
|
|
|
|
|
current: _data?.page_number,
|
|
|
|
|
data: _data?.data?.list,
|
|
|
|
|
pageSize: _data?.page_size,
|
|
|
|
|
total: _data?.total_row || 0,
|
|
|
|
|
current: _data?.pageNumber,
|
|
|
|
|
data: _data?.table_List,
|
|
|
|
|
pageSize: _data?.pageSize,
|
|
|
|
|
total: _data?.totalRow || 0,
|
|
|
|
|
};
|
|
|
|
|
}}
|
|
|
|
|
// dataSource={list}
|
|
|
|
@ -277,16 +317,36 @@ const ExaminationList: React.FC = () => {
|
|
|
|
|
}}
|
|
|
|
|
footer={null}
|
|
|
|
|
centered
|
|
|
|
|
>{ console.log('currentRow',currentRow)}
|
|
|
|
|
>{console.log('currentRow', currentRow)}
|
|
|
|
|
{currentRow?.name && (
|
|
|
|
|
<ProDescriptions<TableListItem>
|
|
|
|
|
column={2}
|
|
|
|
|
/* title={currentRow?.name} */
|
|
|
|
|
dataSource={currentRow}
|
|
|
|
|
/*
|
|
|
|
|
request={async () => ({
|
|
|
|
|
data: currentRow || {},
|
|
|
|
|
})}*/
|
|
|
|
|
request={async (value) => {
|
|
|
|
|
console.log(value, 'form value')
|
|
|
|
|
const { create_time } = value;
|
|
|
|
|
if (create_time) {
|
|
|
|
|
value.start_time = create_time[0]
|
|
|
|
|
value.end_time = create_time[1]
|
|
|
|
|
}
|
|
|
|
|
const _data = await getExaminationList(
|
|
|
|
|
{
|
|
|
|
|
...value,
|
|
|
|
|
rules_type: 0,
|
|
|
|
|
|
|
|
|
|
page_number: value.current,
|
|
|
|
|
page_size: value.pageSize
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
current: _data?.pageNumber,
|
|
|
|
|
data: _data?.table_List,
|
|
|
|
|
pageSize: _data?.pageSize,
|
|
|
|
|
total: _data?.totalRow || 0,
|
|
|
|
|
};
|
|
|
|
|
}}
|
|
|
|
|
params={{
|
|
|
|
|
id: currentRow?.examination_id,
|
|
|
|
|
}}
|
|
|
|
|