|
@@ -30,12 +30,17 @@
|
|
<el-table-column label="操作" align="center" width="150">
|
|
<el-table-column label="操作" align="center" width="150">
|
|
<template slot-scope="scope" >
|
|
<template slot-scope="scope" >
|
|
<div class="operate">
|
|
<div class="operate">
|
|
- <!-- <el-link type="primary" @click.native="handleDownload(scope.row)" v-if="$permission('/workspace/common/taskDownload') && ((scope.row.type == 1 || scope.row.type == 2) && (scope.row.state !== 0 || scope.row.state !== 1))">
|
|
|
|
|
|
+ <el-link type="primary" @click.native="details(scope.row)">
|
|
|
|
+ <el-tooltip class="item" effect="dark" content="下载" placement="top">
|
|
|
|
+ <i class="el-icon-document"></i>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </el-link>
|
|
|
|
+ <el-link type="primary" @click.native="handleDownload(scope.row)" v-if="$permission('/workspace/common/taskDownload') && ((scope.row.type == 1 || scope.row.type == 2) && (scope.row.state !== 0 || scope.row.state !== 1))">
|
|
<el-tooltip class="item" effect="dark" content="下载" placement="top">
|
|
<el-tooltip class="item" effect="dark" content="下载" placement="top">
|
|
<i class="iconfont icon-xiazai"></i>
|
|
<i class="iconfont icon-xiazai"></i>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
- </el-link> -->
|
|
|
|
-
|
|
|
|
|
|
+ </el-link>
|
|
|
|
+
|
|
<el-link class="margin-left_10" type="primary" @click="updateImportTaskState(scope.row,4)" v-if="scope.row.state==1 || scope.row.state==0">
|
|
<el-link class="margin-left_10" type="primary" @click="updateImportTaskState(scope.row,4)" v-if="scope.row.state==1 || scope.row.state==0">
|
|
<el-tooltip class="item" effect="dark" content="暂停" placement="top">
|
|
<el-tooltip class="item" effect="dark" content="暂停" placement="top">
|
|
<i class="iconfont icon-zanting1"></i>
|
|
<i class="iconfont icon-zanting1"></i>
|
|
@@ -73,10 +78,14 @@ import { mapGetters } from "vuex";
|
|
export default {
|
|
export default {
|
|
components: {},
|
|
components: {},
|
|
props: {
|
|
props: {
|
|
-
|
|
|
|
|
|
+ importToId:''
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ //固定检索字段
|
|
|
|
+ searchFiled2:{
|
|
|
|
+ projectId:this.importToId
|
|
|
|
+ },
|
|
//检索字段
|
|
//检索字段
|
|
searchFiled: [],
|
|
searchFiled: [],
|
|
//检索条件
|
|
//检索条件
|
|
@@ -150,10 +159,9 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
initTask() {
|
|
initTask() {
|
|
var webSocket = this.webSocket
|
|
var webSocket = this.webSocket
|
|
- console.log(webSocket)
|
|
|
|
webSocket.onmessage = (e) => {
|
|
webSocket.onmessage = (e) => {
|
|
const { code, data, message } = JSON.parse(e.data)
|
|
const { code, data, message } = JSON.parse(e.data)
|
|
- console.log({ code, data, message });
|
|
|
|
|
|
+ // console.log({ code, data, message });
|
|
// var a = {
|
|
// var a = {
|
|
// "code": 903,
|
|
// "code": 903,
|
|
// "data": {
|
|
// "data": {
|
|
@@ -170,40 +178,51 @@ export default {
|
|
// },
|
|
// },
|
|
// "message": "WebSocket请求成功"
|
|
// "message": "WebSocket请求成功"
|
|
// }
|
|
// }
|
|
- // if (code === 903 || code === 904) {
|
|
|
|
- // const index = this.tableData.findIndex(item=>{return item.id == data.taskId})
|
|
|
|
- // // const index = this.taskData.findIndex(item=>{return item.id == data.id})
|
|
|
|
- // if (index === -1) {
|
|
|
|
- // if(data.projectId == this.projectId){
|
|
|
|
- // this.getList()
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // // this.taskData.unshift(data)
|
|
|
|
- // } else {
|
|
|
|
- // var arr = this.tableData[index]
|
|
|
|
- // arr.index = data.index
|
|
|
|
- // arr.percentage = data.percentage
|
|
|
|
- // arr.successNum = data.index
|
|
|
|
- // arr.state = data.taskStatus
|
|
|
|
- // this.$set(this.tableData, index, arr)
|
|
|
|
- // }
|
|
|
|
- // if (data.complete) {
|
|
|
|
- // if(data.taskType!=2){
|
|
|
|
- // this.$message.success(`导入任务完成`)
|
|
|
|
- // for(var i = 0;i<this.tableData.length;i++){
|
|
|
|
- // if(this.tableData[i].complete==true){
|
|
|
|
- // this.tableData.splice(i,1)
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }else{
|
|
|
|
- // this.$message.success(`导出任务完成`)
|
|
|
|
- // }
|
|
|
|
|
|
+ if(code === 900){
|
|
|
|
+ if(data.doneType == 0){
|
|
|
|
+ const index = this.tableData.findIndex(item=>{return item.id == data.taskId})
|
|
|
|
+ if (index === -1) {
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ var arr = this.tableData[index]
|
|
|
|
+ arr.doneNum = data.index
|
|
|
|
+ arr.percentage = data.percentage
|
|
|
|
+ // arr.successNum = data.index
|
|
|
|
+ arr.state = data.taskStatus
|
|
|
|
+ // this.$set(this.tableData, index, arr)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (code === 903) {
|
|
|
|
+ const index = this.tableData.findIndex(item=>{return item.id == data.taskId})
|
|
|
|
+ if (index === -1) {
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ var arr = this.tableData[index]
|
|
|
|
+ arr.doneNum = data.index
|
|
|
|
+ arr.percentage = data.percentage
|
|
|
|
+ // arr.successNum = data.index
|
|
|
|
+ arr.state = data.taskStatus
|
|
|
|
+ // this.$set(this.tableData, index, arr)
|
|
|
|
+ }
|
|
|
|
+ if (data.complete) {
|
|
|
|
+ // if(data.taskType!=2){
|
|
|
|
+ this.$message.success(`导入任务完成`)
|
|
|
|
+ // for(var i = 0;i<this.tableData.length;i++){
|
|
|
|
+ // if(this.tableData[i].complete==true){
|
|
|
|
+ // this.tableData.splice(i,1)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }else{
|
|
|
|
+ // this.$message.success(`导出任务完成`)
|
|
|
|
+ // }
|
|
|
|
|
|
- // // console.log(this.form)
|
|
|
|
|
|
+ // console.log(this.form)
|
|
|
|
|
|
- // this.getList()
|
|
|
|
- // }
|
|
|
|
- // } else if (code === 803 || code === 804) {
|
|
|
|
|
|
+ // this.getList()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // else if (code === 803 || code === 804) {
|
|
// this.$message.error(message)
|
|
// this.$message.error(message)
|
|
// this.getList()
|
|
// this.getList()
|
|
// }
|
|
// }
|
|
@@ -274,8 +293,12 @@ export default {
|
|
//获取任务
|
|
//获取任务
|
|
getList(){
|
|
getList(){
|
|
var params = {
|
|
var params = {
|
|
|
|
+ ...this.searchFiled2,
|
|
|
|
+ ...this.searchOption
|
|
|
|
+ }
|
|
|
|
+ var params = {
|
|
...this.queryParams,
|
|
...this.queryParams,
|
|
- searchQuery:this.$commonJS.objectToString(this.searchOption || {}),
|
|
|
|
|
|
+ searchQuery:this.$commonJS.objectToString(params),
|
|
orderDTOList:this.sort
|
|
orderDTOList:this.sort
|
|
}
|
|
}
|
|
this.$api.queryImportTask(params).then(res => {
|
|
this.$api.queryImportTask(params).then(res => {
|
|
@@ -317,6 +340,14 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //任务详情
|
|
|
|
+ details(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ //下载附件
|
|
|
|
+ handleDownload(row){
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|