|
|
@@ -5,11 +5,13 @@
|
|
|
* @date 2019/6/5
|
|
|
* @version
|
|
|
*/
|
|
|
-//导出接口相关
|
|
|
+
|
|
|
+// 导出接口相关
|
|
|
const EXPORT_VIEW = (() => {
|
|
|
'use strict';
|
|
|
|
|
|
const _base = INTERFACE_EXPORT_BASE;
|
|
|
+ const _util = _base.UTIL;
|
|
|
const _cache = _base.CACHE;
|
|
|
// 导出数据缓存,为了自检完后,再导出的时候不需要重新运行相关提取程序。(暂时取消了自检,但还是留着这个缓存机制)
|
|
|
let _exportCache = [];
|
|
|
@@ -23,6 +25,12 @@ const EXPORT_VIEW = (() => {
|
|
|
_exportCache = [];
|
|
|
_cache.clear();
|
|
|
}
|
|
|
+ // 设置提示高度样式
|
|
|
+ function setHeightByInfo(infos) {
|
|
|
+ if (infos.length > 20) {
|
|
|
+ $('#hintBox_caption').addClass('export-check');
|
|
|
+ }
|
|
|
+ }
|
|
|
//事件监听
|
|
|
function exportListener() {
|
|
|
// 导出接口
|
|
|
@@ -52,6 +60,12 @@ const EXPORT_VIEW = (() => {
|
|
|
const requestForSummaryInfo = INTERFACE_EXPORT.requestForSummaryInfo || null;
|
|
|
const projectID = projectObj.project.ID();
|
|
|
const exportData = await _base.extractExportData(INTERFACE_EXPORT.entry, requestForSummaryInfo, boqType, areaKey, projectID, userID);
|
|
|
+ const failList = _util.transformFailList(_cache.getItem('failList'));
|
|
|
+ if (failList.length) {
|
|
|
+ // 自检提示错误,打断导出
|
|
|
+ setHeightByInfo(failList);
|
|
|
+ throw failList.join('<br/>');
|
|
|
+ }
|
|
|
_exportCache.push(...exportData);
|
|
|
}
|
|
|
}
|
|
|
@@ -64,6 +78,7 @@ const EXPORT_VIEW = (() => {
|
|
|
console.log(err);
|
|
|
alert(err);
|
|
|
} finally {
|
|
|
+ _cache.setItem('failList', []);
|
|
|
pr.end();
|
|
|
setTimeout(() => {
|
|
|
STATE.exporting = false;
|