提交 8cc8187f authored 作者: 徐立's avatar 徐立
...@@ -15,10 +15,10 @@ export default class userButton extends Component { ...@@ -15,10 +15,10 @@ export default class userButton extends Component {
super() super()
this.state = { this.state = {
// 路由位置 // 路由位置
visibleOk: false, // 通过模态框状态 visibleOk: false, // 通过模态框状态
value:'', // 文本域输入 value:'', // 文本域输入
user: '', // 用于保存用户点击了对应按钮 user: '', // 用于保存用户点击了对应按钮
returnText: '', returnText: '',
key: '',// 后端返回按钮规格 key: '',// 后端返回按钮规格
btnValue: '',// 后端返回按钮状态 btnValue: '',// 后端返回按钮状态
} }
...@@ -119,7 +119,7 @@ export default class userButton extends Component { ...@@ -119,7 +119,7 @@ export default class userButton extends Component {
}; };
render() { render() {
let { btnList,visibleOk,value,user,returnText } = this.state let { btnList,visibleOk,value,user,returnText } = this.state
let { let {
affairOk, affairOk,
btns, btns,
isSecond, isSecond,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* web端文件预览功能 * web端文件预览功能
*/ */
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal,Icon,Tooltip,Popconfirm } from 'antd'; import { Modal,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){
...@@ -16,13 +16,13 @@ export default class index extends Component { ...@@ -16,13 +16,13 @@ export default class index extends Component {
visible: true, visible: true,
}); });
}; };
handleOk = e => { handleOk = e => {
this.setState({ this.setState({
visible: false, visible: false,
}); });
}; };
handleCancel = e => { handleCancel = e => {
this.setState({ this.setState({
visible: false, visible: false,
...@@ -88,19 +88,19 @@ export default class index extends Component { ...@@ -88,19 +88,19 @@ export default class index extends Component {
okText="下载" okText="下载"
cancelText="预览" cancelText="预览"
> >
<a <a
target="_blank" target="_blank"
href={path}> href={path}>
{pathName} {pathName}
</a> </a>
</Popconfirm> </Popconfirm>
: <a : <a
target="_blank" target="_blank"
href={path}> href={path}>
{pathName} {pathName}
</a> </a>
} }
<Modal <Modal
title={pathName} title={pathName}
visible={visible} visible={visible}
...@@ -123,7 +123,7 @@ export default class index extends Component { ...@@ -123,7 +123,7 @@ 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}
...@@ -132,7 +132,7 @@ export default class index extends Component { ...@@ -132,7 +132,7 @@ export default class index extends Component {
/> />
</div> </div>
} }
</Modal> </Modal>
</> </>
) )
......
...@@ -40,7 +40,8 @@ export default class TableList extends React.Component { ...@@ -40,7 +40,8 @@ export default class TableList extends React.Component {
} }
render() { render() {
return <FormList return <FormList
onSelectRow={this.props.value.onSelectRow}
istableCom={true} istableCom={true}
showHeader={this.props.showHeader} showHeader={this.props.showHeader}
get={this.props.get} get={this.props.get}
......
...@@ -626,6 +626,9 @@ class FormList extends React.Component { ...@@ -626,6 +626,9 @@ class FormList extends React.Component {
}; };
handleSelectRows = rows => { handleSelectRows = rows => {
if(this.props.onSelectRow){
this.props.onSelectRow(rows)
}
this.setState({ this.setState({
selectedRows: rows, selectedRows: rows,
}); });
...@@ -1063,7 +1066,7 @@ class FormList extends React.Component { ...@@ -1063,7 +1066,7 @@ class FormList extends React.Component {
(!istableCom)||(this.props.value&&this.props.value.columns)? (!istableCom)||(this.props.value&&this.props.value.columns)?
<StandardTable <StandardTable
showHeader={this.props.showHeader!=null?this.props.showHeader:true} showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={rights==null|| !rights.includes('delete') } noSelectRow={this.props.onSelectRow==null&&( rights==null|| !rights.includes('delete')) }
rowKey="id" rowKey="id"
data={data} data={data}
isHiddenPage={this.props.isHiddenPage!=null?this.props.isHiddenPage:false} isHiddenPage={this.props.isHiddenPage!=null?this.props.isHiddenPage:false}
...@@ -1093,7 +1096,7 @@ class FormList extends React.Component { ...@@ -1093,7 +1096,7 @@ class FormList extends React.Component {
{ {
showDiv&&<StandardTable showDiv&&<StandardTable
showHeader={this.props.showHeader!=null?this.props.showHeader:true} showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={rights==null|| !rights.includes('delete') } noSelectRow={this.props.onSelectRow==null&&( rights==null|| !rights.includes('delete')) }
rowKey="id" rowKey="id"
data={data} data={data}
columns={this.columns} columns={this.columns}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论