Compare commits

...

2 Commits

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

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

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

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

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

@ -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 ( return (
<PageContainer content={content} extraContent={false}> <PageContainer content={content} extraContent={false}>
<Row> <Row>
{/* {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} */} {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)}
{/* {console.log(questionTypeList, 'uestionTypeList')} */} {/* {console.log(questionTypeList, 'uestionTypeList')} */}
<Col span={6} style={{ paddingRight: 24 }}> <Col span={6} style={{ paddingRight: 24 }}>
@ -220,11 +231,11 @@ const CardList = () => {
</div> </div>
</ProCard> </ProCard>
</Col> </Col>
{console.log(questionNow, 'questionNow.index[1]')}
<Col span={13} style={{ background: '#ffffff', padding: 0 }}> <Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard <ProCard
title={ title={showQuestionTypeSocore(questionNow.question_type)}
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
}
extra={false} extra={false}
split='vertical' split='vertical'
bordered bordered
@ -232,7 +243,7 @@ const CardList = () => {
> >
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}> <Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}> <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> </Typography>
<Space direction="vertical" style={{ fontSize: 16 }}> <Space direction="vertical" style={{ fontSize: 16 }}>
@ -357,12 +368,6 @@ const CardList = () => {
// runSavePersonAnswer({ // runSavePersonAnswer({
// answer_ids: e.target.value, // answer_ids: e.target.value,
// question_id: questionNow.question_id, // question_id: questionNow.question_id,
// record_id: rulesPaperInfo.record_id
// })
// console.log("答题:", questionAnswer, qArr, questionNow)
// 修改答题卡状态 写入答案以及修改答题状态
const qX = questionNow?.question_type;
const qI = questionNow?.index;
questionList[questionNow.index[0]].question_list[questionNow.index[1]].answerSelect = questionAnswer; questionList[questionNow.index[0]].question_list[questionNow.index[1]].answerSelect = questionAnswer;
if (questionAnswer === questionNow.answertrue) { if (questionAnswer === questionNow.answertrue) {
questionList[questionNow.index[0]].question_list[questionNow.index[1]].state = 0 questionList[questionNow.index[0]].question_list[questionNow.index[1]].state = 0
@ -380,88 +385,71 @@ const CardList = () => {
})}</Space></Radio.Group> })}</Space></Radio.Group>
) : "" ) : ""
} } <div style={{ background: '#ffffff', padding: 24 }}>
</Form.Item> <Space direction="vertical" style={{ width: '100%' }}>
</Form> <Divider style={{ margin: '6px 0', opacity: 0.5 }} />
</Space> <strong></strong>
<Typography>{questionNowNum}/{questionNum}</Typography>
<Radio.Group onChange={() => { return true }} value={0} size="large"> <Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Space direction="vertical" style={{ fontSize: 16 }}> <Button
<Button type="primary" onClick={() => { size="large"
setParsingShow(!parsingShow) disabled={lastBtnShow}
}}></Button>
<div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} /> onClick={() => {
</Space>
</Radio.Group> paperInfo.map((e, i) => {
</Space>
</ProCard> if (e.question_id === questionNow.question_id) {
</Col> const nextTemp = paperInfo[i - 1]
<Col span={5} style={{ paddingLeft: 24 }}> const questionList = questionTypeList
<div style={{ background: '#ffffff', padding: 24 }}> let nextData = {}
<Space direction="vertical" style={{ width: '100%' }}> questionList[nextTemp.index[0]].question_list.map((item, index) => {
<Divider style={{ margin: '6px 0', opacity: 0.5 }} /> if (item.question_id === nextTemp.question_id) {
<strong></strong> nextData = item
<Typography>{questionNowNum}/{questionNum}</Typography> }
<Divider style={{ margin: '6px 0', opacity: 0.5 }} /> })
<Button setQuestionNow(nextData)
size="large" }
disabled={lastBtnShow}
onClick={() => {
paperInfo.map((e, i) => {
if (e.question_id === questionNow.question_id) {
const nextTemp = paperInfo[i - 1]
const questionList = questionTypeList
let nextData = {}
questionList[nextTemp.index[0]].question_list.map((item, index) => {
if (item.question_id === nextTemp.question_id) {
nextData = item
}
})
setQuestionNow(nextData)
}
})
}}
block></Button>
<Button size="large" })
disabled={nextBtnShow}
block onClick={() => {
paperInfo.map((e, i) => { }}
if (e.question_id === questionNow.question_id) { block></Button>
const nextTemp = paperInfo[i + 1]
const questionList = questionTypeList
let nextData = {}
questionList[nextTemp.index[0]].question_list.map((item, index) => {
if (item.question_id === nextTemp.question_id) {
nextData = item
}
})
setQuestionNow(nextData)
}
}) <Button size="large"
disabled={nextBtnShow}
block onClick={() => {
}}></Button> paperInfo.map((e, i) => {
<Button size="large" type="primary"
onClick={() => {
history.goBack(); if (e.question_id === questionNow.question_id) {
}} const nextTemp = paperInfo[i + 1]
block></Button> const questionList = questionTypeList
</Space> let nextData = {}
</div> questionList[nextTemp.index[0]].question_list.map((item, index) => {
</Col> if (item.question_id === nextTemp.question_id) {
</Row > nextData = item
</PageContainer > }
); })
setQuestionNow(nextData)
}
})
}}></Button>
<Button size="large" type="primary"
onClick={() => {
history.goBack();
}}
block></Button>
</Space>
</div>
</Col>
</Row >
</PageContainer >
);
}; };
export default CardList; export default CardList;

@ -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 ( return (
<PageContainer content={content} extraContent={false}> <PageContainer content={content} extraContent={false}>
<Row> <Row>
{console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)}
{/* {console.log(questionTypeList, 'uestionTypeList')} */} {/* {console.log(questionTypeList, 'uestionTypeList')} */}
<Col span={6} style={{ paddingRight: 24 }}> <Col span={6} style={{ paddingRight: 24 }}>
<ProCard <ProCard
@ -256,9 +266,7 @@ const CardList = () => {
</Col> </Col>
<Col span={13} style={{ background: '#ffffff', padding: 0 }}> <Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard <ProCard
title={ title={showQuestionTypeSocore(questionNow.question_type)}
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
}
extra={false} extra={false}
split='vertical' split='vertical'
bordered bordered
@ -266,7 +274,7 @@ const CardList = () => {
> >
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}> <Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}> <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)} {console.log("question", questionNow)}
</Typography> </Typography>
<Space direction="vertical" style={{ fontSize: 16 }}> <Space direction="vertical" style={{ fontSize: 16 }}>
@ -424,7 +432,7 @@ const CardList = () => {
<Space direction="vertical" style={{ fontSize: 16 }}> <Space direction="vertical" style={{ fontSize: 16 }}>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
setParsingShow(!parsingShow) setParsingShow(!parsingShow)
}}></Button> }}></Button>
<div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} /> <div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} />
</Space> </Space>
</Radio.Group> </Radio.Group>

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

Loading…
Cancel
Save