xialiang 3 years ago
commit 20e3e12349

@ -151,6 +151,10 @@ export default defineConfig({
icon: 'table',
name: '考试规则维护',
routes: [
{
path: '/examinationrules',
redirect: '/examinationrules/normal',
},
{
name: '模拟考试规则设置',
icon: 'smile',
@ -198,6 +202,10 @@ export default defineConfig({
name: '考试管理',
icon: 'profile',
routes: [
{
path: '/examination',
redirect: '/examination/option',
},
{
name: '考试维护',
path: '/examination/option',

@ -90,6 +90,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
/** request 用于配置全局的网络请求,你可以在这里做拦截器,全局错误处理,鉴权的配置。*/
export const request: RequestConfig = {
errorHandler: (error: ResponseError) => {
console.log('RequestConfig errorHandler', error)
/*
notification.error({
description: '您的网络发生异常,无法连接服务器',
@ -97,4 +98,7 @@ export const request: RequestConfig = {
});*/
throw error;
},
//middlewares?: OnionMiddleware[],
//requestInterceptors?: RequestInterceptor[], // 新增自动添加AccessToken的请求前拦截器
//responseInterceptors?: ResponseInterceptor[],
};

@ -188,6 +188,7 @@ const ExaminationList: React.FC = () => {
hideInSearch: true,
dependencies: ['subject_id'],
request: async (params) => {
console.log(params, 'params::::');
const { table_List: Items } = await queryRulesList({ rules_type: 1, subject_id: params.subject_id || 0, });
const rules = [];

@ -313,14 +313,22 @@ export default () => {
rules={[{ required: true, message: '请输入考试时长' }]}
// tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。"
/>
<Row style={{marginBottom:24,marginTop:-7}}>
<Col offset={8} style={{color:'#bfbfbf'}}></Col>
</Row>
<ProFormText name="paper_count" label="试卷数量"
initialValue={ruleData.paper_count}
rules={[{ required: true, message: '请输入数量' }]}
// tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。"
/>
<Row style={{marginBottom:24,marginTop:-7}}>
<Col offset={8} style={{color:'#bfbfbf'}}></Col>
</Row>
<ProFormDateRangePicker name="dateRange" label="试卷有效期" initialValue={[ruleData.start_time, ruleData.end_time]} rules={[{ required: true, message: '请输试卷有效期' }]} />
<Row style={{marginBottom:24,marginTop:-7}}>
<Col offset={8} style={{color:'#bfbfbf'}}></Col>
</Row>
</>
)}
</Col>

@ -345,7 +345,7 @@ const QuestionPaper = (props: any, ref: any) => {
<Typography>
{answer}
</Typography>
<Typography><div dangerouslySetInnerHTML={{__html: parsing.get(record.id)}} /></Typography>
<Typography><div dangerouslySetInnerHTML={{__html: parsing.get(record.id)}} /></Typography>
</Space>
);
}else{

@ -88,7 +88,9 @@ const AnswersSelector = (props) => {
<Form.Item>
<Button
type="dashed"
onClick={() => add()}
onClick={() => {
add()
}}
style={{ marginLeft: 22, width: '60%' }}
icon={<PlusOutlined />}
>

@ -226,13 +226,22 @@ const QuestionBank = () => {
hideInTable: false,
hideInForm: false,
hideInSearch: true,
dependencies:['answers'],
renderFormItem: (item, { defaultRender, ...rest }, form) => {
console.log('正确答案...', form.getFieldValue('answers'))
// 需要处理 关联长度变化及编辑回显
console.log('edit answertrue11', item)
console.log('form::::::',form.getFieldValue('answertrue'))
console.log('rest', rest)
console.log('question_type:::', form.getFieldValue('question_type'))
// 获取选项长度
const len = form.getFieldValue('answers')?.length || 2;
const opts = []
for(let i=0; i<len; i++){
opts.push(labels[i])
}
if(Number(form.getFieldValue('question_type')) === 0){
console.log('my type', Number(form.getFieldValue('question_type')))
}else{
@ -245,12 +254,12 @@ const QuestionBank = () => {
return ((addType?.value === 0 || addType?.value === 2) || (Number(form.getFieldValue('question_type')) === 0) || Number(form.getFieldValue('question_type')) === 2) ?
<Radio.Group
name="answertrue"
options={addType?.value === 0 || (Number(form.getFieldValue('question_type')) === 0) ? ['A', 'B', 'C', 'D'] : ['A', 'B']}
options={addType?.value === 0 || (Number(form.getFieldValue('question_type')) === 0) ? opts : ['A', 'B']}
/>
:
<Checkbox.Group
name="answertrue"
options={['A', 'B', 'C', 'D']}
options={opts}
/>
},
@ -542,7 +551,7 @@ const QuestionBank = () => {
<Typography>
{answer}
</Typography>
<Typography><div dangerouslySetInnerHTML={{__html: parsing.get(record.id)}} /></Typography>
<Typography><div dangerouslySetInnerHTML={{__html: parsing.get(record.id)}} /></Typography>
</Space>
);
}else{

@ -28,6 +28,18 @@ export async function queryPersonTxByYw(params: {
});
}
/** 获取用户信息 */
export async function queryPersonInfo(params: {
person_id: number;
identity_id: number;
random_num?: number;
}) {
return request('/dsideal_yy/person/getPersonInfo', {
method: 'GET',
params,
});
}
/** 退出登录接口 */
export async function outLogin(options?: { [key: string]: any }) {
return request<Record<string, any>>('/dsideal_yy/login/doLogout?login_type=1', {

Loading…
Cancel
Save