master
xialiang 3 years ago
parent a45b26d862
commit 9c6af9d23e

@ -74,7 +74,7 @@ const chapterColumns: ProColumns<TableListItem>[] = [
hideInTable: false,
hideInForm: true,
hideInSearch: true,
renderText: (val: string) => `${val}`,
renderText: (val: string) => `${val}学时`,
},
];

@ -26,7 +26,7 @@ import type { TableListItem, TableListPagination } from '../../option/data';
import { queryCourseList, queryCourseListByTag, queryTagList, removeCourse, saveSubject } from '../../option/service';
import { commitSubject, getSubjectInfo, queryListChapterBySubject, saveChapter, deleteChapter } from '../service';
import { v4 as uuidv4 } from 'uuid';
import {DataItem} from "@antv/data-set/lib/transform/tag-cloud";
import type { DataItem } from "@antv/data-set/lib/transform/tag-cloud";
import { removeTrain } from "@/pages/training/option/service";
import { listMyLearningChapterCourse } from "../../../../../../web/src/pages/course/list/service";
import course from "../../../../../../web/mock/course";
@ -96,6 +96,7 @@ export default () => {
const [uploadFileExt, SetUploadFileExt] = useState<string>();
const [subjectIntro, setSubjectIntro] = useState({});
const [subjectId, setSubjectId] = useState({});
const [currentRow, setCurrentRow] = useState<TableListItem>();
const formMapRef = useRef<React.MutableRefObject<ProFormInstance<any> | undefined>[]>([]);
@ -275,7 +276,6 @@ export default () => {
},
];
const params = useParams();
const { data: subjectInfo } = useRequest(() => {
@ -318,6 +318,10 @@ export default () => {
}
};
useEffect(() => {
setSubjectId(params?.id)
}, [])
useEffect(() => {
// 编辑场景下需要使用formMapRef循环设置formData
formMapRef.current.forEach((formInstanceRef) => {
@ -393,11 +397,12 @@ export default () => {
}}*/
onFinish={async (value: any) => {
console.log(subjectId, 'subjectId')
const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/', '') || value?.upload[0]?.response?.url;
const info = await saveSubject({
...value,
subject_id: params?.id,
subject_id: subjectId,
attachment_json: `{ "url": "${url}"}`
});
@ -405,6 +410,7 @@ export default () => {
message.warning(info.msg);
return false;
} else {
setSubjectId(info?.data.subject_id)
setSubjectIntro({ subject_id: info?.data.subject_id, subject_name: value?.subject_name, subject_describe: value?.subject_describe });
return true;
}

@ -219,7 +219,7 @@ const CourseList: React.FC = () => {
history.push('/examination/certificate/person/' + record.examination_id + "/" + record.accreditation_status + "/" + encodeURIComponent(record.examination_name))
}}
disabled={record.status_type === 4 ? false : true}
// disabled={record.status_type === 4 ? false : true}
>
{record.status_type}
</Button>,

@ -158,7 +158,7 @@ const CourseList: React.FC = () => {
},
{
title: '考试时间',
valueType: 'dateTimeRange',
valueType: 'dateRange',
dataIndex: 'examination_time',
sorter: false,
hideInTable: false,
@ -182,10 +182,11 @@ const CourseList: React.FC = () => {
{
title: '姓名或学校',
dataIndex: 'bureau_name',
sorter: true,
sorter: false,
valueType: 'text',
hideInForm: true,
hideInSearch: false,
hideInTable: true,
},
@ -231,11 +232,12 @@ const CourseList: React.FC = () => {
request={async (value) => {
console.log(value, 'form value')
const { create_time } = value;
if (create_time) {
value.start_time = create_time[0]
value.end_time = create_time[1]
const { examination_time } = value;
if (examination_time) {
value.start_date = examination_time[0]
value.end_date = examination_time[1]
}
delete value.examination_time
const _data = await getExaminationPersonApplyList({
...value,
examination_id: params.id,
@ -244,7 +246,6 @@ const CourseList: React.FC = () => {
page_number: value.current,
page_size: value.pageSize, is_pass: 1
});
return {
current: _data?.pageNumber,
data: _data?.table_List,

@ -183,7 +183,7 @@ const ExaminationList: React.FC = () => {
rules: [
{
required: true,
message: '此项为必填项',
message: '请选择关联主题',
}
]
},
@ -210,7 +210,7 @@ const ExaminationList: React.FC = () => {
rules: [
{
required: true,
message: '此项为必填项',
message: '请选择关联考试规则',
},
]
},
@ -219,13 +219,14 @@ const ExaminationList: React.FC = () => {
{
title: '在线学习时长(分钟)',
dataIndex: 'learning_time',
valueType: 'text',
valueType: 'digit',
hideInForm: false,
hideInSearch: true,
hideInTable: true,
renderText: (val: string) => `${val}`,
fieldProps: {
maxLength: 3
maxLength: 3,
min: 1
},
formItemProps: {
rules: [
@ -626,7 +627,6 @@ const ExaminationList: React.FC = () => {
),
}}
// action = ''
title="编辑"
columns={getInitialValues(columns, currentRow)}
/>
)}

@ -217,7 +217,7 @@ const RegistrationList: React.FC = () => {
title: '考试时间',
dataIndex: 'examination_time',
valueType: 'dateTimeRange',
sorter: true,
sorter: false,
hideInTable: false,
hideInForm: true,
hideInSearch: false,

@ -271,7 +271,7 @@ const TableList: React.FC = () => {
valueType: 'text',
hideInForm: true,
hideInSearch: true,
renderText: (val: string) => `${val}`,
renderText: (val: string) => `${val}`,
},
{
title: '操作',

@ -126,7 +126,7 @@ const certificateColumns = [
dataIndex: 'is_pass',
key: 'statusExam',
render: (dom, entity) => {
return entity.is_pass = 1 ? "通过" : "未通过"
return entity.is_pass = 1 ? "通过" : "未通过"
}
},
{
@ -192,7 +192,8 @@ const Workplace: FC = () => {
() => getExaminationList(
{
person_id: cookie.load('person_id'),
b_use:1
b_use: 1,
page_size: 999
}), {
formatResult: (result) => {
return result.table_List;

@ -41,7 +41,7 @@ const SubjectList = () => {
<List.Item key={item?.subject_id}>
<Card
title={<a>{item?.subject_name}</a>}
hoverable
hoverable={false}
className={styles.card}
actions={[]}
// extra={<><span style={{ padding: 10 }}>开始学习时间:{item?.learning_start_time}</span><span style={{ padding: 10 }}>距离结束时间:{item?.distance_end_time}</span><span style={{ padding: 10 }}>考核学时:{item?.total_course_hours}小时</span></>}

Loading…
Cancel
Save