master
xialiang 3 years ago
parent 4ab835ae9a
commit 3f7d2db323

@ -164,7 +164,7 @@ const CourseList: React.FC = () => {
}, },
{ {
title: '通过人数', title: '通过人数',
dataIndex: 'apply_person_count', dataIndex: 'pass_count',
sorter: false, sorter: false,
valueType: 'text', valueType: 'text',
hideInForm: false, hideInForm: false,

@ -174,11 +174,20 @@ const CourseList: React.FC = () => {
sorter: false, sorter: false,
valueType: 'text', valueType: 'text',
hideInForm: false, hideInForm: false,
hideInSearch: false, hideInSearch: true,
render: (dom, entity) => { render: (dom, entity) => {
return params.accreditation_status == 1 ? "已制证" : "未制证"; return params.accreditation_status == 1 ? "已制证" : "未制证";
}, },
}, },
{
title: '姓名或学校',
dataIndex: 'bureau_name',
sorter: true,
valueType: 'text',
hideInForm: true,
hideInSearch: false,
},
]; ];
@ -233,7 +242,7 @@ const CourseList: React.FC = () => {
city_id: value.city_id ? value.city_id : 0, city_id: value.city_id ? value.city_id : 0,
district_id: value.district_id ? value.district_id : 0, district_id: value.district_id ? value.district_id : 0,
page_number: value.current, page_number: value.current,
page_size: value.pageSize page_size: value.pageSize, is_pass: 1
}); });
return { return {

@ -255,6 +255,10 @@ const ExaminationList: React.FC = () => {
{ {
required: true, required: true,
message: '请选择主题开放时间', message: '请选择主题开放时间',
}, {
validator: () => {
callback('请输入正确的内容!');
}
} }
] ]
}, },
@ -524,6 +528,9 @@ const ExaminationList: React.FC = () => {
}} }}
onFinish={async (values: any) => { onFinish={async (values: any) => {
console.log("Form ", schemaForm)
// 表单处理 // 表单处理
//console.log('columns:', columns); //console.log('columns:', columns);
console.log('values1:', values); console.log('values1:', values);
@ -543,6 +550,8 @@ const ExaminationList: React.FC = () => {
delete params.course_time delete params.course_time
delete params.examination_time delete params.examination_time
/*
const success = await handleUpdate(params); const success = await handleUpdate(params);
if (success) { if (success) {
@ -553,6 +562,7 @@ const ExaminationList: React.FC = () => {
schemaForm.resetFields() schemaForm.resetFields()
} }
} }
*/
}} }}

@ -104,6 +104,9 @@ const RegistrationList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]); const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]);
const [exportBtn, setExportBtn] = useState(true);
/** 获取列数据初始值 */ /** 获取列数据初始值 */
const getInitialValues = (cols: any[], vals: any) => { const getInitialValues = (cols: any[], vals: any) => {
const initialValues: any[] = []; const initialValues: any[] = [];
@ -241,7 +244,7 @@ const RegistrationList: React.FC = () => {
type="primary" type="primary"
key="primary" key="primary"
href={`/dsideal_yy/zygh/training/person/exportPersonApplyData?examination_id=${params.id}`} href={`/dsideal_yy/zygh/training/person/exportPersonApplyData?examination_id=${params.id}`}
disabled={exportBtn}
> >
<ExportOutlined /> <ExportOutlined />
</Button>, </Button>,
@ -268,7 +271,8 @@ const RegistrationList: React.FC = () => {
delete value.examination_time delete value.examination_time
// setExportData(value) // setExportData(value)
const _data = await getExaminationPersonApplyList(value); const _data = await getExaminationPersonApplyList(value);
console.log(_data, '_data 111111')
_data.totalRow > 0 ? setExportBtn(false) : setExportBtn(true)
return { return {
current: _data?.page_number, current: _data?.page_number,
data: _data?.table_List, data: _data?.table_List,

@ -1,9 +1,9 @@
import { AlignLeftOutlined, LaptopOutlined, NotificationOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons'; import { AlignLeftOutlined, LaptopOutlined, NotificationOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography,Image } from 'antd'; import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography, Image, message } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { useParams, useRequest, history } from 'umi'; import { useParams, useRequest, history } from 'umi';
import { viewMyLearningSubject, getCourseExaminationProgressList } from './service'; import { viewMyLearningSubject, getCourseExaminationProgressList, getErrorQuestionList } from './service';
import type { CardListItemDataType } from './data.d'; import type { CardListItemDataType } from './data.d';
import styles from './style.less'; import styles from './style.less';
import SubMenu from 'antd/lib/menu/SubMenu'; import SubMenu from 'antd/lib/menu/SubMenu';
@ -128,11 +128,29 @@ const CardList = () => {
<Card.Grid hoverable={false} style={{ width: '25%', textAlign: 'center', boxShadow: 'none' }}> <Card.Grid hoverable={false} style={{ width: '25%', textAlign: 'center', boxShadow: 'none' }}>
<Button type="primary" <Button type="primary"
style={{ width: '10rem', height: '5rem' }} style={{ width: '10rem', height: '5rem' }}
onClick={() => { onClick={async () => {
console.log('last_data', last_data) console.log('last_data', last_data)
const info = subject_data.subject_id + "," + cookie.load('person_id') const info = subject_data.subject_id + "," + cookie.load('person_id')
console.log(subject_data, 'subject_data') console.log(subject_data, 'subject_data')
const _data1 = await getErrorQuestionList({
subject_id: params.subject_id,
person_id: cookie.load('person_id'),
});
let num = 0
if (_data1.success) {
_data1.list.map((e, i) => {
num += e.question_list.length
})
}
console.log(_data1, '_data1', num);
if (num > 0) {
history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`) history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`)
} else {
message.error("暂无错题");
}
}} }}
></Button> ></Button>
@ -205,7 +223,10 @@ const CardList = () => {
<Progress percent={item ? parseInt(item.process * 100) : 0} format={(percent) => percent === 100 ? '100%' : `${percent}%`} /> <Progress percent={item ? parseInt(item.process * 100) : 0} format={(percent) => percent === 100 ? '100%' : `${percent}%`} />
</div> </div>
<div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}> <div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}>
<Button type="primary" onClick={() => { <Button
type="primary"
disabled={item.question_count > 0 ? false : true}
onClick={() => {
const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id; const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id;
console.log(info) console.log(info)
history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`) history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`)

@ -2,7 +2,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { Button, Card, List, Progress, Typography, Image } from 'antd'; import { Button, Card, List, Progress, Typography, Image } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import { getRulesList } from './service'; import { getRulesList, getSubjectInfo } from './service';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import styles from './style.less'; import styles from './style.less';
@ -14,56 +14,77 @@ const SubjectList = () => {
{ {
dataIndex: 'index', dataIndex: 'index',
valueType: 'indexBorder', valueType: 'indexBorder',
width: 48,
hideInTable: true,
}, },
{ {
title: '封面', title: '封面',
valueType: 'text', valueType: 'image',
request: async (params) => { dataIndex: 'url',
//alert(123) width: "10%",
// console.log('arr',arr) render: (dom, entity) => {
// const {tags} = arr; return <img src={location.pathname + '/dsideal_yy/html/' + entity.url} width="200" height="100" />;
console.log('params::::', params );
const { data } = await getRulesList({b_use: 0});
return '123';
}, },
}, },
{ {
title: '标题', title: '标题',
dataIndex: 'rules_name', dataIndex: 'rules_name',
hideInTable: true,
},
{
title: "内容",
dataIndex: "content",
hideInTable: false,
hideInForm: true,
hideInSearch: true,
render: (dom, entity) => {
return (
<p>
<h3>{entity.subject_name}</h3>
<hr color='#f0f0f0' />
<div>{entity.examination_time}</div>
<div>{entity.sum_score}</div>
<div>{entity.pass_score}</div>
</p>
)
},
}, },
{ {
title: '考试时间', title: '考试时间',
key: 'examination_time', key: 'examination_time',
dataIndex: 'examination_time', dataIndex: 'examination_time',
valueType: 'text', valueType: 'text',
hideInTable: true,
}, },
{ {
title: '总分', title: '总分',
key: 'sum_score', key: 'sum_score',
dataIndex: 'sum_score', dataIndex: 'sum_score',
valueType: 'text', valueType: 'text',
hideInTable: true,
}, },
{ {
title: '及格', title: '及格',
key: 'pass_score', key: 'pass_score',
dataIndex: 'pass_score', dataIndex: 'pass_score',
valueType: 'text', valueType: 'text',
hideInTable: true,
}, },
{ {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: "10%",
render: (text, record, _, action) => [ render: (text, record, _, action) => [
<a <Button
type="primary"
key="editable" key="editable"
onClick={() => { onClick={() => {
history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`); history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`);
}} }}
> >
</a>, </Button>,
], ],
}, },
@ -82,19 +103,18 @@ const SubjectList = () => {
rules_type: 0 rules_type: 0
}) })
console.log(RulesData.table_List) console.log(RulesData.table_List)
const rulesList = RulesData.table_List
const _data = await getRulesList({ rulesList.map(async (e, i) => {
...value, const _data1 = await getSubjectInfo({
b_use: 1, subject_id: e.subject_id
rules_type: 0
});
const _data1 = await getRulesList({
...value,
b_use: 1,
rules_type: 0
}); });
const urlInfo = JSON.parse(JSON.stringify(_data1.data.attachment_json))
rulesList[i].url = urlInfo.url
})
console.log('rulesList', rulesList)
return { data: RulesData.table_List } return { data: rulesList }
}} }}
/*editable={{ /*editable={{
type: 'multiple', type: 'multiple',

Loading…
Cancel
Save