xialiang 3 years ago
commit 1045d34682

@ -77,6 +77,10 @@ export default defineConfig({
icon: 'table', icon: 'table',
name: '课程管理', name: '课程管理',
routes: [ routes: [
{
path: '/course',
redirect: '/course/subject',
},
{ {
name: '主题设置', name: '主题设置',
icon: 'smile', icon: 'smile',
@ -124,6 +128,10 @@ export default defineConfig({
icon: 'table', icon: 'table',
name: '题库维护', name: '题库维护',
routes: [ routes: [
{
path: '/questionbank',
redirect: '/questionbank/normal',
},
{ {
name: '常规题库维护', name: '常规题库维护',
icon: 'smile', icon: 'smile',
@ -144,7 +152,7 @@ export default defineConfig({
name: '考试规则维护', name: '考试规则维护',
routes: [ routes: [
{ {
name: '模拟考试规则维护', name: '模拟考试规则设置',
icon: 'smile', icon: 'smile',
path: '/examinationrules/normal', path: '/examinationrules/normal',
component: './examinationrules/normal', component: './examinationrules/normal',
@ -164,7 +172,7 @@ export default defineConfig({
hideInMenu: true, hideInMenu: true,
}, },
{ {
name: '资质考试规则维护', name: '资质考试规则设置',
icon: 'smile', icon: 'smile',
path: '/examinationrules/attestation', path: '/examinationrules/attestation',
component: './examinationrules/attestation', component: './examinationrules/attestation',
@ -212,7 +220,7 @@ export default defineConfig({
name: '制证名单', name: '制证名单',
icon: 'smile', icon: 'smile',
hideInMenu: true, hideInMenu: true,
path: '/examination/certificate/person/:id/:accreditation_status', path: '/examination/certificate/person/:id/:accreditation_status/:name',
component: './examination/certificate/person', component: './examination/certificate/person',
}, },
], ],

@ -208,7 +208,7 @@ const CourseList: React.FC = () => {
<a <a
key="detail" key="detail"
onClick={() => { onClick={() => {
history.push('/examination/certificate/person/' + record.examination_id + "/" + record.accreditation_status) history.push('/examination/certificate/person/' + record.examination_id + "/" + record.accreditation_status + "/" + encodeURIComponent(record.examination_name))
}} }}
> >

@ -1,7 +1,7 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { useRequest, useParams } from 'umi'; import { useRequest, useParams, Link } from 'umi';
import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'; import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Select } from 'antd'; import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Select, Breadcrumb } from 'antd';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import type { ProColumns, ActionType } from '@ant-design/pro-table'; import type { ProColumns, ActionType } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
@ -207,7 +207,23 @@ const CourseList: React.FC = () => {
]; ];
return ( return (
<PageContainer> <PageContainer
header={{
breadcrumbRender: (props, originBreadcrumb)=>{
return <Breadcrumb>
<Breadcrumb.Item>
<Link to="/examination/option"></Link>
</Breadcrumb.Item>
<Breadcrumb.Item>
<Link to="/examination/certificate"></Link>
</Breadcrumb.Item>
<Breadcrumb.Item>
<Link to="">{decodeURIComponent(params?.name)}</Link>
</Breadcrumb.Item>
</Breadcrumb>
}
}}
>
<ProTable<TableListItem, TableListPagination> <ProTable<TableListItem, TableListPagination>
headerTitle={false} headerTitle={false}
actionRef={actionRef} actionRef={actionRef}

@ -320,7 +320,7 @@ export default () => {
// tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。" // tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。"
/> />
<ProFormDateRangePicker name="dateRange" label="试卷有效期" initialValue={[ruleData.start_time, ruleData.end_time]} /> <ProFormDateRangePicker name="dateRange" label="试卷有效期" initialValue={[ruleData.start_time, ruleData.end_time]} rules={[{ required: true, message: '请输试卷有效期' }]} />
</> </>
)} )}
</Col> </Col>

@ -94,7 +94,7 @@ const ScoreSetter = (props: any, ref: any) => {
{ (record?.code === 1) && { (record?.code === 1) &&
<> <>
<span>:</span> <span>:</span>
<Form.Item style={{margin:0}} name={`score_harf`}><InputNumber min={0} type="number" defaultValue={questionTypeValues ? questionTypeValues[index]?.score_harf : 0} placeholder="请输入" size="small" name='score_harf' onChange={(value)=>{ <Form.Item style={{margin:0}} name={`score_harf`}><InputNumber min={0} max={99} maxLength={2} type="number" defaultValue={questionTypeValues ? questionTypeValues[index]?.score_harf : 0} placeholder="请输入" size="small" name='score_harf' onChange={(value)=>{
// //
const _data = []; const _data = [];
console.log('typeScore',typeScore) console.log('typeScore',typeScore)
@ -202,7 +202,7 @@ const ScoreSetter = (props: any, ref: any) => {
> >
<EditableProTable <EditableProTable
title={()=>{ title={()=>{
return <Space> {sumQuestion} , {sumScore} 线 return <Space size="large"><span> {sumQuestion} ,</span><span> {sumScore} </span> 线
<Form.Item style={{margin:0}} name='pass_socre' initialValue={0}><InputNumber min={0} onChange={(value)=>{ <Form.Item style={{margin:0}} name='pass_socre' initialValue={0}><InputNumber min={0} onChange={(value)=>{
setPassScore(value) setPassScore(value)
}} /></Form.Item> }} /></Form.Item>

@ -337,7 +337,9 @@ export default () => {
onFinish={async () => { onFinish={async () => {
console.log(formRef.current?.getFieldsValue()); console.log(formRef.current?.getFieldsValue());
setCurrentStep(2) // 设置步骤号 setCurrentStep(2) // 设置步骤号
runPaper({ rules_id: params?.id }) //alert(params?.id || rulesId)
runPaper({ rules_id: params?.id || rulesId })
return true; return true;
}} }}
> >

@ -37,11 +37,11 @@ const formItemLayoutWithOutLabel = {
}, },
}; };
console.log('first'); console.log('first');
const AnswersSelector = () => { const AnswersSelector = (props) => {
const {type} = props;
return ( return (
<Form.List <Form.List
initialValue={['','','','']} initialValue={type === 2 ? ['正确','错误'] : ['','','','']}
name="answers" name="answers"
rules={[ rules={[
{ {
@ -76,14 +76,15 @@ const AnswersSelector = () => {
> >
<Input placeholder="" style={{ width: '80%' }} /> <Input placeholder="" style={{ width: '80%' }} />
</Form.Item> </Form.Item>
{fields.length > 1 ? ( {(fields.length > 1) && (type !== 2) &&
<MinusCircleOutlined <MinusCircleOutlined
className="dynamic-delete-button" className="dynamic-delete-button"
onClick={() => remove(field.name)} onClick={() => remove(field.name)}
/> />
) : null} }
</Form.Item> </Form.Item>
))} ))}
{ (type !== 2) &&
<Form.Item> <Form.Item>
<Button <Button
type="dashed" type="dashed"
@ -95,6 +96,7 @@ const AnswersSelector = () => {
</Button> </Button>
<Form.ErrorList errors={errors} /> <Form.ErrorList errors={errors} />
</Form.Item> </Form.Item>
}
</> </>
)} )}
</Form.List> </Form.List>

@ -207,7 +207,7 @@ const QuestionBank = () => {
hideInForm: false, hideInForm: false,
hideInSearch: true, hideInSearch: true,
renderFormItem: (item, { defaultRender, ...rest }, form) => ( renderFormItem: (item, { defaultRender, ...rest }, form) => (
<AnswersSelector /> <AnswersSelector type={addType?.value || Number(form.getFieldValue('question_type'))} />
), ),
formItemProps: { formItemProps: {
rules: [ rules: [
@ -240,11 +240,12 @@ const QuestionBank = () => {
} }
console.log('answers??',form.getFieldValue('answers')?.length) console.log('answers??',form.getFieldValue('answers')?.length)
console.log('addType?.value', addType?.value) console.log('addType?.value', addType?.value)
// 0 单选 1 多选 2 判断 // 0 单选 1 多选 2 判断
return ((addType?.value === 0) || (Number(form.getFieldValue('question_type')) === 0) || Number(form.getFieldValue('question_type')) === 2) ? return ((addType?.value === 0 || addType?.value === 2) || (Number(form.getFieldValue('question_type')) === 0) || Number(form.getFieldValue('question_type')) === 2) ?
<Radio.Group <Radio.Group
name="answertrue" name="answertrue"
options={['A', 'B', 'C', 'D']} options={addType?.value === 0 || (Number(form.getFieldValue('question_type')) === 0) ? ['A', 'B', 'C', 'D'] : ['A', 'B']}
/> />
: :
<Checkbox.Group <Checkbox.Group
@ -365,7 +366,7 @@ const QuestionBank = () => {
return [ return [
<Dropdown overlay={menu}> <Dropdown overlay={menu}>
<Button type="primary"> <Button type="primary">
<PlusOutlined /> <DownOutlined /> <PlusOutlined /> <DownOutlined />
</Button> </Button>
</Dropdown>, </Dropdown>,
<Button key="remove" type="primary" danger onClick={async (value)=>{ <Button key="remove" type="primary" danger onClick={async (value)=>{

@ -99,7 +99,11 @@ const CardList = () => {
JSON.stringify(last_data)!=='{}'? JSON.stringify(last_data)!=='{}'?
<> <>
<Row> <Row>
<Col span={16} style={{ display: 'inline-block', padding: 10 }}><span></span><span style={{ display: 'inline-block', width: '80%' }}><Progress percent={subject_data ? subject_data.subject_learning_progress * 100 : 0} /></span></Col> <Col span={16} style={{ display: 'inline-block', padding: 10 }}><span></span><span style={{ display: 'inline-block', width: '80%' }}>
<Progress percent={subject_data ? subject_data.subject_learning_progress * 100 : 0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</span></Col>
</Row> </Row>
<Row> <Row>
<Col span={10} style={{ padding: 10 }}><span></span><span>{last_data ? last_data.course_name : '--'}</span></Col> <Col span={10} style={{ padding: 10 }}><span></span><span>{last_data ? last_data.course_name : '--'}</span></Col>
@ -169,7 +173,9 @@ 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?.course_hours}</div> <div style={{ paddingRight: '1rem', width: '10%', display: 'inline-block' }}>{item?.course_hours}</div>
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}> <div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
<Progress percent={item?.learning_progress * 100} /> <Progress percent={item?.learning_progress * 100}
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 type="primary" onClick={() => {

@ -70,7 +70,12 @@ const SubjectList = () => {
<div dangerouslySetInnerHTML={{__html:item.subject_describe}}/> <div dangerouslySetInnerHTML={{__html:item.subject_describe}}/>
</Paragraph> </Paragraph>
</Card.Grid> </Card.Grid>
<Card.Grid hoverable={false} style={{width:'30%',textAlign:'center'}}><Progress type="circle" percent={item?.subject_learning_progress*100} /></Card.Grid> <Card.Grid hoverable={false} style={{width:'30%',textAlign:'center'}}>
<Progress type="circle"
percent={item?.subject_learning_progress*100}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'20%',textAlign:'center'}}> <Card.Grid hoverable={false} style={{width:'20%',textAlign:'center'}}>
<Button type="primary" onClick={()=>{ <Button type="primary" onClick={()=>{
const info=item.data_id+','+item.data_type+','+item.subject_id; const info=item.data_id+','+item.data_type+','+item.subject_id;

@ -44,20 +44,20 @@ const SubjectList = () => {
hoverable hoverable
className={styles.card} className={styles.card}
actions={[]} actions={[]}
extra={<><span style={{ padding: 10 }}>:{item?.learning_start_time}</span><span style={{ padding: 10 }}>{item?.distance_end_time}</span><span style={{ padding: 10 }}>{item?.total_course_hours}</span></>} // extra={<><span style={{ padding: 10 }}>开始学习时间:{item?.learning_start_time}</span><span style={{ padding: 10 }}>距离结束时间:{item?.distance_end_time}</span><span style={{ padding: 10 }}>考核学时:{item?.total_course_hours}小时</span></>}
> >
<Card.Meta <Card.Meta
avatar={<Image preview={false} width={200} height={150} src={`${item.attachment_json.url}`} fallback="../fallback.svg" />} avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />}sss
title={false} title={false}
description={ description={
<> <>
<Card.Grid hoverable={false} style={{ width: '50%', padding: 0 }}> <Card.Grid hoverable={false} style={{ width: '50%', padding: 0 }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }}> <Paragraph className={styles.item} ellipsis={{ rows: 4 }}>
{item.subject_describe} <div dangerouslySetInnerHTML={{__html:item.subject_describe}}/>
</Paragraph> </Paragraph>
</Card.Grid> </Card.Grid>
<Card.Grid hoverable={false} style={{ width: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid> {/*<Card.Grid hoverable={false} style={{ width: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid>*/}
<Card.Grid hoverable={false} style={{ width: '20%', textAlign: 'center' }}> <Card.Grid hoverable={false} style={{ width: '50%', textAlign: 'right' }}>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
const info = item.data_id + ',' + item.data_type + ',' + item.subject_id; const info = item.data_id + ',' + item.data_type + ',' + item.subject_id;
history.push(`/mockExamination/chapterExamination/chapterList/${item.data_id}/${item.data_type}/${item.subject_id}`); history.push(`/mockExamination/chapterExamination/chapterList/${item.data_id}/${item.data_type}/${item.subject_id}`);

@ -1,6 +1,6 @@
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 } from 'antd'; import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography,Image } 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 } from './service';
@ -57,15 +57,16 @@ 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 = result.finish_count / result.question_count; num = item.finish_count/item.question_count;
item.process = num.toFixed(4) item.process = parseFloat(num).toFixed(2)
} else { } else {
item.process = 0; item.process = 0;
} }
}); });
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 = total_num.toFixed(4) total_process = parseFloat(total_num).toFixed(2)
} else { } else {
total_process = 0; total_process = 0;
@ -98,6 +99,8 @@ const CardList = () => {
const content = ( const content = (
<div className={styles.pageHeaderContent}> <div className={styles.pageHeaderContent}>
{
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}
@ -105,20 +108,21 @@ const CardList = () => {
actions={[]} actions={[]}
> >
<Card.Meta <Card.Meta
avatar={<img alt="" className={styles.cardAvatar} src={'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png'} style={{ width: '270px', height: '150px', borderRadius: '10px' }} />} avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${subject_data.attachment_json.url}`} fallback="../fallback.svg" />}
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.subject_describe : '--'} {subject_data ?
<div dangerouslySetInnerHTML={{__html:subject_data.subject_describe}}/>
: '--'}
</Paragraph> </Paragraph>
<Row>
<Col span={16} style={{ display: 'inline-block', padding: 10 }}><span></span><span style={{ display: 'inline-block', width: '80%' }}><Progress percent={total_process * 100} /></span></Col> </Card.Grid>
</Row> <Card.Grid hoverable={false} style={{width:'25%',textAlign:'center',boxShadow: 'none'}}>
<Row>
<Col span={4} style={{ padding: 10 }}>
<Button type="primary" <Button type="primary"
style={{width:'10rem',height:'6rem'}}
onClick={() => { onClick={() => {
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')
@ -127,13 +131,27 @@ const CardList = () => {
}} }}
></Button> ></Button>
</Col>
</Row>
</Card.Grid> </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> </div>
); );
@ -178,7 +196,7 @@ 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?.progress * 100} /> <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 type="primary" onClick={() => {

Loading…
Cancel
Save