提交 01fba0fe authored 作者: 徐立's avatar 徐立

注释

上级 d675289b
......@@ -131,20 +131,12 @@ export default class index extends Component {
*/
getListData = (List) => {
const { checkedFuc } = this.state
switch (List.length) {
case 1:
return checkedFuc(List[0].value)
case 2:
return checkedFuc(List[0].value,List[1].value)
case 3:
return checkedFuc(List[0].value,List[1].value,List[2].value)
case 4:
return checkedFuc(List[0].value,List[1].value,List[2].value,List[3].value)
case 5:
return checkedFuc(List[0].value,List[1].value,List[2].value,List[3].value,List[4].value)
case 6:
return checkedFuc(List[0].value,List[1].value,List[2].value,List[3].value,List[4].value,List[5].value)
}
let ary = []
List.map(item => {
ary.push(item.value)
return item
})
return checkedFuc(...ary)
}
componentWillReceiveProps(nextProps){
const { isPicth } = nextProps
......
......@@ -3,7 +3,7 @@
*/
import React, { Component } from 'react';
import { Modal,Icon,Tooltip,Popconfirm } from 'antd';
import FileViewer from 'react-file-viewer';
// import FileViewer from 'react-file-viewer';
export default class index extends Component {
constructor(props){
super(props)
......@@ -45,7 +45,6 @@ export default class index extends Component {
} = this.state
let isShow = pathName?.indexOf('.pdf') !== -1
// || pathName?.indexOf('.doc') !== -1
|| pathName?.indexOf('.xls') !== -1
|| pathName?.indexOf('.mp3') !== -1
|| pathName?.indexOf('.mp4') !== -1
|| pathName?.indexOf('.csv') !== -1
......@@ -57,10 +56,7 @@ export default class index extends Component {
if(pathName?.indexOf('.pdf') !== -1){
isShow = true
type = 'pdf'
} else if(pathName?.indexOf('.xlsx') !== -1){
isShow = true
type = 'xlsx'
} else if(pathName?.indexOf('.mp3') !== -1){
} else if(pathName?.indexOf('.mp3') !== -1){
isShow = true
type = 'mp3'
} else if(pathName?.indexOf('.mp4') !== -1){
......@@ -82,21 +78,29 @@ export default class index extends Component {
isShow = false
}
return (
<span
>
<Popconfirm
title="该附件支持预览,是否预览?"
onConfirm={this.download}
onCancel={this.showModal}
okText="下载"
cancelText="预览"
>
<a
target="_blank"
href={path}>
{pathName}
</a>
</Popconfirm>
<>
{
isShow?
<Popconfirm
title="该附件支持预览,是否预览?"
onConfirm={this.download}
onCancel={this.showModal}
okText="下载"
cancelText="预览"
>
<a
target="_blank"
href={path}>
{pathName}
</a>
</Popconfirm>
: <a
target="_blank"
href={path}>
{pathName}
</a>
}
<Modal
title={pathName}
visible={visible}
......@@ -119,18 +123,18 @@ export default class index extends Component {
height:600,
}}
>
<FileViewer
{/* <FileViewer
fileType={type}
filePath={path}
// onError={this.onError}
// errorComponent={Error}
// unsupportedComponent={Error}
/>
/> */}
</div>
}
</Modal>
</span>
</>
)
}
}
......@@ -64,7 +64,7 @@ const Bs64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
const base64 = baseX(Bs64)
import {Base16Encode} from "../Base16/index"
import { getToken } from '../utils/token';
import FilePreview from '../filePreview';
// import FilePreview from '../filePreview';
function getBase64(value){
return value?base64.encode(new Buffer(value)):null;
......@@ -1745,12 +1745,12 @@ export default class tableCom extends Component {
if (f.path.indexOf('.png') != -1 || f.path.indexOf('.jpg') != -1) {
return <img key={index2} style={{ width: 100, height: 100 }} src={queryApiActionPath() + f.path} />
}
if(get === 'web'){
return <li key={index2}><FilePreview
path={queryApiActionPath() + f.path}
pathName={f.name}
/></li>
}
// if(get === 'web'){
// return <li key={index2}><FilePreview
// path={queryApiActionPath() + f.path}
// pathName={f.name}
// /></li>
// }
return <li key={index2}><a target="_blank" key={f.path} href={queryApiActionPath() + f.path}>
{f.name}
......@@ -1766,12 +1766,12 @@ export default class tableCom extends Component {
if (f.filePath.indexOf('.png') != -1 || f.filePath.indexOf('.jpg') != -1) {
return <img key={index2} style={{ width: 100, height: 100 }} src={queryApiActionPath() + f.filePath} />
}
if(get === 'web'){
return <li key={index2}><FilePreview
path={queryApiActionPath() + f.path}
pathName={f.name}
/></li>
}
// if(get === 'web'){
// return <li key={index2}><FilePreview
// path={queryApiActionPath() + f.path}
// pathName={f.name}
// /></li>
// }
return <li key={index2}><a target="_blank" key={f.filePath} href={queryApiActionPath() + f.filePath}>
{f.fileName}
</a></li>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论