xialiang 3 years ago
commit 1045d34682

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

@ -208,7 +208,7 @@ const CourseList: React.FC = () => {
<a
key="detail"
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 { useRequest, useParams } from 'umi';
import { useRequest, useParams, Link } from 'umi';
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 type { ProColumns, ActionType } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table';
@ -207,7 +207,23 @@ const CourseList: React.FC = () => {
];
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>
headerTitle={false}
actionRef={actionRef}

@ -320,7 +320,7 @@ export default () => {
// 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>

@ -94,7 +94,7 @@ const ScoreSetter = (props: any, ref: any) => {
{ (record?.code === 1) &&
<>
<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 = [];
console.log('typeScore',typeScore)
@ -202,7 +202,7 @@ const ScoreSetter = (props: any, ref: any) => {
>
<EditableProTable
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)=>{
setPassScore(value)
}} /></Form.Item>

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

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

@ -207,7 +207,7 @@ const QuestionBank = () => {
hideInForm: false,
hideInSearch: true,
renderFormItem: (item, { defaultRender, ...rest }, form) => (
<AnswersSelector />
<AnswersSelector type={addType?.value || Number(form.getFieldValue('question_type'))} />
),
formItemProps: {
rules: [
@ -239,12 +239,13 @@ const QuestionBank = () => {
console.log('====0')
}
console.log('answers??',form.getFieldValue('answers')?.length)
console.log('addType?.value', addType?.value)
console.log('addType?.value', addType?.value)
// 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
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
@ -365,7 +366,7 @@ const QuestionBank = () => {
return [
<Dropdown overlay={menu}>
<Button type="primary">
<PlusOutlined /> <DownOutlined />
<PlusOutlined /> <DownOutlined />
</Button>
</Dropdown>,
<Button key="remove" type="primary" danger onClick={async (value)=>{

@ -99,7 +99,11 @@ const CardList = () => {
JSON.stringify(last_data)!=='{}'?
<>
<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>
<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 style={{ paddingRight: '1rem', width: '10%', display: 'inline-block' }}>{item?.course_hours}</div>
<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 style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}>
<Button type="primary" onClick={() => {

@ -70,7 +70,12 @@ const SubjectList = () => {
<div dangerouslySetInnerHTML={{__html:item.subject_describe}}/>
</Paragraph>
</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'}}>
<Button type="primary" onClick={()=>{
const info=item.data_id+','+item.data_type+','+item.subject_id;

@ -44,20 +44,20 @@ const SubjectList = () => {
hoverable
className={styles.card}
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
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}
description={
<>
<Card.Grid hoverable={false} style={{ width: '50%', padding: 0 }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }}>
{item.subject_describe}
<div dangerouslySetInnerHTML={{__html:item.subject_describe}}/>
</Paragraph>
</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: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid>*/}
<Card.Grid hoverable={false} style={{ width: '50%', textAlign: 'right' }}>
<Button type="primary" onClick={() => {
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}`);

@ -1,6 +1,6 @@
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 } from 'antd';
import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography,Image } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import { useParams, useRequest, history } from 'umi';
import { viewMyLearningSubject, getCourseExaminationProgressList } from './service';
@ -57,15 +57,16 @@ const CardList = () => {
total_question_count += item.question_count;
if (item.finish_count !== 0) {
let num = 0;
num = result.finish_count / result.question_count;
item.process = num.toFixed(4)
num = item.finish_count/item.question_count;
item.process = parseFloat(num).toFixed(2)
} else {
item.process = 0;
}
});
console.log('result.list',result.list)
if (total_finish_count !== 0) {
const total_num = total_finish_count / total_question_count;
total_process = total_num.toFixed(4)
total_process = parseFloat(total_num).toFixed(2)
} else {
total_process = 0;
@ -98,42 +99,59 @@ const CardList = () => {
const content = (
<div className={styles.pageHeaderContent}>
<Card
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
hoverable={false}
className={styles.card}
actions={[]}
>
<Card.Meta
avatar={<img alt="" className={styles.cardAvatar} src={'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png'} style={{ width: '270px', height: '150px', borderRadius: '10px' }} />}
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 ? subject_data.subject_describe : '--'}
</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>
</Row>
<Row>
<Col span={4} style={{ padding: 10 }}>
<Button type="primary"
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>
</Col>
</Row>
</Card.Grid>
</>
}
/>
</Card>
{
subject_data.length!==0?
<Card
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
hoverable={false}
className={styles.card}
actions={[]}
>
<Card.Meta
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${subject_data.attachment_json.url}`} fallback="../fallback.svg" />}
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:'6rem'}}
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>
:<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 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?.progress * 100} />
<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={() => {

Loading…
Cancel
Save