提交 2da21f70 authored 作者: 刘浪's avatar 刘浪

导入按钮公共组件结果增加字段数据行数

上级 a1d0245e
...@@ -15,7 +15,7 @@ const message = getMessage(); ...@@ -15,7 +15,7 @@ const message = getMessage();
const Step = Steps.Step; const Step = Steps.Step;
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
// const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel; // const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel;
let tempCallback = () => {}; let tempCallback = () => { };
@connect(({ DataObj, loading }) => ({ @connect(({ DataObj, loading }) => ({
DataObj, DataObj,
...@@ -246,7 +246,7 @@ export default class ImportUtil extends React.PureComponent { ...@@ -246,7 +246,7 @@ export default class ImportUtil extends React.PureComponent {
// }, // },
}) })
.then((res) => { .then((res) => {
console.log(res.status); console.log(res.status);
if (res.status != 200 && res.status !== 202) { if (res.status != 200 && res.status !== 202) {
return res.json(); return res.json();
} else { } else {
...@@ -269,7 +269,7 @@ export default class ImportUtil extends React.PureComponent { ...@@ -269,7 +269,7 @@ export default class ImportUtil extends React.PureComponent {
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
message.error(`网络请求超时`); message.error(`网络请求超时`);
}) })
.finally(() => { .finally(() => {
...@@ -321,17 +321,26 @@ export default class ImportUtil extends React.PureComponent { ...@@ -321,17 +321,26 @@ export default class ImportUtil extends React.PureComponent {
const { name } = this.props; const { name } = this.props;
const column1 = this.state.column const column1 = this.state.column
? [ ? [
{ {
title: '序号', title: '序号',
dataIndex: 'index', dataIndex: 'index',
fixed: 'left', fixed: 'left',
width: 50, width: 50,
render: (v, r, i) => i + 1, render: (v, r, i) => i + 1,
}, },
...this.state.column, {
] title: '数据行数',
dataIndex: 'row_index',
width: 50,
},
...this.state.column,
]
: []; : [];
let column2 = this.state.column ? [...this.state.column] : []; let column2 = this.state.column ? [{
title: '数据行数',
dataIndex: 'row_index',
width: 50,
}, ...this.state.column] : [];
if (column1.length > 1) { if (column1.length > 1) {
column1[1].render = (val) => <span style={{ color: 'red' }}>{val}</span>; column1[1].render = (val) => <span style={{ color: 'red' }}>{val}</span>;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论