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

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

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

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

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

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

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

Loading…
Cancel
Save