|
@@ -1,111 +1,163 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="container-fluid">
|
|
<div class="container-fluid">
|
|
|
- <NavBar :title="$t('lang.DataImportPanel.DataImport')" :is-go-back="true" />
|
|
|
|
|
-
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-md-12">
|
|
|
|
|
- <div class="form-inline">
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="template">{{ $t("lang.DataImportPanel.stepOne") }}.{{
|
|
|
|
|
- $t("lang.DataImportPanel.selectTemplate")
|
|
|
|
|
- }}:</label>
|
|
|
|
|
- <select
|
|
|
|
|
- v-model="selectedDataTemplateNo"
|
|
|
|
|
- class="form-control"
|
|
|
|
|
- @change="changeSelected()"
|
|
|
|
|
- >
|
|
|
|
|
- <option />
|
|
|
|
|
- <option
|
|
|
|
|
- v-for="dataTemplate in dataTemplates"
|
|
|
|
|
- :key="dataTemplate.dataTemplateNo"
|
|
|
|
|
- :value="dataTemplate.dataTemplateNo"
|
|
|
|
|
- >
|
|
|
|
|
- {{ dataTemplate.dataTemplateName }}
|
|
|
|
|
- </option>
|
|
|
|
|
- </select>
|
|
|
|
|
|
|
+ <!-- <NavBar :title="$t('lang.DataImportPanel.DataImport')" :is-go-back="true" /> -->
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-steps :current="current">
|
|
|
|
|
+ <a-step
|
|
|
|
|
+ v-for="item in steps"
|
|
|
|
|
+ :key="item.title"
|
|
|
|
|
+ :title="item.title"
|
|
|
|
|
+ :description="item.description"
|
|
|
|
|
+ />
|
|
|
|
|
+ </a-steps>
|
|
|
|
|
+ <div class="steps-content">
|
|
|
|
|
+ <div v-if="current === 0" class="row">
|
|
|
|
|
+ <div class="col-md-12">
|
|
|
|
|
+ <div class="form-inline">
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>1.请选择导入模板</label><br />
|
|
|
|
|
+ <select
|
|
|
|
|
+ v-model="selectedDataTemplateNo"
|
|
|
|
|
+ class="form-control"
|
|
|
|
|
+ @change="changeSelected()"
|
|
|
|
|
+ >
|
|
|
|
|
+ <option />
|
|
|
|
|
+ <option
|
|
|
|
|
+ v-for="dataTemplate in dataTemplates"
|
|
|
|
|
+ :key="dataTemplate.dataTemplateNo"
|
|
|
|
|
+ :value="dataTemplate.dataTemplateNo"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ dataTemplate.dataTemplateName }}
|
|
|
|
|
+ </option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </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>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- <button type="button" class="btn btn-primary" @click="downloadTemplateButton">
|
|
|
|
|
- <a style="color: #fff" href="javascript:">{{
|
|
|
|
|
- $t("lang.DataImportPanel.downloadTemplate")
|
|
|
|
|
- }}</a>
|
|
|
|
|
- </button>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-md-12">
|
|
|
|
|
- <div class="form-inline">
|
|
|
|
|
- <label>{{ $t("lang.DataImportPanel.stepTwo") }}.</label>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <div>
|
|
|
|
|
- <input
|
|
|
|
|
- id="file"
|
|
|
|
|
- ref="uploadFileInput"
|
|
|
|
|
- autocomplete="off"
|
|
|
|
|
- type="file"
|
|
|
|
|
- class="fileInput form-control"
|
|
|
|
|
- @change="handleFile"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div v-if="current === 1" class="row">
|
|
|
|
|
+ <div class="col-md-12">
|
|
|
|
|
+ <div class="form-inline">
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>1.请选择Excel数据</label><br />
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="file"
|
|
|
|
|
+ ref="uploadFileInput"
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ type="file"
|
|
|
|
|
+ class="fileInput form-control"
|
|
|
|
|
+ @change="handleFile"
|
|
|
|
|
+ />
|
|
|
|
|
+ <span>{{ uploadFilePath }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label>2.请选择需要导入的sheet</label><br />
|
|
|
|
|
+ <select v-model="selectedIndex" class="form-control sheet-select">
|
|
|
|
|
+ <option
|
|
|
|
|
+ v-for="(sheetItem, index) in sheetItems"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :value="index"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ sheetItem }}
|
|
|
|
|
+ </option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label>{{ uploadFilePath }}</label>
|
|
|
|
|
- <label v-if="uploadFilePath != undefined && uploadFilePath != ''"> {{ $t("lang.DataImportPanel.chooseSheet") }}:</label>
|
|
|
|
|
- <select v-model="selectedIndex" class="form-control">
|
|
|
|
|
- <option
|
|
|
|
|
- v-for="(sheetItem, index) in sheetItems"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :value="index"
|
|
|
|
|
- >
|
|
|
|
|
- {{ sheetItem }}
|
|
|
|
|
- </option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-md-12">
|
|
|
|
|
- <div class="form-inline">
|
|
|
|
|
- <label>{{ $t("lang.DataImportPanel.stepThree") }}.</label>
|
|
|
|
|
- <div v-if="sheetItems.length > 0" class="form-group">
|
|
|
|
|
- <button type="button" class="btn btn-primary" @click="runProcessClear(selectedDataTemplateNo)">
|
|
|
|
|
- 3.1{{ $t("lang.DataImportPanel.emptyImport") }}
|
|
|
|
|
- </button>
|
|
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- class="btn btn-primary"
|
|
|
|
|
- @click="testImportButton(true)"
|
|
|
|
|
- >
|
|
|
|
|
- 3.2{{ $t("lang.DataImportPanel.testImport") }}
|
|
|
|
|
- </button>
|
|
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- class="btn btn-primary"
|
|
|
|
|
- @click="runProcessImport(selectedDataTemplateNo)"
|
|
|
|
|
- >
|
|
|
|
|
- 3.3{{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
|
|
- </button>
|
|
|
|
|
- <button v-if="taskId != null && taskId.length > 0" type="button" class="btn btn-primary" @click="finishTask">
|
|
|
|
|
- <a style="color: #fff" href="javascript:">{{ $t("lang.DataImportPanel.completeTask") }}</a>
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <div v-if="current === 2" class="row">
|
|
|
|
|
+ <div class="col-md-12">
|
|
|
|
|
+ <div class="form-inline">
|
|
|
|
|
+ <!-- <label>{{ $t("lang.DataImportPanel.stepThree") }}.</label> -->
|
|
|
|
|
+ <div v-if="sheetItems.length > 0" class="form-group">
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="btn btn-primary"
|
|
|
|
|
+ @click="runProcessClear(selectedDataTemplateNo)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 3.1{{ $t("lang.DataImportPanel.emptyImport") }}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="btn btn-primary"
|
|
|
|
|
+ @click="testImportButton(true)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 3.2{{ $t("lang.DataImportPanel.testImport") }}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="btn btn-primary"
|
|
|
|
|
+ @click="runProcessImport(selectedDataTemplateNo)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 3.3{{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ v-if="taskId != null && taskId.length > 0"
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="btn btn-primary"
|
|
|
|
|
+ @click="finishTask"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a style="color: #fff" href="javascript:">{{
|
|
|
|
|
+ $t("lang.DataImportPanel.completeTask")
|
|
|
|
|
+ }}</a>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-md-12">
|
|
|
|
|
- <div v-if="selectedDataTemplate != null" style="white-space: pre-wrap">
|
|
|
|
|
- {{ selectedDataTemplate.description }}
|
|
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-md-12">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="selectedDataTemplate != null"
|
|
|
|
|
+ style="white-space: pre-wrap"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ selectedDataTemplate.description }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <a-table
|
|
|
|
|
+ bordered
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :data-source="dataSource"
|
|
|
|
|
+ :scroll="{ y:900 }"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-table-column type="index" />
|
|
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
|
|
+ <template v-if="column.key === 'ImportResult'">
|
|
|
|
|
+ {{ record.ImportResult }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table>
|
|
|
|
|
+
|
|
|
|
|
+ <Loading v-if="loading" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <div id="page" data-role="page" data-theme="a" style="height: 500px">
|
|
|
|
|
- <a-table :data-source="dataSource" :columns="columns" />
|
|
|
|
|
|
|
+ <div class="steps-action">
|
|
|
|
|
+ <a-button v-if="current>0" class="prevBtn" @click="prev"> 上一步 </a-button>
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ v-if="current < steps.length - 1"
|
|
|
|
|
+ class="nextBtn"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="next"
|
|
|
|
|
+ >
|
|
|
|
|
+ 下一步
|
|
|
|
|
+ </a-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <Loading v-if="loading" />
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -118,12 +170,38 @@ import WorkflowResource from '../api/workflow/WorkflowResource.js';
|
|
|
import { Notify, Uuid } from 'pc-component-v3';
|
|
import { Notify, Uuid } from 'pc-component-v3';
|
|
|
import { notificationError } from '../common/notification.js';
|
|
import { notificationError } from '../common/notification.js';
|
|
|
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ UserOutlined,
|
|
|
|
|
+ SolutionOutlined,
|
|
|
|
|
+ LoadingOutlined,
|
|
|
|
|
+ SmileOutlined,
|
|
|
|
|
+} from '@ant-design/icons-vue';
|
|
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
-
|
|
|
|
|
|
|
+ UserOutlined,
|
|
|
|
|
+ SolutionOutlined,
|
|
|
|
|
+ LoadingOutlined,
|
|
|
|
|
+ SmileOutlined,
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
data: function () {
|
|
data: function () {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ current: 0,
|
|
|
|
|
+ steps: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '步骤一',
|
|
|
|
|
+ description: '选择模板',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '步骤二',
|
|
|
|
|
+ description: '上传文件',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '步骤三',
|
|
|
|
|
+ description: '导入成功',
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
dataTemplates: [],
|
|
dataTemplates: [],
|
|
|
selectedDataTemplateNo: '',
|
|
selectedDataTemplateNo: '',
|
|
|
selectedDataTemplate: '', // 选择的导入模板
|
|
selectedDataTemplate: '', // 选择的导入模板
|
|
@@ -136,7 +214,7 @@ export default {
|
|
|
loading: false,
|
|
loading: false,
|
|
|
selectedFile: null,
|
|
selectedFile: null,
|
|
|
dataTemplateNo: null,
|
|
dataTemplateNo: null,
|
|
|
- taskId:null,
|
|
|
|
|
|
|
+ taskId: null,
|
|
|
|
|
|
|
|
columns: [], // 列定义
|
|
columns: [], // 列定义
|
|
|
dataSource: [], // 表格数据源
|
|
dataSource: [], // 表格数据源
|
|
@@ -147,19 +225,34 @@ export default {
|
|
|
|
|
|
|
|
mounted: function () {
|
|
mounted: function () {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
-
|
|
|
|
|
|
|
+ console.log('uploadFileInput::::',_self);
|
|
|
_self.initView();
|
|
_self.initView();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- _self.$nextTick(function(){
|
|
|
|
|
|
|
+ _self.$nextTick(function () {
|
|
|
_self.canVisit();
|
|
_self.canVisit();
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (_self.$route.query.dataTemplateNos) {
|
|
if (_self.$route.query.dataTemplateNos) {
|
|
|
_self.dataTemplateNos = JSON.parse(_self.$route.query.dataTemplateNos);
|
|
_self.dataTemplateNos = JSON.parse(_self.$route.query.dataTemplateNos);
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 步骤条切换
|
|
|
|
|
+ */
|
|
|
|
|
+ next() {
|
|
|
|
|
+ console.log('selectedDataTemplateNo:::',this.selectedDataTemplateNo);
|
|
|
|
|
+ if (!this.selectedDataTemplateNo) {
|
|
|
|
|
+ message.error('请选择导入模板');
|
|
|
|
|
+ } else{
|
|
|
|
|
+ this.current++;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ prev() {
|
|
|
|
|
+ this.current--;
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* [canVisit 获取当前权限下可访问的导入数据模板]
|
|
* [canVisit 获取当前权限下可访问的导入数据模板]
|
|
@@ -198,15 +291,17 @@ export default {
|
|
|
|
|
|
|
|
for (var i = 0, len = data.length; i < len; i++) {
|
|
for (var i = 0, len = data.length; i < len; i++) {
|
|
|
if (_self.dataTemplateNos != null && _self.dataTemplateNos.length > 0) {
|
|
if (_self.dataTemplateNos != null && _self.dataTemplateNos.length > 0) {
|
|
|
- if (_self.arrayContain(_self.dataTemplateNos, data[i].dataTemplateNo)) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ _self.arrayContain(_self.dataTemplateNos, data[i].dataTemplateNo)
|
|
|
|
|
+ ) {
|
|
|
_self.dataTemplates.push(data[i]);
|
|
_self.dataTemplates.push(data[i]);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if(_self.dataTemplateNo != null){
|
|
|
|
|
- if(_self.dataTemplateNo == data[i].dataTemplateNo){
|
|
|
|
|
- _self.dataTemplates.push(data[i]);//0 0 12 1 1 ?
|
|
|
|
|
|
|
+ if (_self.dataTemplateNo != null) {
|
|
|
|
|
+ if (_self.dataTemplateNo == data[i].dataTemplateNo) {
|
|
|
|
|
+ _self.dataTemplates.push(data[i]); //0 0 12 1 1 ?
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
_self.dataTemplates.push(data[i]);
|
|
_self.dataTemplates.push(data[i]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -255,19 +350,27 @@ export default {
|
|
|
downloadTemplateButton: function () {
|
|
downloadTemplateButton: function () {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
//var url = window.location.origin;
|
|
//var url = window.location.origin;
|
|
|
- for (var i = 0, len = _self.dataTemplates.length; i < len; i++) {
|
|
|
|
|
- if (_self.selectedDataTemplateNo == _self.dataTemplates[i].dataTemplateNo) {
|
|
|
|
|
- var realtivePath = _self.dataTemplates[i].dataTemplateFileRelativePath.replace(
|
|
|
|
|
- '\\',
|
|
|
|
|
- '/',
|
|
|
|
|
- );
|
|
|
|
|
- var downloadUrl = Common.getFileServerUrl() + realtivePath;
|
|
|
|
|
- var fileName =
|
|
|
|
|
|
|
+ if(this.selectedDataTemplateNo){
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ for (var i = 0, len = _self.dataTemplates.length; i < len; i++) {
|
|
|
|
|
+ if (
|
|
|
|
|
+ _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 != null && realtivePath.lastIndexOf('/') >= 0
|
|
|
? realtivePath.substring(realtivePath.lastIndexOf('/') + 1)
|
|
? realtivePath.substring(realtivePath.lastIndexOf('/') + 1)
|
|
|
: '导入模板.xls';
|
|
: '导入模板.xls';
|
|
|
- DownloadService.downloadFile(downloadUrl, fileName);
|
|
|
|
|
|
|
+ DownloadService.downloadFile(downloadUrl, fileName);
|
|
|
|
|
+ this.current++;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ message.error('请先选择导入模板');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -279,14 +382,22 @@ export default {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
_self.uploadFilePath = event.currentTarget.value;
|
|
_self.uploadFilePath = event.currentTarget.value;
|
|
|
if (_self.uploadFilePath.length == 0) {
|
|
if (_self.uploadFilePath.length == 0) {
|
|
|
- Notify.error(_self.$t('lang.Notify.prompt'), _self.$t('lang.DataImportPanel.describe1'), false);
|
|
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.prompt'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe1'),
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (
|
|
if (
|
|
|
!_self.uploadFilePath.toLowerCase().endsWith('.xls') &&
|
|
!_self.uploadFilePath.toLowerCase().endsWith('.xls') &&
|
|
|
!_self.uploadFilePath.toLowerCase().endsWith('.xlsx')
|
|
!_self.uploadFilePath.toLowerCase().endsWith('.xlsx')
|
|
|
) {
|
|
) {
|
|
|
- Notify.error(_self.$t('lang.Notify.warning'), _self.$t('lang.DataImportPanel.describe2'), false);
|
|
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.warning'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe2'),
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
var formData = new FormData();
|
|
var formData = new FormData();
|
|
@@ -392,11 +503,12 @@ export default {
|
|
|
title: _self.$t('lang.DataImportPanel.processingResults'),
|
|
title: _self.$t('lang.DataImportPanel.processingResults'),
|
|
|
dataIndex: 'ImportResult',
|
|
dataIndex: 'ImportResult',
|
|
|
key: 'ImportResult',
|
|
key: 'ImportResult',
|
|
|
- width: 130,
|
|
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ // scopedSlots: { customRender: 'ImportResult' },
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* [测试导入点击事件]
|
|
* [测试导入点击事件]
|
|
|
* @return {[type]} [description]
|
|
* @return {[type]} [description]
|
|
@@ -408,17 +520,32 @@ export default {
|
|
|
_self.selectedDataTemplateNo == '' ||
|
|
_self.selectedDataTemplateNo == '' ||
|
|
|
_self.selectedDataTemplateNo == undefined
|
|
_self.selectedDataTemplateNo == undefined
|
|
|
) {
|
|
) {
|
|
|
- Notify.error(_self.$t('lang.Notify.prompt'), _self.$t('lang.DataImportPanel.describe3'), false);
|
|
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.prompt'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe3'),
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (_self.selectedDataTemplate == '' || _self.selectedDataTemplate == undefined) {
|
|
|
|
|
- Notify.error(_self.$t('lang.Notify.prompt'), _self.$t('lang.DataImportPanel.describe3'), false);
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ _self.selectedDataTemplate == '' ||
|
|
|
|
|
+ _self.selectedDataTemplate == undefined
|
|
|
|
|
+ ) {
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.prompt'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe3'),
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (sheetIndex < 0 || sheetIndex == undefined) {
|
|
if (sheetIndex < 0 || sheetIndex == undefined) {
|
|
|
- Notify.error(_self.$t('lang.Notify.prompt'), _self.$t('lang.DataImportPanel.describe4'), false);
|
|
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.prompt'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe4'),
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -445,7 +572,11 @@ export default {
|
|
|
_self.uploadClassFile();
|
|
_self.uploadClassFile();
|
|
|
if (data.isSuccess) {
|
|
if (data.isSuccess) {
|
|
|
if (isformalImport) {
|
|
if (isformalImport) {
|
|
|
- Notify.info(_self.$t('lang.Notify.success'), _self.$t('lang.DataImportPanel.describe5'), false);
|
|
|
|
|
|
|
+ Notify.info(
|
|
|
|
|
+ _self.$t('lang.Notify.success'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe5'),
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
} else {
|
|
} else {
|
|
|
Notify.info(
|
|
Notify.info(
|
|
|
_self.$t('lang.Notify.success'),
|
|
_self.$t('lang.Notify.success'),
|
|
@@ -516,11 +647,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
_self.dataSource = [];
|
|
_self.dataSource = [];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
data.forEach(function (item) {
|
|
data.forEach(function (item) {
|
|
|
_self.dataSource.push(item.data);
|
|
_self.dataSource.push(item.data);
|
|
|
|
|
+ console.log('dataSource:::',_self.dataSource);
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -539,8 +670,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
_self.loading = false;
|
|
_self.loading = false;
|
|
|
- Notify.success(_self.$t('lang.DataImportPanel.describe9'), data.processResult.result, false);
|
|
|
|
|
- if(_self.dataTemplateNo != null && _self.taskId != null){
|
|
|
|
|
|
|
+ Notify.success(
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe9'),
|
|
|
|
|
+ data.processResult.result,
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
|
|
+ if (_self.dataTemplateNo != null && _self.taskId != null) {
|
|
|
_self.finishTask();
|
|
_self.finishTask();
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
@@ -568,7 +703,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
_self.loading = false;
|
|
_self.loading = false;
|
|
|
- Notify.success(_self.$t('lang.DataImportPanel.describe9'), data.processResult.result, false);
|
|
|
|
|
|
|
+ Notify.success(
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe9'),
|
|
|
|
|
+ data.processResult.result,
|
|
|
|
|
+ false,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
},
|
|
},
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
@@ -581,33 +720,45 @@ export default {
|
|
|
initView: function () {
|
|
initView: function () {
|
|
|
let _self = this;
|
|
let _self = this;
|
|
|
const dataTemplateNo = this.$route.query.dataTemplateNo;
|
|
const dataTemplateNo = this.$route.query.dataTemplateNo;
|
|
|
- if(dataTemplateNo != null){
|
|
|
|
|
|
|
+ if (dataTemplateNo != null) {
|
|
|
_self.dataTemplateNo = dataTemplateNo;
|
|
_self.dataTemplateNo = dataTemplateNo;
|
|
|
}
|
|
}
|
|
|
_self.taskId = _self.$route.query.taskId;
|
|
_self.taskId = _self.$route.query.taskId;
|
|
|
console.log('taskId:' + _self.taskId);
|
|
console.log('taskId:' + _self.taskId);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 完成任务
|
|
* 完成任务
|
|
|
*/
|
|
*/
|
|
|
- finishTask: function(){
|
|
|
|
|
|
|
+ finishTask: function () {
|
|
|
let _self = this;
|
|
let _self = this;
|
|
|
- if(_self.taskId == null){
|
|
|
|
|
- Notify.error(_self.$t('lang.Notify.error'), _self.$t('lang.DataImportPanel.describe10'), true);
|
|
|
|
|
|
|
+ if (_self.taskId == null) {
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.error'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe10'),
|
|
|
|
|
+ true,
|
|
|
|
|
+ );
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- WorkflowResource.finishTask(_self.taskId).then(successData => {
|
|
|
|
|
- if(successData.errorCode == 0){
|
|
|
|
|
- Notify.success(_self.$t('lang.Notify.success'), _self.$t('lang.DataImportPanel.describe11'));
|
|
|
|
|
- }else{
|
|
|
|
|
- Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage);
|
|
|
|
|
- }
|
|
|
|
|
- }, errorData => {
|
|
|
|
|
- Common.processException(errorData);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ WorkflowResource.finishTask(_self.taskId).then(
|
|
|
|
|
+ successData => {
|
|
|
|
|
+ if (successData.errorCode == 0) {
|
|
|
|
|
+ Notify.success(
|
|
|
|
|
+ _self.$t('lang.Notify.success'),
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe11'),
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Notify.error(
|
|
|
|
|
+ _self.$t('lang.Notify.error'),
|
|
|
|
|
+ successData.errorMessage,
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ errorData => {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
@@ -622,15 +773,53 @@ export default {
|
|
|
width: 200px !important;
|
|
width: 200px !important;
|
|
|
font-size: 12px !important;
|
|
font-size: 12px !important;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+.form-control{
|
|
|
|
|
+ margin-left: 20px;
|
|
|
|
|
+}
|
|
|
label {
|
|
label {
|
|
|
- margin-bottom: 0px !important;
|
|
|
|
|
|
|
+ /* 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 {
|
|
|
|
|
+ margin-top: 8px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+}
|
|
|
|
|
+.prevBtn{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+.nextBtn{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ right: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+.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;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|