Browse Source

导入进度优化,列表分页问题需改

feature
mk 2 years ago
parent
commit
1a11591495
  1. 3
      src/views/modules/base/smartImport/cpts/completeTask.vue
  2. 4
      src/views/modules/base/smartImport/cpts/createdTask.vue
  3. 4
      src/views/modules/base/smartImport/cpts/executeTask.vue
  4. 106
      src/views/modules/base/smartImport/cpts/smartImportInfo.vue

3
src/views/modules/base/smartImport/cpts/completeTask.vue

@ -44,7 +44,7 @@
<!-- -->
<i class="el-icon-download" style="margin-left: 16px;"></i>
<a
v-if="this.resultDescFile"
v-if="resultDescFile"
:href="this.resultDescFile"
target="_blank"
style="color: #ff4d4f; cursor: pointer"
@ -135,6 +135,7 @@ export default {
async handelClickLook(type) {
this.showTable = true;
this.tableType = type;
this.pageNo = 1;
this.getTable()
},
async getTable(){

4
src/views/modules/base/smartImport/cpts/createdTask.vue

@ -343,8 +343,6 @@ export default {
await this.$http
.post("/actual/base/intelligentImportData/uploadFile", formData)
.then((res) => {
console.log("res-up", res);
if (res.data.code == 0) {
const { fileName, url } = res.data.data;
this.createdFileName = fileName;
@ -357,7 +355,7 @@ export default {
.catch((err) => {
console.log("失败", err);
file.onError(); //
// this.$message.error("");
this.dataListLoading = false;
});
this.$refs.upload.clearFiles();
},

4
src/views/modules/base/smartImport/cpts/executeTask.vue

@ -124,8 +124,7 @@ export default {
pageNo:1,
pageSize:20,
total:0,
tableType:null
tableType:null,
};
},
props: {
@ -201,6 +200,7 @@ export default {
async handelClickLook(type) {
this.showTable = true;
this.tableType = type;
this.pageNo = 1;
this.getTable()
},
async getTable(){

106
src/views/modules/base/smartImport/cpts/smartImportInfo.vue

@ -2,75 +2,103 @@
<div class="m-detail-main">
<el-card>
<div class="steps">
<el-steps :active="progress" >
<!-- description="这是一段很长很长很长的描述性文字" -->
<el-step :class="[this.operatorName == null?'showNum':'']" title="创建任务" :description="`${this.operatorName}(${this.createdTime})`" ></el-step>
<el-step title="正在导入" :description="`导入进度${this.processStatus == 'processing'?this.progressNum:100 }%`"></el-step>
<el-steps :active="progress">
<el-step
:class="[this.operatorName == null ? 'showNum' : '']"
title="创建任务"
:description="`${this.operatorName}(${this.createdTime})`"
></el-step>
<el-step
title="正在导入"
:class="[this.progress == 2 || this.progress == 3 ? '' : 'showNum']"
:description="`导入进度${
this.progressNum ? this.progressNum : 100
}%`"
></el-step>
<el-step title="导入完成"></el-step>
</el-steps>
</div>
<div style="margin-top: 37px;">
<created-task v-if="progress == 1" @handelClickUpload="handelClickUpload" @handelClickBack="handelClickBack"></created-task>
<execute-task v-if="progress == 2" @successImport="successImport" @handelClickBack="handelClickBack" @updateProgress="updateProgress" :fileCode="fileCode" :fileCodeP="fileCodeP" @updateoperatorName="updateoperatorName"></execute-task>
<complete-task v-if="progress == 3"@handelClickBack="handelClickBack" :fileCodeP="fileCodeP" @updateoperatorName="updateoperatorName" :fileCode="fileCode"></complete-task>
<div style="margin-top: 37px">
<created-task
v-if="progress == 1"
@handelClickUpload="handelClickUpload"
@handelClickBack="handelClickBack"
></created-task>
<execute-task
v-if="progress == 2"
@successImport="successImport"
@handelClickBack="handelClickBack"
@updateProgress="updateProgress"
:fileCode="fileCode"
:fileCodeP="fileCodeP"
@updateoperatorName="updateoperatorName"
></execute-task>
<complete-task
v-if="progress == 3"
@handelClickBack="handelClickBack"
:fileCodeP="fileCodeP"
@updateoperatorName="updateoperatorName"
:fileCode="fileCode"
></complete-task>
</div>
</el-card>
</div>
</template>
<script>
import createdTask from './createdTask.vue'
import executeTask from './executeTask.vue'
import completeTask from './completeTask.vue'
import createdTask from "./createdTask.vue";
import executeTask from "./executeTask.vue";
import completeTask from "./completeTask.vue";
export default {
data() {
return {
progress:1,
fileCode:null,
progressNum:null,
createdTime:null,
operatorName:null
progress: 1,
fileCode: null,
progressNum: null,
createdTime: null,
operatorName: null,
};
},
props: {
fileCodeP:{
type:String,
default:null
fileCodeP: {
type: String,
default: null,
},
taskId:{
type:String,
default:null
taskId: {
type: String,
default: null,
},
processStatus: {
type: String,
default: null,
},
processStatus:{
type:String,
default:null
}
},
created() {
console.log(this.processStatus);
if(this.processStatus){
this.progress = this.processStatus == 'processing'?2:3
if (this.processStatus) {
this.progress = this.processStatus == "processing" ? 2 : 3;
}
},
methods: {
handelClickUpload(fileCode){
this.progress = 2;
this.fileCode = fileCode;
handelClickUpload(fileCode) {
this.progress = 2;
this.fileCode = fileCode;
},
handelClickBack(){
this.$emit('handleClose');
handelClickBack() {
this.$emit("handleClose");
},
successImport(){
successImport() {
this.progress = 3;
this.progressNum = 100;
},
updateProgress(num){
updateProgress(num) {
this.progressNum = num;
},
updateoperatorName({operatorName,createdTime}){
updateoperatorName({ operatorName, createdTime }) {
this.operatorName = operatorName;
this.createdTime = createdTime;
},
},
components: {createdTask,executeTask,completeTask},
components: { createdTask, executeTask, completeTask },
computed: {},
watch: {},
};
@ -79,8 +107,8 @@ export default {
@import "@/assets/scss/buttonstyle.scss";
@import "@/assets/scss/modules/management/detail-main.scss";
@import "@/assets/scss/pages/smartImport.scss";
.showNum{
/deep/.el-step__description{
.showNum {
/deep/.el-step__description {
display: none;
}
}

Loading…
Cancel
Save