提交 4c93271c authored 作者: 徐立's avatar 徐立
......@@ -208,6 +208,7 @@ export default class List extends Component {
const { formValues, selectRows, list, pagination, loading } = this.state;
const { listConfig, pageSearch, pageButton ,children, addFields} = this.props;
const { columns, search } = pageSearch;
const columnsLength = columns.length;
for(let item of columns){
if(typeof item.renderConfig !== 'undefined' && !item.render){
item.render = (text,record)=>{
......@@ -254,6 +255,9 @@ export default class List extends Component {
}
}
}
if(columnsLength > 10 && item.title && !item.width){
item.width = item.title.length * 30;
}
}
let data = list;
......@@ -271,7 +275,6 @@ export default class List extends Component {
}
}
}
const tableProps = {
rowKey: pageSearch.tableRowKey || 'id',
selectedRows: selectRows,
......
......@@ -259,6 +259,8 @@ export default class List extends Component {
const { formValues, selectRows, list, pagination, loading } = this.state;
const { listConfig, pageSearch, pageButton ,children, addFields} = this.props;
const { columns, search } = pageSearch;
const columnsLength = columns.length;
for(let item of columns){
if(typeof item.renderConfig !== 'undefined' && !item.render){
item.render = (text,record)=>{
......@@ -306,6 +308,10 @@ export default class List extends Component {
}
}
}
if(columnsLength > 10 && item.title && !item.width){
item.width = item.title.length * 30;
}
}
let data = list;
......
......@@ -104,14 +104,23 @@ const CreateForm = Form.create()(props => {
handleAdd(params, isAdd);
});
};
console.log("isView",isView)
//需要获取动态表单
return (
<Modal
width="700px"
maskClosable={false}
destroyOnClose
title={isAdd ? '新增' : '编辑'}
title={isView?"查看详情":(isAdd ? '新增' : '编辑')}
visible={modalVisible}
footer={isView?null:[
<Button key="back" onClick={() => handleModalVisible()}>
取消
</Button>,
<Button key="submit" type="primary" onClick={okHandle}>
确定
</Button>
]}
onOk={okHandle}
onCancel={() => handleModalVisible()}
>
......@@ -872,6 +881,7 @@ class FormList extends React.Component {
} = this.props;
const {
showMobileDiv,
isView
} = this.state
......@@ -889,7 +899,7 @@ class FormList extends React.Component {
formItem: this.state.formItem,
isAdd: this.state.isAdd,
getItem: this.getItem,
isView:isView,
};
......@@ -907,8 +917,6 @@ class FormList extends React.Component {
}
if(this.columns.length>0&&this.columns[this.columns.length-1].title=="操作"){
this.columns[this.columns.length-1]=column;
}else{
this.columns.push(column);
}
}else{
const column = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论