master
zhengpengju 3 years ago
parent a6498a5ee3
commit ffc43e91ff

@ -14,6 +14,8 @@ import type { TableListItem, TableListPagination } from './data';
import Tags from './components/Tags';
import type { DataItem } from '@antv/data-set/lib/transform/tag-cloud';
import { VideoJS } from './components/VideoJS';
import { getInfo } from 'react-mediainfo';
import { v4 as uuidv4 } from 'uuid';
const uuid = uuidv4();
@ -247,9 +249,16 @@ const CourseList: React.FC = () => {
hideInDescriptions: true,
renderFormItem: (item, { defaultRender, ...rest }, form) => (
<Upload
accept='.mp4'
action='/dsideal_yy/res/plupload/'
defaultFileList={item.initialValue ? [item.initialValue] : []}
beforeUpload={(file) => {
beforeUpload={async (file) => {
/** 获取视频文件信息 */
const {media: {track:[General, Video, Audio]}} = await getInfo(file)
if(Video.format !== 'AVC' || Audio.format !== 'AAC'){
message.error('视频编码格式不正确视频采用AVC音频采用AAC')
return false;
}
// console.log('file', file)
// 获取文件名
SetUploadFileName(file?.name);

@ -439,10 +439,26 @@ export default () => {
label="主题图片"
max={2}
fieldProps={{
accept:'.jpg,.jpeg,.git,.png',
name: 'file',
listType: 'picture-card',
maxCount: 1,
beforeUpload: (file) => {
//限制图片 格式、size、分辨率
const isJPG = file.type === 'image/jpeg';
const isJPEG = file.type === 'image/jpeg';
const isGIF = file.type === 'image/gif';
const isPNG = file.type === 'image/png';
if (!(isJPG || isJPEG || isGIF || isPNG)) {
message.error('只能上传JPG 、JPEG 、GIF、 PNG格式的图片~');
return false;
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('超过2M限制不允许上传~');
return false;
}
// 获取文件名
SetUploadFileName(file?.name);
// 获取最后一个.的位置

@ -376,13 +376,17 @@ const QuestionBank = () => {
console.log('del selectedRowsState', selectedRowsState)
const selectedRows = selectedRowsState?.map((item)=>({key:item?.id}))
console.log('selectedRows', selectedRows)
const success = await handleRemove(selectedRows);
if (success) {
// handleModalVisible(false);
if (actionRef.current) {
setSelectedRows([]);
actionRef.current?.reload();
if(selectedRows?.length > 0){
const success = await handleRemove(selectedRows);
if (success) {
// handleModalVisible(false);
if (actionRef.current) {
setSelectedRows([]);
actionRef.current?.reload();
}
}
}else{
message.warn('请选择删除项')
}
}}>
<DeleteOutlined />

Loading…
Cancel
Save