diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js index f42c7ef2..82ed0adb 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -16,39 +16,42 @@ class ImpStep3 extends Component { const { importResult } = this.props; return (
- - { - !_.isEmpty(importResult) ? -
-

+ importResult.results ? : + { - importResult.successCount && -

- {getLabel(389249, "已导入")} - {importResult.successCount}   - {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} - {importResult.errorCount}  {getLabel(30690, "条数据")} -

+ !_.isEmpty(importResult) ? +
+

+ { + importResult.successCount && +

+ {getLabel(389249, "已导入")} + {importResult.successCount}   + {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} + {importResult.errorCount}  {getLabel(30690, "条数据")} +

+ } +
: +
+

{getLabel(111, "导入失败")}

+
} -
: -
-

{getLabel(111, "导入失败")}

-
- } - { - !_.isEmpty(importResult) && (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) && - } - ]} - dataSource={importResult.errorData || importResult.errorNotice} pagination={false} - scroll={{ y: `calc(100vh - 387px)` }} - /> + }
); diff --git a/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js b/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js index db1d3fef..ab3bc675 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js @@ -8,16 +8,45 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; const getLabel = WeaLocaleProvider.getLabel; class MoveInResult extends Component { - render() { - return ( -
+ downloadTxtfile = (value, type) => { + if (!value) return; + const element = document.createElement("a"); + const file = new Blob([value], { type: "text/plain" }); + element.href = URL.createObjectURL(file); + element.download = `导入${type}信息.txt`; + document.body.appendChild(element); + element.click(); + }; -
+ render() { + const { dataSource } = this.props; + return ( + ( + this.downloadTxtfile(record.success.join("\n"), getLabel(111, "成功"))}> + {record.success.length} + this.downloadTxtfile(record.warning.join("\n"), getLabel(111, "警告"))}>{record.warning.length} + this.downloadTxtfile(record.error.join("\n"), getLabel(111, "错误"))}>{record.error.length} + ) + } + ]} + dataSource={dataSource} pagination={false} bordered scroll={{ y: `calc(100vh - 333px)` }} + /> ); } }