模拟考试规则维护

master
xialiang 4 years ago
parent ee6c8a0cfe
commit d1f8c8ac06

@ -5,7 +5,7 @@ import defaultSettings from './defaultSettings';
import proxy from './proxy';
const { REACT_APP_ENV } = process.env;
export default defineConfig({
history:{
history: {
type: 'hash'
},
hash: true,
@ -86,6 +86,13 @@ export default defineConfig({
{
name: '新建主题',
icon: 'smile',
path: '/course/subject/step/update/',
component: './course/subject/step',
hideInMenu: true,
},
{
name: '编辑主题',
icon: 'smile',
path: '/course/subject/step/update/:id',
component: './course/subject/step',
hideInMenu: true,
@ -145,7 +152,7 @@ export default defineConfig({
{
name: '创建模拟考试',
icon: 'smile',
path: '/examinationrules/normal/step',
path: '/examinationrules/normal/step/:id',
component: './examinationrules/normal/step',
hideInMenu: true,
},
@ -156,6 +163,13 @@ export default defineConfig({
path: '/examinationrules/attestation',
component: './examinationrules/attestation',
},
{
name: '创建资质考试规则维护',
icon: 'smile',
path: '/examinationrules/attestation/step',
component: './examinationrules/attestation/step',
hideInMenu: true,
},
],
},
{
@ -163,7 +177,7 @@ export default defineConfig({
name: '考试管理',
icon: 'profile',
routes: [
{
{
name: '考试维护',
path: '/examination/option',
component: './examination/option',
@ -182,7 +196,7 @@ export default defineConfig({
component: './examination/certificate',
},
],
},
},
{
path: '/history',
icon: 'table',
@ -195,7 +209,7 @@ export default defineConfig({
component: './history/analysis',
},
],
},
},
{
path: '/demo',
icon: 'table',
@ -291,8 +305,8 @@ export default defineConfig({
component: './profile/advanced',
},
],
},
},
{
name: 'exception',
icon: 'warning',

@ -26,7 +26,7 @@ const uuid = uuidv4();
const handleAdd = async (fields: TableListItem) => {
const hide = message.loading('正在添加');
try {
await saveCourse({ ...fields, attachment_filesize:0, });
await saveCourse({ ...fields, attachment_filesize: 0, });
hide();
message.success('添加成功');
return true;
@ -111,9 +111,8 @@ const CourseList: React.FC = () => {
valueType: 'indexBorder',
render: (text: React.ReactNode, _: any, index: number) => {
if (actionRef && actionRef?.current && actionRef?.current?.pageInfo) {
return `${
(actionRef?.current?.pageInfo?.current - 1) * actionRef.current.pageInfo?.pageSize + (index + 1)
}`;
return `${(actionRef?.current?.pageInfo?.current - 1) * actionRef.current.pageInfo?.pageSize + (index + 1)
}`;
} else {
return '';
}
@ -218,11 +217,11 @@ const CourseList: React.FC = () => {
valueType: 'select',
hideInForm: false,
request: async () => {
const {data: Items} = await queryTagList({});
const { data: Items } = await queryTagList({});
const tags = []
for(let i=0; i<Items.length; i++){
tags.push({label:Items[i].tag_name, value: Items[i].tag_id})
}
for (let i = 0; i < Items.length; i++) {
tags.push({ label: Items[i].tag_name, value: Items[i].tag_id })
}
return tags;
},
formItemProps: {
@ -246,23 +245,23 @@ const CourseList: React.FC = () => {
renderFormItem: (item, { defaultRender, ...rest }, form) => (
<Upload
action='/dsideal_yy/res/plupload/'
defaultFileList={item.initialValue?[item.initialValue]:[]}
beforeUpload={(file)=>{
defaultFileList={item.initialValue ? [item.initialValue] : []}
beforeUpload={(file) => {
console.log('file', file)
// 获取文件名
SetUploadFileName(file?.name) ;
SetUploadFileName(file?.name);
// 获取最后一个.的位置
const index = file?.name.lastIndexOf(".");
// 获取后缀
SetUploadFileExt(file?.name.substr(index+1));
SetUploadFileExt(file?.name.substr(index + 1));
}}
data={{
name: uploadFileName,
chunk: 0,
chunks: 1,
key: `down/Syzx/${uuid?.substr(0,2)}/${uuid}.${uploadFileExt}`
name: uploadFileName,
chunk: 0,
chunks: 1,
key: `down/Syzx/${uuid?.substr(0, 2)}/${uuid}.${uploadFileExt}`
}}
maxCount={1}
maxCount={1}
multiple={false}
>
<Button icon={<UploadOutlined />}></Button>
@ -329,10 +328,10 @@ const CourseList: React.FC = () => {
>
</a>,
<a
key="remove"
onClick={() => {
handleRemove([{key: record?.course_id}]); // 调用批量删除函数如果接口不支持批量需要在service中处理
<a
key="remove"
onClick={() => {
handleRemove([{ key: record?.course_id }]); // 调用批量删除函数如果接口不支持批量需要在service中处理
setSelectedRows([]);
actionRef.current?.reloadAndRest?.();
}}>
@ -388,11 +387,11 @@ const CourseList: React.FC = () => {
request={async (value) => {
console.log('value', value)
const { create_time } = value;
if(create_time){
value['begin_time'] = create_time[0]
value['end_time'] = create_time[1]
}
const {data} = await queryCourseList({
if (create_time) {
value.begin_time = create_time[0]
value.end_time = create_time[1]
}
const { data } = await queryCourseList({
...value,
page_number: value?.current || 1,
page_size: value?.pageSize,
@ -554,12 +553,12 @@ const CourseList: React.FC = () => {
// 表单处理
//console.log('columns:', columns);
console.log('values:', values);
console.log('uploadFileName',uploadFileName)
console.log('uploadFileName', uploadFileName)
//return false;
// values.attachment_json.response.file.response.url
await handleAdd({
...values,
attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/M3u8/${uuid?.substr(0,2)}/${uuid}.m3u8"}`
...values,
attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/M3u8/${uuid?.substr(0, 2)}/${uuid}.m3u8"}`
});
handleCreateModalVisible(false);
actionRef.current?.reloadAndRest?.();
@ -575,7 +574,7 @@ const CourseList: React.FC = () => {
}}
// action = ''
title="新建"
columns={columns||[]}
columns={columns || []}
/>
</Modal>

@ -28,6 +28,25 @@ export async function queryCourseList(
});
}
/**
*
* http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
* @param params
* @returns
*/
export async function querySubjectList(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/ypt/careerTraining/subject/listSubject', {
params,
});
}
/** 新建/修改课程 POST /dsideal_yy/ypt/careerTraining/course/save */
export async function saveCourse(data: Record<string, any>, options?: Record<string, any>) {
return request<TableListItem>('/dsideal_yy/ypt/careerTraining/course/save', {
@ -39,10 +58,10 @@ export async function saveCourse(data: Record<string, any>, options?: Record<str
}
/** 删除课程 POST /dsideal_yy/ypt/careerTraining/course/delete */
export async function removeCourse(data: { key: number[] }, options?: Record<string, any>) {
export async function removeCourse(data: { key: number[] }, options?: Record<string, any>) {
console.log('data:::', data);
return request<Record<string, any>>('/dsideal_yy/ypt/careerTraining/course/delete', {
data: {course_id: data?.key[0]}, // 当前接口不支持批量操作
data: { course_id: data?.key[0] }, // 当前接口不支持批量操作
method: 'POST',
requestType: 'form',
...(options || {}),

@ -1,6 +1,7 @@
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import { BetaSchemaForm, ProFormInstance, ProFormRadio, ProFormUploadButton } from '@ant-design/pro-form';
import type { ProFormInstance } from '@ant-design/pro-form';
import { BetaSchemaForm, ProFormRadio, ProFormUploadButton } from '@ant-design/pro-form';
import ProForm, {
StepsForm,
ProFormText,
@ -19,87 +20,88 @@ import { MailOutlined, AppstoreOutlined, PlusOutlined, TagsOutlined } from '@ant
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css'
import ProFormRichEdit from '../components/ProFormRichEdit';
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { TableListItem, TableListPagination } from '../../option/data';
import type { ActionType, ProColumns } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table';
import type { TableListItem, TableListPagination } from '../../option/data';
import { queryCourseList } from '../../option/service';
/** 列表项定义 */
const columns: ProColumns<TableListItem>[] = [
{
title: '序号',
key: 'index',
valueType: 'indexBorder',
width: 48,
},
{
title: '章节名称',
dataIndex: 'course_name',
valueType: 'text',
hideInTable: false,
hideInDescriptions: false,
hideInForm: false,
hideInSearch: true,
},
{
title: '简介',
dataIndex: 'lecture_teacher',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '课程',
valueType: 'textarea',
dataIndex: 'course_describe',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '学时',
dataIndex: 'course_minutes',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<a
key="detail"
onClick={() => {
//console.log('entity', entity);
//setCurrentRow(record);
//handleDetailModalVisible(true);
}}
>
</a>,
<a
key="update"
onClick={() => {
//setCurrentRow(record);
//handleUpdateModalVisible(true);
}}
>
</a>,
<a key="remove" onClick={() => { }}>
</a>,
],
},
];
{
title: '序号',
key: 'index',
valueType: 'indexBorder',
width: 48,
},
{
title: '章节名称',
dataIndex: 'course_name',
valueType: 'text',
hideInTable: false,
hideInDescriptions: false,
hideInForm: false,
hideInSearch: true,
},
{
title: '简介',
dataIndex: 'lecture_teacher',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '课程',
valueType: 'textarea',
dataIndex: 'course_describe',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '学时',
dataIndex: 'course_minutes',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<a
key="detail"
onClick={() => {
//console.log('entity', entity);
//setCurrentRow(record);
//handleDetailModalVisible(true);
}}
>
</a>,
<a
key="update"
onClick={() => {
//setCurrentRow(record);
//handleUpdateModalVisible(true);
}}
>
</a>,
<a key="remove" onClick={() => { }}>
</a>,
],
},
];
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
@ -109,243 +111,245 @@ const waitTime = (time: number = 100) => {
});
};
const numbers = [];
for(let i=0;i<50;i++){
numbers.push({id: `${i}`})
for (let i = 0; i < 50; i++) {
numbers.push({ id: `${i}` })
}
export default () => {
const formRef = useRef<ProFormInstance>();
const actionRef = useRef<ActionType>();
/** 更新窗口的弹窗 */
const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false);
const [detailModalVisible, handleDetailModalVisible] = useState<boolean>(false);
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
/** 更新窗口的弹窗 */
const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false);
const [detailModalVisible, handleDetailModalVisible] = useState<boolean>(false);
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
return (
<PageContainer content={''} extraContent={''}>
<ProCard className={styles.examinationrules}>
<ProCard className={styles.examinationrules}>
<StepsForm<{
name: string;
name: string;
}>
formRef={formRef}
onFinish={async () => {
formRef={formRef}
onFinish={async () => {
await waitTime(1000);
message.success('提交成功');
}}
formProps={{
layout: "horizontal",
labelCol: { span: 8 },
wrapperCol: { span: 12 },
validateMessages: {
required: '此项为必填项',
},
}}
>
<StepsForm.StepForm<{
name: string;
}>
name="base"
title="主题基本信息"
stepProps={{
description: false,
}}
formProps={{
layout: "horizontal",
labelCol: { span: 8 },
wrapperCol: { span: 12 },
validateMessages: {
required: '此项为必填项',
},
onFinish={async (value) => {
console.log(value, "vvvvv");
console.log(formRef.current?.getFieldsValue());
await waitTime(2000);
return true;
}}
>
<StepsForm.StepForm<{
name: string;
}>
name="base"
title="主题基本信息"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
await waitTime(2000);
return true;
>
<Row gutter={24}>
<Col lg={24} md={24} sm={24}>
<ProFormText
name="subject_name"
label="主题名称"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"
// rules={[{ required: true }]}
// value="锦书"
// disabled
/>
<ProFormRichEdit
name="subject_describe"
label="主题介绍"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入介绍"
// rules={[{ required: true }]}
// value="锦书"
// disabled
/>
<ProFormUploadButton
name="upload"
label="主题图片"
max={2}
fieldProps={{
name: 'file',
listType: 'picture-card',
data: {
name: '5.jpg',
chunk: 0,
chunks: 1,
key: 'down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A5.jpg'
}
}}
action="/dsideal_yy/res/plupload/"
extra=""
/>
</Col>
</Row>
</StepsForm.StepForm>
<StepsForm.StepForm<{
checkbox: string;
}>
name="object"
title="章节信息"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
return true;
}}
>
<div style={{ margin: '0' }}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="主题信息"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 },
});
}}
>
<Row gutter={24}>
<Col lg={24} md={24} sm={24}>
<ProFormText
name="subject_name"
label="主题名称"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"
// rules={[{ required: true }]}
// value="锦书"
// disabled
/>
<ProFormRichEdit
name="subject_describe"
label="主题介绍"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入介绍"
// rules={[{ required: true }]}
// value="锦书"
// disabled
/>
<ProFormUploadButton
name="upload"
label="主题图片"
max={2}
fieldProps={{
name: 'file',
listType: 'picture-card',
data: {
name: '5.jpg',
chunk: 0,
chunks: 1,
key: 'down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A5.jpg'
}
}}
action="/dsideal_yy/res/plupload/"
extra=""
/>
</Col>
</Row>
</StepsForm.StepForm>
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="主题名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="主题介绍" valueType="text" />
</ProDescriptions>
<StepsForm.StepForm<{
checkbox: string;
}>
name="object"
title="章节信息"
stepProps={{
description: false,
<ProTable<TableListItem, TableListPagination>
headerTitle={false}
actionRef={actionRef}
rowKey="course_id"
options={false}
search={false}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
handleCreateModalVisible(true);
}}
>
<PlusOutlined />
</Button>,
]}
request={async (value) => {
const _data = await queryCourseList(value);
return {
current: _data?.page_number,
data: _data?.data?.list,
pageSize: _data?.page_size,
total: _data?.total_row || 0,
};
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
return true;
// dataSource={list}
columns={columns}
rowSelection={false}
/>
<Modal
title="新建章节"
//
width="60%"
visible={createModalVisible}
destroyOnClose
onCancel={() => {
handleCreateModalVisible(false);
}}
>
<div style={{margin:'0'}}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="主题信息"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
});
}}
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="主题名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="主题介绍" valueType="text" />
</ProDescriptions>
footer={null}
>
<BetaSchemaForm<DataItem>
layout="horizontal"
layoutType="Form"
labelCol={{ span: 8 }}
wrapperCol={{ span: 12 }}
onFinish={async (values: any) => {
// 表单处理
console.log('columns:', columns);
console.log('values:', values);
<ProTable<TableListItem, TableListPagination>
headerTitle={false}
actionRef={actionRef}
rowKey="course_id"
options={false}
search={false}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
handleCreateModalVisible(true);
}}
>
<PlusOutlined />
</Button>,
]}
request={async (value) => {
const _data = await queryCourseList(value);
return {
current: _data?.page_number,
data: _data?.data?.list,
pageSize: _data?.page_size,
total: _data?.total_row || 0,
};
}}
// dataSource={list}
columns={columns}
rowSelection={false}
/>
<Modal
title="新建章节"
//
width="60%"
visible={createModalVisible}
destroyOnClose
onCancel={() => {
handleCreateModalVisible(false);
}}
footer={null}
>
<BetaSchemaForm<DataItem>
layout="horizontal"
layoutType="Form"
labelCol={{ span: 8 }}
wrapperCol={{ span: 12 }}
onFinish={async (values: any) => {
// 表单处理
console.log('columns:', columns);
console.log('values:', values);
}}
submitter={{
render: (props, doms) => (
<Row>
<Col span={12} offset={8}>
<Space>{doms}</Space>
</Col>
</Row>
),
}}
// action = ''
title="新建"
columns={columns}
/>
</Modal>
</div>
</StepsForm.StepForm>
}}
submitter={{
render: (props, doms) => (
<Row>
<Col span={12} offset={8}>
<Space>{doms}</Space>
</Col>
</Row>
),
}}
// action = ''
title="新建"
columns={columns}
/>
</Modal>
</div>
</StepsForm.StepForm>
<StepsForm.StepForm
name="time"
title="完成"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
// 跳转到指定路由
history.push('/course/subject');
return true;
}}
>
<StepsForm.StepForm
name="time"
title="完成"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
// 跳转到指定路由
history.push('/course/subject');
return true;
}}
>
<Row gutter={24}>
<Col lg={12} md={12} sm={12} offset={8}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="模拟考试"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
});
}}
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="考试名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="关联培训主题" valueType="text" />
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
<Row gutter={24}>
<Col lg={12} md={12} sm={12} offset={8}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="模拟考试"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 },
});
}}
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="考试名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="关联培训主题" valueType="text" />
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
<ProDescriptions.Item dataIndex="grade" label="考试信息" valueType="text" />
<ProDescriptions.Item dataIndex="grade" label="考试信息" valueType="text" />
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
</ProDescriptions>
</Col>
</Row>
</StepsForm.StepForm>
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
</ProDescriptions>
</Col>
</Row>
</StepsForm.StepForm>
</StepsForm>
</ProCard>
</ProCard>
</PageContainer>
);

@ -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, queryExaminationRules } from '../service';
import { queryTagList, saveExamination, removeExamination, queryRulesList } 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';
/**
@ -89,7 +89,7 @@ const ExaminationRules: 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,21 +99,29 @@ const ExaminationRules: React.FC = () => {
{
title: '序号',
key: 'index',
valueType: 'indexBorder',
valueType: 'indexBorder',
render: (text: React.ReactNode, _: any, index: number) => {
if (actionRef && actionRef?.current && actionRef?.current?.pageInfo) {
return `${(actionRef?.current?.pageInfo?.current - 1) * actionRef.current.pageInfo?.pageSize + (index + 1)
}`;
} else {
return '';
}
},
width: 48,
},
{
title: '考试名称',
dataIndex: 'examination_name',
dataIndex: 'subject_name',
valueType: 'text',
hideInTable: false,
hideInForm: false,
hideInSearch: true,
},
{
title: '考试时',
dataIndex: 'examination_start_time',
valueType: 'text',
title: '考试时',
dataIndex: 'examination_time',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
@ -121,8 +129,8 @@ const ExaminationRules: React.FC = () => {
renderText: (val: string) => `${val}`,
},
{
title: '关联培训',
dataIndex: 'examination_name',
title: '关联主题',
dataIndex: 'subject_name',
valueType: 'text',
hideInTable: false,
hideInForm: false,
@ -131,24 +139,17 @@ const ExaminationRules: React.FC = () => {
{
title: '创建日期',
dataIndex: 'create_time',
valueType: 'text',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '试卷数量',
dataIndex: 'paper_count',
sorter: false,
valueType: 'text',
hideInForm: false,
renderText: (val: string) => `${val}`,
},
{
title: '总分',
dataIndex: 'paper_count',
dataIndex: 'sum_score',
sorter: false,
valueType: 'text',
hideInForm: false,
@ -156,7 +157,7 @@ const ExaminationRules: React.FC = () => {
},
{
title: '通过线',
dataIndex: 'apply_person_count',
dataIndex: 'pass_score',
sorter: false,
valueType: 'text',
hideInForm: false,
@ -166,39 +167,42 @@ const ExaminationRules: React.FC = () => {
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<a
key="detail"
onClick={() => {
//console.log('entity', entity);
setCurrentRow(record);
handleDetailModalVisible(true);
}}
>
</a>,
<a
key="update"
onClick={() => {
handleUpdateModalVisible(true);
setCurrentRow(record);
}}
>
</a>,
<a key="subscribeAlert" href="https://procomponents.ant.design/">
</a>,
<a
key="registration"
onClick={() => {
history.push(`/examination/option/registration/${record.examination_id}`);
//setCurrentRow(record);
}}
>
</a>,
],
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => {
console.log(record, 'record')
return [
// <a
// key="detail"
// onClick={() => {
// //console.log('entity', entity);
// setCurrentRow(record);
// handleDetailModalVisible(true);
// }}
// >
// 查看
// </a>,
<a
key="update"
onClick={() => {
handleUpdateModalVisible(true);
setCurrentRow(record);
}}
>
</a>,
<a key="subscribeAlert" href="https://procomponents.ant.design/">
</a>,
<a
key="registration"
onClick={() => {
history.push(`/examination/option/registration/${record.examination_id}`);
//setCurrentRow(record);
}}
>
</a>,
]
},
},
];
@ -217,19 +221,27 @@ const ExaminationRules: React.FC = () => {
type="primary"
key="primary"
onClick={() => {
handleCreateModalVisible(true);
history.push('/examinationrules/attestation/step')
}}
>
<PlusOutlined />
</Button>,
]}
request={async (value) => {
const _data = await queryExaminationList(value);
const _data = await queryRulesList(
{
...value,
rules_type: 1,
page_number: value.current,
page_size: value.pageSize
}
);
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}
@ -274,7 +286,7 @@ const ExaminationRules: React.FC = () => {
}}
footer={null}
centered
>{ console.log('currentRow',currentRow)}
>{console.log('currentRow', currentRow)}
{currentRow?.name && (
<ProDescriptions<TableListItem>
column={2}

@ -5,6 +5,25 @@ type ParamsType = {
count?: number;
} & Partial<BasicListItemDataType>;
/**
*
* http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
* @param params
* @returns
*/
export async function querySubjectList(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/ypt/careerTraining/subject/listSubject', {
params,
});
}
export async function queryFakeList(
params: ParamsType,
): Promise<{ data: { list: BasicListItemDataType[] } }> {

@ -0,0 +1,27 @@
@import '~antd/es/style/themes/default.less';
.error_icon {
color: @highlight-color;
}
.title {
margin-bottom: 16px;
color: @heading-color;
font-weight: 500;
font-size: 16px;
}
.examinationrules{
:global {
.ant-pro-steps-form-step{
min-width: 960px;
}
.ant-space-align-center{
padding:24px;
display: block;
text-align: center;
.ant-space-item{
display: inline-block;
}
}
}
}

@ -0,0 +1,248 @@
import React, { useRef } from 'react';
import { history, useParams } from 'umi';
import type { ProFormInstance } from '@ant-design/pro-form';
import { ProFormRadio } from '@ant-design/pro-form';
import ProForm, {
StepsForm,
ProFormText,
ProFormDatePicker,
ProFormSelect,
ProFormTextArea,
ProFormCheckbox,
ProFormDateRangePicker,
} from '@ant-design/pro-form';
import ProCard from '@ant-design/pro-card';
import { Button, Checkbox, Col, Divider, List, Menu, message, Radio, Row, Space, Typography } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import ProDescriptions from '@ant-design/pro-descriptions';
import styles from './index.less'
import { queryProvince, querySubjectList } from '../service';
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
const numbers = [];
for (let i = 0; i < 50; i++) {
numbers.push({ id: `${i}` })
}
export default () => {
const formRef = useRef<ProFormInstance>();
const params = useParams();
console.log(params, 'params');
return (
<PageContainer content={''} extraContent={''}>
<ProCard className={styles.examinationrules}>
<StepsForm<{
name: string;
}>
formRef={formRef}
onFinish={async () => {
await waitTime(1000);
message.success('提交成功');
}}
formProps={{
layout: "horizontal",
labelCol: { span: 8 },
wrapperCol: { span: 12 },
validateMessages: {
required: '此项为必填项',
},
}}
>
<StepsForm.StepForm<{
name: string;
}>
name="base"
title="模拟考试基本信息"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
await waitTime(2000);
return true;
}}
>
<Row gutter={24}>
<Col lg={24} md={24} sm={24}>
<ProFormText
name="name"
label="考试名称"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"
rules={[{ required: true, message: '请输入考试名称' }]}
// value="锦书"
// disabled
/>
<ProFormSelect
width="md"
request={async () => {
return querySubjectList().then(({ data }) => {
console.log(data)
return data.list.map((item) => {
return {
label: item.subject_name,
value: item.subject_id,
};
});
});
}}
rules={[{ required: true, message: '请选择主题' }]}
name="unusedMode"
label="关联主题"
/>
<ProFormText name="time" label="考试时长"
rules={[{ required: true, message: '请输入考试时长' }]}
tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。" />
</Col>
</Row>
</StepsForm.StepForm>
<StepsForm.StepForm<{
checkbox: string;
}>
name="object"
title="组卷"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
return true;
}}
>
<div style={{ margin: '0' }}>
<Typography style={{ padding: 24, fontSize: 24, textAlign: 'center' }}></Typography>
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
<Radio.Group value={1} onChange={() => { }} style={{ marginBottom: 16 }}>
<Radio.Button value={1}></Radio.Button>
<Radio.Button value={2}></Radio.Button>
</Radio.Group>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Row>
<Col span={18} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title="一. 单选题 共50分每题1分"
extra={false}
split='vertical'
bordered
headerBordered
>
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
4.
</Typography>
<Radio.Group onChange={() => { return true }} value={0} size="large">
<Space direction="vertical" style={{ fontSize: 16 }}>
<Radio value={1} style={{ padding: 5, fontSize: 16 }}>A. 退</Radio>
<Radio value={2} style={{ padding: 5, fontSize: 16 }}>B. </Radio>
<Radio value={3} style={{ padding: 5, fontSize: 16 }}>C. </Radio>
<Radio value={4} style={{ padding: 5, fontSize: 16 }}>D. </Radio>
</Space>
</Radio.Group>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
5. ()
</Typography>
<Checkbox.Group onChange={() => { return true }}>
<Space direction="vertical" style={{}}>
<Checkbox value={1} style={{ padding: 5, fontSize: 16 }}>A. 退</Checkbox>
<Checkbox value={2} style={{ padding: 5, fontSize: 16 }}>B. </Checkbox>
<Checkbox value={3} style={{ padding: 5, fontSize: 16 }}>C. </Checkbox>
<Checkbox value={4} style={{ padding: 5, fontSize: 16 }}>D. </Checkbox>
</Space>
</Checkbox.Group>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
6. 退
</Typography>
<Radio.Group onChange={() => { return true }} value={0} size="large">
<Space direction="vertical" style={{ fontSize: 16 }}>
<Radio value={1} style={{ padding: 5, fontSize: 16 }}></Radio>
<Radio value={2} style={{ padding: 5, fontSize: 16 }}></Radio>
</Space>
</Radio.Group>
</Space>
</ProCard>
</Col>
<Col span={6} style={{ paddingLeft: 24 }}>
<div style={{ background: '#ffffff', padding: 24 }}>
<Space direction="vertical" style={{ width: '100%' }}>
<strong></strong>
<Typography> { } { } </Typography>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Space direction="vertical">
<Typography> { } { } </Typography>
<Typography> { } { } </Typography>
<Typography> { } { } </Typography>
</Space>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Button size="large" block></Button>
<Button size="large" type="primary" block></Button>
</Space>
</div>
</Col>
</Row>
</div>
</StepsForm.StepForm>
<StepsForm.StepForm
name="time"
title="完成"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
// 跳转到指定路由
history.push('/examinationrules/normal');
return true;
}}
>
<Row gutter={24}>
<Col lg={12} md={12} sm={12} offset={8}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="模拟考试"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 },
});
}}
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="考试名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="关联培训主题" valueType="text" />
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
<ProDescriptions.Item dataIndex="grade" label="考试信息" valueType="text" />
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
</ProDescriptions>
</Col>
</Row>
</StepsForm.StepForm>
</StepsForm>
</ProCard>
</PageContainer>
);
};

@ -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, queryExaminationRules } from '../service';
import { queryTagList, 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';
/**
@ -89,7 +89,7 @@ const ExaminationRules: 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,21 +99,29 @@ const ExaminationRules: React.FC = () => {
{
title: '序号',
key: 'index',
valueType: 'indexBorder',
valueType: 'indexBorder',
render: (text: React.ReactNode, _: any, index: number) => {
if (actionRef && actionRef?.current && actionRef?.current?.pageInfo) {
return `${(actionRef?.current?.pageInfo?.current - 1) * actionRef.current.pageInfo?.pageSize + (index + 1)
}`;
} else {
return '';
}
},
width: 48,
},
{
title: '考试名称',
dataIndex: 'examination_name',
title: '规则名称',
dataIndex: 'rules_name',
valueType: 'text',
hideInTable: false,
hideInForm: false,
hideInSearch: true,
},
{
title: '考试时',
dataIndex: 'examination_start_time',
valueType: 'text',
title: '考试时',
dataIndex: 'examination_time',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
@ -121,8 +129,8 @@ const ExaminationRules: React.FC = () => {
renderText: (val: string) => `${val}`,
},
{
title: '关联培训',
dataIndex: 'examination_name',
title: '关联主题',
dataIndex: 'subject_name',
valueType: 'text',
hideInTable: false,
hideInForm: false,
@ -131,24 +139,17 @@ const ExaminationRules: React.FC = () => {
{
title: '创建日期',
dataIndex: 'create_time',
valueType: 'text',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: true,
renderText: (val: string) => `${val}`,
},
{
title: '试卷数量',
dataIndex: 'paper_count',
sorter: false,
valueType: 'text',
hideInForm: false,
renderText: (val: string) => `${val}`,
},
{
title: '总分',
dataIndex: 'paper_count',
dataIndex: 'sum_score',
sorter: false,
valueType: 'text',
hideInForm: false,
@ -156,7 +157,7 @@ const ExaminationRules: React.FC = () => {
},
{
title: '通过线',
dataIndex: 'apply_person_count',
dataIndex: 'pass_score',
sorter: false,
valueType: 'text',
hideInForm: false,
@ -166,39 +167,42 @@ const ExaminationRules: React.FC = () => {
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<a
key="detail"
onClick={() => {
//console.log('entity', entity);
setCurrentRow(record);
handleDetailModalVisible(true);
}}
>
</a>,
<a
key="update"
onClick={() => {
handleUpdateModalVisible(true);
setCurrentRow(record);
}}
>
</a>,
<a key="subscribeAlert" href="https://procomponents.ant.design/">
</a>,
<a
key="registration"
onClick={() => {
history.push(`/examination/option/registration/${record.examination_id}`);
//setCurrentRow(record);
}}
>
</a>,
],
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => {
console.log(record, 'record')
return [
// <a
// key="detail"
// onClick={() => {
// //console.log('entity', entity);
// setCurrentRow(record);
// handleDetailModalVisible(true);
// }}
// >
// 查看
// </a>,
<a
key="update"
onClick={() => {
history.push('/examinationrules/normal/step/' + record.id)
}}
>
</a>,
<a key="subscribeAlert" href="https://procomponents.ant.design/">
</a>,
<a
key="registration"
onClick={() => {
history.push(`/examination/option/registration/${record.examination_id}`);
//setCurrentRow(record);
}}
>
{record.b_use == 0 ? "未发布" : "已发布"}
</a>,
]
},
},
];
@ -220,16 +224,24 @@ const ExaminationRules: React.FC = () => {
history.push('/examinationrules/normal/step')
}}
>
<PlusOutlined />
<PlusOutlined />
</Button>,
]}
request={async (value) => {
const _data = await queryExaminationList(value);
const _data = await queryExaminationList(
{
...value,
rules_type: 0,
page_number: value.current,
page_size: value.pageSize
}
);
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}
@ -274,7 +286,7 @@ const ExaminationRules: React.FC = () => {
}}
footer={null}
centered
>{ console.log('currentRow',currentRow)}
>{console.log('currentRow', currentRow)}
{currentRow?.name && (
<ProDescriptions<TableListItem>
column={2}

@ -13,6 +13,25 @@ export async function queryFakeList(
});
}
/**
*
* http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
* @param params
* @returns
*/
export async function querySubjectList(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/ypt/careerTraining/subject/listSubject', {
params,
});
}
export async function removeFakeList(
params: ParamsType,
): Promise<{ data: { list: BasicListItemDataType[] } }> {

@ -1,239 +1,268 @@
import React, { useRef } from 'react';
import { history } from 'umi';
import { ProFormInstance, ProFormRadio } from '@ant-design/pro-form';
import { history, useParams, useRequest } from 'umi';
import type { ProFormInstance } from '@ant-design/pro-form';
import { ProFormRadio } from '@ant-design/pro-form';
import ProForm, {
StepsForm,
ProFormText,
ProFormDatePicker,
ProFormSelect,
ProFormTextArea,
ProFormCheckbox,
ProFormDateRangePicker,
StepsForm,
ProFormText,
ProFormDatePicker,
ProFormSelect,
ProFormTextArea,
ProFormCheckbox,
ProFormDateRangePicker,
} from '@ant-design/pro-form';
import ProCard from '@ant-design/pro-card';
import { Button, Checkbox, Col, Divider, List, Menu, message, Radio, Row, Space, Typography } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import ProDescriptions from '@ant-design/pro-descriptions';
import styles from './index.less'
import { MailOutlined, AppstoreOutlined } from '@ant-design/icons';
import { saveExamination, querySubjectList, queryRulesView } from '../../service';
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
const numbers = [];
for(let i=0;i<50;i++){
numbers.push({id: `${i}`})
for (let i = 0; i < 50; i++) {
numbers.push({ id: `${i}` })
}
export default () => {
const formRef = useRef<ProFormInstance>();
return (
<PageContainer content={''} extraContent={''}>
<ProCard className={styles.examinationrules}>
<StepsForm<{
name: string;
}>
formRef={formRef}
onFinish={async () => {
await waitTime(1000);
message.success('提交成功');
}}
formProps={{
layout: "horizontal",
labelCol: { span: 8 },
wrapperCol: { span: 12 },
validateMessages: {
required: '此项为必填项',
},
}}
>
<StepsForm.StepForm<{
name: string;
}>
name="base"
title="模拟考试基本信息"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
await waitTime(2000);
return true;
}}
>
<Row gutter={24}>
<Col lg={24} md={24} sm={24}>
<ProFormText
name="name"
label="考试名称"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"
// rules={[{ required: true }]}
// value="锦书"
// disabled
/>
<ProFormSelect
width="md"
options={[
{
value: '1',
label: '主题1',
},
{
value: '2',
label: '主题3',
},
]}
name="unusedMode"
label="关联主题"
/>
<ProFormText name="time" label="考试时长" tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。"/>
</Col>
</Row>
</StepsForm.StepForm>
<StepsForm.StepForm<{
checkbox: string;
const formRef = useRef<ProFormInstance>();
const params = useParams();
console.log(params, 'params');
if (params) {
const data = useRequest(async () => {
return await queryRulesView(params);
});
console.log(data, 'data1`11');
}
return (
<PageContainer content={''} extraContent={''}>
<ProCard className={styles.examinationrules}>
<StepsForm<{
name: string;
}>
name="object"
title="组卷"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
return true;
}}
>
<div style={{margin:'0'}}>
<Typography style={{padding:24, fontSize: 24, textAlign: 'center'}}></Typography>
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
<Radio.Group value={1} onChange={()=>{}} style={{ marginBottom: 16 }}>
<Radio.Button value={1}></Radio.Button>
<Radio.Button value={2}></Radio.Button>
</Radio.Group>
<Divider style={{margin:'6px 0', opacity: 0.5}}/>
<Row>
<Col span={18} style={{background:'#ffffff', padding:0}}>
<ProCard
title="一. 单选题 共50分每题1分"
extra={false}
split='vertical'
bordered
headerBordered
>
<Space direction="vertical" style={{width:'100%', padding: '24px 48px'}}>
<Typography style={{marginBottom:16, fontSize:18}}>
4.
</Typography>
<Radio.Group onChange={()=>{return true}} value={0} size="large">
<Space direction="vertical" style={{fontSize:16}}>
<Radio value={1} style={{padding:5, fontSize:16}}>A. 退</Radio>
<Radio value={2} style={{padding:5, fontSize:16}}>B. </Radio>
<Radio value={3} style={{padding:5, fontSize:16}}>C. </Radio>
<Radio value={4} style={{padding:5, fontSize:16}}>D. </Radio>
</Space>
</Radio.Group>
formRef={formRef}
onFinish={async (e) => {
console.log(e, 'eeeeeeeeeee');
await waitTime(1000);
message.success('提交成功');
}}
formProps={{
layout: "horizontal",
labelCol: { span: 8 },
wrapperCol: { span: 12 },
validateMessages: {
required: '此项为必填项',
},
}}
>
<StepsForm.StepForm<{
name: string;
}>
name="base"
title="模拟考试基本信息"
stepProps={{
description: false,
}}
onFinish={async (fileds) => {
console.log(fileds, 'fileds');
await saveExamination({
...fileds,
b_use: 0,
rules_type: 0,
});
await waitTime(2000);
return true;
}}
>
<Row gutter={24}>
<Col lg={24} md={24} sm={24}>
<ProFormText
name="rules_name"
label="考试名称"
width="md"
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"
rules={[{ required: true, message: '请输入考试名称' }]}
// value="锦书"
// disabled
/>
<ProFormSelect
width="md"
<Typography style={{marginBottom:16, fontSize:18}}>
5. ()
</Typography>
<Checkbox.Group onChange={()=>{return true}}>
<Space direction="vertical" style={{}}>
<Checkbox value={1} style={{padding:5, fontSize:16}}>A. 退</Checkbox>
<Checkbox value={2} style={{padding:5, fontSize:16}}>B. </Checkbox>
<Checkbox value={3} style={{padding:5, fontSize:16}}>C. </Checkbox>
<Checkbox value={4} style={{padding:5, fontSize:16}}>D. </Checkbox>
</Space>
</Checkbox.Group>
<Typography style={{marginBottom:16, fontSize:18}}>
6. 退
</Typography>
<Radio.Group onChange={()=>{return true}} value={0} size="large">
<Space direction="vertical" style={{fontSize:16}}>
<Radio value={1} style={{padding:5, fontSize:16}}></Radio>
<Radio value={2} style={{padding:5, fontSize:16}}></Radio>
</Space>
request={async () => {
return querySubjectList().then(({ data }) => {
console.log(data, 'querySubjectList')
return data.list.map((item) => {
return {
label: item.subject_name,
value: item.subject_id,
};
});
});
}}
rules={[{ required: true, message: '请选择主题' }]}
name="subject_id"
label="关联主题"
/>
<ProFormText name="examination_time" label="考试时长"
rules={[{ required: true, message: '请输入考试时长' }]}
tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。" />
</Col>
</Row>
</StepsForm.StepForm>
<StepsForm.StepForm<{
checkbox: string;
}>
name="object"
title="组卷"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
return true;
}}
>
<div style={{ margin: '0' }}>
<Typography style={{ padding: 24, fontSize: 24, textAlign: 'center' }}></Typography>
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
<Radio.Group value={1} onChange={() => { }} style={{ marginBottom: 16 }}>
<Radio.Button value={1}></Radio.Button>
<Radio.Button value={2}></Radio.Button>
</Radio.Group>
</Space>
</ProCard>
</Col>
<Col span={6} style={{paddingLeft:24}}>
<div style={{background:'#ffffff', padding:24}}>
<Space direction="vertical" style={{width:'100%'}}>
<strong></strong>
<Typography> {} {} </Typography>
<Divider style={{margin:'6px 0', opacity: 0.5}}/>
<Space direction="vertical">
<Typography> {} {} </Typography>
<Typography> {} {} </Typography>
<Typography> {} {} </Typography>
</Space>
<Divider style={{margin:'6px 0', opacity: 0.5}}/>
<Button size="large" block></Button>
<Button size="large" type="primary" block></Button>
</Space>
</div>
</Col>
</Row>
</div>
</StepsForm.StepForm>
<StepsForm.StepForm
name="time"
title="完成"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
// 跳转到指定路由
history.push('/examinationrules/normal');
return true;
}}
>
<Row gutter={24}>
<Col lg={12} md={12} sm={12} offset={8}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="模拟考试"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
});
}}
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="考试名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="关联培训主题" valueType="text" />
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
<ProDescriptions.Item dataIndex="grade" label="考试信息" valueType="text" />
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
</ProDescriptions>
</Col>
</Row>
</StepsForm.StepForm>
</StepsForm>
</ProCard>
</PageContainer>
);
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Row>
<Col span={18} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title="一. 单选题 共50分每题1分"
extra={false}
split='vertical'
bordered
headerBordered
>
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
4.
</Typography>
<Radio.Group onChange={() => { return true }} value={0} size="large">
<Space direction="vertical" style={{ fontSize: 16 }}>
<Radio value={1} style={{ padding: 5, fontSize: 16 }}>A. 退</Radio>
<Radio value={2} style={{ padding: 5, fontSize: 16 }}>B. </Radio>
<Radio value={3} style={{ padding: 5, fontSize: 16 }}>C. </Radio>
<Radio value={4} style={{ padding: 5, fontSize: 16 }}>D. </Radio>
</Space>
</Radio.Group>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
5. ()
</Typography>
<Checkbox.Group onChange={() => { return true }}>
<Space direction="vertical" style={{}}>
<Checkbox value={1} style={{ padding: 5, fontSize: 16 }}>A. 退</Checkbox>
<Checkbox value={2} style={{ padding: 5, fontSize: 16 }}>B. </Checkbox>
<Checkbox value={3} style={{ padding: 5, fontSize: 16 }}>C. </Checkbox>
<Checkbox value={4} style={{ padding: 5, fontSize: 16 }}>D. </Checkbox>
</Space>
</Checkbox.Group>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
6. 退
</Typography>
<Radio.Group onChange={() => { return true }} value={0} size="large">
<Space direction="vertical" style={{ fontSize: 16 }}>
<Radio value={1} style={{ padding: 5, fontSize: 16 }}></Radio>
<Radio value={2} style={{ padding: 5, fontSize: 16 }}></Radio>
</Space>
</Radio.Group>
</Space>
</ProCard>
</Col>
<Col span={6} style={{ paddingLeft: 24 }}>
<div style={{ background: '#ffffff', padding: 24 }}>
<Space direction="vertical" style={{ width: '100%' }}>
<strong></strong>
<Typography> { } { } </Typography>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Space direction="vertical">
<Typography> { } { } </Typography>
<Typography> { } { } </Typography>
<Typography> { } { } </Typography>
</Space>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Button size="large" block></Button>
<Button size="large" type="primary" block></Button>
</Space>
</div>
</Col>
</Row>
</div>
</StepsForm.StepForm>
<StepsForm.StepForm
name="time"
title="完成"
stepProps={{
description: false,
}}
onFinish={async () => {
console.log(formRef.current?.getFieldsValue());
// 跳转到指定路由
history.push('/examinationrules/normal');
return true;
}}
>
<Row gutter={24}>
<Col lg={12} md={12} sm={12} offset={8}>
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="模拟考试"
request={async () => {
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 },
});
}}
extra={false}
>
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="object" label="考试名称" valueType="text" />
<ProDescriptions.Item dataIndex="date" label="关联培训主题" valueType="text" />
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
<ProDescriptions.Item dataIndex="grade" label="考试信息" valueType="text" />
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
</ProDescriptions>
</Col>
</Row>
</StepsForm.StepForm>
</StepsForm>
</ProCard>
</PageContainer>
);
};

@ -1,8 +1,8 @@
import { request } from 'umi';
import { TableListItem } from './data';
import type { TableListItem } from './data';
/** 获取考试列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */
export async function queryExaminationList(
/** 获取考试规则列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */
export async function queryRulesList(
params: {
// query
/** 当前的页码 */
@ -10,7 +10,7 @@ export async function queryExaminationList(
/** 页面的容量 */
pageSize?: number;
},
options?: { [key: string]: any },
options?: Record<string, any>,
) {
return request<{
data: TableListItem[];
@ -19,7 +19,7 @@ export async function queryExaminationList(
/** 页面的容量 */
page_size?: number;
success?: boolean;
}>('/api/zygh/training/examination/getExaminationList', {
}>('/dsideal_yy/zygh/training/rules/getRulesList', {
method: 'GET',
params: {
...params,
@ -37,7 +37,7 @@ export async function queryCertificateList(
/** 页面的容量 */
pageSize?: number;
},
options?: { [key: string]: any },
options?: Record<string, any>,
) {
return request<{
data: TableListItem[];
@ -55,17 +55,46 @@ export async function queryCertificateList(
});
}
/** 新建/修改考试 POST /dsideal_yy/ypt/careerTraining/course/save */
export async function saveExamination(data: { [key: string]: any }, options?: { [key: string]: any }) {
return request<TableListItem>('/dsideal_yy/ypt/careerTraining/course/save', {
data,
method: 'POST',
/** 获取考试规则列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */
export async function queryRulesView(
params: {
// query
/** 当前的页码 */
id?: number;
},
options?: Record<string, any>,
) {
return request('/dsideal_yy/zygh/training/rules/getRulesById', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 删除考试 POST /dsideal_yy/ypt/careerTraining/course/delete */
export async function removeExamination(data: { key: number[] }, options?: { [key: string]: any }) {
export async function removeExamination(data: { key: number[] }, options?: Record<string, any>) {
return request<Record<string, any>>('/dsideal_yy/ypt/careerTraining/course/delete', {
data,
method: 'POST',
@ -74,7 +103,7 @@ export async function removeExamination(data: { key: number[] }, options?: { [ke
}
/** 查看考试仅仅获取考试详情不标记浏览量GET /dsideal_yy/ypt/careerTraining/course/view */
export async function queryExaminationView(data: { [key: string]: any }, options?: { [key: string]: any }) {
export async function queryExaminationView(data: Record<string, any>, options?: Record<string, any>) {
return request<TableListItem>('/dsideal_yy/ypt/careerTraining/course/view', {
data,
method: 'POST',
@ -91,7 +120,7 @@ export async function queryRegistrationList(
/** 页面的容量 */
pageSize?: number;
},
options?: { [key: string]: any },
options?: Record<string, any>,
) {
return request<{
data: TableListItem[];

Loading…
Cancel
Save