提交 aac8e489 authored 作者: 钟是志's avatar 钟是志

一站式 服务 列表 新增 Modal 字段显示bug修改 hidden 的自定义不应该显示高度

操作列的 分栏修改
上级 b13984f1
......@@ -83,3 +83,6 @@
border-radius: 2px;
border-color: #1998f0;
}
.hidden{
margin: 0px;
}
import React, { Fragment } from 'react';
import React, {Fragment} from 'react';
import {
Button,
Card,
......@@ -19,7 +19,7 @@ import {
Popover,
Checkbox,
} from 'antd';
import { connect } from 'dva';
import {connect} from 'dva';
import PageHeaderWrapper from './PageHeaderWrapper';
import styles from './TableList.less';
import StandardTable from './StandardTable';
......@@ -31,17 +31,18 @@ import ExportCurrentInfo from '../../App/ExportCurrentInfo';
import StatisticsInfo from '../../App/StatisticsInfo';
import ImportUtil from '../../App/ImportUtil';
import SearchInfo from '../../App/SearchInfo';
import { Base16Encode } from '../../Base16/index';
import {Base16Encode} from '../../Base16/index';
import { isEmpty } from 'lodash';
import {isEmpty} from 'lodash';
import FilePreview from '@/webPublic/one_stop_public/filePreview';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import {queryApiActionPath} from '@/webPublic/one_stop_public/utils/queryConfig';
import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom';
import ButtonDiy from '../../App/ButtonDiy/ButtonDiy';
import { cloneDeep } from '../../copy/index';
import {cloneDeep} from '../../copy/index';
const FormItem = Form.Item;
let AllWidth = 0; // 表格总长度
const { RangePicker } = DatePicker;
const {RangePicker} = DatePicker;
const text = [
'BINARY',
......@@ -74,7 +75,7 @@ const text = [
'VARCHAR2',
'NVARCHAR2'
];
const number = ['BIGINT', 'DOUBLE', 'FLOAT', 'INT', 'INTEGER', 'NUMERIC', 'SMALLINT', 'TINYINT','NUMBER'];
const number = ['BIGINT', 'DOUBLE', 'FLOAT', 'INT', 'INTEGER', 'NUMERIC', 'SMALLINT', 'TINYINT', 'NUMBER'];
const data = ['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'];
const CreateForm = Form.create()(props => {
......@@ -106,7 +107,8 @@ const CreateForm = Form.create()(props => {
//处理日期何时入库问题
try {
fieldsValue[d] = fieldsValue[d].format('YYYY-MM-DD HH:mm:ss');
} catch (e) {}
} catch (e) {
}
break;
}
}
......@@ -119,7 +121,7 @@ const CreateForm = Form.create()(props => {
}
}
});
let params = { ...fieldsValue };
let params = {...fieldsValue};
handleAdd(params, isAdd);
});
};
......@@ -148,13 +150,13 @@ const CreateForm = Form.create()(props => {
onCancel={() => handleModalVisible()}
>
{formItem.map((item, index) =>
getItem(false, form, item, isAdd, formData, { span: 5 }, { span: 15 }),
getItem(false, form, item, isAdd, formData, {span: 5}, {span: 15}),
)}
</Modal>
);
});
@connect(({ formList, DataColumn, DataObj, loading }) => ({
@connect(({formList, DataColumn, DataObj, loading}) => ({
formList,
DataColumn,
DataObj,
......@@ -207,9 +209,9 @@ class FormList extends React.Component {
if (refIds.length > 0) {
this.props.dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
payload: {ids: refIds},
callback: options => {
this.setState({ options: { ...this.state.options, ...options } });
this.setState({options: {...this.state.options, ...options}});
},
});
}
......@@ -219,8 +221,13 @@ class FormList extends React.Component {
this.getOptions();
this.props.dispatch({
type: 'formList/getDetail',
payload: { dataObjId:this.state.objId,key:this.state.primaryKey ,value:record[this.state.primaryKey] ,isBase:false },
callback:record => {
payload: {
dataObjId: this.state.objId,
key: this.state.primaryKey,
value: record[this.state.primaryKey],
isBase: false
},
callback: record => {
this.setState({
formData: record,
modalVisible: true,
......@@ -230,22 +237,9 @@ class FormList extends React.Component {
},
});
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: {
// id: this.state.objId,
// recordId: record[this.state.primaryKey],
// recordKey: this.state.primaryKey,
// isAdd: false,
// isView:false
// },
// });
// }
};
view = record => {
// if (this.state.formItem.length < 10) {
this.getOptions();
this.setState({
formData: record,
......@@ -253,18 +247,7 @@ class FormList extends React.Component {
isAdd: false,
isView: true,
});
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: {
// id: this.state.objId,
// recordId: record[this.state.primaryKey],
// recordKey: this.state.primaryKey,
// isAdd: false,
// isView:true
// },
// });
// }
};
isJSON = str => {
......@@ -301,7 +284,7 @@ class FormList extends React.Component {
};
viewProcess = record => {
const { dispatch } = this.props;
const {dispatch} = this.props;
dispatch({
type: 'formList/getAppId',
payload: {
......@@ -335,33 +318,34 @@ class FormList extends React.Component {
});
}
};
//渲染值
componentDidMount() {
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
const {dispatch, isFormCom, isSelect, callback, valueName} = this.props;
window.addEventListener('resize', this.resize);
if (this.props.objCode) {
const { dispatch, objCode, sql } = this.props;
const {dispatch, objCode, sql} = this.props;
if (objCode == 1 || objCode == '1') {
this.initColumn();
} else {
dispatch({
type: 'DataObj/findByCode',
payload: { objCode: this.props.objCode },
payload: {objCode: this.props.objCode},
callback: dataObj => {
this.setState({ objId: dataObj.id, isTable: data.isTable }, () => {
this.setState({objId: dataObj.id, isTable: data.isTable}, () => {
dispatch({
type: 'DataRight/getUserRight',
payload: { objId: this.state.objId },
payload: {objId: this.state.objId},
callback: data => {
if (!this.props.rights) {
this.setState({ rights: data });
this.setState({rights: data});
}
dispatch({
type: 'DataRight/getUserColumnRight',
payload: { objId: this.state.objId },
payload: {objId: this.state.objId},
callback: data => {
this.setState({ columnRights: data });
this.setState({columnRights: data});
this.initColumn();
},
});
......@@ -374,23 +358,23 @@ class FormList extends React.Component {
} else {
dispatch({
type: 'formList/getObjDetail',
payload: { id: this.state.objId },
payload: {id: this.state.objId},
callback: data => {
this.setState({ isTable: data.isTable });
this.setState({isTable: data.isTable});
},
});
dispatch({
type: 'DataRight/getUserRight',
payload: { objId: this.state.objId },
payload: {objId: this.state.objId},
callback: data => {
if (!this.props.rights) {
this.setState({ rights: data });
this.setState({rights: data});
}
dispatch({
type: 'DataRight/getUserColumnRight',
payload: { objId: this.state.objId },
payload: {objId: this.state.objId},
callback: data => {
this.setState({ columnRights: data });
this.setState({columnRights: data});
this.initColumn();
},
});
......@@ -398,13 +382,16 @@ class FormList extends React.Component {
});
}
}
/**
* 移除监听器
*/
componentWillUnmount() {
window.removeEventListener('resize', this.resize);
}
custom = this.props.value ? Base16Encode(JSON.stringify(this.props.value)) : null;
componentWillReceiveProps(nextProps) {
const b = nextProps.value || {};
......@@ -433,13 +420,14 @@ class FormList extends React.Component {
const x = nextProps.selects;
const y = this.props.selects;
if (JSON.stringify(x) != JSON.stringify(y)) {
this.setState({ selects: x });
this.setState({selects: x});
}
}
initColumn = () => {
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
const {dispatch, isFormCom, isSelect, callback, valueName} = this.props;
const { rights, columnRights } = this.state;
const {rights, columnRights} = this.state;
if (this.props.value && this.props.value.columns) {
this.columns = this.props.value.columns;
let cacheList = [];
......@@ -466,9 +454,9 @@ class FormList extends React.Component {
} else {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
payload: {dataObjId: this.state.objId},
callback: datas => {
this.state.formItem=datas
this.state.formItem = datas
const querys = [];
const groups = {};
const refIds = [];
......@@ -482,23 +470,23 @@ class FormList extends React.Component {
if (datas[t].isGroupQuery != null) {
dispatch({
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
payload: {columnId: datas[t].id},
callback: gourp => {
groups[datas[t].id] = gourp;
this.setState({ groups });
this.setState({groups});
},
});
}
}
}
if (querys.length > 0) {
this.setState({ querys });
this.setState({querys});
if (refIds.length > 0) {
dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
payload: {ids: refIds},
callback: options => {
this.setState({ options });
this.setState({options});
},
});
}
......@@ -514,7 +502,7 @@ class FormList extends React.Component {
} else {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
payload: {dataObjId: this.state.objId},
callback: datas => {
const querys = [];
const refIds = [];
......@@ -576,7 +564,7 @@ class FormList extends React.Component {
{files.map((f, index2) => {
return (
<li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} />
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name}/>
</li>
);
})}
......@@ -590,7 +578,7 @@ class FormList extends React.Component {
} else {
column.render = val =>
val && val.length > 100 ? (
<Tooltip title={val} overlayStyle={{ width: 1000 }}>
<Tooltip title={val} overlayStyle={{width: 1000}}>
<span
style={{
width: column.width || 200,
......@@ -609,7 +597,7 @@ class FormList extends React.Component {
);
}
this.setState({ tableWidth: (datas.length - 1) * 200 });
this.setState({tableWidth: (datas.length - 1) * 200});
this.columns.push(column);
this.setState({
cacheColumns: cloneDeep(this.columns),
......@@ -622,10 +610,10 @@ class FormList extends React.Component {
if (datas[t].isGroupQuery != null) {
dispatch({
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
payload: {columnId: datas[t].id},
callback: gourp => {
groups[datas[t].id] = gourp;
this.setState({ groups });
this.setState({groups});
},
});
}
......@@ -633,13 +621,13 @@ class FormList extends React.Component {
i++;
}
if (querys.length > 0) {
this.setState({ querys });
this.setState({querys});
if (refIds.length > 0) {
dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
payload: {ids: refIds},
callback: options => {
this.setState({ options });
this.setState({options});
},
});
}
......@@ -657,7 +645,7 @@ class FormList extends React.Component {
if (this.columns == null || this.columns.length == 0) {
return;
}
const { dispatch } = this.props;
const {dispatch} = this.props;
const pagination = this.state.data.pagination;
if (params == null) {
......@@ -668,25 +656,25 @@ class FormList extends React.Component {
query: JSON.stringify(values != null ? values : this.state.formValues),
};
}else{
if(params.pageNo==null&&callPage==null&&this.props.value.getPage==null) return;
} else {
if (params.pageNo == null && callPage == null && this.props.value.getPage == null) return;
}
if (this.props.objCode && (this.props.objCode == '1' || this.props.objCode == 1)) {
if (callPage) {
callPage(params, data => {
if (!this.state.isReady) {
this.setState({ data, isReady: true });
this.setState({data, isReady: true});
} else {
this.setState({ data });
this.setState({data});
}
});
} else if (this.props.value && this.props.value.getPage) {
this.props.value.getPage(params, data => {
if (!this.state.isReady) {
this.setState({ data, isReady: true });
this.setState({data, isReady: true});
} else {
this.setState({ data });
this.setState({data});
}
});
}
......@@ -702,9 +690,9 @@ class FormList extends React.Component {
},
callback: data => {
if (!this.state.isReady) {
this.setState({ data, isReady: true });
this.setState({data, isReady: true});
} else {
this.setState({ data });
this.setState({data});
}
},
});
......@@ -713,7 +701,7 @@ class FormList extends React.Component {
handleStandardTableChange = (pagination, filtersArg, sorter) => {
const filters = Object.keys(filtersArg).reduce((obj, key) => {
const newObj = { ...obj };
const newObj = {...obj};
newObj[key] = getValue(filtersArg[key]);
return newObj;
}, {});
......@@ -788,8 +776,8 @@ class FormList extends React.Component {
};
batchDelete = e => {
const { dispatch } = this.props;
const { selectedRows } = this.state;
const {dispatch} = this.props;
const {selectedRows} = this.state;
if (!selectedRows) return;
......@@ -824,9 +812,9 @@ class FormList extends React.Component {
handleSearch = e => {
e.preventDefault();
const { dispatch, form } = this.props;
const {dispatch, form} = this.props;
const { formValues } = this.state;
const {formValues} = this.state;
form.validateFields((err, fieldsValue) => {
if (err) return;
......@@ -871,11 +859,11 @@ class FormList extends React.Component {
pageSize: pagination.pageSize ? pagination.pageSize : this.props.pageSize || 10,
...e,
};
this.setState({ formValues: { ...e, ...this.state.formValues } });
this.setState({formValues: {...e, ...this.state.formValues}});
this.getPage(params);
};
handleFormReset = () => {
const { form, dispatch } = this.props;
const {form, dispatch} = this.props;
form.resetFields();
this.setState(
{
......@@ -887,15 +875,15 @@ class FormList extends React.Component {
);
};
getItem = (isQuery, form, item, isAdd, formData, labelCol, wrapperCol) => {
const { groups, isView } = this.state;
const {groups, isView} = this.state;
// console.log(item);
//如果隐藏的话 就用隐藏域放置
if (item.isHidden) {
return (
<FormItem>
<FormItem className={styles.hidden}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
})(<Input type="hidden" placeholder="请输入" />)}
})(<Input type="hidden" placeholder="请输入"/>)}
</FormItem>
);
}
......@@ -908,23 +896,23 @@ class FormList extends React.Component {
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input style={{ width: '70%' }} readOnly={!isAdd} placeholder="请输入" />)}
rules: [{required: !item.isNull}],
})(<Input style={{width: '70%'}} readOnly={!isAdd} placeholder="请输入"/>)}
</FormItem>
);
}
} else if (item.referenceObjId != null) {
const { options } = this.state;
const {options} = this.state;
const ops = options[item.id + ''] || [];
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
rules: [{required: !item.isNull}],
})(
<Select
disabled={isView}
style={{ width: '70%' }}
style={{width: '70%'}}
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
......@@ -949,9 +937,9 @@ class FormList extends React.Component {
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
rules: [{required: !item.isNull}],
})(
<Select disabled={isView} style={{ width: '70%' }} placeholder="请选择" allowClear>
<Select disabled={isView} style={{width: '70%'}} placeholder="请选择" allowClear>
<Option value={'0'} key={'0'}>
审核通过
</Option>
......@@ -974,8 +962,8 @@ class FormList extends React.Component {
: formData[item.name] && this.isJSON(formData[item.name])
? JSON.parse(formData[item.name])
: null,
rules: [{ required: !item.isNull }],
})(<UploadCom disabled={isView} />)}
rules: [{required: !item.isNull}],
})(<UploadCom disabled={isView}/>)}
</FormItem>
);
} else if (isQuery && item.isGroupQuery != null && item.isGroupQuery) {
......@@ -986,11 +974,11 @@ class FormList extends React.Component {
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
rules: [{required: !item.isNull}],
})(
<Select
disabled={isView}
style={{ width: 200 }}
style={{width: 200}}
placeholder="请选择"
optionFilterProp="children"
showSearch
......@@ -1015,8 +1003,8 @@ class FormList extends React.Component {
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input disabled={isView} style={{ width: '70%' }} placeholder="请输入" />)}
rules: [{required: !item.isNull}],
})(<Input disabled={isView} style={{width: '70%'}} placeholder="请输入"/>)}
</FormItem>
);
} else if (number.indexOf(item.type) > -1) {
......@@ -1025,7 +1013,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [
{ required: !item.isNull },
{required: !item.isNull},
(rule, value, callback) => {
var errors = [];
var reg = new RegExp(/(^-?[0-9][0-9]*(.[0-9]+)?)$/);
......@@ -1035,7 +1023,7 @@ class FormList extends React.Component {
callback(errors);
},
],
})(<Input disabled={isView} placeholder="请输入" />)}
})(<Input disabled={isView} placeholder="请输入"/>)}
</FormItem>
);
} else if (isQuery && data.indexOf(item.type) > -1) {
......@@ -1043,12 +1031,12 @@ class FormList extends React.Component {
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? null : moment(formData[item.name]),
rules: [{ required: !item.isNull }],
rules: [{required: !item.isNull}],
})(
<RangePicker
disabled={isView}
format={item.dataFormatStrWeb == null ? 'YYYY-MM-DD HH:mm:ss' : item.dataFormatStrWeb}
style={{ width: '95%' }}
style={{width: '95%'}}
/>,
)}
</FormItem>
......@@ -1063,11 +1051,11 @@ class FormList extends React.Component {
: formData[item.name]
? moment(formData[item.name])
: null,
rules: [{ required: !item.isNull }],
rules: [{required: !item.isNull}],
})(
<DatePicker
format={item.dataFormatStrWeb == null ? 'YYYY-MM-DD HH:mm:ss' : item.dataFormatStrWeb}
style={{ width: '100%' }}
style={{width: '100%'}}
placeholder="请输入"
disabled={isView}
/>,
......@@ -1079,26 +1067,26 @@ class FormList extends React.Component {
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input disabled={isView} style={{ width: '70%' }} placeholder="请输入" />)}
rules: [{required: !item.isNull}],
})(<Input disabled={isView} style={{width: '70%'}} placeholder="请输入"/>)}
</FormItem>
);
}
};
renderForm() {
const { form, get } = this.props;
const {form, get} = this.props;
const { querys } = this.state;
const {querys} = this.state;
if (querys.length == 0) {
return '';
}
return (
<Form layout="inline">
<Row style={{ padding: '15px' }}>
<Row style={{padding: '15px'}}>
{querys.map(item => (
<Col style={{ height: 58 }} span={get === 'mobile' ? 24 : 8} key={item.id}>
<Col style={{height: 58}} span={get === 'mobile' ? 24 : 8} key={item.id}>
{this.getItem(
true,
form,
......@@ -1122,7 +1110,7 @@ class FormList extends React.Component {
<Button type="primary" loading={this.props.loading} onClick={this.handleSearch}>
查询
</Button>
<Button style={{ marginLeft: 8 }} onClick={this.handleFormReset}>
<Button style={{marginLeft: 8}} onClick={this.handleFormReset}>
重置
</Button>
{/* <a style={{ marginLeft: 8 }} onClick={this.toggleForm}>
......@@ -1134,6 +1122,7 @@ class FormList extends React.Component {
</Form>
);
}
/**
* @description: 表头筛选复选框 根据用户筛选将表头内容重置
* @param { Array<string> } 用户选择参数
......@@ -1145,7 +1134,7 @@ class FormList extends React.Component {
message.error('至少选择一项');
return;
}
const { cacheColumns } = this.state;
const {cacheColumns} = this.state;
let initList = [];
checkedValues.map(item => {
let ary = cacheColumns.filter(data => data.dataIndex === item);
......@@ -1158,12 +1147,13 @@ class FormList extends React.Component {
checkedList: checkedValues,
});
};
render() {
const { modalVisible, selectedRows, querys, tableWidth, rights, data, isReady } = this.state;
const {modalVisible, selectedRows, querys, tableWidth, rights, data, isReady} = this.state;
if (!isReady) {
return (
<div style={{ width: 20, margin: 'auto' }}>
<Spin />
<div style={{width: 20, margin: 'auto'}}>
<Spin/>
</div>
);
}
......@@ -1176,11 +1166,11 @@ class FormList extends React.Component {
notShowBack,
json,
istableCom, // 是否有模板设计器调用
value: { btns },
value: {btns},
loading,
} = this.props;
const { showMobileDiv, isView } = this.state;
const {showMobileDiv, isView} = this.state;
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let isMobile = scrollWidth < 1000;
......@@ -1188,7 +1178,7 @@ class FormList extends React.Component {
isMobile = true;
}
let showDiv =json.twidth?json.twidth:(
let showDiv = json.twidth ? json.twidth : (
document.querySelector('#mobelDiv') &&
document.querySelector('#mobelDiv')?.parentNode.clientWidth);
const parentMethods = {
......@@ -1227,63 +1217,43 @@ class FormList extends React.Component {
fixed: 'right',
width: width,
render: (text, record) => {
return (
<Fragment>
<div style={{ textAlign: 'center', paddingLeft: '0px', paddingRight: '0px' }}>
{isSelect ? (
this.state.selects.includes(record[valueName]) ? (
<>
<span>已选择</span>
<Divider type="vertical" />
</>
) : (
<>
<a onClick={callback.bind(this, record, this.columns)}>选择</a>
<Divider type="vertical" />
</>
)
) : (
''
)}
{rights && !rights.includes('view') ? (
''
) : (
<div>
let Dom = [];
if (isSelect) {
if (this.state.selects.includes(record[valueName])) {
Dom.push(<span>已选择</span>);
} else {
Dom.push(<a onClick={callback.bind(this, record, this.columns)}>选择</a>);
}
}
if (rights) {
if (rights.includes('view')) {
Dom.push(
<a onClick={this.view.bind(this, record)}>查看详情</a>
<Divider type="vertical" />
</div>
)}
{rights && !rights.includes('edit') ? (
''
) : (
<>
<a onClick={this.modify.bind(this, record)}>编辑</a>
<Divider type="vertical" />
</>
)}
{rights && rights.includes('viewProcess') && record.process_biz_key ? (
<>
<a onClick={this.viewProcess.bind(this, record)}>流程详情</a>
{rights.includes('delete') ? <Divider type="vertical" /> : ''}
</>
) : (
''
)}
{rights && !rights.includes('delete') ? (
''
) : (
<>
{' '}
<Popconfirm
);
}
if (rights.includes('edit')) {
Dom.push(<a onClick={this.modify.bind(this, record)}>编辑</a>);
}
if (rights.includes('viewProcess') && record.process_biz_key) {
Dom.push(<a onClick={this.viewProcess.bind(this, record)}>流程详情</a>);
}
if (rights.includes('delete')) {
Dom.push(<Popconfirm
title="确定删除该数据?"
onConfirm={this.delete.bind(this, record)}
okText="确定"
cancelText="取消"
>
<a>删除</a>
</Popconfirm>
</>
)}
</Popconfirm>)
}
}
return (
<Fragment>
<div style={{textAlign: 'center', paddingLeft: '0px', paddingRight: '0px'}}>
{Dom && Dom.length && Dom.map((x, index) => <Fragment key={Math.random()}>{x}
{index > 0 && index !== Dom.length - 1 && <Divider type="vertical"/>}
</Fragment>)}
</div>
</Fragment>
);
......@@ -1332,7 +1302,7 @@ class FormList extends React.Component {
}
const xxxx = (
<>
<Card bordered={false} bodyStyle={{ padding: 0,width:json.twidth?json.twidth:"100%" }}>
<Card bordered={false} bodyStyle={{padding: 0, width: json.twidth ? json.twidth : "100%"}}>
<div className={styles.tableList}>
<div className={styles.tableListForm}>{this.renderForm()}</div>
<div className={styles.tableListOperator}>
......@@ -1344,7 +1314,7 @@ class FormList extends React.Component {
</Button>
)}
{btns && btns.before && btns.before.length > 0
? btns.before.map(r => <Button {...r} loading={loading} />)
? btns.before.map(r => <Button {...r} loading={loading}/>)
: ''}
{rights && !rights.includes('add') ? (
''
......@@ -1356,13 +1326,13 @@ class FormList extends React.Component {
{rights && !rights.includes('searchData') ? (
''
) : (
<SearchInfo hanldeHighSearch={this.hanldeHighSearch} objId={this.state.objId} />
<SearchInfo hanldeHighSearch={this.hanldeHighSearch} objId={this.state.objId}/>
)}
{rights && !rights.includes('importData') ? (
''
) : (
<ImportUtil objId={this.state.objId} callback={()=>this.getPage()} />
<ImportUtil objId={this.state.objId} callback={() => this.getPage()}/>
)}
{rights && !rights.includes('exportCurrent') ? (
''
......@@ -1377,12 +1347,12 @@ class FormList extends React.Component {
{rights && !rights.includes('exportData') ? (
''
) : (
<ExportInfo objId={this.state.objId} />
<ExportInfo objId={this.state.objId}/>
)}
{rights && !rights.includes('statistics') ? (
''
) : (
<StatisticsInfo objId={this.state.objId} />
<StatisticsInfo objId={this.state.objId}/>
)}
{rights && !rights.includes('delete')
? ''
......@@ -1428,7 +1398,7 @@ class FormList extends React.Component {
</Popover>
)}
{btns && btns.after && btns.after.length > 0
? btns.after.map(r => <Button {...r} loading={loading} />)
? btns.after.map(r => <Button {...r} loading={loading}/>)
: ''}
</div>
{!istableCom || (this.props.value && this.props.value.columns) ? (
......@@ -1447,11 +1417,11 @@ class FormList extends React.Component {
this.props.onSelectRow == null &&
(rights == null || !rights.includes('delete'))
}
rowKey={this.props.value?.rowKey?this.props.value.rowKey:"row_id"}
rowKey={this.props.value?.rowKey ? this.props.value.rowKey : "row_id"}
data={data}
isHiddenPage={this.props.isHiddenPage != null ? this.props.isHiddenPage : false}
columns={this.columns}
scroll={{ x: AllWidth }}
scroll={{x: AllWidth}}
selectedRows={selectedRows}
onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange}
......@@ -1477,10 +1447,10 @@ class FormList extends React.Component {
this.props.onSelectRow == null &&
(rights == null || !rights.includes('delete'))
}
rowKey={this.props.value?.rowKey?this.props.value.rowKey:"row_id"}
rowKey={this.props.value?.rowKey ? this.props.value.rowKey : "row_id"}
data={data}
columns={this.columns}
scroll={this.props.value && this.props.value.columns ? {} : { x: AllWidth }}
scroll={this.props.value && this.props.value.columns ? {} : {x: AllWidth}}
selectedRows={selectedRows}
isHiddenPage={
this.props.isHiddenPage != null ? this.props.isHiddenPage : false
......@@ -1495,7 +1465,7 @@ class FormList extends React.Component {
)}
</div>
</Card>
<CreateForm {...parentMethods} modalVisible={modalVisible} />
<CreateForm {...parentMethods} modalVisible={modalVisible}/>
</>
);
if (isFormCom) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论