|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="container-fluid">
|
|
<div class="container-fluid">
|
|
|
- <!-- <NavBar :title="$t('lang.DataImportPanel.DataImport')" :is-go-back="true" /> -->
|
|
|
|
|
- <div>
|
|
|
|
|
|
|
+ <Navbar :title="$t('lang.DataImportPanel.DataImport')" :is-go-back="true" />
|
|
|
|
|
+
|
|
|
|
|
+ <div style="margin-top: 2rem">
|
|
|
<a-steps :current="current">
|
|
<a-steps :current="current">
|
|
|
<a-step
|
|
<a-step
|
|
|
v-for="item in steps"
|
|
v-for="item in steps"
|
|
@@ -10,12 +11,15 @@
|
|
|
:description="item.description"
|
|
:description="item.description"
|
|
|
/>
|
|
/>
|
|
|
</a-steps>
|
|
</a-steps>
|
|
|
- <div class="steps-content">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <a-divider />
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
<div v-if="current === 0" class="row">
|
|
<div v-if="current === 0" class="row">
|
|
|
- <div class="col-md-12">
|
|
|
|
|
- <div class="form-inline">
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label>1.请选择导入模板</label><br />
|
|
|
|
|
|
|
+ <label class="form-label">1.请选择导入模板</label>
|
|
|
<select
|
|
<select
|
|
|
v-model="selectedDataTemplateNo"
|
|
v-model="selectedDataTemplateNo"
|
|
|
class="form-control"
|
|
class="form-control"
|
|
@@ -31,28 +35,26 @@
|
|
|
</option>
|
|
</option>
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
- <div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <label class="downloadTemplateLabel">2.请下载导入模板</label><br />
|
|
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- class="btn btn-primary"
|
|
|
|
|
- @click="downloadTemplateButton"
|
|
|
|
|
- >
|
|
|
|
|
- <a style="color: #fff" href="javascript:">{{
|
|
|
|
|
- $t("lang.DataImportPanel.downloadTemplate")
|
|
|
|
|
- }}</a>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">2.请下载导入模板</label>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="btn btn-primary btn-primary-1 btn-primary-block"
|
|
|
|
|
+ @click="downloadTemplateButton"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ $t("lang.DataImportPanel.downloadTemplate") }}
|
|
|
|
|
+ </button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<div v-if="current === 1" class="row">
|
|
<div v-if="current === 1" class="row">
|
|
|
- <div class="col-md-12">
|
|
|
|
|
- <div class="form-inline">
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label>1.请选择Excel数据</label><br />
|
|
|
|
|
|
|
+ <label>1.请选择Excel数据</label>
|
|
|
<input
|
|
<input
|
|
|
id="file"
|
|
id="file"
|
|
|
ref="uploadFileInput"
|
|
ref="uploadFileInput"
|
|
@@ -64,7 +66,7 @@
|
|
|
<span>{{ uploadFilePath }}</span>
|
|
<span>{{ uploadFilePath }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <label>2.请选择需要导入的sheet</label><br />
|
|
|
|
|
|
|
+ <label>2.请选择需要导入的sheet</label>
|
|
|
<select v-model="selectedIndex" class="form-control sheet-select">
|
|
<select v-model="selectedIndex" class="form-control sheet-select">
|
|
|
<option
|
|
<option
|
|
|
v-for="(sheetItem, index) in sheetItems"
|
|
v-for="(sheetItem, index) in sheetItems"
|
|
@@ -78,48 +80,49 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
<div v-if="current === 2" class="row">
|
|
<div v-if="current === 2" class="row">
|
|
|
- <div class="col-md-12">
|
|
|
|
|
|
|
+ <div>
|
|
|
<div class="form-inline">
|
|
<div class="form-inline">
|
|
|
<!-- <label>{{ $t("lang.DataImportPanel.stepThree") }}.</label> -->
|
|
<!-- <label>{{ $t("lang.DataImportPanel.stepThree") }}.</label> -->
|
|
|
<div v-if="sheetItems.length > 0" class="form-group">
|
|
<div v-if="sheetItems.length > 0" class="form-group">
|
|
|
<button
|
|
<button
|
|
|
type="button"
|
|
type="button"
|
|
|
- class="btn btn-primary"
|
|
|
|
|
|
|
+ class="btn btn-primary btn-primary-1"
|
|
|
@click="runProcessClear(selectedDataTemplateNo)"
|
|
@click="runProcessClear(selectedDataTemplateNo)"
|
|
|
>
|
|
>
|
|
|
- 3.1{{ $t("lang.DataImportPanel.emptyImport") }}
|
|
|
|
|
|
|
+ 1.{{ $t("lang.DataImportPanel.emptyImport") }}
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
type="button"
|
|
type="button"
|
|
|
- class="btn btn-primary"
|
|
|
|
|
|
|
+ class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
|
@click="testImportButton(true)"
|
|
@click="testImportButton(true)"
|
|
|
>
|
|
>
|
|
|
- 3.2{{ $t("lang.DataImportPanel.testImport") }}
|
|
|
|
|
|
|
+ 2.{{ $t("lang.DataImportPanel.testImport") }}
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
type="button"
|
|
type="button"
|
|
|
- class="btn btn-primary"
|
|
|
|
|
|
|
+ class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
|
@click="runProcessImport(selectedDataTemplateNo)"
|
|
@click="runProcessImport(selectedDataTemplateNo)"
|
|
|
>
|
|
>
|
|
|
- 3.3{{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
|
|
|
|
+ 3.{{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
v-if="taskId != null && taskId.length > 0"
|
|
v-if="taskId != null && taskId.length > 0"
|
|
|
type="button"
|
|
type="button"
|
|
|
- class="btn btn-primary"
|
|
|
|
|
|
|
+ class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
|
@click="finishTask"
|
|
@click="finishTask"
|
|
|
>
|
|
>
|
|
|
- <a style="color: #fff" href="javascript:">{{
|
|
|
|
|
|
|
+ {{
|
|
|
$t("lang.DataImportPanel.completeTask")
|
|
$t("lang.DataImportPanel.completeTask")
|
|
|
- }}</a>
|
|
|
|
|
|
|
+ }}
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="row">
|
|
|
- <div class="col-md-12">
|
|
|
|
|
|
|
+ <div>
|
|
|
<div
|
|
<div
|
|
|
v-if="selectedDataTemplate != null"
|
|
v-if="selectedDataTemplate != null"
|
|
|
style="white-space: pre-wrap"
|
|
style="white-space: pre-wrap"
|
|
@@ -167,7 +170,7 @@ import Common from '../common/Common.js';
|
|
|
|
|
|
|
|
import DownloadService from '../resource/file/DownloadService.js';
|
|
import DownloadService from '../resource/file/DownloadService.js';
|
|
|
import WorkflowResource from '../api/workflow/WorkflowResource.js';
|
|
import WorkflowResource from '../api/workflow/WorkflowResource.js';
|
|
|
-import { Notify, Uuid } from 'pc-component-v3';
|
|
|
|
|
|
|
+import { Notify, Uuid, Navbar } from 'pc-component-v3';
|
|
|
import { notificationError } from '../common/notification.js';
|
|
import { notificationError } from '../common/notification.js';
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
@@ -183,6 +186,7 @@ export default {
|
|
|
SolutionOutlined,
|
|
SolutionOutlined,
|
|
|
LoadingOutlined,
|
|
LoadingOutlined,
|
|
|
SmileOutlined,
|
|
SmileOutlined,
|
|
|
|
|
+ Navbar,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
data: function () {
|
|
data: function () {
|
|
@@ -357,16 +361,15 @@ export default {
|
|
|
if (
|
|
if (
|
|
|
_self.selectedDataTemplateNo == _self.dataTemplates[i].dataTemplateNo
|
|
_self.selectedDataTemplateNo == _self.dataTemplates[i].dataTemplateNo
|
|
|
) {
|
|
) {
|
|
|
- var realtivePath = _self.dataTemplates[
|
|
|
|
|
- i
|
|
|
|
|
- ].dataTemplateFileRelativePath.replace('\\', '/');
|
|
|
|
|
- var downloadUrl = Common.getFileServerUrl() + realtivePath;
|
|
|
|
|
- var fileName =
|
|
|
|
|
- realtivePath != null && realtivePath.lastIndexOf('/') >= 0
|
|
|
|
|
- ? realtivePath.substring(realtivePath.lastIndexOf('/') + 1)
|
|
|
|
|
|
|
+ var realtivePath = _self.dataTemplates[i].dataTemplateFileRelativePath;
|
|
|
|
|
+
|
|
|
|
|
+ var downloadUrl = '/api/dataImportResource/downloadTemplateFile?dataTemplateNo=' + _self.selectedDataTemplateNo;
|
|
|
|
|
+
|
|
|
|
|
+ var fileName = (realtivePath != null)
|
|
|
|
|
+ ? realtivePath
|
|
|
: '导入模板.xls';
|
|
: '导入模板.xls';
|
|
|
|
|
+
|
|
|
DownloadService.downloadFile(downloadUrl, fileName);
|
|
DownloadService.downloadFile(downloadUrl, fileName);
|
|
|
- this.current++;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
@@ -694,6 +697,7 @@ export default {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
var no = selectedDataTemplateNo;
|
|
var no = selectedDataTemplateNo;
|
|
|
_self.loading = true;
|
|
_self.loading = true;
|
|
|
|
|
+ _self.dataSource = [];
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: Common.getApiURL('dataImportResource/clearDataImportByIds/') + no,
|
|
url: Common.getApiURL('dataImportResource/clearDataImportByIds/') + no,
|
|
|
type: 'post',
|
|
type: 'post',
|
|
@@ -773,53 +777,45 @@ export default {
|
|
|
width: 200px !important;
|
|
width: 200px !important;
|
|
|
font-size: 12px !important;
|
|
font-size: 12px !important;
|
|
|
}
|
|
}
|
|
|
-.form-control{
|
|
|
|
|
- margin-left: 20px;
|
|
|
|
|
-}
|
|
|
|
|
-label {
|
|
|
|
|
- /* margin-bottom: 0px !important; */
|
|
|
|
|
- margin-top: 24px;
|
|
|
|
|
-}
|
|
|
|
|
-/* .downloadTemplateLabel{
|
|
|
|
|
- margin-left: -160px;
|
|
|
|
|
-} */
|
|
|
|
|
-/* .form-inline{
|
|
|
|
|
- margin-top: 24px;
|
|
|
|
|
-} */
|
|
|
|
|
|
|
+
|
|
|
.button-item {
|
|
.button-item {
|
|
|
margin-right: 5px;
|
|
margin-right: 5px;
|
|
|
}
|
|
}
|
|
|
.checkResultFlag {
|
|
.checkResultFlag {
|
|
|
background-color: red;
|
|
background-color: red;
|
|
|
}
|
|
}
|
|
|
-.steps-content {
|
|
|
|
|
- /* margin-top: 16px; */
|
|
|
|
|
- border: 1px dashed #e9e9e9;
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
- background-color: #fafafa;
|
|
|
|
|
- min-height: 240px;
|
|
|
|
|
- /* text-align: center; */
|
|
|
|
|
- padding-top: 8px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
.steps-action {
|
|
.steps-action {
|
|
|
margin-top: 8px;
|
|
margin-top: 8px;
|
|
|
- position: relative;
|
|
|
|
|
|
|
+ position: relative;
|
|
|
}
|
|
}
|
|
|
.prevBtn{
|
|
.prevBtn{
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- left: 8px;
|
|
|
|
|
|
|
+ left: 0px;
|
|
|
}
|
|
}
|
|
|
.nextBtn{
|
|
.nextBtn{
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- right: 8px;
|
|
|
|
|
|
|
+ right: 0px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.btn-primary-1{
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ background: #1890ff;
|
|
|
|
|
+ border-color: #1890ff;
|
|
|
|
|
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
|
|
|
|
|
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
|
|
|
|
|
+ border: 1px solid transparent;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
}
|
|
}
|
|
|
-.btn-primary {
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- background: #1890ff;
|
|
|
|
|
- border-color: #1890ff;
|
|
|
|
|
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
|
|
|
|
|
- box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
|
|
|
|
|
- margin-left: 5px;
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+.btn-primary-block{
|
|
|
|
|
+ display: block;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+.btn-primary-import{
|
|
|
|
|
+ margin-left: 5px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
</style>
|
|
</style>
|