xialiang 3 years ago
commit 73a1e7339f

@ -480,7 +480,7 @@ const CourseList: React.FC = () => {
fluid: true, // 当true时Video.js player将拥有流体大小。换句话说它将按比例缩放以适应其容器。
sources: [
{
src: (currentRow?.attachment_json?.url) || '/dsideal_yy/html/down/M3u8/2D/2D99BF1D-2F37-47FB-8A24-45112A236B8F.mp4', // 测试地址后续请删除
src: (currentRow?.attachment_json?.url) || '/dsideal_yy/html/down/Syzx/3b/3b225da8-87a5-4619-82a4-664ae2b37e23.mp4', // 测试地址后续请删除
type: 'application/x-mpegURL'
}
],
@ -573,7 +573,7 @@ const CourseList: React.FC = () => {
await handleAdd({
...values,
//course_id: currentRow?.course_id,
attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/M3u8/${uuid?.substr(0, 2)}/${uuid}.m3u8"}`
attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/Syzx/${uuid?.substr(0, 2)}/${uuid}.mp4"}`
});
handleCreateModalVisible(false); // 隐藏创建窗口
actionRef.current?.reloadAndRest?.();

@ -110,7 +110,7 @@ const ExaminationRules: React.FC = () => {
width: 48,
},
{
title: '规则名称',
title: '资质考试名称',
dataIndex: 'rules_name',
valueType: 'text',
hideInTable: false,
@ -118,7 +118,7 @@ const ExaminationRules: React.FC = () => {
hideInSearch: true,
},
{
title: '考试时',
title: '考试时',
width: 80,
dataIndex: 'examination_time',
valueType: 'text',
@ -269,7 +269,7 @@ const ExaminationRules: React.FC = () => {
history.push('/examinationrules/attestation/step')
}}
>
<PlusOutlined />
<PlusOutlined />
</Button>,
]}
request={async (value) => {

@ -18,6 +18,7 @@ import ScoreSetter from '../../components/ScoreSetter';
import AutoSelector from '../components/AutoSelector';
import QuestionSelector from '../../components/QuestionSelector';
import { getSubjectInfo } from '@/pages/course/subject/service';
import { max } from 'lodash';
/** 选项序号 */
const labels = ['A','B','C','D','E','F','G','H','I','J','K'];
@ -80,7 +81,7 @@ export default () => {
dataIndex: 'examination_time',
valueType: 'text',
sorter: false,
hideInTable: false,
hideInTable: true,
hideInForm: true,
hideInSearch: true,
renderText: (val: string) => `${val}`,
@ -93,9 +94,9 @@ export default () => {
hideInTable: false,
hideInForm: true,
hideInSearch: true,
renderText: (val: string) => {
render: (dom, record,index) => {
return <>
{record.question_type_count.map((item)=>{return <span style={{paddingRight:15}}>{`${item.type_name} ${item.count}`}</span>})}
</>
},
},
@ -282,6 +283,18 @@ export default () => {
name="rules_name"
label="考试名称"
width="md"
fieldProps={{
type: 'text',
allowClear: false,
width: 'large',
onInput:(e)=>{
const val = `${e.currentTarget?.value}`;
if(val.length > 50) {
e.currentTarget.value = val.slice(0,50)
}
}
//style:{width: '100%'}
}}
initialValue={ruleData.rules_name}
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"

@ -71,13 +71,29 @@ const QuestionSelector = (props: any, ref: any) => {
},
},
{
title: '标签',
dataIndex: 'tag',
valueType: 'text',
hideInTable: true,
hideInForm: true,
hideInSearch: false,
},
{
title: '课程',
dataIndex: 'course',
valueType: 'text',
hideInTable: true,
hideInForm: true,
hideInSearch: false,
},
{
title: '题干',
dataIndex: 'question_stem',
valueType: 'text',
hideInTable: false,
hideInForm: true,
hideInSearch: false,
hideInSearch: true,
},
];
const match = useRouteMatch();

@ -125,7 +125,7 @@ const ScoreSetter = (props: any, ref: any) => {
width: 80,
render: (text, _, index) => {
return <>
{(typeScore && questionTypeValues) ? typeScore[index]?.score * questionTypeValues[index]?.count : '0'}
{(typeScore && questionTypeValues) ? (typeScore[index]?.score * questionTypeValues[index]?.count).toFixed(2) : '0'}
</>
},

@ -78,7 +78,7 @@ const AutoSelector = (props: any, ref: any) => {
//key: 'code',
dataIndex: `type${item?.code}`,
render: ( item, { defaultRender, ...rest }, form) => {
return <Form.Item style={{margin:0}} ><InputNumber min={0} defaultValue={1}
return <Form.Item style={{margin:0}} ><InputNumber min={0} max={3} defaultValue={1} type='number'
onChange={(value)=>{
//
const _data = [];
@ -87,6 +87,7 @@ const AutoSelector = (props: any, ref: any) => {
_data.push({...item, score_harf: ((index === key) ? value : item?.score_harf)})
})
setTypeScore(_data)
console.log('setTypeScore',typeScore)
}}
/></Form.Item>;
},
@ -140,20 +141,6 @@ const AutoSelector = (props: any, ref: any) => {
// setDataSource
}}
toolBarRender={false}
/*
editable={{
type: 'multiple',
//editableKeys,
actionRender: (row, config, defaultDoms) => {
return [defaultDoms.delete];
},
onValuesChange: (record, recordList) => {
console.log('rrrr',record, recordList)
// setDataSource(recordList);
},
//onChange: setEditableRowKeys,
}}
*/
/>
</>
);

@ -128,8 +128,10 @@ const ExaminationRules: React.FC = () => {
sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id })
}
console.log(sinfo, 'sinfo');
return sinfo;
const info = sinfo?.filter((item, idx, self)=>{
return item?.b_use === 1
});
return info;
},
},
{

@ -262,6 +262,18 @@ export default () => {
initialValue={ruleData?.rules_name}
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称"
fieldProps={{
type: 'text',
allowClear: false,
width: 'large',
onInput:(e)=>{
const val = `${e.currentTarget?.value}`;
if(val.length > 50) {
e.currentTarget.value = val.slice(0,50)
}
}
//style:{width: '100%'}
}}
rules={[
{ required: true, message: '请输入考试名称' },
{
@ -345,7 +357,15 @@ export default () => {
console.log(formRef.current?.getFieldsValue());
setCurrentStep(2) // 设置步骤号
//alert(params?.id || rulesId)
let msg = '操作成功'
if(!questions){
msg = '请选择试题'
message.error(msg);
return false;
}
// question 请选择试题 请选择试题
runPaper({ rules_id: params?.id || rulesId })
return true;
}}
@ -354,19 +374,15 @@ export default () => {
<Typography style={{ padding: 24, fontSize: 24, textAlign: 'center' }}>{rulesName}</Typography>
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
<Radio.Group size='large' value={createType} onChange={(e) => {
setCreateType(Number(e?.target?.value))
console.log('value', e?.target?.value)
//handleAutoModalVisible(true); // 显示系统组卷窗口
}} style={{ marginBottom: 16, }}>
<Radio.Button value={1} style={{ width: 200, textAlign: 'center' }}></Radio.Button>
<Radio.Button value={2} style={{ width: 200, textAlign: 'center' }}></Radio.Button>
</Radio.Group>
<Row>
<Col span={12} style={{padding:5}}><Button size="large" onClick={()=>{handleSelectorModalVisible(true)}} value={1} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button></Col>
<Col span={12} style={{padding:5}}><Button size="large" onClick={()=>{handleAutoModalVisible(true)}} value={2} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button></Col>
</Row>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Row>
<Col span={18} style={{ background: '#ffffff', padding: 0 }}>
<Empty style={{minHeight:360,padding:60,verticalAlign:'middle'}} />
{questions &&
<ProCard
title=""
extra={false}
@ -422,12 +438,16 @@ export default () => {
</Space>
</ProCard>
}
{!questions &&
<Empty style={{minHeight:360, padding:60, verticalAlign:'middle',color:'#cccccc'}} description='暂无试卷' />
}
</Col>
<Col span={6} style={{ paddingLeft: 24 }}>
<div style={{ background: '#ffffff', padding: 24 }}>
<Space direction="vertical" style={{ width: '100%' }}>
<strong></strong>
<Typography> {'-'} {'-'} </Typography>
<Typography> {'0'} {'-'} </Typography>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Space direction="vertical">
{questionType.map((item) => {
@ -436,19 +456,6 @@ export default () => {
)}
</Space>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Button size="large" block onClick={() => {
console.log('createType', createType)
if (createType === 1) {
console.log('11:', createType)
handleSelectorModalVisible(true)
} else {
console.log('22:', createType)
handleAutoModalVisible(true); // 显示系统组卷窗口(true)
}
}}></Button>
<Button size="large" block onClick={() => {
/**
*

@ -71,18 +71,6 @@ export async function querySubjectList(params: {
});
}
/** 删除考试 POST /dsideal_yy/ypt/careerTraining/course/delete */
export async function removeExamination(data: { key: number[] }, options?: Record<string, any>) {
return request<Record<string, any>>('/dsideal_yy/ypt/careerTraining/course/delete', {
@ -257,3 +245,28 @@ export async function exchangeSortNum(data: Record<string, any>, options?: Recor
...(options || {}),
});
}
/** 16 组卷,查询试题数据(去掉已选列表)*/
export async function queryQuestionWithoutList(
params: {
// query
/** 当前的页码 */
current?: number;
/** 页面的容量 */
pageSize?: number;
},
options?: Record<string, any>,
) {
return request<{
data: TableListItem[];
/** 列表的内容总数 */
total?: number;
success?: boolean;
}>('/dsideal_yy/zygh/training/rules/getQuestionList', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

@ -484,7 +484,7 @@ const QuestionBank = () => {
title: '题干',
search: false,
dataIndex: 'question_stem',
render: (text: React.ReactNode, record: T, index: number) => (<><Text code style={{width:80, fontSize:10, color:'bfbfbf'}}>{record?.id}</Text> {text}</>),
render: (text: React.ReactNode, record: T, index: number) => (<><Text code style={{width:80, fontSize:10, color:'bfbfbf',display:'none'}}>{record?.id}</Text> {text}</>),
},
avatar: {
title: '题型',
@ -664,7 +664,7 @@ const QuestionBank = () => {
valueType: 'select',
dataIndex: 'tag_ids',
fieldProps: {
mode: "multiple"
//mode: "multiple"
},
request: async () => {
const { data: Items } = await queryTagList({});

@ -82,7 +82,7 @@ export default defineConfig({
{
name: '资质考试答题',
icon: 'dashboard',
path: '/dashboard/qualification/examAnswer/:examination_id/:examination_name/:time',
path: '/dashboard/qualification/examAnswer/:examination_id/:rule_id/:examination_name/:time',
component: './dashboard/qualification/examAnswer',
hideInMenu: true,
},

@ -0,0 +1,80 @@
import React, {forwardRef, useEffect,useImperativeHandle,useState} from "react";
import videojs from "video.js";
import "video.js/dist/video-js.css";
import "videojs-contrib-hls";
// React.forwardRef 接受渲染函数作为参数。React 将使用 props 和 ref 作为参数来调用此函数。此函数应返回 React 节点。
const VideoJS = ( props: any, ref: any) => {
//const [count,setCount]=useState(0);
//const countRef=React.useRef(count);
const videoRef = React.useRef(null);
const playerRef = React.useRef<any>(null);
const { options, onReady, } = props;
useEffect(() => {
if (!playerRef.current) {
const videoElement = videoRef.current;
if (!videoElement) return;
const player = playerRef.current = videojs(videoElement, options, () => {
// console.log("player is ready");
onReady && onReady(player);
});
} else {
// you can update player here [update player through props]
const player = playerRef.current;
player.src(options.sources[0].src);
// player.autoplay(true);
videoRef.current.addEventListener('play',()=>{
console.log('播放');
//setCount(player.currentTime());
//playerRef.current.currentTime(count)
// player.currentTime(count)
// getTime(player.currentTime());
// saveLearning();
});
videoRef.current.addEventListener('pause',()=>{
console.log('停止了')
})
}
}, [options]);
// useEffect(()=>{
// videoRef.current.addEventListener()
// },[]);
/*
useEffect(()=>{
countRef.current=count;
},[count])
*/
/*
if(count!==0){
if(countRef.current.toFixed(2)!==count.toFixed(2)){
// console.log('countRef.current前一次',countRef.current.toFixed(2));
// console.log('count这一次',count.toFixed(2))
getTime(count.toFixed(2));
saveLearning(count);
}
}
*/
// 暴露组件的方法 接受外部获取的ref
useImperativeHandle(ref, () => ({
// 构造ref的获取数据方法
currentTime: (time: number) => {
if(time){
playerRef?.current?.currentTime(time)
}
return playerRef?.current?.currentTime() || 0
},
}));
return (
<div data-vjs-player>
<video style={{
width:'100%',
height:'auto'
}} ref={videoRef} className="video-js vjs-big-play-centered" />
</div>
);
}
// forwardRef这个组件能够将其接受的 ref 属性转发到其组件树下
export default forwardRef( VideoJS );

@ -1,68 +0,0 @@
import React, {useEffect,useState} from "react";
import videojs from "video.js";
import "video.js/dist/video-js.css";
import "videojs-contrib-hls";
export const VideoJS = ( props: any ) => {
const [count,setCount]=useState(0);
const countRef=React.useRef(count);
const videoRef = React.useRef(null);
const playerRef = React.useRef<any>(null);
const { options, onReady,saveLearning,getTime } = props;
React.useEffect(() => {
if (!playerRef.current) {
const videoElement = videoRef.current;
if (!videoElement) return;
const player = playerRef.current = videojs(videoElement, options, () => {
// console.log("player is ready");
onReady && onReady(player);
});
} else {
// you can update player here [update player through props]
const player = playerRef.current;
player.src(options.sources[0].src);
// player.autoplay(true);
videoRef.current.addEventListener('play',()=>{
console.log('播放');
setCount(player.currentTime());
playerRef.current.currentTime(count)
// player.currentTime(count)
// getTime(player.currentTime());
// saveLearning();
});
videoRef.current.addEventListener('pause',()=>{
console.log('停止了')
})
}
}, [options]);
// useEffect(()=>{
// videoRef.current.addEventListener()
// },[]);
React.useEffect(()=>{
countRef.current=count;
},[count])
if(count!==0){
if(countRef.current.toFixed(2)!==count.toFixed(2)){
// console.log('countRef.current前一次',countRef.current.toFixed(2));
// console.log('count这一次',count.toFixed(2))
getTime(count.toFixed(2));
saveLearning(count);
}
}
return (
<div data-vjs-player>
<video style={{
width:'100%',
height:'auto'
}} ref={videoRef} className="video-js vjs-big-play-centered" />
</div>
);
}

@ -9,10 +9,11 @@ import styles from './style.less';
import { Content } from 'antd/lib/layout/layout';
import Sider from 'antd/lib/layout/Sider';
import SubMenu from 'antd/lib/menu/SubMenu';
import { VideoJS } from '../components/VideoJS';
import { useRef } from 'react';
import {listMyLearningChapterCourse1, viewCourseGetMyLearning,saveMyLearning} from './service';
import cookie from 'react-cookies';
import VideoJS from '../components/VideoJS';
const { Paragraph } = Typography;
const CardList = () => {
@ -64,7 +65,6 @@ const CardList = () => {
});
});
/** 首次页面 当data 变化 执行run chapterCourse 变化 进行currentCourse赋值 */
useEffect(() => {
if(data !== undefined && data !== null){
@ -162,52 +162,50 @@ const CardList = () => {
</Col>
<Col span={18} style={{background:'#ffffff', padding:24}}>
{
videoInfo.url && <VideoJS
options={{
controls: true,
playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
autoplay: false, // 如果true,浏览器准备好时开始回放。
muted: false, // 默认情况下将会消除任何音频。
loop: true, // 导致视频一结束就重新开始。
preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
language: 'zh-CN',
aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3"
fluid: true, // 当true时Video.js player将拥有流体大小。换句话说它将按比例缩放以适应其容器。
sources: [
{
// src: 'http://10.10.24.121:8000/dsideal_yy/html/'+videoInfo.url,
src: videoInfo.url,
type: 'application/x-mpegURL'
}
],
poster: videoInfo.img, // 你的封面地址
width: document.documentElement.clientWidth,
notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
controlBar: {
timeDivider: true,
durationDisplay: true,
remainingTimeDisplay: true,
fullscreenToggle: true // 全屏按钮
}
}}
onReady={(play: any)=>{
console.log('play====',play);
videoRef.current = play;
play.play()
}}
saveLearning={()=>{saveLearning()}}
getTime={(info)=>{
// setTime(info);
time=info;
console.log('接收的秒数',info)
}}
/>
}
videoInfo.url && <VideoJS
options={{
controls: true,
playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
autoplay: false, // 如果true,浏览器准备好时开始回放。
muted: false, // 默认情况下将会消除任何音频。
loop: true, // 导致视频一结束就重新开始。
preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
language: 'zh-CN',
aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3"
fluid: true, // 当true时Video.js player将拥有流体大小。换句话说它将按比例缩放以适应其容器。
sources: [
{
// src: 'http://10.10.24.121:8000/dsideal_yy/html/'+videoInfo.url,
src: videoInfo.url,
type: 'application/x-mpegURL'
}
],
poster: videoInfo.img, // 你的封面地址
width: document.documentElement.clientWidth,
notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
controlBar: {
timeDivider: true,
durationDisplay: true,
remainingTimeDisplay: true,
fullscreenToggle: true // 全屏按钮
}
}}
ref={videoRef}
/>
}
</Col>
</Row>
<a onClick={()=>{
const data = videoRef?.current?.currentTime();
console.log('getData', data)
}}>videoRef get</a>
<a onClick={()=>{
const data = videoRef?.current?.currentTime(300);
console.log('setData', data)
}}>videoRef set</a>
</PageContainer>
);
};

@ -107,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 ? parseInt(subject_data.subject_learning_progress * 100) : 0}
<Progress percent={subject_data ? parseInt(subject_data.subject_learning_progress ) : 0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</span></Col>
@ -182,7 +182,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?.course_hours*60}</div>
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
<Progress percent={item?parseInt(item.learning_progress * 100):0}
<Progress percent={item?parseInt(item.learning_progress):0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</div>

@ -77,7 +77,7 @@ const SubjectList = () => {
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'30%',textAlign:'center'}}>
<Progress type="circle"
percent={item?parseInt(item.subject_learning_progress*100):0}
percent={item?parseInt(item.subject_learning_progress):0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</Card.Grid>

@ -82,9 +82,11 @@ const CardList = () => {
// 当前题号
const [questionNowNum, setQuestionNowNum] = useState(0)
const [questionNum, setQuestioNum] = useState(0)
// 试题分数
const [rulesPaperScore, setRulesPaperScore] = useState([]);
const [timeData, setTimeData] = useState(0);
const [num,setNum]=useState(0);
const [questionType,setQuestionType]=useState([]);
useEffect(() => {
let secondValue = params.time; // 秒 截至时间 - 服务器当前时间
@ -138,6 +140,26 @@ const CardList = () => {
}
});
const getRules = useRequest(() => {
return getRulesPaper({
rules_id: params.rule_id
});
},
{
formatResult: (result) => {
return result;
},
onSuccess: (result) => {
// console.log(result, 111111111111111);
if (result.success) {
setRulesPaperScore(result.question_type_score || [])
// setQuestionTypeList(result.question_list[0].question_type_count)
}
}
});
const { run } = useRequest(getPaperQuestionList,
{
refreshDeps: [rulesPaperInfo],
@ -172,7 +194,7 @@ const CardList = () => {
question_type_count[0].count = arr[0].length;
question_type_count[1].count = arr[1].length;
question_type_count[2].count = arr[2].length;
setQuestionType(question_type_count);
const qList = question_type_count
const questionList: any[] = []
qList.map((e, i) => {
@ -308,9 +330,58 @@ const CardList = () => {
}
}
// 题型回数字
const tiTypeNum = (a: number) => {
switch (a) {
case 0:
return "一、"
break;
case 1:
return "二、"
break;
case 2:
return "三、"
break;
default:
return ""
break;
}
}
// 根据题型返回题数、分数、总分
const showQuestionTypeSocore = (type) => {
let questionName = ""
let num = 0
let score = 0
// 当前分类下试题总数
if (questionType.length !== 0) {
questionType.map((e, i) => {
if (e.question_type === type) {
num = e.count
questionName = e.type_name
}
})
rulesPaperScore.map((e, i) => {
if (e.question_type === type) {
score = e.score
}
})
}
return `${questionName} (共${num}题,每题${score}分)`
}
return (
<PageContainer content={content} extraContent={false}>
<div style={{marginBottom:'2rem',background:'#fff',width:'100%',height:'5rem',lineHeight:'5rem',fontSize:'23px',fontWeight:'bold',textAlign:'center'}}>{params.examination_name}</div>
<Row>
<Col span={6} style={{ paddingRight: 24 }}>
<ProCard
@ -327,7 +398,7 @@ const CardList = () => {
return <List
key={i}
header={e.type_name}
header={tiTypeNum(e.question_type) +e.type_name}
footer={false}
bordered
dataSource={e.children}
@ -362,13 +433,17 @@ const CardList = () => {
)}
<div>
<div style={{ float: 'right', lineHeight: "28px" }}>
</div><div className='pdefault dt-demo' />
<div style={{ float: 'right', lineHeight: "28px" }}>
</div><div className='pok dt-demo' />
</div>
</ProCard>
</Col>
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title={
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
}
title={tiTypeNum(questionNow.question_type) + showQuestionTypeSocore(questionNow.question_type)}
extra={false}
split='vertical'
borderedshia1
@ -376,9 +451,9 @@ const CardList = () => {
>
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
{questionNow?.question_stem}
{questionNow.index?questionNow.index[1]+1:''}.
{questionNow?.question_stem}
{/* {console.log(questionNow.answerId, 'answerId', questionNow.answerId)} */}
</Typography>
<Space direction="vertical" style={{ fontSize: 16 }}>
<Form

@ -63,7 +63,7 @@ const Qualification = () => {
return (
<div className="qualification" style={{height:window.innerHeight-200,background:'#fff',width:'100%',padding:20}}>
<div ><span className="title" onClick={()=>{history.push('/dashboard/workplace')}} style={{color:'#8C8C8C',cursor:'pointer',}}></span> / </div>
<div ><span className="title" onClick={()=>{history.push('/dashboard/workplace')}} style={{color:'#8C8C8C',cursor:'pointer',}}></span> / / {examinationInfo?.examination_name}</div>
<div style={{paddingTop:'3rem',width:'20rem',margin:'0 auto'}}>
<div className='condition' >
<div className='condition-title' ></div>
@ -94,7 +94,7 @@ const Qualification = () => {
// const time = await getCurrentDate();
// getTime(time);
const time=rule.examination_time*60;
history.push(`/dashboard/qualification/examAnswer/${params.examination_id}/${examinationInfo.examination_name}/${time}`)
history.push(`/dashboard/qualification/examAnswer/${params.examination_id}/${examinationInfo.rules_id}/${examinationInfo.examination_name}/${time}`)
}
}
}

@ -1,6 +1,6 @@
import type { FC } from 'react';
import { useEffect } from 'react';
import { Avatar, Card, Col, List, Skeleton, Row, Statistic, Descriptions, Progress, Table, Button } from 'antd';
import { Avatar, Card, Col, List, Skeleton, Row, Statistic, Descriptions, Progress, Table, Button ,Image} from 'antd';
import { Line, Radar } from '@ant-design/charts';
import { Link, history, useRequest } from 'umi';
import { PageContainer } from '@ant-design/pro-layout';
@ -191,7 +191,8 @@ const Workplace: FC = () => {
const { loading: lastexaminationLoading, data: examinationList } = useRequest(
() => getExaminationList(
{
person_id: cookie.load('person_id')
person_id: cookie.load('person_id'),
b_use:1
}), {
formatResult: (result) => {
return result.table_List;
@ -268,7 +269,8 @@ const Workplace: FC = () => {
className={styles.studyCard}
title="当前学习"
loading={activitiesLoading}
cover={<img alt="example" src={lastLearningList?.course_attachment_json?.img} />}
// cover={<img alt="example" src={lastLearningList?.course_attachment_json?.img} />}
cover={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${lastLearningList?.subject_attachment_json?.url}`} fallback="../fallback.svg" />}
>
<Descriptions title={lastLearningList?.course_name} layout='horizontal' column={1} >
<Descriptions.Item label="主将人">{lastLearningList?.lecture_teacher}</Descriptions.Item>

@ -127,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:'5'}}
style={{width:'10rem',height:'5rem'}}
onClick={() => {
console.log('last_data', last_data)
const info = subject_data.subject_id + "," + cookie.load('person_id')

@ -123,6 +123,7 @@ export default () => {
<div className='condition-title' ></div>
<div className='condition-text' style={{display:'inline-block',}} >
<Input.Password maxLength='12'
placeholder="输入内容"
value={oldPassWord}
onChange={(e)=>{
const strExp= /^[A-Za-z0-9]+$/;
@ -142,6 +143,7 @@ export default () => {
<div className='condition-text' style={{display:'inline-block',}} >
<Input.Password maxLength='12'
value={newPassWord}
placeholder="输入内容"
onChange={(e)=>{
const strExp= /^[A-Za-z0-9]+$/;
if(strExp.test(e.target.value) || e.target.value===''){
@ -160,6 +162,7 @@ export default () => {
<div className='condition-text' style={{display:'inline-block',}} >
<Input.Password maxLength='12'
value={secondNewPassWord}
placeholder="输入内容"
onChange={(e)=>{
const strExp= /^[A-Za-z0-9]+$/;
if(strExp.test(e.target.value) || e.target.value===''){
@ -186,7 +189,7 @@ export default () => {
showConfirm();
}
}}></Button>
}}></Button>
</div>
</div>

@ -16,7 +16,7 @@ import ProCard from '@ant-design/pro-card';
import { Button, Col, message, Row } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import ProDescriptions from '@ant-design/pro-descriptions';
import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo } from './service';
import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo,checkExaminationPersonID } from './service';
import cookie from 'react-cookies';
import styles from './index.less'
@ -85,12 +85,23 @@ export default () => {
description: false,
}}
onFinish={async (values) => {
// console.log('values',values);
// console.log(formRef.current?.getFieldsValue());
// await waitTime(2000);
setBaseInfo(values);
return true;
}}
try {
const info = await checkExaminationPersonID({
examination_id:params.examination_id,
id_code:values.idCard
});
setBaseInfo(values);
return true;
}catch (error) {
if(error.response){
message.error(error.response.info);
}else {
message.error('填写失败,请重新填写!');
}
return false;
}
}}
>
<Row gutter={24}>
<Col lg={12} md={12} sm={24}>
@ -123,16 +134,16 @@ export default () => {
/>
<ProFormDatePicker name="birthday"
label="出生年月"
picker="month"
fieldProps={{
format: 'YYYY-MM',
}}
rules={[{ required: true, message: '请选择出生年月' }]}
/>
<ProFormText name="idCard" label="身份证号" width="sm" rules={[{ required: true, message: '请输入身份证号' },{len:18,message:'请输入18位身份证号'},{pattern:/^[0-9]+$/,message:'只允许输入数字'}]}/>
<ProFormText name="address" label="家庭地址" rules={[{ required: true, message: '请输入家庭地址' }]}/>
<ProFormText name="contact" label="联系方式" width="lg" placeholder="联系方式" rules={[{ required: true, message: '请输入联系方式' },{len:11,message:'请输入11位联系方式'},{pattern:/^[0-9]+$/,message:'只允许输入数字'}]} />
<ProFormText name="idCard" label="身份证号" width="sm" rules={[{ required: true, message: '请输入身份证号' },{pattern:/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,message:'请输入正确身份证号'}]}/>
<ProFormText name="address" label="家庭地址" rules={[{ required: true, message: '请输入家庭地址' },{ whitespace: true },]}/>
<ProFormText name="contact" label="联系方式" width="lg" placeholder="联系方式" rules={[{ required: true, message: '请输入联系方式' },{pattern:/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,message:'请输入正确联系方式'}]} />
</Col>
<Col lg={12} md={12} sm={24}>
<ProFormText name="org" label="所在学校" width="md" placeholder="请填写" value={backInfo?.bureau_name} disabled />
@ -150,14 +161,14 @@ export default () => {
value: '全日制本科',
},
{
label: '硕士研究生及以上...',
value: '硕士研究生及以上...',
label: '硕士研究生及以上学历',
value: '硕士研究生及以上学历',
},
]}
placeholder="请选择"
/>
<ProFormText name="graduation" label="毕业院校" rules={[{ required: true, message: '请输入毕业院校' }]}/>
<ProFormText name="major" label="专业" rules={[{ required: true, message: '请输入专业' }]}/>
<ProFormText name="graduation" label="毕业院校" rules={[{ required: true, message: '请输入毕业院校' },{ whitespace: true },]}/>
<ProFormText name="major" label="专业" rules={[{ required: true, message: '请输入专业' },{ whitespace: true },]}/>
<ProFormSelect
label='任教学科'
name="subject"
@ -269,37 +280,37 @@ export default () => {
// console.log(formRef.current?.getFieldsValue());
// 跳转到指定路由
try {
const success = await savePersonSignUpInfo({
address:baseInfo?.address,
birthday:baseInfo?.birthday,
bureau_id:backInfo?.bureau_id,
bureau_name:backInfo?.bureau_name,
city_id:backInfo?.city_id,
city_name:backInfo?.city_name,
district_id:backInfo?.district_id,
district_name:backInfo?.district_name,
education:baseInfo?.qualifications,
examination_id:params.examination_id,
gender:baseInfo?.sex,
id_code:baseInfo?.idCard,
identity_id:backInfo?.identity_id,
major:baseInfo?.major,
person_id:backInfo?.person_id,
person_name:backInfo?.person_name,
province_id:backInfo?.province_id,
province_name:backInfo?.province_name,
subject:baseInfo?.subject,
tel:baseInfo?.contact,
university:baseInfo?.graduation,
const success = await savePersonSignUpInfo({
address:baseInfo?.address,
birthday:baseInfo?.birthday,
bureau_id:backInfo?.bureau_id,
bureau_name:backInfo?.bureau_name,
city_id:backInfo?.city_id,
city_name:backInfo?.city_name,
district_id:backInfo?.district_id,
district_name:backInfo?.district_name,
education:baseInfo?.qualifications,
examination_id:params.examination_id,
gender:baseInfo?.sex,
id_code:baseInfo?.idCard,
identity_id:backInfo?.identity_id,
major:baseInfo?.major,
person_id:backInfo?.person_id,
person_name:backInfo?.person_name,
province_id:backInfo?.province_id,
province_name:backInfo?.province_name,
subject:baseInfo?.subject,
tel:baseInfo?.contact,
university:baseInfo?.graduation,
});
const msg=testInfo.examination_start_time+','+testInfo.examination_end_time+','+testInfo.examination_name+','+success.admission_number;
history.push( '/registration/success/'+msg);
}catch (error) {
if(error.response){
message.error(error.response.info);
}else {
message.error('报名失败');
}
const msg=testInfo.examination_start_time+','+testInfo.examination_end_time+','+testInfo.examination_name+','+success.admission_number;
history.push( '/registration/success/'+msg);
}catch (error) {
if(error.response){
message.error(error.response.info);
}else {
message.error('报名失败');
}
}

@ -50,3 +50,11 @@ export async function savePersonSignUpInfo(data: { [key: string]: any }, options
...(options || {}),
});
}
//身份证重复校验/dsideal_yy/zygh/training/person/checkExaminationPersonID
export async function checkExaminationPersonID(params: {
}) {
return request('/dsideal_yy/zygh/training/person/checkExaminationPersonID', {
params,
});
}

Loading…
Cancel
Save