Jelajahi Sumber

任务模块

zhuliu 1 tahun lalu
induk
melakukan
a3c1edb1c7

+ 5 - 2
src/views/components/import/conditionImport/components/projectListDialog.vue

@@ -409,8 +409,8 @@ export default {
             });
             this.form.importContent = Number(importContent.join(''))
             this.form.assoImportTaskFieldVOS = this.assoImportTaskFieldVOS
-            console.log(this.form)
-            // this.addImportTask(this.form)
+            // console.log(this.form)
+            this.addImportTask(this.form)
         }
       });
     },
@@ -445,6 +445,9 @@ export default {
       // 传专题库id是查到当前专题库的导入任务,不传是查看所有导入任务
       const router = this.$router.resolve({
         path: "/taskList",
+        query:{
+          importToId:this.form.importToId
+        }
       });
       window.open(router.href, "_blank");
     },

+ 70 - 39
src/views/components/import/task/components/index.vue

@@ -30,12 +30,17 @@
             <el-table-column label="操作" align="center" width="150">
               <template slot-scope="scope" >
                 <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">
                       <i class="iconfont icon-xiazai"></i>
                     </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-tooltip class="item" effect="dark" content="暂停" placement="top">
                       <i class="iconfont icon-zanting1"></i>
@@ -73,10 +78,14 @@ import { mapGetters } from "vuex";
 export default {
   components: {},
   props: {
-    
+    importToId:''
   },
   data() {
     return {
+        //固定检索字段
+        searchFiled2:{
+            projectId:this.importToId
+        },
         //检索字段
         searchFiled: [],
         //检索条件
@@ -150,10 +159,9 @@ export default {
   methods: {
     initTask() {
       var webSocket = this.webSocket
-      console.log(webSocket)
       webSocket.onmessage = (e) => {
         const { code, data, message } = JSON.parse(e.data)
-        console.log({ code, data, message });
+        // console.log({ code, data, message });
 //         var a = {
 //     "code": 903,
 //     "data": {
@@ -170,40 +178,51 @@ export default {
 //     },
 //     "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.getList()
         // }
@@ -274,8 +293,12 @@ export default {
     //获取任务
     getList(){
         var params = {
+            ...this.searchFiled2,
+            ...this.searchOption
+        }
+        var params = {
             ...this.queryParams,
-            searchQuery:this.$commonJS.objectToString(this.searchOption || {}),
+            searchQuery:this.$commonJS.objectToString(params),
             orderDTOList:this.sort
         }
         this.$api.queryImportTask(params).then(res => {
@@ -317,6 +340,14 @@ export default {
             }
         })
     },
+    //任务详情
+    details(){
+
+    },
+    //下载附件
+    handleDownload(row){
+
+    }
   },
 };
 </script>

+ 31 - 0
src/views/components/import/task/index.vue

@@ -0,0 +1,31 @@
+
+<template>
+  <div class="height_100">
+    <TaskList :importToId="importToId"></TaskList>
+  </div>
+</template>
+
+<script>
+import TaskList from './components/index.vue'
+export default {
+  components: {
+    TaskList
+  },
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {
+    importToId(){
+        return this.$route.query.importToId
+    }
+  },
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 4 - 4
src/views/patentMining/components/details/components/drawer.vue

@@ -8,7 +8,7 @@
           </el-tabs>
         </el-header>
         <el-main>
-          <component :is='activeName' :id="id" :pathObj="pathObj"></component>
+          <component :is='activeName' :id="id" :processId="processId"></component>
         </el-main>
       </el-container>
     </el-drawer>
@@ -38,7 +38,7 @@ export default {
           path: 'FileMessage'
         },
       ],
-      pathObj:null,
+      processId:null,
     }
   },
   mounted() {
@@ -47,12 +47,12 @@ export default {
   methods: {
     // 打开
     open(data) {
-      this.pathObj=JSON.parse(JSON.stringify(data))
+      this.processId=data.pathId
       this.drawer = true
     },
     // 关闭
     handleClose() {
-      this.pathObj = null
+      this.processId = null
       this.activeName='ExcavateTaskIndex'
       this.drawer = false
     },

+ 12 - 2
src/views/patentMining/components/details/components/projectPath.vue

@@ -199,11 +199,21 @@ export default {
     },
     // 获取文件数量
     getNumber(str, id, type) {
-      return this.numObj[id][type]
+      if(this.numObj[id]){
+        var num = this.numObj[id][type]
+        return num?num:0
+      }
+      return 0
+      
     },
     // 获取背景颜色
     getColor(str,id) {
-      let num=this.numObj[id].taskCount + this.numObj[id].fileCount
+      var num = 0
+      if(this.numObj[id]){
+        var taskCount = this.numObj[id].taskCount
+        var fileCount = this.numObj[id].fileCount
+        num = taskCount + fileCount
+      }
       return num > 0 ? '#5ed325' : 'pink'
     },
     // 打开抽屉弹窗

+ 7 - 12
src/views/patentMining/components/details/index.vue

@@ -3,12 +3,12 @@
   <div class="height_100">
       <el-container>
         <el-header class="basic_header">
-            <el-tabs v-model="activeName" type="card"  style="width:100%">
+            <el-tabs v-model="activeName" @tab-click="handleClick" type="card"  style="width:100%">
               <el-tab-pane v-for="item in menu" :key='item.path' :label="item.label" :name="item.path"></el-tab-pane>
             </el-tabs>
         </el-header>
         <el-main>
-            <component :is='activeName' :id="id" @grandson="handleGrandson" :pathObj="pathObj"></component>
+            <component :is='activeName' :id="id" @grandson="handleGrandson" :processId="processId"></component>
         </el-main>
       </el-container>
     </div>
@@ -42,18 +42,10 @@ export default {
           path:'FileMessage'
         },
       ],
-      pathObj:null,
+      processId:null,
     };
   },
   watch: {
-    activeName(val) {
-      if (val != 'FileMessage' || val != 'ExcavateTaskIndex') {
-        this.$nextTick(() => {
-          this.pathObj=null
-        })
-        
-      }
-    },
   },
   computed: {
     id() {
@@ -72,10 +64,13 @@ export default {
         } else {
           this.activeName = 'FileMessage'
         }
-        this.pathObj=val
+        this.processId=val.pathId
       }
     },
     handleClick(tab, event) {
+        this.$nextTick(() => {
+          this.processId=null
+        })
     }
   }
 };

+ 3 - 3
src/views/patentMining/components/dialog/uploadFile.vue

@@ -41,7 +41,7 @@ export default {
   components: {
     examine,
   },
-  props: ['pathObj'],
+  props: ['processId'],
   data() {
     return {
       dialogVisible: false,
@@ -105,8 +105,8 @@ export default {
         }
         this.title = '编辑文件'
       } else {
-        if (this.pathObj) {
-          this.$set(this.form, 'processId', this.pathObj.pathId)
+        if (this.processId) {
+          this.$set(this.form, 'processId', this.processId)
         }
         this.title = '上传文件'
       }

+ 5 - 14
src/views/patentMining/components/excavateTask/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="height_100">
-    <Table :type="1" :id="id" :obj="obj"></Table>
+    <Table :type="1" :id="id" :processId="processId"></Table>
   </div>
 </template>
 
@@ -9,29 +9,20 @@
 import Table from '@/views/task/components/index.vue'
 
 export default {
-  props:['id','pathObj'],
+  props:['id','processId'],
   components: {
     // excavateTask
     Table,
   },
   data() {
     return {
-      obj: {
-        search: {
-          projectId: this.id?this.id:'',
-          processId: this.pathObj ? this.pathObj.pathId : '',
-        },
-      },
     }
   },
   watch: {
-    pathObj(val) {
-      if (val) {
-        this.obj.search.processId = val.pathId
-      }
-    },
   },
-  computed: {},
+  computed: {
+
+  },
   mounted() {
   },
   methods: {

+ 8 - 5
src/views/patentMining/components/fileMessage.vue

@@ -59,7 +59,7 @@
       </el-footer>
     </el-container>
 
-    <uploadFile ref="uploadFile" @isSuccess="isSuccess" :pathObj="pathObj"></uploadFile>
+    <uploadFile ref="uploadFile" @isSuccess="isSuccess" :processId="processId"></uploadFile>
   </div>
 </template>
 
@@ -67,7 +67,7 @@
 import { optionsData } from './mixins/index2'
 import uploadFile from './dialog/uploadFile.vue'
 export default {
-  props: ['id', 'pathObj'],
+  props: ['id', 'processId'],
   mixins: [optionsData],
   components: {
     uploadFile
@@ -126,16 +126,19 @@ export default {
       //排序字段
       sort: [{ "orderBy": "createTime", "orderType": 1 }],
       // 复制传过来的参数
-      pathObjCopy:JSON.parse(JSON.stringify(this.pathObj)),
+      pathObjCopy:this.processId,
     }
   },
   watch: {
-    pathObjCopy(val) {
+    processId(val) {
       if (val) {
+        this.pathObjCopy = val
         this.getList()
       }
     },
   },
+  computed:{
+  },
   async mounted() {
     // 获取table栏位
     this.columnList = await this.$commonJS.getCustomField('patentDigProjectFiles')
@@ -170,7 +173,7 @@ export default {
     // 获取数据
     async getList() {
       let searchOption = {
-        processId: this.pathObjCopy?this.pathObjCopy.pathId : '',//流程节点id
+        processId: this.pathObjCopy,//流程节点id
         projectId: this.id,//固有检索
         ...this.searchOption
       }

+ 1 - 1
src/views/project/patentCollection/index.vue

@@ -186,7 +186,7 @@ export default {
       //总数
       total: 0,
       //排序
-      sort: [{ "orderBy": "createTime", "orderType": 1 }],
+      sort: [],
       //选择的专利集合
       patentNoList: [],
       //加载

+ 23 - 11
src/views/task/components/index.vue

@@ -5,8 +5,8 @@
         <div>
           <mySearch :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
         </div>
-        <div style="display:flex;margin-right:10px">
-          <el-button v-if="type == 1" type="primary" size="small" @click="createTask">创建任务</el-button>
+        <div>
+          <el-button class="margin-right_10" type="primary" size="small" @click="createTask">创建任务</el-button>
         </div>
       </el-header>
       <el-main class="height_100">
@@ -84,7 +84,13 @@ import handleTask2 from '@/views/patentMining/components/dialog/handleTask2.vue'
 export default {
   mixins: [column, optionsData, taskPatentMining],
   // type区分是从哪里进入
-  props: ['type', 'id', 'obj'],
+  props: {
+    type:{
+      default:1
+    },
+    id:'',
+    processId:''
+  },
   components: {
     auditRecords,
     createTask,
@@ -101,6 +107,10 @@ export default {
         size: 10,
         total: 0,
       },
+      searchFiled2:{
+        projectId:this.id,
+        processId:this.processId
+      },
       // 检索字段
       searchFiled: [],
       // 检索字符串
@@ -132,12 +142,14 @@ export default {
     }
   },
   watch: {
-    'obj.search': {  
-      handler(newVal, oldVal) {  
-        this.getList() 
-      },  
-      deep: true, // 设置为deep,可以监听到obj.search对象内部属性的变化  
-    },  
+    processId(val){
+      if(val){
+        this.searchFiled2.processId = val
+        this.tableData = []
+        this.getList()
+      }
+      
+    }
   },
   computed: {
     ...mapGetters(['webSocket', 'userinfo']),
@@ -166,7 +178,7 @@ export default {
     // 请求数据
     getList() {
       let searchOption = {
-        ...this.obj.search,//固有检索字段
+        ...this.searchFiled2,//固有检索字段
         ...this.searchOption
       }
       let params = {
@@ -174,7 +186,7 @@ export default {
         searchQuery: this.$commonJS.objectToString(searchOption),//检索条件
         orderDTOList: this.sort,//排序信息
       }
-
+      
       this.$api.queryProjectTask(params).then(response => {
         if (response.code == 200) {
           this.tableData = response.data.data

+ 4 - 3
src/views/task/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <Table></Table>
+    <Table :id="id" ></Table>
   </div>
 </template>
 
@@ -16,8 +16,9 @@ export default {
     }
   },
   computed: {
-    type(){},
-    id(){},
+    id(){
+      return this.$route.query.projectId
+    },
   },
   mounted() {