zhengpengju 3 years ago
commit e31b97aad0

@ -26,34 +26,35 @@ const TrainingRow = () => {
<Row>
<Col {...topColResponsiveProps}>
<div className={styles.salesBar}>
<ChartCard loading={courseBrowseTimesLoading} bordered={false} bodyStyle={{ padding:'20px 24px 8px', marginBottom:'24px' }} title="课程浏览量">
<div className={styles.salesBar}>
<Column
height={300}
forceFit
data={courseBrowseTimesData as any}
xField="course_name"
yField="browse_times"
tooltip={{
formatter: (name, value: number) => {
// const {name, value} = args;
console.log('args', name)
return { name: '浏览量', value: value };
}
}}
xAxis={{
visible: true,
title: {
visible: false,
},
}}
yAxis={{
visible: true,
title: {
text: '课程浏览量',
visible: false,
},
}}
<ChartCard loading={courseBrowseTimesLoading} bordered={false} bodyStyle={{ padding: '20px 24px 8px', marginBottom: '24px' }} title="课程浏览量">
<div className={styles.salesBar}>
<Column
height={300}
forceFit
data={courseBrowseTimesData as any}
xField="course_name"
yField="browse_times"
tooltip={{
formatter: (name, value: number) => {
// const {name, value} = args;
console.log('args', name)
return { name: '浏览量', value: value };
}
}}
xAxis={{
visible: true,
title: {
text: '课程名称',
visible: false,
},
}}
yAxis={{
visible: true,
title: {
text: '课程浏览量',
visible: false,
},
}}
/*
title={{
visible: true,
@ -62,16 +63,12 @@ const TrainingRow = () => {
fontSize: 14,
},
}}*/
meta={{
y: {
alias: '次',
},
}}
/>
</div>
</ChartCard>
/>
</div>
</ChartCard>
</div>
</Col>
</Col>
</Row>
);
}

@ -1,9 +1,9 @@
//import { InfoCircleOutlined } from '@ant-design/icons';
import { Column } from '@ant-design/charts';
import { Col, Row,} from 'antd';
import { Column } from '@ant-design/charts';
import { Col, Row, } from 'antd';
import numeral from 'numeral';
import { ChartCard, } from './Charts';
import { ChartCard, } from './Charts';
// import type { SubjectAndCourseNumberStatistics } from '../data.d';
//import styles from '../style.less';
import { useRequest } from 'umi';
@ -25,7 +25,7 @@ const IntroduceRow = () => {
total={numeral(subjectAndCourseData?.subject_numbers || 0).format('0,0')}
footer={false}
//contentHeight={150}
style={{flex:1, marginBottom: 24, height:120}}
style={{ flex: 1, marginBottom: 24, height: 120 }}
/>
<ChartCard
bordered={false}
@ -35,7 +35,7 @@ const IntroduceRow = () => {
total={numeral(subjectAndCourseData?.course_numbers || 0).format('0,0')}
footer={false}
//contentHeight={150}
style={{flex:1, marginBottom: 24, height:120}}
style={{ flex: 1, marginBottom: 24, height: 120 }}
/>
</Col>
<Col xs={18} sm={18} md={18} lg={18} xl={18}>
@ -47,7 +47,7 @@ const IntroduceRow = () => {
total={false}
footer={false}
// contentHeight={300}
style={{marginBottom: 24}}
style={{ marginBottom: 24 }}
>
<Column
height={202}
@ -65,27 +65,24 @@ const IntroduceRow = () => {
xAxis={{
visible: true,
title: {
text: '主题名称',
visible: false,
},
}}
yAxis={{
visible: true,
title: {
text: '数量',
visible: false,
},
}}
title={{
visible: false,
text: '课程浏览量',
style: {
fontSize: 14,
},
}}
meta={{
y: {
alias: '培训数',
},
}}
/>
</ChartCard>
</Col>

@ -101,7 +101,7 @@ const CourseList: React.FC = () => {
width: 48,
},
{
title: '证件名称',
title: '考试名称',
dataIndex: 'examination_name',
valueType: 'text',
hideInTable: false,
@ -221,6 +221,7 @@ const CourseList: React.FC = () => {
},
];
return (
<PageContainer>
<ProTable<TableListItem, TableListPagination>

@ -1,6 +1,6 @@
/** 认证考试规则 */
import React, { useState, useRef } from 'react';
import { useRequest } from 'umi';
import { useParams, useRequest } from 'umi';
import { ExportOutlined, PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload } from 'antd';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
@ -11,7 +11,7 @@ import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
import ProDescriptions from '@ant-design/pro-descriptions';
import type { FormValueType } from './components/UpdateForm';
import UpdateForm from './components/UpdateForm';
import { saveRegistration, removeRegistration, queryRegistrationList } from '../service';
import { saveRegistration, removeRegistration, getExaminationPersonApplyList, getAsyncOrgTree } from '../service';
import type { TableListItem, TableListPagination } from './data';
import type { DataItem } from '@antv/data-set/lib/transform/tag-cloud';
@ -84,10 +84,19 @@ const handleRemove = async (selectedRows: TableListItem[]) => {
};
const RegistrationList: React.FC = () => {
const params = useParams();
/** 更新窗口的弹窗 */
const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false);
const [detailModalVisible, handleDetailModalVisible] = useState<boolean>(false);
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
const [provinceId, setProvinceId] = useState("100007")
const [cityId, setCityId] = useState("0")
const [areaId, setAreaId] = useState("0")
const [exportData, setExportData] = useState({
examination_id: Number(params.id),
})
const actionRef = useRef<ActionType>();
@ -95,6 +104,16 @@ const RegistrationList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]);
/** 获取列数据初始值 */
const getInitialValues = (cols: any[], vals: any) => {
const initialValues: any[] = [];
cols.forEach((column: { dataIndex: string }) => {
const key: any = column?.dataIndex || '';
initialValues.push({ ...column, initialValue: key ? vals[key] : '' });
});
return initialValues || [];
};
/** 列表项定义 */
const columns: ProColumns<TableListItem>[] = [
{
@ -105,13 +124,14 @@ const RegistrationList: React.FC = () => {
},
{
title: '姓名',
dataIndex: 'username',
dataIndex: 'person_name',
valueType: 'text',
hideInTable: false,
hideInForm: false,
hideInSearch: true,
},
{
title: '市',
dataIndex: 'city_name',
valueType: 'text',
@ -119,22 +139,56 @@ const RegistrationList: React.FC = () => {
hideInTable: false,
hideInForm: false,
hideInSearch: false,
renderText: (val: string) => `${val}`,
colSize: 1,
request: async (params) => {
const Items = await getAsyncOrgTree({
org_id: provinceId,
org_type: 1,
get_next: 1
});
console.log('queryCourseListByTag...', Items)
const courses = [{ label: "全部", value: "0" }]
for (let i = 0; i < Items?.length; i++) {
courses.push({ label: Items[i]?.name, value: Items[i]?.id })
}
console.log(courses, 'courses:::');
return courses;
},
},
{
title: '区县',
dataIndex: 'area_name',
dataIndex: 'district_name',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInForm: false,
hideInSearch: false,
renderText: (val: string) => `${val}`,
dependencies: ['city_name'],
request: async (params) => {
const courses = [{ label: "全部", value: "0" }]
if (params.city_name) {
console.log(params, 'params')
const Items = await getAsyncOrgTree({
org_id: params.city_name,
org_type: 2,
get_next: 1
});
console.log('queryCourseListByTag...', Items)
for (let i = 0; i < Items?.length; i++) {
courses.push({ label: Items[i]?.name, value: Items[i]?.id })
}
console.log(courses, 'courses:::');
}
return courses;
},
},
{
title: '学校',
valueType: 'text',
dataIndex: 'org_name',
dataIndex: 'bureau_name',
sorter: false,
hideInTable: false,
hideInForm: false,
@ -152,44 +206,17 @@ const RegistrationList: React.FC = () => {
},
{
title: '考试时间',
dataIndex: 'create_time',
dataIndex: 'examination_time',
valueType: 'dateRange',
sorter: true,
hideInTable: true,
hideInTable: false,
hideInForm: true,
hideInSearch: false,
//renderText: (val: string) => `${val}`,
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<a
key="detail"
onClick={() => {
//console.log('entity', entity);
setCurrentRow(record);
handleDetailModalVisible(true);
}}
>
</a>,
<a
key="update"
onClick={() => {
handleUpdateModalVisible(true);
setCurrentRow(record);
}}
>
</a>,
<a key="subscribeAlert" href="https://procomponents.ant.design/">
</a>,
],
render: (dom, entity) => {
return entity.examination_start_time + "-" + entity.examination_end_time;
},
},
];
return (
@ -202,33 +229,54 @@ const RegistrationList: React.FC = () => {
search={{
labelWidth: 120,
}}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
// handleCreateModalVisible(true);
}}
href={`/dsideal_yy/zygh/training/person/exportPersonApplyData?examination_id=${params.id}`}
>
<ExportOutlined />
</Button>,
]}
request={async (value) => {
const _data = await queryRegistrationList(value);
console.log('value', value);
let examination_time = {}
if (value.examination_time) {
examination_time = {
examination_start_time: value.examination_time[0],
examination_end_time: value.examination_time[1]
}
}
value = {
...value,
page_number: value.current,
page_size: value.pageSize,
city_id: cityId,
district_id: areaId,
examination_id: params.id,
...examination_time
}
// setExportData(value)
const _data = await getExaminationPersonApplyList(value);
return {
current: _data?.page_number,
data: _data?.data?.list,
data: _data?.table_List,
pageSize: _data?.page_size,
total: _data?.total_row || 0,
};
}}
// dataSource={list}
columns={columns}
rowSelection={{
onChange: (_, selectedRows) => {
setSelectedRows(selectedRows);
},
}}
columns={getInitialValues(columns, { city_name: cityId, area_name: areaId })}
// rowSelection={{
// onChange: (_, selectedRows) => {
// setSelectedRows(selectedRows);
// },
// }}
/*
pagination={{
showTotal: (total) => {

@ -82,10 +82,10 @@ export async function updateExamination(data: Record<string, any>, options?: Rec
}
/** 删除考试 */
export async function removeExamination(data: { key: number[]}, options?: Record<string, any>) {
export async function removeExamination(data: { key: number[] }, options?: Record<string, any>) {
console.log('data:::', data);
return request<Record<string, any>>('/dsideal_yy/zygh/training/examination/delExamination', {
data: { examination_id: data?.key[0], rules_id: options?.rules_id}, // 当前接口不支持批量操作
data: { examination_id: data?.key[0], rules_id: options?.rules_id }, // 当前接口不支持批量操作
method: 'POST',
requestType: 'form',
});
@ -118,30 +118,11 @@ export async function queryExaminationView(data: Record<string, any>, options?:
});
}
/** 获取报名列表 GET Mock /api/queryRegistrationList */
export async function queryRegistrationList(
params: {
// query
/** 当前的页码 */
current?: number;
/** 页面的容量 */
pageSize?: number;
},
options?: Record<string, any>,
) {
return request<{
data: TableListItem[];
/** 列表的内容总数 */
total?: number;
success?: boolean;
}>('/api/getRegistrationList', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 获取考试规则列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */
@ -218,4 +199,6 @@ export async function getAsyncOrgTree(params: {
return request('dsideal_yy/org/getAsyncOrgTree', {
params,
});
}
}

@ -339,7 +339,7 @@ export default () => {
setCurrentStep(2) // 设置步骤号
//alert(params?.id || rulesId)
runPaper({rules_id: params?.id || rulesId})
runPaper({ rules_id: params?.id || rulesId })
return true;
}}
>
@ -527,7 +527,7 @@ export default () => {
console.log('v::::', values.name);
const rows = selectorRef?.current?.getSelectedRows()
console.log('rows::::', rows);
const {code, data: paper, msg} = await handleAppend(Number(params?.id || rulesId), rows)
const { code, data: paper, msg } = await handleAppend(Number(params?.id || rulesId), rows)
console.log('paper', paper)
setUuidPaper(paper?.paper_uuid)
console.log('paper_uuid', paper?.paper_uuid)

@ -54,13 +54,23 @@ const SalesCard = () => {
geometry: 'column',
},
{
geometry: 'line',
lineStyle: {
lineWidth: 2,
},
},
],
meta: {
city: {
alias: '类别',
},
count: {
alias: '资质证书人数',
},
credential_rate: {
alias: '证书比例',
},
}
};
return (<Card bordered={false} bodyStyle={{ padding: 0, marginBottom: '24px' }}>
<div className={styles.salesCard}>

@ -1,7 +1,7 @@
import { DefaultFooter } from '@ant-design/pro-layout';
export default () => {
const defaultMessage = '东北师大理想软件股份有限公司';
const defaultMessage = '东北师大理想软件股份有限公司<br> 123';
const currentYear = new Date().getFullYear();
return (
<DefaultFooter

@ -17,6 +17,7 @@ const CardList = () => {
const ids = params.msg.split(',');
const [currentCourse, SetCurrentCourse] = useState()
const [selectedMenu, setSelectedMenu] = useState('')
/** 获取主题下课程 */
const { data } = useRequest(() => {
@ -33,6 +34,7 @@ const CardList = () => {
result.subject.startTime= result.subject.learning_start_time.split(' ')[0];
result.subject.endTime= result.subject.learning_end_time.split(' ')[0];
console.log('result9999',result);
setSelectedMenu(result.chapter_list[0].chapter_id.toString())
}
});
@ -81,7 +83,12 @@ const CardList = () => {
hoverable={false}
className={styles.card}
actions={[]}
extra={<><span style={{ padding: 10 }}>: {subject_data ? subject_data.startTime : '--'}</span><span style={{ padding: 10 }}>{subject_data ? subject_data.distance_end_time : '--'}</span><span style={{padding:10}}>:{subject_data?subject_data.endTime:'--'}</span><span style={{ padding: 10 }}>{subject_data ? subject_data.total_course_hours : '--'}</span></>}
extra={<>
<span style={{ padding: 10 }}> {subject_data ? subject_data.startTime : '--'}</span>
<span style={{ padding: 10 }}>{subject_data ? subject_data.distance_end_time : '--'}</span>
<span style={{padding:10}}>{subject_data?subject_data.endTime:'--'}</span>
<span style={{ padding: 10 }}>{subject_data ? subject_data.total_course_hours : '--'}</span>
</>}
>
<Card.Meta
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${subject_data.attachment_json.url}`} fallback="../fallback.svg" />}
@ -100,7 +107,7 @@ const CardList = () => {
<>
<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}
<Progress percent={subject_data ? parseInt(subject_data.subject_learning_progress * 100) : 0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</span></Col>
@ -139,7 +146,7 @@ const CardList = () => {
<Col span={6} style={{ paddingRight: 24 }}>
<Menu
mode="inline"
selectedKeys={[chapter_list.length !== 0 ? chapter_list[0].chapter_id.toString() : '']}
selectedKeys={[selectedMenu]}
defaultOpenKeys={['sub1']}
style={{ height: '100%', width: '100%' }}
>
@ -151,6 +158,7 @@ const CardList = () => {
<Menu.Item
key={item.chapter_id}
onClick={() => {
setSelectedMenu(item.chapter_id.toString())
run({ subject_id: item.subject_id, chapter_id: item.chapter_id })
}}
>{item.chapter_name}</Menu.Item>
@ -161,6 +169,7 @@ const CardList = () => {
</SubMenu>
</Menu>
</Col>
<Col span={18} style={{ background: '#ffffff', padding: 24, minHeight: '20rem' }}>
{
@ -171,9 +180,9 @@ const CardList = () => {
<div style={{ marginBottom: '2rem', }}>
<div style={{ paddingRight: '1rem', width: '10%', display: 'inline-block' }}>{item?.sort_no}</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*60}</div>
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
<Progress percent={item?.learning_progress * 100}
<Progress percent={item?parseInt(item.learning_progress * 100):0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</div>

@ -57,7 +57,12 @@ const SubjectList = () => {
hoverable
className={styles.card}
actions={[]}
extra={<><span style={{padding:10}}>:{item?.startTime}</span><span style={{padding:10}}>{item?.distance_end_time}</span><span style={{padding:10}}>:{item?.endTime}</span><span style={{padding:10}}>{item?.total_course_hours}</span></>}
extra={<>
<span style={{padding:10}}>{item?.startTime}</span>
<span style={{padding:10}}>{item?.distance_end_time}</span>
<span style={{padding:10}}>{item?.endTime}</span>
<span style={{padding:10}}>{item?.total_course_hours}</span>
</>}
>
<Card.Meta
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />}
@ -72,7 +77,7 @@ const SubjectList = () => {
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'30%',textAlign:'center'}}>
<Progress type="circle"
percent={item?.subject_learning_progress*100}
percent={item?parseInt(item.subject_learning_progress*100):0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</Card.Grid>

@ -332,7 +332,7 @@ const CardList = () => {
bordered
dataSource={e.children}
renderItem={(item, index) => {
setNum(index+1);
// console.log(item, 'list')
return <List.Item
id={item.id}
@ -344,7 +344,7 @@ const CardList = () => {
onClick={() => {
// 查看解析关闭
setParsingShow(false)
setNum(index+1);
paperInfo.map((e) => {
if (e.id === item.id) {
// 重写单选的label、valueindex保存当前试题的index。
@ -376,7 +376,7 @@ const CardList = () => {
>
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
{num}. {questionNow?.question_stem}
{questionNow?.question_stem}
{/* {console.log(questionNow.answerId, 'answerId', questionNow.answerId)} */}
</Typography>

@ -106,7 +106,7 @@ const Result = () => {
person_id:cookie.load('person_id')
});
},{
manual:true,
// manual:true,
formatResult:(result)=>{
const paper_id='1';
if(result.paper_id===''){

@ -158,10 +158,21 @@ const CardList = () => {
}
}
// 根据题型返回题数、分数、总分
const showQuestionTypeSocore = (questionType) => {
let num = 0
let name = 0
questionTypeList.map((e) => {
e.question_type === questionType ? name = e.question_type_name : "";
e.question_type === questionType ? num = e.question_list.length : ""
})
return `${name} (共${num}题)`
}
return (
<PageContainer content={content} extraContent={false}>
<Row>
{/* {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} */}
{console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)}
{/* {console.log(questionTypeList, 'uestionTypeList')} */}
<Col span={6} style={{ paddingRight: 24 }}>
@ -220,11 +231,11 @@ const CardList = () => {
</div>
</ProCard>
</Col>
{console.log(questionNow, 'questionNow.index[1]')}
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title={
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
}
title={showQuestionTypeSocore(questionNow.question_type)}
extra={false}
split='vertical'
bordered
@ -232,7 +243,7 @@ const CardList = () => {
>
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
{questionNow.id ? questionNow.index[0] + 1 : ""} {questionNow?.question_stem}
{JSON.stringify(questionNow) !== "{}" ? questionNow.index[1] + 1 : ""} {questionNow?.question_stem}
</Typography>
<Space direction="vertical" style={{ fontSize: 16 }}>
@ -389,7 +400,7 @@ const CardList = () => {
<Space direction="vertical" style={{ fontSize: 16 }}>
<Button type="primary" onClick={() => {
setParsingShow(!parsingShow)
}}></Button>
}}></Button>
<div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} />
</Space>
</Radio.Group>

@ -47,7 +47,7 @@ const SubjectList = () => {
// 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={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />}sss
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />}
title={false}
description={
<>

@ -15,9 +15,10 @@ let chapterCourse = [];
let total_process = 0;
const CardList = () => {
const params = useParams();
const [selectedMenu, setSelectedMenu] = useState('')
const [currentCourse, SetCurrentCourse] = useState()
/** 获取主题下课程 */
const { data } = useRequest(() => {
return viewMyLearningSubject({
@ -28,6 +29,10 @@ const CardList = () => {
subject_id: params?.subject_id
});
},{
onSuccess:(result)=>{
setSelectedMenu(result.chapter_list[0].chapter_id.toString())
}
});
// const list = data?.list||[];
@ -122,7 +127,7 @@ const CardList = () => {
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'25%',textAlign:'center',boxShadow: 'none'}}>
<Button type="primary"
style={{width:'10rem',height:'6rem'}}
style={{width:'10rem',height:'5'}}
onClick={() => {
console.log('last_data', last_data)
const info = subject_data.subject_id + "," + cookie.load('person_id')
@ -162,7 +167,7 @@ const CardList = () => {
<Col span={6} style={{ paddingRight: 24 }}>
<Menu
mode="inline"
selectedKeys={[chapter_list.length !== 0 ? chapter_list[0].chapter_id.toString() : '']}
selectedKeys={[selectedMenu]}
defaultOpenKeys={['sub1']}
style={{ height: '100%', width: '100%' }}
>
@ -174,6 +179,7 @@ const CardList = () => {
<Menu.Item
key={item.chapter_id}
onClick={() => {
setSelectedMenu(item.chapter_id.toString())
run({ subject_id: item.subject_id, chapter_id: item.chapter_id })
}}
>{item.chapter_name}</Menu.Item>

@ -189,13 +189,23 @@ const CardList = () => {
}
// 计算试题总数以及已答题数
// 根据题型返回题数、分数、总分
const showQuestionTypeSocore = (questionType) => {
let num = 0
let name = 0
questionTypeList.map((e) => {
console.log(e, 'eee')
e.question_type === questionType ? name = e.question_type_name : "";
e.question_type === questionType ? num = e.question_list.length : ""
})
return `${name} (共${num}题)`
}
return (
<PageContainer content={content} extraContent={false}>
<Row>
{console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)}
{/* {console.log(questionTypeList, 'uestionTypeList')} */}
<Col span={6} style={{ paddingRight: 24 }}>
<ProCard
@ -256,9 +266,7 @@ const CardList = () => {
</Col>
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title={
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
}
title={showQuestionTypeSocore(questionNow.question_type)}
extra={false}
split='vertical'
bordered
@ -266,7 +274,7 @@ const CardList = () => {
>
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
{questionNow.id ? questionNow.index[0] + 1 : ""} {questionNow?.question_stem}
{questionNow.id ? questionNow.index[1] + 1 : ""} {questionNow?.question_stem}
{console.log("question", questionNow)}
</Typography>
<Space direction="vertical" style={{ fontSize: 16 }}>
@ -424,7 +432,7 @@ const CardList = () => {
<Space direction="vertical" style={{ fontSize: 16 }}>
<Button type="primary" onClick={() => {
setParsingShow(!parsingShow)
}}></Button>
}}></Button>
<div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} />
</Space>
</Radio.Group>

@ -402,7 +402,7 @@ const CardList = () => {
}
onClick={() => {
// 查看解析关闭
// 查看答案关闭
setParsingShow(false)
paperInfo.map((e) => {
@ -556,7 +556,7 @@ const CardList = () => {
<Space direction="vertical" style={{ fontSize: 16 }}>
<Button type="primary" onClick={() => {
setParsingShow(!parsingShow)
}}></Button>
}}></Button>
<div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} />
</Space>
</Radio.Group>

Loading…
Cancel
Save