master
xialiang 3 years ago
parent 4ab835ae9a
commit 3f7d2db323

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

@ -174,11 +174,20 @@ const CourseList: React.FC = () => {
sorter: false, sorter: false,
valueType: 'text', valueType: 'text',
hideInForm: false, hideInForm: false,
hideInSearch: false, hideInSearch: true,
render: (dom, entity) => { render: (dom, entity) => {
return params.accreditation_status == 1 ? "已制证" : "未制证"; 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, city_id: value.city_id ? value.city_id : 0,
district_id: value.district_id ? value.district_id : 0, district_id: value.district_id ? value.district_id : 0,
page_number: value.current, page_number: value.current,
page_size: value.pageSize page_size: value.pageSize, is_pass: 1
}); });
return { return {

@ -255,6 +255,10 @@ const ExaminationList: React.FC = () => {
{ {
required: true, required: true,
message: '请选择主题开放时间', message: '请选择主题开放时间',
}, {
validator: () => {
callback('请输入正确的内容!');
}
} }
] ]
}, },
@ -524,6 +528,9 @@ const ExaminationList: React.FC = () => {
}} }}
onFinish={async (values: any) => { onFinish={async (values: any) => {
console.log("Form ", schemaForm)
// 表单处理 // 表单处理
//console.log('columns:', columns); //console.log('columns:', columns);
console.log('values1:', values); console.log('values1:', values);
@ -543,6 +550,8 @@ const ExaminationList: React.FC = () => {
delete params.course_time delete params.course_time
delete params.examination_time delete params.examination_time
/*
const success = await handleUpdate(params); const success = await handleUpdate(params);
if (success) { if (success) {
@ -553,6 +562,7 @@ const ExaminationList: React.FC = () => {
schemaForm.resetFields() schemaForm.resetFields()
} }
} }
*/
}} }}

@ -104,6 +104,9 @@ const RegistrationList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]); const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]);
const [exportBtn, setExportBtn] = useState(true);
/** 获取列数据初始值 */ /** 获取列数据初始值 */
const getInitialValues = (cols: any[], vals: any) => { const getInitialValues = (cols: any[], vals: any) => {
const initialValues: any[] = []; const initialValues: any[] = [];
@ -241,7 +244,7 @@ const RegistrationList: React.FC = () => {
type="primary" type="primary"
key="primary" key="primary"
href={`/dsideal_yy/zygh/training/person/exportPersonApplyData?examination_id=${params.id}`} href={`/dsideal_yy/zygh/training/person/exportPersonApplyData?examination_id=${params.id}`}
disabled={exportBtn}
> >
<ExportOutlined /> <ExportOutlined />
</Button>, </Button>,
@ -268,7 +271,8 @@ const RegistrationList: React.FC = () => {
delete value.examination_time delete value.examination_time
// setExportData(value) // setExportData(value)
const _data = await getExaminationPersonApplyList(value); const _data = await getExaminationPersonApplyList(value);
console.log(_data, '_data 111111')
_data.totalRow > 0 ? setExportBtn(false) : setExportBtn(true)
return { return {
current: _data?.page_number, current: _data?.page_number,
data: _data?.table_List, data: _data?.table_List,

@ -1,9 +1,9 @@
import { AlignLeftOutlined, LaptopOutlined, NotificationOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons'; import { AlignLeftOutlined, LaptopOutlined, NotificationOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons';
import { useEffect, useState } from 'react'; 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 { PageContainer } from '@ant-design/pro-layout';
import { useParams, useRequest, history } from 'umi'; import { useParams, useRequest, history } from 'umi';
import { viewMyLearningSubject, getCourseExaminationProgressList } from './service'; import { viewMyLearningSubject, getCourseExaminationProgressList, getErrorQuestionList } from './service';
import type { CardListItemDataType } from './data.d'; import type { CardListItemDataType } from './data.d';
import styles from './style.less'; import styles from './style.less';
import SubMenu from 'antd/lib/menu/SubMenu'; import SubMenu from 'antd/lib/menu/SubMenu';
@ -29,8 +29,8 @@ const CardList = () => {
subject_id: params?.subject_id subject_id: params?.subject_id
}); });
},{ }, {
onSuccess:(result)=>{ onSuccess: (result) => {
setSelectedMenu(result.chapter_list[0].chapter_id.toString()) setSelectedMenu(result.chapter_list[0].chapter_id.toString())
} }
}); });
@ -62,13 +62,13 @@ const CardList = () => {
total_question_count += item.question_count; total_question_count += item.question_count;
if (item.finish_count !== 0) { if (item.finish_count !== 0) {
let num = 0; let num = 0;
num = item.finish_count/item.question_count; num = item.finish_count / item.question_count;
item.process = parseFloat(num).toFixed(2) item.process = parseFloat(num).toFixed(2)
} else { } else {
item.process = 0; item.process = 0;
} }
}); });
console.log('result.list',result.list) console.log('result.list', result.list)
if (total_finish_count !== 0) { if (total_finish_count !== 0) {
const total_num = total_finish_count / total_question_count; const total_num = total_finish_count / total_question_count;
total_process = parseFloat(total_num).toFixed(2) total_process = parseFloat(total_num).toFixed(2)
@ -105,7 +105,7 @@ const CardList = () => {
const content = ( const content = (
<div className={styles.pageHeaderContent}> <div className={styles.pageHeaderContent}>
{ {
subject_data.length!==0? subject_data.length !== 0 ?
<Card <Card
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>} title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
hoverable={false} hoverable={false}
@ -117,42 +117,60 @@ const CardList = () => {
title={false} title={false}
description={ description={
<> <>
<Card.Grid hoverable={false} style={{ width: '100%', padding: 0, boxShadow: 'none' }}> <Card.Grid hoverable={false} style={{ width: '100%', padding: 0, boxShadow: 'none' }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{ paddingLeft: 10 }}> <Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{ paddingLeft: 10 }}>
{subject_data ? {subject_data ?
<div dangerouslySetInnerHTML={{__html:subject_data.subject_describe}}/> <div dangerouslySetInnerHTML={{ __html: subject_data.subject_describe }} />
: '--'} : '--'}
</Paragraph> </Paragraph>
</Card.Grid> </Card.Grid>
<Card.Grid hoverable={false} style={{width:'25%',textAlign:'center',boxShadow: 'none'}}> <Card.Grid hoverable={false} style={{ width: '25%', textAlign: 'center', boxShadow: 'none' }}>
<Button type="primary" <Button type="primary"
style={{width:'10rem',height:'5rem'}} style={{ width: '10rem', height: '5rem' }}
onClick={() => { onClick={async () => {
console.log('last_data', last_data) console.log('last_data', last_data)
const info = subject_data.subject_id + "," + cookie.load('person_id') const info = subject_data.subject_id + "," + cookie.load('person_id')
console.log(subject_data, 'subject_data') console.log(subject_data, 'subject_data')
history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`)
}} const _data1 = await getErrorQuestionList({
></Button> subject_id: params.subject_id,
</Card.Grid> person_id: cookie.load('person_id'),
<Card.Grid hoverable={false} style={{width:'50%',textAlign:'center',boxShadow: 'none'}}> });
<span style={{ display: 'inline-block', width:'100%' }}> let num = 0
<Progress width={70} if (_data1.success) {
type="circle" _data1.list.map((e, i) => {
percent={parseInt(total_process * 100)} num += e.question_list.length
format={(percent) => percent === 100 ? '100%' : `${percent}%`} })
/>
</span> }
<span></span> console.log(_data1, '_data1', num);
</Card.Grid> 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> </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 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: '10%', display: 'inline-block' }}>{item?.finish_count}/{item?.question_count}</div>
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}> <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>
<div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}> <div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}>
<Button type="primary" onClick={() => { <Button
const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id; type="primary"
console.log(info) disabled={item.question_count > 0 ? false : true}
history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`) 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>
</div> </div>
@ -224,7 +245,7 @@ const CardList = () => {
</Col> </Col>
</Row> </Row>
</PageContainer> </PageContainer >
); );
}; };

@ -2,7 +2,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { Button, Card, List, Progress, Typography, Image } from 'antd'; import { Button, Card, List, Progress, Typography, Image } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import { getRulesList } from './service'; import { getRulesList, getSubjectInfo } from './service';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import styles from './style.less'; import styles from './style.less';
@ -14,57 +14,78 @@ const SubjectList = () => {
{ {
dataIndex: 'index', dataIndex: 'index',
valueType: 'indexBorder', valueType: 'indexBorder',
width: 48,
hideInTable: true,
}, },
{ {
title: '封面', title: '封面',
valueType: 'text', valueType: 'image',
request: async (params) => { dataIndex: 'url',
//alert(123) width: "10%",
// console.log('arr',arr) render: (dom, entity) => {
// const {tags} = arr; return <img src={location.pathname + '/dsideal_yy/html/' + entity.url} width="200" height="100" />;
console.log('params::::', params );
const { data } = await getRulesList({b_use: 0});
return '123';
}, },
}, },
{ {
title: '标题', title: '标题',
dataIndex: 'rules_name', 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: '考试时间', title: '考试时间',
key: 'examination_time', key: 'examination_time',
dataIndex: 'examination_time', dataIndex: 'examination_time',
valueType: 'text', valueType: 'text',
hideInTable: true,
}, },
{ {
title: '总分', title: '总分',
key: 'sum_score', key: 'sum_score',
dataIndex: 'sum_score', dataIndex: 'sum_score',
valueType: 'text', valueType: 'text',
hideInTable: true,
}, },
{ {
title: '及格', title: '及格',
key: 'pass_score', key: 'pass_score',
dataIndex: 'pass_score', dataIndex: 'pass_score',
valueType: 'text', valueType: 'text',
hideInTable: true,
}, },
{ {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: "10%",
render: (text, record, _, action) => [ render: (text, record, _, action) => [
<a <Button
type="primary"
key="editable" key="editable"
onClick={() => { onClick={() => {
history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`); history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`);
}} }}
> >
</a>, </Button>,
], ],
}, },
]; ];
@ -82,19 +103,18 @@ const SubjectList = () => {
rules_type: 0 rules_type: 0
}) })
console.log(RulesData.table_List) 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, console.log('rulesList', rulesList)
b_use: 1,
rules_type: 0
});
const _data1 = await getRulesList({
...value,
b_use: 1,
rules_type: 0
});
return { data: RulesData.table_List } return { data: rulesList }
}} }}
/*editable={{ /*editable={{
type: 'multiple', type: 'multiple',
@ -109,8 +129,8 @@ const SubjectList = () => {
pagination={{ pagination={{
pageSize: 10, pageSize: 10,
}} }}
//dateFormatter="string" //dateFormatter="string"
//headerTitle="高级表格" //headerTitle="高级表格"
/> />
</div> </div>
</PageContainer> </PageContainer>

Loading…
Cancel
Save