From ac947135e622adb00bdef3fa9d99d33247cc8c5a Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Tue, 15 Mar 2022 08:30:42 +0800 Subject: [PATCH] 314bug --- .../analysis/components/CourseRow.tsx | 14 +- .../analysis/components/IntroduceRow.tsx | 9 + admin/src/pages/demo/index.tsx | 634 +++++++++--------- .../pages/examination/certificate/index.tsx | 40 +- .../pages/examination/certificate/person.tsx | 100 ++- admin/src/pages/examination/option/index.tsx | 41 +- .../pages/examination/registration/index.tsx | 12 +- .../examinationrules/attestation/index.tsx | 6 +- .../pages/examinationrules/normal/index.tsx | 22 +- web/src/pages/dashboard/workplace/index.tsx | 41 +- .../mockExamination/chapterErrorListPaper.tsx | 2 +- .../mockExamination/chapterListPaper.tsx | 2 +- web/src/pages/mockExamination/paper/index.tsx | 6 +- 13 files changed, 502 insertions(+), 427 deletions(-) diff --git a/admin/src/pages/dashboard/analysis/components/CourseRow.tsx b/admin/src/pages/dashboard/analysis/components/CourseRow.tsx index 5283f11..7074a8e 100644 --- a/admin/src/pages/dashboard/analysis/components/CourseRow.tsx +++ b/admin/src/pages/dashboard/analysis/components/CourseRow.tsx @@ -6,7 +6,7 @@ import { Column, TinyColumn } from '@ant-design/charts'; import numeral from 'numeral'; import type { DataItem } from '../data'; import styles from '../style.less'; -import { InfoCircleOutlined } from '@ant-design/icons'; +import { InfoCircleOutlined, AlignLeftOutlined } from '@ant-design/icons'; import { ChartCard } from './Charts'; import { courseBrowseTimesStatistics } from '../service'; import { useRequest } from 'umi'; @@ -27,10 +27,11 @@ const TrainingRow = () => {
-
+
111 { text: '课程名称', visible: false, }, + label: { + interval: 0,//横轴信息全部显示 + rotate: 0.3, + autoEllipsis: true, + style: { + textAlign: 'left' + } + } }} yAxis={{ visible: true, + title: { text: '课程浏览量', visible: false, diff --git a/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx b/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx index 6e06218..c7a9efa 100644 --- a/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx +++ b/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx @@ -55,6 +55,7 @@ const IntroduceRow = () => { data={trainNumberBySubjectData?.subject_train_list || [] as any} xField="subject_name" yField="train_number" + tooltip={{ formatter: (name, value: number) => { // const {name, value} = args; @@ -68,6 +69,14 @@ const IntroduceRow = () => { text: '主题名称', visible: false, }, + label: { + interval: 0,//横轴信息全部显示 + rotate: 0.3,//-30度角倾斜显示 \ + autoEllipsis: true, + style: { + textAlign: 'left' + } + } }} yAxis={{ visible: true, diff --git a/admin/src/pages/demo/index.tsx b/admin/src/pages/demo/index.tsx index 94c8bc3..02b6048 100644 --- a/admin/src/pages/demo/index.tsx +++ b/admin/src/pages/demo/index.tsx @@ -1,338 +1,338 @@ -import { DingdingOutlined, UploadOutlined } from '@ant-design/icons'; -import { Button, Card, Steps, Result, Descriptions, Modal, Input, Upload, Popconfirm, Menu, Radio } from 'antd'; -import { Fragment, useEffect, useRef, useState } from 'react'; -import { GridContent } from '@ant-design/pro-layout'; -import { getInfo } from 'react-mediainfo'; -import { Line } from '@ant-design/charts'; -import { DualAxes } from "@ant-design/charts"; -import styles from './index.less'; -import ReactQuill from 'react-quill'; -import 'react-quill/dist/quill.snow.css' -import ProDescriptions, { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; -import { TableListItem } from '../ListTableList2'; -import { v4 as uuidv4 } from 'uuid'; -import { queryCourseList } from '../course/option/service'; -import { useRequest } from 'umi'; +// import { DingdingOutlined, UploadOutlined } from '@ant-design/icons'; +// import { Button, Card, Steps, Result, Descriptions, Modal, Input, Upload, Popconfirm, Menu, Radio } from 'antd'; +// import { Fragment, useEffect, useRef, useState } from 'react'; +// import { GridContent } from '@ant-design/pro-layout'; +// import { getInfo } from 'react-mediainfo'; +// import { Line } from '@ant-design/charts'; +// import { DualAxes } from "@ant-design/charts"; +// import styles from './index.less'; +// import ReactQuill from 'react-quill'; +// import 'react-quill/dist/quill.snow.css' +// import ProDescriptions, { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; +// import { TableListItem } from '../ListTableList2'; +// import { v4 as uuidv4 } from 'uuid'; +// import { queryCourseList } from '../course/option/service'; +// import { useRequest } from 'umi'; -const { Step } = Steps; +// const { Step } = Steps; -// 秒数转化为时分秒 -const formatSeconds= (value)=>{ - // 秒 - let second = parseInt(value) - // 分 - let minute = 0 - // 小时 - let hour = 0 - // 天 - // let day = 0 - // 如果秒数大于60,将秒数转换成整数 - if (second > 60) { - // 获取分钟,除以60取整数,得到整数分钟 - minute = parseInt(second / 60) - // 获取秒数,秒数取佘,得到整数秒数 - second = parseInt(second % 60) - // 如果分钟大于60,将分钟转换成小时 - if (minute > 60) { - // 获取小时,获取分钟除以60,得到整数小时 - hour = parseInt(minute / 60) - // 获取小时后取佘的分,获取分钟除以60取佘的分 - minute = parseInt(minute % 60) - // 如果小时大于24,将小时转换成天 - // if (hour > 23) { - // // 获取天数,获取小时除以24,得到整天数 - // day = parseInt(hour / 24) - // // 获取天数后取余的小时,获取小时除以24取余的小时 - // hour = parseInt(hour % 24) - // } - } - } +// // 秒数转化为时分秒 +// const formatSeconds= (value)=>{ +// // 秒 +// let second = parseInt(value) +// // 分 +// let minute = 0 +// // 小时 +// let hour = 0 +// // 天 +// // let day = 0 +// // 如果秒数大于60,将秒数转换成整数 +// if (second > 60) { +// // 获取分钟,除以60取整数,得到整数分钟 +// minute = parseInt(second / 60) +// // 获取秒数,秒数取佘,得到整数秒数 +// second = parseInt(second % 60) +// // 如果分钟大于60,将分钟转换成小时 +// if (minute > 60) { +// // 获取小时,获取分钟除以60,得到整数小时 +// hour = parseInt(minute / 60) +// // 获取小时后取佘的分,获取分钟除以60取佘的分 +// minute = parseInt(minute % 60) +// // 如果小时大于24,将小时转换成天 +// // if (hour > 23) { +// // // 获取天数,获取小时除以24,得到整天数 +// // day = parseInt(hour / 24) +// // // 获取天数后取余的小时,获取小时除以24取余的小时 +// // hour = parseInt(hour % 24) +// // } +// } +// } - let result = '' + parseInt(second) + ' 秒 ' - if (minute > 0) { - result = '' + parseInt(minute) + ' 分 ' + result - } - if (hour > 0) { - result = '' + parseInt(hour) + ' 小时 ' + result - } - // if (day > 0) { - // result = '' + parseInt(day) + '天' + result - // } - //console.log('result:', result) - return result -} -export default () => { - const uuid = uuidv4() - //console.log('uuid', uuidv4()); - const data = [ - { - year: "1991", - value: 3, - count: 10 - }, - { - year: "1992", - value: 4, - count: 4 - }, - { - year: "1993", - value: 3.5, - count: 5 - }, - { - year: "1994", - value: 5, - count: 5 - }, - { - year: "1995", - value: 4.9, - count: 4.9 - }, - { - year: "1996", - value: 6, - count: 35 - }, - { - year: "1997", - value: 7, - count: 7 - }, - { - year: "1998", - value: 9, - count: 1 - }, - { - year: "1999", - value: 13, - count: 20 - } - ]; - const data2 = [ - { - year: "1991", - value: 30, - count: 100 - }, - { - year: "1992", - value: 40, - count: 40 - }, - { - year: "1993", - value: 3.5, - count: 50 - }, - { - year: "1994", - value: 5, - count: 50 - }, - { - year: "1995", - value: 40.9, - count: 24.9 - }, - { - year: "1996", - value: 6, - count: 395 - }, - { - year: "1997", - value: 7, - count: 79 - }, - { - year: "1998", - value: 99, - count: 1 - }, - { - year: "1999", - value: 193, - count: 20 - } - ]; +// let result = '' + parseInt(second) + ' 秒 ' +// if (minute > 0) { +// result = '' + parseInt(minute) + ' 分 ' + result +// } +// if (hour > 0) { +// result = '' + parseInt(hour) + ' 小时 ' + result +// } +// // if (day > 0) { +// // result = '' + parseInt(day) + '天' + result +// // } +// //console.log('result:', result) +// return result +// } +// export default () => { +// const uuid = uuidv4() +// //console.log('uuid', uuidv4()); +// const data = [ +// { +// year: "1991", +// value: 3, +// count: 10 +// }, +// { +// year: "1992", +// value: 4, +// count: 4 +// }, +// { +// year: "1993", +// value: 3.5, +// count: 5 +// }, +// { +// year: "1994", +// value: 5, +// count: 5 +// }, +// { +// year: "1995", +// value: 4.9, +// count: 4.9 +// }, +// { +// year: "1996", +// value: 6, +// count: 35 +// }, +// { +// year: "1997", +// value: 7, +// count: 7 +// }, +// { +// year: "1998", +// value: 9, +// count: 1 +// }, +// { +// year: "1999", +// value: 13, +// count: 20 +// } +// ]; +// const data2 = [ +// { +// year: "1991", +// value: 30, +// count: 100 +// }, +// { +// year: "1992", +// value: 40, +// count: 40 +// }, +// { +// year: "1993", +// value: 3.5, +// count: 50 +// }, +// { +// year: "1994", +// value: 5, +// count: 50 +// }, +// { +// year: "1995", +// value: 40.9, +// count: 24.9 +// }, +// { +// year: "1996", +// value: 6, +// count: 395 +// }, +// { +// year: "1997", +// value: 7, +// count: 79 +// }, +// { +// year: "1998", +// value: 99, +// count: 1 +// }, +// { +// year: "1999", +// value: 193, +// count: 20 +// } +// ]; - const [modalVisible, handleModalVisible] = useState(false); - const saveInputRef = useRef(); - const radioRef = useRef(); +// const [modalVisible, handleModalVisible] = useState(false); +// const saveInputRef = useRef(); +// const radioRef = useRef(); - //const currentRow = {course_name:'课程0001'}; - const currentRow = {course_name1:'课程0001'}; - const columns = [ - {title: "序号", key: "index", valueType: "indexBorder", width: 48}, - //{title: "课程名称", dataIndex: "course_name", valueType: "text", hideInTable: false, hideInDescriptions: false}, - {dataIndex: "course_name", hideInDescriptions: false, hideInForm: false,hideInSearch: true,hideInTable: false, title: "课程名称1", valueType: "text"}, - {} - ]; - const [chartData, setChartData] = useState([data, data]); +// //const currentRow = {course_name:'课程0001'}; +// const currentRow = {course_name1:'课程0001'}; +// const columns = [ +// {title: "序号", key: "index", valueType: "indexBorder", width: 48}, +// //{title: "课程名称", dataIndex: "course_name", valueType: "text", hideInTable: false, hideInDescriptions: false}, +// {dataIndex: "course_name", hideInDescriptions: false, hideInForm: false,hideInSearch: true,hideInTable: false, title: "课程名称1", valueType: "text"}, +// {} +// ]; +// const [chartData, setChartData] = useState([data, data]); - const [selectedCourse, setSelectedCourse] = useState(0); - const [menu, setMenu] = useState(); +// const [selectedCourse, setSelectedCourse] = useState(0); +// const [menu, setMenu] = useState(); - const [timeData, setTimeData] = useState(0); +// const [timeData, setTimeData] = useState(0); - useEffect(() => { - let secondValue = 3000; // 秒 截至时间 - 服务器当前时间 - setTimeData(secondValue) - const timer = setInterval(() => { // - setTimeData((secondValue > 1) ? secondValue-- : 0); - }, 1000); - return ()=>{ - clearInterval(timer) // 清理计算器 - } - },[]) +// useEffect(() => { +// let secondValue = 3000; // 秒 截至时间 - 服务器当前时间 +// setTimeData(secondValue) +// const timer = setInterval(() => { // +// setTimeData((secondValue > 1) ? secondValue-- : 0); +// }, 1000); +// return ()=>{ +// clearInterval(timer) // 清理计算器 +// } +// },[]) - /** 获取课程数据 */ - const { data: listData } = useRequest(() => { - return queryCourseList(); - }); - useEffect(() => { - //console.log('listData', listData) - /* - setInterval(() => { - setChartData(Math.random() > 0.5 ? [data, data] : [data2, data2]); - }, 1000);*/ +// /** 获取课程数据 */ +// const { data: listData } = useRequest(() => { +// return queryCourseList(); +// }); +// useEffect(() => { +// //console.log('listData', listData) +// /* +// setInterval(() => { +// setChartData(Math.random() > 0.5 ? [data, data] : [data2, data2]); +// }, 1000);*/ - /** 生成菜单 */ - const menuItems = []; +// /** 生成菜单 */ +// const menuItems = []; - if(listData?.length > 0){ - //console.log('push'); - listData.list.forEach((item: {code: number, name: string})=>{ - menuItems.push({item?.course_name}) - }) - } - setMenu( - { - console.log('menu11', value); - console.log('menu11', value.key); - //setMenu({ name: listData[Number(value?.key)]?.name, value: Number(value?.key)}); - }} - > - {menuItems} - - ); - }, [listData, selectedCourse]); +// if(listData?.length > 0){ +// //console.log('push'); +// listData.list.forEach((item: {code: number, name: string})=>{ +// menuItems.push({item?.course_name}) +// }) +// } +// setMenu( +// { +// console.log('menu11', value); +// console.log('menu11', value.key); +// //setMenu({ name: listData[Number(value?.key)]?.name, value: Number(value?.key)}); +// }} +// > +// {menuItems} +// +// ); +// }, [listData, selectedCourse]); - const config = { - data: chartData, - xField: "year", - yField: ["value", "count"] - }; +// const config = { +// data: chartData, +// xField: "year", +// yField: ["value", "count"] +// }; - return( - <> - {menu} - - { - saveInputRef.current.focus({}) - //console.log('ref', saveInputRef.current) - }}>焦点 - {handleModalVisible(true)}}>课程 -

uuid: {uuidv4()}

- { - // val === 转化出来的html - }} - /> -

-

hello'}} /> -

-

- /dsideal_yy/html/down/Syzx/{uuid?.substr(0,2)}/{uuid}.jpg - /dsideal_yy/html/down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A2.jpg - 获取文件详情(下载url,播放url) /dsideal_yy/wkds/getwkdsInfo -

- { - const {media: {track:[General, Video, Audio]}} = await getInfo(file) - console.log('General:', General) - console.log('Video:', Video) - console.log('Video:', Video.format) // AVC - console.log('Audio:', Audio.format) // AAC - /* - console.log('info:', media) - console.log('track[0]:', media.track[0]) - console.log('track[1]:', media.track[1]) - console.log('track[2]:', media.track[2])*/ - }} - data={ - { - name: '4.jpg', - chunk: 0, - chunks: 1, - key: 'down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A2.jpg' - } - } - > -
- -
-
+// return( +// <> +// {menu} +// +// { +// saveInputRef.current.focus({}) +// //console.log('ref', saveInputRef.current) +// }}>焦点 +// {handleModalVisible(true)}}>课程 +//

uuid: {uuidv4()}

+// { +// // val === 转化出来的html +// }} +// /> +//

+//

hello'}} /> +//

+//

+// /dsideal_yy/html/down/Syzx/{uuid?.substr(0,2)}/{uuid}.jpg +// /dsideal_yy/html/down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A2.jpg +// 获取文件详情(下载url,播放url) /dsideal_yy/wkds/getwkdsInfo +//

+// { +// const {media: {track:[General, Video, Audio]}} = await getInfo(file) +// console.log('General:', General) +// console.log('Video:', Video) +// console.log('Video:', Video.format) // AVC +// console.log('Audio:', Audio.format) // AAC +// /* +// console.log('info:', media) +// console.log('track[0]:', media.track[0]) +// console.log('track[1]:', media.track[1]) +// console.log('track[2]:', media.track[2])*/ +// }} +// data={ +// { +// name: '4.jpg', +// chunk: 0, +// chunks: 1, +// key: 'down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A2.jpg' +// } +// } +// > +//
+// +//
+//
- { - // setCurrentRow(undefined); // 设置当前行 - handleModalVisible(false); - }} - footer={null} - centered - > +// { +// // setCurrentRow(undefined); // 设置当前行 +// handleModalVisible(false); +// }} +// footer={null} +// centered +// > - - column={2} - /* title={currentRow?.name} */ - dataSource={currentRow} - /* - request={async () => ({ - data: currentRow || {}, - })}*/ - params={{ - id: currentRow?.id, - }} - columns={ - columns.slice(0, columns.length - 1) as ProDescriptionsItemProps[] - } - /> +// +// column={2} +// /* title={currentRow?.name} */ +// dataSource={currentRow} +// /* +// request={async () => ({ +// data: currentRow || {}, +// })}*/ +// params={{ +// id: currentRow?.id, +// }} +// columns={ +// columns.slice(0, columns.length - 1) as ProDescriptionsItemProps[] +// } +// /> - - - Delete - - {/* - -*/} - { - }}> - A - B - C - D - - {}}>rrrrr +// +// +// Delete +// +// {/* +// +// */} +// { +// }}> +// A +// B +// C +// D +// +// {}}>rrrrr -
{formatSeconds(timeData)}
- - ) -}; +//
{formatSeconds(timeData)}
+// +// ) +// }; diff --git a/admin/src/pages/examination/certificate/index.tsx b/admin/src/pages/examination/certificate/index.tsx index 7560d2a..2934c9e 100644 --- a/admin/src/pages/examination/certificate/index.tsx +++ b/admin/src/pages/examination/certificate/index.tsx @@ -119,14 +119,16 @@ const CourseList: React.FC = () => { renderText: (val: string) => `${val}`, }, { - title: '报名开始日期', + title: '报名日期', dataIndex: 'apply_start_time', valueType: 'text', sorter: false, hideInTable: false, hideInForm: false, hideInSearch: true, - renderText: (val: string) => `${val}`, + render: (dom, entity) => { + return entity.apply_start_time + " - " + entity.apply_end_time + }, }, { title: '考试时间', @@ -136,6 +138,7 @@ const CourseList: React.FC = () => { hideInTable: false, hideInForm: false, hideInSearch: false, + colSize: 2, render: (dom, entity) => { return entity.examination_start_time + " - " + entity.examination_end_time }, @@ -176,6 +179,9 @@ const CourseList: React.FC = () => { valueType: 'text', hideInForm: false, hideInSearch: false, + fieldProps: { + allowClear: false + }, renderFormItem: (_, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => { if (type === 'form') { return null; @@ -185,6 +191,7 @@ const CourseList: React.FC = () => { return ( // value 和 onchange 会通过 form 自动注入。 @@ -205,18 +212,36 @@ const CourseList: React.FC = () => { valueType: 'option', render: (_dom: any, record: React.SetStateAction) => [ - { history.push('/examination/certificate/person/' + record.examination_id + "/" + record.accreditation_status + "/" + encodeURIComponent(record.examination_name)) }} + disabled={record.status_type === 4 ? false : true} + > + 查看名单{record.status_type} + , + , ], }, ]; @@ -231,6 +256,7 @@ const CourseList: React.FC = () => { options={false} search={{ labelWidth: 120, + defaultCollapsed: false }} // toolBarRender={() => [ // , - // ]} + request={async (value) => { console.log(value, 'form value') const { create_time } = value; @@ -268,7 +244,7 @@ const CourseList: React.FC = () => { }; }} // dataSource={list} - columns={columns} + columns={getInitialValues(columns, { city_id: 0, district_id: 0 })} rowSelection={false} /> diff --git a/admin/src/pages/examination/option/index.tsx b/admin/src/pages/examination/option/index.tsx index 463b734..1ed2575 100644 --- a/admin/src/pages/examination/option/index.tsx +++ b/admin/src/pages/examination/option/index.tsx @@ -104,6 +104,10 @@ const ExaminationList: React.FC = () => { required: true, message: '请填写考试名称', }, + { + pattern: /^[^\s]*$/, + message: '禁止输入空格' + } ] }, }, @@ -148,10 +152,11 @@ const ExaminationList: React.FC = () => { { title: '创建时间', dataIndex: 'create_time', - valueType: 'dateTime', + valueType: 'dateTimeRange', hideInTable: false, hideInForm: true, hideInSearch: false, + colSize: 2, }, { title: '关联主题', @@ -164,6 +169,7 @@ const ExaminationList: React.FC = () => { const { data: Items } = await querySubjectList({ page_size: 1000 }); // console.log(Items, ')))'); + const sinfo = [] for (let i = 0; i < Items.list.length; i++) { // console.log(Items.list[i], ">>>") @@ -178,12 +184,12 @@ const ExaminationList: React.FC = () => { { required: true, message: '此项为必填项', - }, + } ] }, }, { - title: '关联的规则', + title: '关联考试规则', dataIndex: 'rules_id', valueType: 'select', hideInTable: true, @@ -191,13 +197,13 @@ const ExaminationList: React.FC = () => { hideInSearch: true, dependencies: ['subject_id'], request: async (params) => { - - console.log(params, 'params::::'); + console.log(params, 'params::::', schemaForm); const { table_List: Items } = await queryRulesList({ rules_type: 1, subject_id: params.subject_id || 0, }); const rules = []; for (let i = 0; i < Items.length; i++) { rules.push({ label: Items[i].rules_name, value: Items[i].id }) } + schemaForm.setFieldsValue({ rules_id: "" }); return rules; }, formItemProps: { @@ -227,12 +233,16 @@ const ExaminationList: React.FC = () => { required: true, message: '请填写在线时长', }, + { + pattern: /^[^\s]*$/, + message: '禁止输入空格' + } ] }, }, { - title: '课程开放时间', + title: '课程主题开放时间', dataIndex: 'course_time', valueType: 'dateTimeRange', @@ -245,7 +255,7 @@ const ExaminationList: React.FC = () => { { required: true, message: '请选择主题开放时间', - }, + } ] }, }, @@ -320,14 +330,14 @@ const ExaminationList: React.FC = () => { handleUpdateModalVisible(true); record.apply_time = [record.apply_start_time, record.apply_end_time] record.examination_time = [record.examination_end_time, record.examination_end_time] - record.apply_time = [record.apply_start_time, record.apply_end_time] + record.course_time = [record.course_start_time, record.course_end_time] setCurrentRow(record); }} style={{ padding: '0 2px 0 0' }} > 编辑 , - { handleRemove([{ key: record?.examination_id }], record); // 调用批量删除函数(如果接口不支持批量需要在service中处理) setSelectedRows([]); @@ -370,6 +380,7 @@ const ExaminationList: React.FC = () => { options={false} search={{ labelWidth: 120, + defaultCollapsed: false }} toolBarRender={() => [ , + , , { onClick={async () => { //history.push(`/examination/option/registration/${record.examination_id}`); //setCurrentRow(record); - console.log('record', {...record, b_use: !record.b_use}) - await handleUpdate({b_use: record?.b_use === 0 ? 1 : 0}, record); + console.log('record', { ...record, b_use: !record.b_use }) + await handleUpdate({ b_use: record?.b_use === 0 ? 1 : 0 }, record); actionRef.current?.reloadAndRest?.(); }} > diff --git a/web/src/pages/dashboard/workplace/index.tsx b/web/src/pages/dashboard/workplace/index.tsx index 05358e8..341e9c4 100644 --- a/web/src/pages/dashboard/workplace/index.tsx +++ b/web/src/pages/dashboard/workplace/index.tsx @@ -7,7 +7,7 @@ import { PageContainer } from '@ant-design/pro-layout'; import moment from 'moment'; import EditableLinkGroup from './components/EditableLinkGroup'; import styles from './style.less'; -import type { ActivitiesType, CurrentUser } from './data.d'; +import ProTable from '@ant-design/pro-table'; import { personLastLearning, personLearningDayStatistics, getPersonExaminationList, getExaminationList } from './service'; import cookie from 'react-cookies'; import OfflineData from './components/OfflineData'; @@ -212,7 +212,7 @@ const Workplace: FC = () => { () => getPersonExaminationList( { identity_id: cookie.load('identity_id'), - person_id: cookie.load('person_id') + person_id: cookie.load('person_id'), }), { formatResult: (result) => { return result.table_List; @@ -286,17 +286,48 @@ const Workplace: FC = () => { bordered={false} bodyStyle={{ padding: 0 }} > -
+
-
+ { + const { create_time } = value; + if (create_time) { + value.start_time = create_time[0] + value.end_time = create_time[1] + } + console.log('form _data', value) + delete value.create_time + const _data = await getPersonExaminationList( + { + ...value, + identity_id: cookie.load('identity_id'), + person_id: cookie.load('person_id'), + }); + return { + current: _data?.pageNumber, + data: _data?.table_List, + pageSize: _data?.pageSize, + total: _data?.totalRow || 0, + }; + }} + columns={certificateColumns} + rowKey="id" + /> + {/*
*/} diff --git a/web/src/pages/mockExamination/chapterErrorListPaper.tsx b/web/src/pages/mockExamination/chapterErrorListPaper.tsx index 2a30b3c..ba80327 100644 --- a/web/src/pages/mockExamination/chapterErrorListPaper.tsx +++ b/web/src/pages/mockExamination/chapterErrorListPaper.tsx @@ -105,7 +105,7 @@ const CardList = () => { setLastBtnShow(questionNowNum == 1 ? true : false) setNextBtnShow(questionNowNum == questionNum ? true : false) - }, [questionNowNum]) + }, [questionNowNum, questionNum]) const content = (
diff --git a/web/src/pages/mockExamination/chapterListPaper.tsx b/web/src/pages/mockExamination/chapterListPaper.tsx index 7984dbb..dc4211e 100644 --- a/web/src/pages/mockExamination/chapterListPaper.tsx +++ b/web/src/pages/mockExamination/chapterListPaper.tsx @@ -138,7 +138,7 @@ const CardList = () => { useEffect(() => { setLastBtnShow(questionNowNum == 1 ? true : false) setNextBtnShow(questionNowNum == questionNum ? true : false) - }, [questionNowNum]) + }, [questionNowNum, questionNum]) const content = (
diff --git a/web/src/pages/mockExamination/paper/index.tsx b/web/src/pages/mockExamination/paper/index.tsx index e5c697f..c8dac28 100644 --- a/web/src/pages/mockExamination/paper/index.tsx +++ b/web/src/pages/mockExamination/paper/index.tsx @@ -86,7 +86,7 @@ const CardList = () => { const [lastBtnShow, setLastBtnShow] = useState(true) - const [nextBtnShow, setNextBtnShow] = useState(false) + const [nextBtnShow, setNextBtnShow] = useState(true) // 当前题号 const [questionNowNum, setQuestionNowNum] = useState(0) @@ -236,10 +236,10 @@ const CardList = () => { }, [questionNow]); useEffect(() => { - console.log(questionNowNum, questionNum); + console.log(questionNowNum, questionNum, 'questionNowNum'); setLastBtnShow(questionNowNum == 1 ? true : false) setNextBtnShow(questionNowNum == questionNum ? true : false) - }, [questionNowNum]) + }, [questionNowNum, questionNum]) const content = (