|
|
|
@ -50,6 +50,8 @@ export default () => {
|
|
|
|
|
/** 试卷详情窗口 */
|
|
|
|
|
const [paperModalVisible, handlePaperModalVisible] = useState<boolean>(false);
|
|
|
|
|
|
|
|
|
|
const [paperInfo, setPaperInfo] = useState({})
|
|
|
|
|
|
|
|
|
|
/** 查看试卷 */
|
|
|
|
|
const { data: questions, run } = useRequest(async (params) => {
|
|
|
|
|
console.log('questions', questions)
|
|
|
|
@ -60,6 +62,37 @@ export default () => {
|
|
|
|
|
return result?.question_list;
|
|
|
|
|
}});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
const { data: paperData, run: runPaper } = useRequest(async (params) => {
|
|
|
|
|
console.log('paperData', paperData)
|
|
|
|
|
/**
|
|
|
|
|
* rules_id: params?.id,
|
|
|
|
|
page_number: value.current,
|
|
|
|
|
page_size: value.pageSize
|
|
|
|
|
*/
|
|
|
|
|
return queryRulesPaper(params);
|
|
|
|
|
}, {
|
|
|
|
|
manual: true,
|
|
|
|
|
formatResult: (result) => {
|
|
|
|
|
return result?.question_list;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
console.log('paperData2', paperData)
|
|
|
|
|
if (paperData?.length > 0) {
|
|
|
|
|
console.log('paperData[0]', paperData[0])
|
|
|
|
|
setPaperInfo(paperData[0])
|
|
|
|
|
}
|
|
|
|
|
console.log('PaperInfo', paperInfo)
|
|
|
|
|
}, [paperData]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 列表项定义 */
|
|
|
|
|
const columns: ProColumns[] = [
|
|
|
|
|
{
|
|
|
|
@ -192,6 +225,7 @@ export default () => {
|
|
|
|
|
)
|
|
|
|
|
if(success){
|
|
|
|
|
message.success('试卷生成成功')
|
|
|
|
|
actionRef.current?.reload()
|
|
|
|
|
}else{
|
|
|
|
|
message.success('试卷生成失败')
|
|
|
|
|
}
|
|
|
|
@ -406,6 +440,7 @@ export default () => {
|
|
|
|
|
onFinish={async () => {
|
|
|
|
|
console.log(formRef.current?.getFieldsValue());
|
|
|
|
|
setCurrentStep(2)
|
|
|
|
|
runPaper({ rules_id: params?.id || rulesId })
|
|
|
|
|
return true;
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
@ -506,12 +541,13 @@ export default () => {
|
|
|
|
|
column={1}
|
|
|
|
|
//actionRef={actionRef}
|
|
|
|
|
title={false}
|
|
|
|
|
request={async () => {
|
|
|
|
|
const result = await queryRulesView(params)
|
|
|
|
|
request={async () => {
|
|
|
|
|
const result = await queryRulesView({id: rulesId})
|
|
|
|
|
console.log('queryRulesView', result)
|
|
|
|
|
const subjectInfo = await getSubjectInfo({subject_id: result.bean.subject_id})
|
|
|
|
|
const subjectInfo = await getSubjectInfo({ subject_id: result.bean.subject_id })
|
|
|
|
|
console.log('subjectInfo', subjectInfo)
|
|
|
|
|
return {data: {...result.bean, subject_name: subjectInfo.data.subject_name}};
|
|
|
|
|
return { data: { ...result.bean, subject_name: subjectInfo.data.subject_name } };
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
extra={false}
|
|
|
|
|
>
|
|
|
|
@ -520,20 +556,20 @@ export default () => {
|
|
|
|
|
<ProDescriptions.Item dataIndex="subject_name" label="关联主题" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="examination_time" label="考试时长" valueType="text" renderText={(text)=>(`${text} 分钟`)} />
|
|
|
|
|
|
|
|
|
|
<ProDescriptions.Item dataIndex="grade" label="试卷信息" valueType="text" render={()=>{
|
|
|
|
|
<ProDescriptions.Item dataIndex="grade" label="试卷信息" valueType="text" render={() => {
|
|
|
|
|
{/** 从试卷中读取 临时卷必须保存后才进入此页 */ }
|
|
|
|
|
return <Space direction="vertical">
|
|
|
|
|
<span>共 0 道题, 100 分</span>
|
|
|
|
|
<span>单选: 0 道题 单选: 0 道题 单选: 0 道题</span>
|
|
|
|
|
<span>通过线 60 分</span>
|
|
|
|
|
<span>共 {paperInfo?.question_type_count?.map(item=>item.count)?.reduce((prev, curr)=>prev + curr)} 道题, {paperInfo?.sum_score || '-'} 分</span>
|
|
|
|
|
<span>{paperInfo?.question_type_count?.map(item=>(<span style={{paddingRight:10}}>{`${item?.type_name} ${item?.count} 道题 `}</span>))}</span>
|
|
|
|
|
<span>通过线 {paperInfo?.pass_score || '-'} 分</span>
|
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
|
|
}} />
|
|
|
|
|
}} />
|
|
|
|
|
|
|
|
|
|
<ProDescriptions.Item dataIndex="paper_count" label="试卷数量" valueType="text" render={()=>{
|
|
|
|
|
return <div stype={{padding:0}}><span style={{display:'inline-block', width:200}}>0</span> <span><ExclamationCircleOutlined /> 试卷数量是学生重复考试次数</span></div>
|
|
|
|
|
<ProDescriptions.Item dataIndex="paper_count" label="试卷数量" valueType="text" render={(dom,entity)=>{
|
|
|
|
|
return <div stype={{padding:0}}><span style={{display:'inline-block', width:200}}>{entity?.paper_count}</span> <span><ExclamationCircleOutlined /> 试卷数量是学生重复考试次数</span></div>
|
|
|
|
|
}} />
|
|
|
|
|
<ProDescriptions.Item dataIndex="live_time" label="试卷有效期" valueType="text" render={()=>{
|
|
|
|
|
return <div stype={{padding:0}}><span style={{display:'inline-block', width:200}}>2020/03/01</span> <span><ExclamationCircleOutlined /> 超过试卷有效期将重新生成试卷</span></div>
|
|
|
|
|
<ProDescriptions.Item dataIndex="live_time" label="试卷有效期" valueType="text" render={(dom,entity)=>{
|
|
|
|
|
return <div stype={{padding:0}}><span style={{display:'inline-block', width:200}}>{/*entity?.start_time.substring(0,10)*/} {entity?.end_time.substring(0,10)}</span> <span><ExclamationCircleOutlined /> 超过试卷有效期将重新生成试卷</span></div>
|
|
|
|
|
}} />
|
|
|
|
|
|
|
|
|
|
</ProDescriptions>
|
|
|
|
|