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

注释

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