Commit f8c00cd1 authored by 田翔's avatar 田翔

fix: 增加操作按钮

parent 13bb554c
{
"name": "panda-xform",
"version": "4.2.0",
"description": "4.2.0 增加批量操作一些属性",
"version": "4.2.1",
"description": "4.2.1 增加功能按钮",
"keywords": [
"panda-xform"
],
......@@ -130,4 +130,4 @@
"publishConfig": {
"registry": "https://g.civnet.cn:4873"
}
}
}
\ No newline at end of file
import React, { useEffect, useMemo, useState } from 'react'
import React, { useMemo, useState } from 'react'
import styles from './index.less'
import { Button, Upload, message } from 'antd'
import { accepts, getFileType } from '../../../../../../constant'
import { uploadFileUrl, downloadFileUrl, downloadFile } from '../../../../../../apis/process'
import { getFileType } from '../../../../../../constant'
import { downloadFileUrl } from '../../../../../../apis/process'
import {
SnippetsOutlined,
PlusOutlined,
FormOutlined,
DeleteOutlined,
ImportOutlined,
ExportOutlined,
FileZipOutlined,
FileImageOutlined,
CustomerServiceOutlined,
VideoCameraOutlined,
ExclamationCircleOutlined,
QuestionCircleOutlined,
EditOutlined,
DownOutlined,
FileOutlined,
UploadOutlined,
ArrowDownOutlined
ArrowDownOutlined,
} from '@ant-design/icons'
import FileViewer from 'react-file-viewer'
import Viewer from 'viewerjs-react'
import Drag from '../../../../../components/Drag'
const FileView = (props) => {
const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite
const { value, fileType, title, preview, download } = props
let fileList = value ? value.split(',') : []
......@@ -34,6 +23,16 @@ const FileView = (props) => {
const [viewVisible, setViewVisible] = useState(false)
const [showFile, setShowFile] = useState({ fileType: '', filePath: '' })
const icon = useMemo(() => {
if (fileType === '音频') {
return <CustomerServiceOutlined />
}
if (fileType === '视频') {
return <VideoCameraOutlined />
}
return <FileZipOutlined />
}, [fileType])
const showList = useMemo(() => {
let list = []
fileList.forEach((item, index) => {
......@@ -120,7 +119,7 @@ const FileView = (props) => {
<div className={styles.fileView}>
<Button
size='small'
icon={<FileZipOutlined />}
icon={icon}
onClick={() => setVisible(true)}
>
{fileList.length}条记录
......
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