Commit 3ff1a860 authored by zhuyangbin's avatar zhuyangbin

视频组件

parent 638cdc29
...@@ -11,7 +11,9 @@ message.config({ ...@@ -11,7 +11,9 @@ message.config({
}); });
const UploadCom = (props) => { const UploadCom = (props) => {
const { onChange, CDN_HOST, getFormat, setFormat, data, maxLength, disabled } = props; const {
onChange, CDN_HOST, getFormat, setFormat, data, maxLength, disabled,
} = props;
const selfProps = antiAssign(props, ['onChange', 'CDN_HOST', 'data']); const selfProps = antiAssign(props, ['onChange', 'CDN_HOST', 'data']);
const getFormatFileList = (fileList = []) => { const getFormatFileList = (fileList = []) => {
if (!fileList) { if (!fileList) {
...@@ -106,7 +108,7 @@ const UploadCom = (props) => { ...@@ -106,7 +108,7 @@ const UploadCom = (props) => {
const previewFile = (file) => { const previewFile = (file) => {
return new Promise((res, rej) => { return new Promise((res, rej) => {
const obj = checkoutFileType(file.name); const obj = checkoutFileType(file.name);
const typeArr = file.name.match(/\.[a-zA-Z]+$/); const typeArr = file.name.match(/\.[a-zA-Z0-9]+$/);
const type = typeArr && typeArr[0] ? typeArr[0].replace('.', '') : ''; const type = typeArr && typeArr[0] ? typeArr[0].replace('.', '') : '';
if (!['png', 'gif', 'bmp', 'jpg', 'jpeg'].includes(type)) { if (!['png', 'gif', 'bmp', 'jpg', 'jpeg'].includes(type)) {
res(obj.thumbUrl); res(obj.thumbUrl);
...@@ -125,6 +127,8 @@ const UploadCom = (props) => { ...@@ -125,6 +127,8 @@ const UploadCom = (props) => {
onSaveFileList(newFileList); onSaveFileList(newFileList);
}; };
const onDownload = (file) => {};
const beforeUpload = async () => { const beforeUpload = async () => {
await getToken(); await getToken();
return true; return true;
...@@ -144,6 +148,7 @@ const UploadCom = (props) => { ...@@ -144,6 +148,7 @@ const UploadCom = (props) => {
onRemove={onRemove} onRemove={onRemove}
previewFile={previewFile} previewFile={previewFile}
onPreview={onPreview} onPreview={onPreview}
onDownload={onDownload}
showUploadList={{ showUploadList={{
showPreviewIcon: true, showPreviewIcon: true,
showRemoveIcon: true, showRemoveIcon: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment