Compare commits

...

3 Commits

@ -164,7 +164,7 @@ const CourseList: React.FC = () => {
},
{
title: '通过人数',
dataIndex: 'apply_person_count',
dataIndex: 'pass_count',
sorter: false,
valueType: 'text',
hideInForm: false,

@ -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 {

@ -524,6 +524,9 @@ const ExaminationList: React.FC = () => {
}}
onFinish={async (values: any) => {
console.log("Form ", schemaForm)
// 表单处理
//console.log('columns:', columns);
console.log('values1:', values);
@ -543,6 +546,8 @@ const ExaminationList: React.FC = () => {
delete params.course_time
delete params.examination_time
const success = await handleUpdate(params);
if (success) {
@ -553,6 +558,7 @@ const ExaminationList: React.FC = () => {
schemaForm.resetFields()
}
}
}}

@ -104,6 +104,9 @@ const RegistrationList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]);
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}
>
<ExportOutlined />
</Button>,
@ -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,

@ -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 = (
<div className={styles.pageHeaderContent}>
{
subject_data.length!==0?
subject_data.length !== 0 ?
<Card
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
hoverable={false}
@ -117,42 +117,60 @@ const CardList = () => {
title={false}
description={
<>
<Card.Grid hoverable={false} style={{ width: '100%', padding: 0, boxShadow: 'none' }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{ paddingLeft: 10 }}>
{subject_data ?
<div dangerouslySetInnerHTML={{__html:subject_data.subject_describe}}/>
: '--'}
</Paragraph>
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'25%',textAlign:'center',boxShadow: 'none'}}>
<Button type="primary"
style={{width:'10rem',height:'5rem'}}
onClick={() => {
console.log('last_data', last_data)
const info = subject_data.subject_id + "," + cookie.load('person_id')
console.log(subject_data, 'subject_data')
history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`)
}}
></Button>
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'50%',textAlign:'center',boxShadow: 'none'}}>
<span style={{ display: 'inline-block', width:'100%' }}>
<Progress width={70}
type="circle"
percent={parseInt(total_process * 100)}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</span>
<span></span>
</Card.Grid>
<Card.Grid hoverable={false} style={{ width: '100%', padding: 0, boxShadow: 'none' }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{ paddingLeft: 10 }}>
{subject_data ?
<div dangerouslySetInnerHTML={{ __html: subject_data.subject_describe }} />
: '--'}
</Paragraph>
</Card.Grid>
<Card.Grid hoverable={false} style={{ width: '25%', textAlign: 'center', boxShadow: 'none' }}>
<Button type="primary"
style={{ width: '10rem', height: '5rem' }}
onClick={async () => {
console.log('last_data', last_data)
const info = subject_data.subject_id + "," + cookie.load('person_id')
console.log(subject_data, 'subject_data')
const _data1 = await getErrorQuestionList({
subject_id: params.subject_id,
person_id: cookie.load('person_id'),
});
let num = 0
if (_data1.success) {
_data1.list.map((e, i) => {
num += e.question_list.length
})
}
console.log(_data1, '_data1', num);
if (num > 0) {
history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`)
} else {
message.error("暂无错题");
}
}}
></Button>
</Card.Grid>
<Card.Grid hoverable={false} style={{ width: '50%', textAlign: 'center', boxShadow: 'none' }}>
<span style={{ display: 'inline-block', width: '100%' }}>
<Progress width={70}
type="circle"
percent={parseInt(total_process * 100)}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</span>
<span></span>
</Card.Grid>
</>
}
/>
</Card>
:<div/>
: <div />
}
@ -202,15 +220,18 @@ const CardList = () => {
<div title={item?.course_name} style={{ paddingRight: '1rem', width: '30%', display: 'inline-block', verticalAlign: 'middle', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{item?.course_name}</div>
<div style={{ paddingRight: '1rem', width: '10%', display: 'inline-block' }}>{item?.finish_count}/{item?.question_count}</div>
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
<Progress percent={item?parseInt(item.process * 100):0} format={(percent) => percent === 100 ? '100%' : `${percent}%`}/>
<Progress percent={item ? parseInt(item.process * 100) : 0} format={(percent) => percent === 100 ? '100%' : `${percent}%`} />
</div>
<div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}>
<Button type="primary" onClick={() => {
const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id;
console.log(info)
history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`)
<Button
type="primary"
disabled={item.question_count > 0 ? false : true}
onClick={() => {
const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id;
console.log(info)
history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`)
}}></Button>
}}></Button>
</div>
</div>
@ -224,7 +245,7 @@ const CardList = () => {
</Col>
</Row>
</PageContainer>
</PageContainer >
);
};

@ -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 <img src={location.pathname + '/dsideal_yy/html/' + entity.url} width="200" height="100" />;
},
},
{
title: '标题',
dataIndex: 'rules_name',
hideInTable: true,
},
{
title: "内容",
dataIndex: "content",
hideInTable: false,
hideInForm: true,
hideInSearch: true,
render: (dom, entity) => {
return (
<p>
<h3>{entity.subject_name}</h3>
<hr color='#f0f0f0' />
<div>{entity.examination_time}</div>
<div>{entity.sum_score}</div>
<div>{entity.pass_score}</div>
</p>
)
},
},
{
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) => [
<a
<Button
type="primary"
key="editable"
onClick={() => {
history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`);
}}
>
</a>,
</Button>,
],
},
];
@ -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="高级表格"
/>
</div>
</PageContainer>

Loading…
Cancel
Save