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 { 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 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 } ]; 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 [selectedCourse, setSelectedCourse] = useState(0); const [menu, setMenu] = useState(); const [timeData, setTimeData] = useState(0); 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 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]); 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

{ // 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[] } /> Delete { }}> A B C D {}}>rrrrr
{formatSeconds(timeData)}
) };