|
@@ -36,14 +36,14 @@
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label class="form-label">2.请下载导入模板</label>
|
|
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- class="btn btn-primary btn-primary-1 btn-primary-block"
|
|
|
|
|
|
|
+ <label class="form-label">2.请下载导入模板</label><br />
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ style="padding: 0"
|
|
|
|
|
+ type="link"
|
|
|
@click="downloadTemplateButton"
|
|
@click="downloadTemplateButton"
|
|
|
>
|
|
>
|
|
|
{{ $t("lang.DataImportPanel.downloadTemplate") }}
|
|
{{ $t("lang.DataImportPanel.downloadTemplate") }}
|
|
|
- </button>
|
|
|
|
|
|
|
+ </a-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -53,7 +53,7 @@
|
|
|
<div>
|
|
<div>
|
|
|
<div>
|
|
<div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label>1.请选择Excel数据</label>
|
|
|
|
|
|
|
+ <label>3.请选择Excel数据</label>
|
|
|
<input
|
|
<input
|
|
|
id="file"
|
|
id="file"
|
|
|
ref="uploadFileInput"
|
|
ref="uploadFileInput"
|
|
@@ -65,7 +65,7 @@
|
|
|
<span>{{ uploadFilePath }}</span>
|
|
<span>{{ uploadFilePath }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <label>2.请选择需要导入的sheet</label>
|
|
|
|
|
|
|
+ <label>4.请选择需要导入的sheet</label>
|
|
|
<select
|
|
<select
|
|
|
v-model="selectedIndex"
|
|
v-model="selectedIndex"
|
|
|
class="form-control sheet-select"
|
|
class="form-control sheet-select"
|
|
@@ -109,22 +109,23 @@
|
|
|
class="btn btn-primary btn-primary-1"
|
|
class="btn btn-primary btn-primary-1"
|
|
|
@click="testImportButton(true)"
|
|
@click="testImportButton(true)"
|
|
|
>
|
|
>
|
|
|
- 1.{{ $t("lang.DataImportPanel.testImport") }}
|
|
|
|
|
|
|
+ {{ $t("lang.DataImportPanel.testImport") }}
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
|
|
+ v-if="testSuccess"
|
|
|
type="button"
|
|
type="button"
|
|
|
class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
|
@click="runProcessImport(selectedDataTemplateNo)"
|
|
@click="runProcessImport(selectedDataTemplateNo)"
|
|
|
>
|
|
>
|
|
|
- 2.{{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
|
|
|
|
+ {{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
</button>
|
|
</button>
|
|
|
- <button
|
|
|
|
|
|
|
+ <!-- <button
|
|
|
type="button"
|
|
type="button"
|
|
|
class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
|
@click="runProcessClear(selectedDataTemplateNo, false)"
|
|
@click="runProcessClear(selectedDataTemplateNo, false)"
|
|
|
>
|
|
>
|
|
|
3.{{ $t("lang.DataImportPanel.emptyImport") }}
|
|
3.{{ $t("lang.DataImportPanel.emptyImport") }}
|
|
|
- </button>
|
|
|
|
|
|
|
+ </button> -->
|
|
|
<button
|
|
<button
|
|
|
v-if="taskId != null && taskId.length > 0"
|
|
v-if="taskId != null && taskId.length > 0"
|
|
|
type="button"
|
|
type="button"
|
|
@@ -149,11 +150,12 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<a-table
|
|
<a-table
|
|
|
|
|
+ v-if="current === 2"
|
|
|
bordered
|
|
bordered
|
|
|
|
|
+ sticky
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:data-source="dataSource"
|
|
:data-source="dataSource"
|
|
|
- :scroll="{ y: 900 }"
|
|
|
|
|
- size="small"
|
|
|
|
|
|
|
+ :scroll="{ x: 2200 }"
|
|
|
>
|
|
>
|
|
|
<a-table-column type="index" />
|
|
<a-table-column type="index" />
|
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
@@ -162,7 +164,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
-
|
|
|
|
|
<Loading v-if="loading" />
|
|
<Loading v-if="loading" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -242,6 +243,7 @@ export default {
|
|
|
dataSource: [], // 表格数据源
|
|
dataSource: [], // 表格数据源
|
|
|
lineCount: null, // 导入行数
|
|
lineCount: null, // 导入行数
|
|
|
columnCount: null, // 导入列数
|
|
columnCount: null, // 导入列数
|
|
|
|
|
+ testSuccess: false, // 测试导入是否成功
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -272,6 +274,7 @@ export default {
|
|
|
this.current++;
|
|
this.current++;
|
|
|
}
|
|
}
|
|
|
if (this.current == 2) {
|
|
if (this.current == 2) {
|
|
|
|
|
+ this.testSuccess = false;
|
|
|
this.runProcessClear(this.selectedDataTemplateNo, true);
|
|
this.runProcessClear(this.selectedDataTemplateNo, true);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -542,11 +545,11 @@ export default {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
var sheetIndex = _self.selectedIndex;
|
|
var sheetIndex = _self.selectedIndex;
|
|
|
|
|
|
|
|
- if(_self.lineCount <= 0){
|
|
|
|
|
|
|
+ if (_self.lineCount <= 0) {
|
|
|
message.warning('请输入正确的导入行数!');
|
|
message.warning('请输入正确的导入行数!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(_self.columnCount <= 0){
|
|
|
|
|
|
|
+ if (_self.columnCount <= 0) {
|
|
|
message.warning('请输入正确的导入列数!');
|
|
message.warning('请输入正确的导入列数!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -594,7 +597,9 @@ export default {
|
|
|
const columnCount = _self.columnCount;
|
|
const columnCount = _self.columnCount;
|
|
|
_self.loading = true;
|
|
_self.loading = true;
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
- url: Common.getApiURL(`dataImportResource/saveImportModelData?lineCount=${lineCount}&columnCount=${columnCount}`),
|
|
|
|
|
|
|
+ url: Common.getApiURL(
|
|
|
|
|
+ `dataImportResource/saveImportModelData?lineCount=${lineCount}&columnCount=${columnCount}`,
|
|
|
|
|
+ ),
|
|
|
type: 'post',
|
|
type: 'post',
|
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
|
contentType: 'application/json',
|
|
contentType: 'application/json',
|
|
@@ -686,8 +691,15 @@ export default {
|
|
|
|
|
|
|
|
data.forEach(function (item) {
|
|
data.forEach(function (item) {
|
|
|
_self.dataSource.push(item.data);
|
|
_self.dataSource.push(item.data);
|
|
|
- console.log('dataSource:::', _self.dataSource);
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ const flag = _self.dataSource.every(item => {
|
|
|
|
|
+ return item.ImportResult === '成功';
|
|
|
|
|
+ });
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ this.testSuccess = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.testSuccess = false;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -695,11 +707,11 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
runProcessImport: function (selectedDataTemplateNo) {
|
|
runProcessImport: function (selectedDataTemplateNo) {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
- if(_self.lineCount <= 0){
|
|
|
|
|
|
|
+ if (_self.lineCount <= 0) {
|
|
|
message.warning('请输入正确的导入行数!');
|
|
message.warning('请输入正确的导入行数!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(_self.columnCount <= 0){
|
|
|
|
|
|
|
+ if (_self.columnCount <= 0) {
|
|
|
message.warning('请输入正确的导入列数!');
|
|
message.warning('请输入正确的导入列数!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -708,7 +720,10 @@ export default {
|
|
|
const columnCount = _self.columnCount;
|
|
const columnCount = _self.columnCount;
|
|
|
_self.loading = true;
|
|
_self.loading = true;
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
- url: Common.getApiURL('dataImportResource/formalDataImportByIds/') + no + `?lineCount=${lineCount}&columnCount=${columnCount}`,
|
|
|
|
|
|
|
+ url:
|
|
|
|
|
+ Common.getApiURL('dataImportResource/formalDataImportByIds/') +
|
|
|
|
|
+ no +
|
|
|
|
|
+ `?lineCount=${lineCount}&columnCount=${columnCount}`,
|
|
|
type: 'post',
|
|
type: 'post',
|
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
|
beforeSend: function (request) {
|
|
beforeSend: function (request) {
|
|
@@ -750,20 +765,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
_self.loading = false;
|
|
_self.loading = false;
|
|
|
- if (flag) {
|
|
|
|
|
- message.success(
|
|
|
|
|
- _self.$t('lang.DataImportPanel.describe9') +
|
|
|
|
|
- '!' +
|
|
|
|
|
- data.processResult.result,
|
|
|
|
|
- );
|
|
|
|
|
- } else {
|
|
|
|
|
- message.success(
|
|
|
|
|
- _self.$t('lang.DataImportPanel.describe9') +
|
|
|
|
|
- '!' +
|
|
|
|
|
- data.processResult.result,
|
|
|
|
|
- 10,
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe9') +
|
|
|
|
|
+ '!' +
|
|
|
|
|
+ data.processResult.result,
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
_self.loading = false;
|
|
_self.loading = false;
|
|
@@ -866,4 +872,7 @@ export default {
|
|
|
.btn-primary-import {
|
|
.btn-primary-import {
|
|
|
margin-left: 5px;
|
|
margin-left: 5px;
|
|
|
}
|
|
}
|
|
|
|
|
+:deep(.ant-table-sticky-scroll){
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|