master
xialiang 3 years ago
parent a45b26d862
commit 9c6af9d23e

@ -39,7 +39,7 @@ const chapterColumns: ProColumns<TableListItem>[] = [
hideInTable: false, hideInTable: false,
hideInForm: false, hideInForm: false,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => (<div dangerouslySetInnerHTML={{__html: val}} />), renderText: (val: string) => (<div dangerouslySetInnerHTML={{ __html: val }} />),
}, },
{ {
title: '课程', title: '课程',
@ -54,8 +54,8 @@ const chapterColumns: ProColumns<TableListItem>[] = [
}, },
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val}`,
request: async (params) => { request: async (params) => {
const {tags} = params; const { tags } = params;
const { data: Items } = await queryCourseListByTag({tag_ids: tags?.toString()}); const { data: Items } = await queryCourseListByTag({ tag_ids: tags?.toString() });
console.log('queryCourseListByTag...') console.log('queryCourseListByTag...')
const courses = [] const courses = []
for (let i = 0; i < Items?.length; i++) { for (let i = 0; i < Items?.length; i++) {
@ -74,7 +74,7 @@ const chapterColumns: ProColumns<TableListItem>[] = [
hideInTable: false, hideInTable: false,
hideInForm: true, hideInForm: true,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val}学时`,
}, },
]; ];
@ -130,13 +130,13 @@ const handleRemove = async (selectedRows: TableListItem[]) => {
if (!selectedRows) return true; if (!selectedRows) return true;
try { try {
const {code, msg} = await removeSubject({ const { code, msg } = await removeSubject({
key: selectedRows.map((row) => row.key), key: selectedRows.map((row) => row.key),
}); });
hide(); hide();
if(code === 2000 ){ if (code === 2000) {
message.success('删除成功,即将刷新'); message.success('删除成功,即将刷新');
}else{ } else {
message.warning(msg); message.warning(msg);
} }
return true; return true;
@ -220,7 +220,7 @@ const TableList: React.FC = () => {
hideInSearch: true, hideInSearch: true,
width: 200, width: 200,
render: (dom, entity) => { render: (dom, entity) => {
if(entity.b_use === 0){ if (entity.b_use === 0) {
return '待发布' return '待发布'
} }
@ -287,7 +287,7 @@ const TableList: React.FC = () => {
</a>, </a>,
<a <a
key="remove" key="remove"
onClick={ () => { onClick={() => {
showConfirm(record) showConfirm(record)
}}> }}>
@ -296,10 +296,10 @@ const TableList: React.FC = () => {
], ],
}, },
]; ];
const showConfirm=async (record)=>{ const showConfirm = async (record) => {
confirm({ confirm({
title: '确认删除主题吗?', title: '确认删除主题吗?',
centered:true, centered: true,
onOk() { onOk() {
handleRemove([{ key: record?.subject_id }]); // 调用批量删除函数如果接口不支持批量需要在service中处理 handleRemove([{ key: record?.subject_id }]); // 调用批量删除函数如果接口不支持批量需要在service中处理
setSelectedRows([]); setSelectedRows([]);
@ -426,53 +426,53 @@ const TableList: React.FC = () => {
> >
{currentRow?.subject_id && ( {currentRow?.subject_id && (
<> <>
<ProDescriptions <ProDescriptions
layout='horizontal' layout='horizontal'
column={1} column={1}
//actionRef={actionRef} //actionRef={actionRef}
title={false} title={false}
/* /*
request={async () => { request={async () => {
console.log('step2 主题信息') console.log('step2 主题信息')
return Promise.resolve({ return Promise.resolve({
success: true, success: true,
data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 }, data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 },
}); });
}}*/ }}*/
extra={false} extra={false}
> >
<ProDescriptions.Item dataIndex="id" hideInDescriptions /> <ProDescriptions.Item dataIndex="id" hideInDescriptions />
<ProDescriptions.Item dataIndex="subject_name" label="主题名称" valueType="text">{currentRow?.subject_name}</ProDescriptions.Item> <ProDescriptions.Item dataIndex="subject_name" label="主题名称" valueType="text">{currentRow?.subject_name}</ProDescriptions.Item>
<ProDescriptions.Item dataIndex="subject_describe" label="主题介绍" valueType="text"> <ProDescriptions.Item dataIndex="subject_describe" label="主题介绍" valueType="text">
<div dangerouslySetInnerHTML={{__html: currentRow?.subject_describe}} /> <div dangerouslySetInnerHTML={{ __html: currentRow?.subject_describe }} />
</ProDescriptions.Item> </ProDescriptions.Item>
</ProDescriptions> </ProDescriptions>
<ProTable<TableListItem, TableListPagination> <ProTable<TableListItem, TableListPagination>
headerTitle={false} headerTitle={false}
actionRef={actionChapterRef} actionRef={actionChapterRef}
rowKey="chapter_id" rowKey="chapter_id"
options={false} options={false}
search={false} search={false}
toolBarRender={false} toolBarRender={false}
request={async (value) => { request={async (value) => {
const { data } = await queryListChapterBySubject({ const { data } = await queryListChapterBySubject({
subject_id: currentRow?.subject_id, subject_id: currentRow?.subject_id,
page_number: value?.current || 1, page_number: value?.current || 1,
page_size: value?.pageSize, page_size: value?.pageSize,
}); });
return { return {
current: data?.page_number, current: data?.page_number,
data: data?.list, data: data?.list,
pageSize: data?.page_size, pageSize: data?.page_size,
success: true, success: true,
total: data?.total_row || 0, total: data?.total_row || 0,
}; };
}} }}
// dataSource={list} // dataSource={list}
columns={chapterColumns} columns={chapterColumns}
rowSelection={false} rowSelection={false}
/> />
</> </>
)} )}
</Modal> </Modal>

@ -23,12 +23,12 @@ import ProFormRichEdit from '../components/ProFormRichEdit';
import type { ActionType, ProColumns } from '@ant-design/pro-table'; import type { ActionType, ProColumns } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import type { TableListItem, TableListPagination } from '../../option/data'; import type { TableListItem, TableListPagination } from '../../option/data';
import {queryCourseList, queryCourseListByTag, queryTagList, removeCourse, saveSubject} from '../../option/service'; import { queryCourseList, queryCourseListByTag, queryTagList, removeCourse, saveSubject } from '../../option/service';
import { commitSubject, getSubjectInfo, queryListChapterBySubject, saveChapter,deleteChapter } from '../service'; import { commitSubject, getSubjectInfo, queryListChapterBySubject, saveChapter, deleteChapter } from '../service';
import { v4 as uuidv4 } from 'uuid'; 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 { removeTrain } from "@/pages/training/option/service";
import {listMyLearningChapterCourse} from "../../../../../../web/src/pages/course/list/service"; import { listMyLearningChapterCourse } from "../../../../../../web/src/pages/course/list/service";
import course from "../../../../../../web/mock/course"; import course from "../../../../../../web/mock/course";
const { confirm } = Modal; const { confirm } = Modal;
@ -38,13 +38,13 @@ const { confirm } = Modal;
const handleUpdateChapter = async (fields: TableListItem) => { const handleUpdateChapter = async (fields: TableListItem) => {
try { try {
const {course_ids} = fields; const { course_ids } = fields;
const {tag_ids} = fields; const { tag_ids } = fields;
const {code, msg} = await saveChapter({ ...fields, course_ids: course_ids.toString(),tag_ids: tag_ids.toString()}); const { code, msg } = await saveChapter({ ...fields, course_ids: course_ids.toString(), tag_ids: tag_ids.toString() });
if(code === 2000){ if (code === 2000) {
message.success('编辑成功'); message.success('编辑成功');
return true; return true;
}else{ } else {
message.warn(msg); message.warn(msg);
return false; return false;
} }
@ -62,14 +62,14 @@ const handleUpdateChapter = async (fields: TableListItem) => {
const handleAddChapter = async (fields: TableListItem) => { const handleAddChapter = async (fields: TableListItem) => {
const hide = message.loading('正在添加'); const hide = message.loading('正在添加');
try { try {
const {course_ids} = fields; const { course_ids } = fields;
const {tag_ids} = fields; const { tag_ids } = fields;
const {code, msg} = await saveChapter({ ...fields, course_ids: course_ids.toString(),tag_ids: tag_ids.toString()}); const { code, msg } = await saveChapter({ ...fields, course_ids: course_ids.toString(), tag_ids: tag_ids.toString() });
if(code === 2000){ if (code === 2000) {
hide(); hide();
message.success('添加成功'); message.success('添加成功');
return true; return true;
}else{ } else {
hide(); hide();
message.warn(msg); message.warn(msg);
return false; return false;
@ -96,6 +96,7 @@ export default () => {
const [uploadFileExt, SetUploadFileExt] = useState<string>(); const [uploadFileExt, SetUploadFileExt] = useState<string>();
const [subjectIntro, setSubjectIntro] = useState({}); const [subjectIntro, setSubjectIntro] = useState({});
const [subjectId, setSubjectId] = useState({});
const [currentRow, setCurrentRow] = useState<TableListItem>(); const [currentRow, setCurrentRow] = useState<TableListItem>();
const formMapRef = useRef<React.MutableRefObject<ProFormInstance<any> | undefined>[]>([]); const formMapRef = useRef<React.MutableRefObject<ProFormInstance<any> | undefined>[]>([]);
@ -106,7 +107,7 @@ export default () => {
key: 'index', key: 'index',
valueType: 'indexBorder', valueType: 'indexBorder',
width: 48, width: 48,
align:'center' align: 'center'
}, },
{ {
title: '章节名称', title: '章节名称',
@ -124,7 +125,7 @@ export default () => {
}, },
] ]
}, },
align:'center' align: 'center'
}, },
{ {
title: '简介', title: '简介',
@ -142,7 +143,7 @@ export default () => {
}, },
] ]
}, },
renderText: (val: string) => (<div dangerouslySetInnerHTML={{__html: val}} />), renderText: (val: string) => (<div dangerouslySetInnerHTML={{ __html: val }} />),
renderFormItem: (item, { defaultRender, ...rest }, form) => ( renderFormItem: (item, { defaultRender, ...rest }, form) => (
<ProFormRichEdit <ProFormRichEdit
name="chapter_describe" name="chapter_describe"
@ -152,11 +153,11 @@ export default () => {
placeholder="请输入介绍" placeholder="请输入介绍"
// rules={[{ required: true }]} // rules={[{ required: true }]}
value="" value=""
// disabled // disabled
/> />
), ),
align:'center' align: 'center'
}, },
{ {
title: '标签', title: '标签',
@ -186,7 +187,7 @@ export default () => {
} }
return tags; return tags;
}, },
align:'center' align: 'center'
}, },
{ {
title: '课程', title: '课程',
@ -208,18 +209,18 @@ export default () => {
] ]
}, },
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [ render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<div> <div>
{ {
record.course_names.length!==0?record.course_names.map((i,index)=>{ record.course_names.length !== 0 ? record.course_names.map((i, index) => {
if(index+1===record.course_names.length){ if (index + 1 === record.course_names.length) {
return i return i
}else { } else {
return i+'' return i + ''
} }
}):'--' }) : '--'
} }
</div> </div>
], ],
// renderText: (val: string) => `${val}`, // renderText: (val: string) => `${val}`,
@ -227,14 +228,14 @@ export default () => {
request: async (arr) => { request: async (arr) => {
// console.log('arr',arr) // console.log('arr',arr)
// const {tags} = arr; // const {tags} = arr;
const { data: Items } = await queryCourseListByTag({tag_ids:arr?.tag_ids?.toString()}); const { data: Items } = await queryCourseListByTag({ tag_ids: arr?.tag_ids?.toString() });
const courses = [] const courses = []
for (let i = 0; i < Items?.length; i++) { for (let i = 0; i < Items?.length; i++) {
courses.push({ label: Items[i]?.course_name, value: Items[i]?.course_id }) courses.push({ label: Items[i]?.course_name, value: Items[i]?.course_id })
} }
return courses; return courses;
}, },
align:'center' align: 'center'
}, },
{ {
title: '学时', title: '学时',
@ -245,7 +246,7 @@ export default () => {
hideInForm: true, hideInForm: true,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val}`,
align:'center' align: 'center'
}, },
{ {
@ -253,11 +254,11 @@ export default () => {
dataIndex: 'option', dataIndex: 'option',
valueType: 'option', valueType: 'option',
width: 200, width: 200,
align:'center', align: 'center',
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [ render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => [
<a <a
key="update" key="update"
style={{marginRight:'1rem'}} style={{ marginRight: '1rem' }}
onClick={() => { onClick={() => {
setCurrentRow(record); setCurrentRow(record);
handleUpdateModalVisible(true); handleUpdateModalVisible(true);
@ -275,18 +276,17 @@ export default () => {
}, },
]; ];
const params = useParams(); const params = useParams();
const {data:subjectInfo} = useRequest(() => { const { data: subjectInfo } = useRequest(() => {
return getSubjectInfo({subject_id: params?.id}); return getSubjectInfo({ subject_id: params?.id });
}); });
const showConfirm=async (record)=>{ const showConfirm = async (record) => {
confirm({ confirm({
title: '确认删除章节吗?', title: '确认删除章节吗?',
centered:true, centered: true,
onOk() { onOk() {
handleRemove([record]); handleRemove([record]);
setSelectedRows([]); setSelectedRows([]);
@ -301,13 +301,13 @@ export default () => {
const hide = message.loading('正在删除'); const hide = message.loading('正在删除');
if (!selectedRows) return true; if (!selectedRows) return true;
try { try {
const {code, msg} = await deleteChapter({ const { code, msg } = await deleteChapter({
key: selectedRows, key: selectedRows,
}); });
hide(); hide();
if(code === 2000 ){ if (code === 2000) {
message.success('删除成功,即将刷新'); message.success('删除成功,即将刷新');
}else{ } else {
message.warning(msg); message.warning(msg);
} }
return true; return true;
@ -318,18 +318,22 @@ export default () => {
} }
}; };
useEffect(() => {
setSubjectId(params?.id)
}, [])
useEffect(() => { useEffect(() => {
// 编辑场景下需要使用formMapRef循环设置formData // 编辑场景下需要使用formMapRef循环设置formData
formMapRef.current.forEach((formInstanceRef) => { formMapRef.current.forEach((formInstanceRef) => {
let fieldsValue; let fieldsValue;
const subjectValue = { const subjectValue = {
subject_name:subjectInfo?.subject_name, subject_name: subjectInfo?.subject_name,
subject_describe:subjectInfo?.subject_describe, subject_describe: subjectInfo?.subject_describe,
} }
if(params?.id && subjectInfo?.attachment_json?.url){ if (params?.id && subjectInfo?.attachment_json?.url) {
fieldsValue = { fieldsValue = {
...subjectValue, ...subjectValue,
upload:[ upload: [
{ {
name: subjectInfo?.attachment_json?.name, name: subjectInfo?.attachment_json?.name,
status: 'done', status: 'done',
@ -337,7 +341,7 @@ export default () => {
} }
] ]
} }
}else{ } else {
// 无附件 // 无附件
fieldsValue = subjectValue; fieldsValue = subjectValue;
} }
@ -393,19 +397,21 @@ export default () => {
}}*/ }}*/
onFinish={async (value: any) => { onFinish={async (value: any) => {
console.log(subjectId, 'subjectId')
const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/','') || value?.upload[0]?.response?.url; const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/', '') || value?.upload[0]?.response?.url;
const info = await saveSubject({ const info = await saveSubject({
...value, ...value,
subject_id: params?.id, subject_id: subjectId,
attachment_json: `{ "url": "${url}"}` attachment_json: `{ "url": "${url}"}`
}); });
if(info.code!==2000){ if (info.code !== 2000) {
message.warning(info.msg); message.warning(info.msg);
return false; return false;
}else { } else {
setSubjectIntro({subject_id:info?.data.subject_id, subject_name: value?.subject_name, subject_describe:value?.subject_describe}); setSubjectId(info?.data.subject_id)
setSubjectIntro({ subject_id: info?.data.subject_id, subject_name: value?.subject_name, subject_describe: value?.subject_describe });
return true; return true;
} }
@ -439,7 +445,7 @@ export default () => {
label="主题图片" label="主题图片"
max={2} max={2}
fieldProps={{ fieldProps={{
accept:'.jpg,.jpeg,.git,.png', accept: '.jpg,.jpeg,.git,.png',
name: 'file', name: 'file',
listType: 'picture-card', listType: 'picture-card',
maxCount: 1, maxCount: 1,
@ -530,7 +536,7 @@ export default () => {
<ProDescriptions.Item dataIndex="subject_id" hideInDescriptions /> <ProDescriptions.Item dataIndex="subject_id" hideInDescriptions />
<ProDescriptions.Item dataIndex="subject_name" label="主题名称" valueType="text">{subjectIntro?.subject_name}</ProDescriptions.Item> <ProDescriptions.Item dataIndex="subject_name" label="主题名称" valueType="text">{subjectIntro?.subject_name}</ProDescriptions.Item>
<ProDescriptions.Item dataIndex="subject_describe" label="主题介绍" valueType="text"> <ProDescriptions.Item dataIndex="subject_describe" label="主题介绍" valueType="text">
<div dangerouslySetInnerHTML={{__html: subjectIntro?.subject_describe}} /> <div dangerouslySetInnerHTML={{ __html: subjectIntro?.subject_describe }} />
</ProDescriptions.Item> </ProDescriptions.Item>
</ProDescriptions> </ProDescriptions>
@ -559,19 +565,19 @@ export default () => {
page_number: value?.current || 1, page_number: value?.current || 1,
page_size: value?.pageSize, page_size: value?.pageSize,
}); });
if(data.list.length!==0){ if (data.list.length !== 0) {
data.list.forEach((i)=>{ data.list.forEach((i) => {
i.course_ids=i.course_ids.split(',') i.course_ids = i.course_ids.split(',')
i.course_names=i.course_names.split(',') i.course_names = i.course_names.split(',')
i.tag_ids=i.tag_ids.split(',') i.tag_ids = i.tag_ids.split(',')
i.tag_names=i.tag_names.split(',') i.tag_names = i.tag_names.split(',')
}) })
} }
if(data.list.length!==0){ if (data.list.length !== 0) {
data.list.forEach((item)=>{ data.list.forEach((item) => {
item.tag_ids=item.tag_ids.map(i => i * 1); item.tag_ids = item.tag_ids.map(i => i * 1);
item.course_ids=item.course_ids.map(a => a * 1); item.course_ids = item.course_ids.map(a => a * 1);
}) })
} }
return { return {
@ -610,7 +616,7 @@ export default () => {
...values, ...values,
subject_id: params?.id || 0, subject_id: params?.id || 0,
}); });
if(success){ if (success) {
handleCreateModalVisible(false); handleCreateModalVisible(false);
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
} }
@ -652,9 +658,9 @@ export default () => {
const success = await handleUpdateChapter({ const success = await handleUpdateChapter({
...values, ...values,
subject_id: params?.id || 0, subject_id: params?.id || 0,
chapter_id:currentRow.chapter_id chapter_id: currentRow.chapter_id
}); });
if(success){ if (success) {
handleUpdateModalVisible(false); handleUpdateModalVisible(false);
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
} }
@ -684,7 +690,7 @@ export default () => {
description: false, description: false,
}} }}
onFinish={async (values) => { onFinish={async (values) => {
await commitSubject({subject_id: subjectIntro?.subject_id}); await commitSubject({ subject_id: subjectIntro?.subject_id });
// 跳转到指定路由 // 跳转到指定路由
history.push('/course/subject'); history.push('/course/subject');
return true; return true;
@ -693,17 +699,17 @@ export default () => {
<Row gutter={24}> <Row gutter={24}>
<Col lg={12} md={12} sm={12} offset={6}> <Col lg={12} md={12} sm={12} offset={6}>
<Result <Result
className={styles.registerResult} className={styles.registerResult}
status="success" status="success"
title={ title={
<div className={styles.title}> <div className={styles.title}>
<span style={{color: '#1890ff'}}>{subjectIntro?.subject_name} </span>/ <span style={{ color: '#1890ff' }}>{subjectIntro?.subject_name} </span>/
</div> </div>
} }
subTitle="点击提交将设置为发布状态。" subTitle="点击提交将设置为发布状态。"
//extra={actions} //extra={actions}
/> />
</Col> </Col>
</Row> </Row>
</StepsForm.StepForm> </StepsForm.StepForm>

@ -219,7 +219,7 @@ const CourseList: React.FC = () => {
history.push('/examination/certificate/person/' + record.examination_id + "/" + record.accreditation_status + "/" + encodeURIComponent(record.examination_name)) 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} {record.status_type}
</Button>, </Button>,

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

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

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

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

@ -1,6 +1,6 @@
import type { FC } from 'react'; import type { FC } from 'react';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { Avatar, Card, Col, List, Skeleton, Row, Statistic, Descriptions, Progress, Table, Button ,Image} 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 { Line, Radar } from '@ant-design/charts';
import { Link, history, useRequest } from 'umi'; import { Link, history, useRequest } from 'umi';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
@ -126,7 +126,7 @@ const certificateColumns = [
dataIndex: 'is_pass', dataIndex: 'is_pass',
key: 'statusExam', key: 'statusExam',
render: (dom, entity) => { render: (dom, entity) => {
return entity.is_pass = 1 ? "通过" : "未通过" return entity.is_pass = 1 ? "通过" : "未通过"
} }
}, },
{ {
@ -192,7 +192,8 @@ const Workplace: FC = () => {
() => getExaminationList( () => getExaminationList(
{ {
person_id: cookie.load('person_id'), person_id: cookie.load('person_id'),
b_use:1 b_use: 1,
page_size: 999
}), { }), {
formatResult: (result) => { formatResult: (result) => {
return result.table_List; return result.table_List;
@ -262,12 +263,12 @@ const Workplace: FC = () => {
point={{ size: 5 }} point={{ size: 5 }}
tooltip={{ tooltip={{
customContent: (title: any, items: any): any => { customContent: (title: any, items: any): any => {
console.log('title',title); console.log('title', title);
console.log('items',items); console.log('items', items);
return( return (
<div style={{ padding: '12px 14px', fontSize: '12px', width: '180px', height: '68px',lineHeight:'20px' }}> <div style={{ padding: '12px 14px', fontSize: '12px', width: '180px', height: '68px', lineHeight: '20px' }}>
<div>{title}</div> <div>{title}</div>
<div>{items[0]?items[0].data.learning_minutes:''}</div> <div>{items[0] ? items[0].data.learning_minutes : ''}</div>
</div> </div>
@ -277,32 +278,32 @@ const Workplace: FC = () => {
/> />
</div> </div>
</Card> </Card>
{ {
JSON.stringify(lastLearningList)!=='{}'? JSON.stringify(lastLearningList) !== '{}' ?
<Card <Card
bodyStyle={{ padding: 15 }} bodyStyle={{ padding: 15 }}
bordered={false} bordered={false}
className={styles.studyCard} className={styles.studyCard}
title="当前学习" title="当前学习"
loading={activitiesLoading} 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" />} 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 title={lastLearningList?.course_name} layout='horizontal' column={1} >
<Descriptions.Item label="主将人">{lastLearningList?.lecture_teacher}</Descriptions.Item> <Descriptions.Item label="主将人">{lastLearningList?.lecture_teacher}</Descriptions.Item>
<Descriptions.Item label="章节">{lastLearningList?.chapter_name}</Descriptions.Item> <Descriptions.Item label="章节">{lastLearningList?.chapter_name}</Descriptions.Item>
<Descriptions.Item label="主题">{lastLearningList?.subject_name}</Descriptions.Item> <Descriptions.Item label="主题">{lastLearningList?.subject_name}</Descriptions.Item>
<Descriptions.Item label="时长">{lastLearningList?.total_course_minutes}</Descriptions.Item> <Descriptions.Item label="时长">{lastLearningList?.total_course_minutes}</Descriptions.Item>
</Descriptions> </Descriptions>
<Progress percent={lastLearningList?.learning_progress} /> <Progress percent={lastLearningList?.learning_progress} />
</Card> </Card>
: <Card : <Card
bodyStyle={{ padding: 15 }} bodyStyle={{ padding: 15 }}
bordered={false} bordered={false}
className={styles.studyCard} className={styles.studyCard}
title="当前学习" title="当前学习"
><div style={{minHeight:'5rem',textAlign:'right',paddingTop:'1rem',fontSize:'15px'}}></div></Card> ><div style={{ minHeight: '5rem', textAlign: 'right', paddingTop: '1rem', fontSize: '15px' }}></div></Card>
} }
</Col> </Col>
<Col xl={14} lg={14} md={14} sm={14} xs={14}> <Col xl={14} lg={14} md={14} sm={14} xs={14}>
<Card <Card

@ -41,10 +41,10 @@ const SubjectList = () => {
<List.Item key={item?.subject_id}> <List.Item key={item?.subject_id}>
<Card <Card
title={<a>{item?.subject_name}</a>} title={<a>{item?.subject_name}</a>}
hoverable hoverable={false}
className={styles.card} className={styles.card}
actions={[]} 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></>} // 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></>}
> >
<Card.Meta <Card.Meta
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />} avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />}
@ -53,7 +53,7 @@ const SubjectList = () => {
<> <>
<Card.Grid hoverable={false} style={{ width: '50%', padding: 0 }}> <Card.Grid hoverable={false} style={{ width: '50%', padding: 0 }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }}> <Paragraph className={styles.item} ellipsis={{ rows: 4 }}>
<div dangerouslySetInnerHTML={{__html:item.subject_describe}}/> <div dangerouslySetInnerHTML={{ __html: item.subject_describe }} />
</Paragraph> </Paragraph>
</Card.Grid> </Card.Grid>
{/*<Card.Grid hoverable={false} style={{ width: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid>*/} {/*<Card.Grid hoverable={false} style={{ width: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid>*/}

Loading…
Cancel
Save