diff --git a/admin/src/pages/examination/certificate/index.tsx b/admin/src/pages/examination/certificate/index.tsx index 2934c9e..832ff9c 100644 --- a/admin/src/pages/examination/certificate/index.tsx +++ b/admin/src/pages/examination/certificate/index.tsx @@ -164,7 +164,7 @@ const CourseList: React.FC = () => { }, { title: '通过人数', - dataIndex: 'apply_person_count', + dataIndex: 'pass_count', sorter: false, valueType: 'text', hideInForm: false, diff --git a/admin/src/pages/examination/certificate/person.tsx b/admin/src/pages/examination/certificate/person.tsx index 8d63115..ab64d1c 100644 --- a/admin/src/pages/examination/certificate/person.tsx +++ b/admin/src/pages/examination/certificate/person.tsx @@ -174,11 +174,20 @@ const CourseList: React.FC = () => { sorter: false, valueType: 'text', hideInForm: false, - hideInSearch: false, + hideInSearch: true, render: (dom, entity) => { return params.accreditation_status == 1 ? "已制证" : "未制证"; }, }, + { + title: '姓名或学校', + dataIndex: 'bureau_name', + sorter: true, + valueType: 'text', + hideInForm: true, + hideInSearch: false, + + }, ]; @@ -233,7 +242,7 @@ const CourseList: React.FC = () => { city_id: value.city_id ? value.city_id : 0, district_id: value.district_id ? value.district_id : 0, page_number: value.current, - page_size: value.pageSize + page_size: value.pageSize, is_pass: 1 }); return { diff --git a/admin/src/pages/examination/option/index.tsx b/admin/src/pages/examination/option/index.tsx index 1ed2575..0bac274 100644 --- a/admin/src/pages/examination/option/index.tsx +++ b/admin/src/pages/examination/option/index.tsx @@ -255,6 +255,10 @@ const ExaminationList: React.FC = () => { { required: true, message: '请选择主题开放时间', + }, { + validator: () => { + callback('请输入正确的内容!'); + } } ] }, @@ -524,6 +528,9 @@ const ExaminationList: React.FC = () => { }} onFinish={async (values: any) => { + console.log("Form ", schemaForm) + + // 表单处理 //console.log('columns:', columns); console.log('values1:', values); @@ -543,6 +550,8 @@ const ExaminationList: React.FC = () => { delete params.course_time delete params.examination_time + + /* const success = await handleUpdate(params); if (success) { @@ -553,6 +562,7 @@ const ExaminationList: React.FC = () => { schemaForm.resetFields() } } + */ }} diff --git a/admin/src/pages/examination/registration/index.tsx b/admin/src/pages/examination/registration/index.tsx index 612f3f2..9223898 100644 --- a/admin/src/pages/examination/registration/index.tsx +++ b/admin/src/pages/examination/registration/index.tsx @@ -104,6 +104,9 @@ const RegistrationList: React.FC = () => { const [selectedRowsState, setSelectedRows] = useState([]); + const [exportBtn, setExportBtn] = useState(true); + + /** 获取列数据初始值 */ const getInitialValues = (cols: any[], vals: any) => { const initialValues: any[] = []; @@ -241,7 +244,7 @@ const RegistrationList: React.FC = () => { type="primary" key="primary" href={`/dsideal_yy/zygh/training/person/exportPersonApplyData?examination_id=${params.id}`} - + disabled={exportBtn} > 导出名单 , @@ -268,7 +271,8 @@ const RegistrationList: React.FC = () => { delete value.examination_time // setExportData(value) const _data = await getExaminationPersonApplyList(value); - + console.log(_data, '_data 111111') + _data.totalRow > 0 ? setExportBtn(false) : setExportBtn(true) return { current: _data?.page_number, data: _data?.table_List, diff --git a/web/src/pages/mockExamination/chapterList.tsx b/web/src/pages/mockExamination/chapterList.tsx index 44e559d..eaedcd9 100644 --- a/web/src/pages/mockExamination/chapterList.tsx +++ b/web/src/pages/mockExamination/chapterList.tsx @@ -1,9 +1,9 @@ import { AlignLeftOutlined, LaptopOutlined, NotificationOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons'; import { useEffect, useState } from 'react'; -import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography,Image } from 'antd'; +import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography, Image, message } from 'antd'; import { PageContainer } from '@ant-design/pro-layout'; import { useParams, useRequest, history } from 'umi'; -import { viewMyLearningSubject, getCourseExaminationProgressList } from './service'; +import { viewMyLearningSubject, getCourseExaminationProgressList, getErrorQuestionList } from './service'; import type { CardListItemDataType } from './data.d'; import styles from './style.less'; import SubMenu from 'antd/lib/menu/SubMenu'; @@ -29,8 +29,8 @@ const CardList = () => { subject_id: params?.subject_id }); - },{ - onSuccess:(result)=>{ + }, { + onSuccess: (result) => { setSelectedMenu(result.chapter_list[0].chapter_id.toString()) } }); @@ -62,13 +62,13 @@ const CardList = () => { total_question_count += item.question_count; if (item.finish_count !== 0) { let num = 0; - num = item.finish_count/item.question_count; + num = item.finish_count / item.question_count; item.process = parseFloat(num).toFixed(2) } else { item.process = 0; } }); - console.log('result.list',result.list) + console.log('result.list', result.list) if (total_finish_count !== 0) { const total_num = total_finish_count / total_question_count; total_process = parseFloat(total_num).toFixed(2) @@ -105,7 +105,7 @@ const CardList = () => { const content = (
{ - subject_data.length!==0? + subject_data.length !== 0 ? {subject_data ? subject_data.subject_name : '--'}} hoverable={false} @@ -117,42 +117,60 @@ const CardList = () => { title={false} description={ <> - - - {subject_data ? -
- : '--'} - - - - - - - - - percent === 100 ? '100%' : `${percent}%`} - /> - - 章节模拟考试进度 - + + + {subject_data ? +
+ : '--'} + + + + + + + + + percent === 100 ? '100%' : `${percent}%`} + /> + + 章节模拟考试进度 + } /> - :
+ :
} @@ -202,15 +220,18 @@ const CardList = () => {
{item?.course_name}
{item?.finish_count}题/{item?.question_count}题
- percent === 100 ? '100%' : `${percent}%`}/> + percent === 100 ? '100%' : `${percent}%`} />
- + }}>开始考试
@@ -224,7 +245,7 @@ const CardList = () => { - + ); }; diff --git a/web/src/pages/mockExamination/index.tsx b/web/src/pages/mockExamination/index.tsx index 68e2435..0441e1c 100644 --- a/web/src/pages/mockExamination/index.tsx +++ b/web/src/pages/mockExamination/index.tsx @@ -2,7 +2,7 @@ import { PlusOutlined } from '@ant-design/icons'; import { Button, Card, List, Progress, Typography, Image } from 'antd'; import { PageContainer } from '@ant-design/pro-layout'; import { history } from 'umi'; -import { getRulesList } from './service'; +import { getRulesList, getSubjectInfo } from './service'; import React, { useRef } from 'react'; import styles from './style.less'; @@ -14,57 +14,78 @@ const SubjectList = () => { { dataIndex: 'index', valueType: 'indexBorder', - width: 48, + + hideInTable: true, }, { title: '封面', - valueType: 'text', - request: async (params) => { - //alert(123) - // console.log('arr',arr) - // const {tags} = arr; - console.log('params::::', params ); - const { data } = await getRulesList({b_use: 0}); - return '123'; + valueType: 'image', + dataIndex: 'url', + width: "10%", + render: (dom, entity) => { + return ; }, }, { title: '标题', dataIndex: 'rules_name', + hideInTable: true, + }, + { + title: "内容", + dataIndex: "content", + hideInTable: false, + hideInForm: true, + hideInSearch: true, + render: (dom, entity) => { + return ( +

+

{entity.subject_name}

+
+
考试时间:{entity.examination_time}分钟
+
满分:{entity.sum_score}分
+
及格:{entity.pass_score}分
+

+ ) + }, }, - { title: '考试时间', key: 'examination_time', dataIndex: 'examination_time', valueType: 'text', + hideInTable: true, }, { title: '总分', key: 'sum_score', dataIndex: 'sum_score', valueType: 'text', + hideInTable: true, }, { title: '及格', key: 'pass_score', dataIndex: 'pass_score', valueType: 'text', + hideInTable: true, }, - + { title: '操作', valueType: 'option', + width: "10%", render: (text, record, _, action) => [ - { history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`); }} > 开始考试 - , - + , + ], }, ]; @@ -82,19 +103,18 @@ const SubjectList = () => { rules_type: 0 }) console.log(RulesData.table_List) + const rulesList = RulesData.table_List + rulesList.map(async (e, i) => { + const _data1 = await getSubjectInfo({ + subject_id: e.subject_id + }); + const urlInfo = JSON.parse(JSON.stringify(_data1.data.attachment_json)) + rulesList[i].url = urlInfo.url - const _data = await getRulesList({ - ...value, - b_use: 1, - rules_type: 0 - }); - const _data1 = await getRulesList({ - ...value, - b_use: 1, - rules_type: 0 - }); + }) + console.log('rulesList', rulesList) - return { data: RulesData.table_List } + return { data: rulesList } }} /*editable={{ type: 'multiple', @@ -109,8 +129,8 @@ const SubjectList = () => { pagination={{ pageSize: 10, }} - //dateFormatter="string" - //headerTitle="高级表格" + //dateFormatter="string" + //headerTitle="高级表格" />