zhuliu 7 meses atrás
pai
commit
380497b429

+ 9 - 0
src/utils/constants.js

@@ -252,4 +252,13 @@ updateCycle:[
     value:'year'
   },
 ],
+
+taskStatus:{
+  1: '审核中',
+  2: '处理中',
+  3: '已完成',
+  4: '缺少资料',
+  5: '取消',
+  6: '确认结果中',
+}
 }

+ 5 - 1
src/utils/model/index.js

@@ -26,6 +26,9 @@ import myTabsItem from './tabs/tabsItem'
 //查新检索发明点弹窗
 import inventionPointDialog from '@/views/noveltySearch/components/dialog/inventionPoint/inventionPoint.vue'
 
+//可监视的dom
+import observerDom from './observerDom/index.vue'
+
 var models = {
   myCustomSvg,
   myTree,
@@ -50,7 +53,8 @@ var models = {
   //tab
   myTabs,
   myTabsItem,
-  inventionPointDialog
+  inventionPointDialog,
+  observerDom
 }
 export default {
   install(Vue) {

+ 102 - 0
src/utils/model/observerDom/index.vue

@@ -0,0 +1,102 @@
+<template>
+    <div style="width:100%;height:100%" ref="observerDom">
+        <div v-if="show" v-html="html" v-bind="$attrs" v-on='$listeners' style="width:100%;height:100%"></div> 
+        <div v-else style="width:100%;height:100%" v-loading="true"></div>
+    </div>
+    
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    params:{
+        type:Object,
+        default:()=>{
+            return {}
+        }
+    },
+    url:{
+        type:String,
+        default:''
+    },
+    isObserver:{
+        type:Boolean,
+        default:true
+    },
+    fun:{
+        type:Function,
+        default:null
+    }
+  },
+  data() {
+    return {
+        show:true,
+        html:''
+    };
+  },
+  watch: {
+  },
+  computed: {},
+  created() {},
+  mounted() {
+    this.init()
+  },
+  methods: {
+    init(){
+        if(!this.url && !this.fun){
+            return
+        }
+        if(!this.isObserver){
+            this.getHtml()
+            return
+        }
+        var that = this
+        // 创建一个 Intersection Observer 实例
+        let observer = new IntersectionObserver((entries, observer) => {
+            entries.forEach(entry => {
+                if (entry.isIntersecting) {
+                    // 当元素进入视口时执行的逻辑
+                    that.getHtml()
+                    // 可以在这里执行懒加载、动画触发等操作
+                    observer.unobserve(entry.target); // 如果只需要触发一次,可以取消观察
+                }
+            });
+        }, {
+            root: null, // null 表示视口
+            rootMargin: '0px',
+            threshold: 0.3 // 当元素 10% 进入视口时触发
+        });
+
+        // 选择需要观察的元素
+        const elements = this.$refs.observerDom;
+        observer.observe(elements);
+    },
+    async getHtml(){
+        if(!this.url && !this.fun){
+            return
+        }
+        this.show = false
+        if(this.url){
+            this.$api[this.url](this.params).then(async response=>{
+                if(response.code == 200){
+                    if(this.fun){
+                        this.html = await this.fun(response.data)
+                    }else{
+                        this.html = response.data
+                    }
+                    this.show = true
+                }
+            }).catch(error=>{
+                this.show = true
+            })
+            return
+        }
+        this.html = await this.fun()
+
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>'

+ 82 - 28
src/views/patentMining/components/fileMessage.vue

@@ -30,16 +30,13 @@
             :render-header="$commonJS.renderHeaderMethods" :label="item.name" sortable align="center">
             <template slot-scope="scope">
               <div v-if="['name'].includes(item.value)">
-                <!-- <el-link @click="handleItem(scope.row, item.value)"> -->
                 <span v-html="$commonJS.getColumnData(scope.row, item)"></span>
-                <!-- </el-link> -->
               </div>
               <div v-else-if="['ifFinal'].includes(item.value)"
                 v-html="$commonJS.getColumnData(scope.row, item, null, { data: ifFinal })"></div>
-              <!-- <div v-else-if="['type'].includes(item.value)"
-                v-html="$commonJS.getColumnData(scope.row, item, null, { data: taskType })"></div>
-              <div v-else-if="['status'].includes(item.value)"
-                v-html="$commonJS.getColumnData(scope.row, item, null, { data: taskStatus })"></div> -->
+              <div v-else-if="['statusOrResult'].includes(item.value)">
+                <observerDom url="getExamineHistory" :params="{fileGuid:scope.row.fileGuid,ifGetLast:true}" :fun="getData"></observerDom>
+              </div>
               <div v-else v-html="$commonJS.getColumnData(scope.row, item)"></div>
             </template>
           </el-table-column>
@@ -52,6 +49,7 @@
                   预览
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item command="1">下载</el-dropdown-item>
+                    <el-dropdown-item command="examineHistory">审核历史</el-dropdown-item>
                     <el-dropdown-item command="2" divided style="color: red;" v-if="scope.row.fileGuid && scope.row.source">删除</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
@@ -68,6 +66,9 @@
     </el-container>
 
     <uploadFile ref="uploadFile" @isSuccess="isSuccess" :processId="processId"></uploadFile>
+
+    <!-- 审核历史 -->
+    <examineHistoryDialog ref="examineHistoryDialog"></examineHistoryDialog>
   </div>
 </template>
 
@@ -75,11 +76,14 @@
 import { optionsData } from './mixins/index2'
 import uploadFile from './dialog/uploadFile.vue'
 import {File} from '@/utils/model/menu/mixins'
+
+import examineHistoryDialog from '@/views/report/components/reportFile/examineHistoryDialog.vue'
 export default {
   props: ['id', 'processId'],
   mixins: [optionsData,File],
   components: {
-    uploadFile
+    uploadFile,
+    examineHistoryDialog
   },
   data() {
     return {
@@ -92,36 +96,69 @@ export default {
       // table栏位信息
       columnList: [
         {
-          name: "文件流程",
-          type: "String",
-          value: "path",
+            "name": "文件名称",
+            "type": "String",
+            "value": "name",
+            "field": "name",
+            "ifShow": true,
+            "ifHidden": false,
+            "ifSort": true
         },
         {
-          name: "文件上传人",
-          type: "Integer",
-          value: "createName",
+            "name": "状态/结果",
+            "type": "String",
+            "value": "statusOrResult",
+            "field": "statusOrResult",
+            "ifSort": false
         },
         {
-          name: "文件上传时间",
-          type: "DateTime",
-          value: "createTime",
+            "name": "流程节点",
+            "type": "String",
+            "value": "processName",
+            "field": "processName",
+            "ifShow": true,
+            "ifHidden": true,
+            "defaultHidden": true,
+            "ifSort": true
         },
         {
-          name: "文件类型",
-          type: "String",
-          value: "type",
+            "name": "最终文件",
+            "type": "Boolean",
+            "value": "ifFinal",
+            "field": "ifFinal",
+            "ifShow": true,
+            "ifHidden": true,
+            "defaultHidden": true,
+            "ifSort": true
         },
         {
-          name: "是否最终文件",
-          type: "DateTime",
-          value: "endFile",
+            "name": "描述",
+            "type": "String",
+            "value": "description",
+            "field": "description",
+            "ifShow": true,
+            "ifHidden": false,
+            "ifSort": true
         },
         {
-          name: "说明",
-          type: "DateTime",
-          value: "description",
+            "name": "创建人",
+            "type": "String",
+            "value": "createName",
+            "field": "createName",
+            "ifShow": true,
+            "ifHidden": false,
+            "ifSort": true
         },
-      ],
+        {
+            "name": "创建时间",
+            "type": "DateTime",
+            "value": "createTime",
+            "field": "createTime",
+            "ifShow": true,
+            "ifHidden": false,
+            "ifSort": true
+        }
+    ],
       // 分页信息
       queryParams: {
         current: 1,
@@ -150,13 +187,28 @@ export default {
   },
   async mounted() {
     // 获取table栏位
-    this.columnList = await this.$commonJS.getCustomField('patentDigProjectFiles')
+    // this.columnList = await this.$commonJS.getCustomField('patentDigProjectFiles')
     // 获取栏位
     // await this.getColumn()
     // 获取数据
     await this.getList()
   },
   methods: {
+    getData(data){
+      if(!data || data.length == 0){
+        return ''
+      }
+      var message = data[0]
+      if(message['status'] == 3){
+        return message.handleResult
+      }
+      if(message['status'] == 2){
+        return '审核中'
+      }
+      if(message['status'] == 5){
+        return '取消审核'
+      }
+    },
     // 新增/更新文件列表成功
     isSuccess(val) {
       this.getList()
@@ -278,7 +330,9 @@ export default {
         case '2'://删除
           this.handleDeletes(row)
           break;
-      
+        case 'examineHistory'://审核历史
+          this.$refs.examineHistoryDialog.open(row.fileGuid)
+          break;
         default:
           break;
       }

+ 24 - 0
src/views/report/components/reportFile/reportFileTable.vue

@@ -36,6 +36,9 @@
                   <span v-html="$commonJS.getColumnData(scope.row, item)"></span>
                 </el-tooltip>
               </div>
+              <div v-else-if="['statusOrResult'].includes(item.value)">
+                <observerDom url="getExamineHistory" :params="{fileGuid:scope.row.fileGuid,ifGetLast:true}" :fun="getData"></observerDom>
+              </div>
               <div v-else v-html="$commonJS.getColumnData(scope.row, item)"></div>
             </template>
           </el-table-column>
@@ -133,6 +136,12 @@ export default {
           value: "type",
           noSort:true
         },
+        {
+          name: "状态/结果",
+          type: "String",
+          value: "statusOrResult",
+          noSort:true
+        },
         // {
         //   name: "所属项目",
         //   type: "String",
@@ -192,6 +201,21 @@ export default {
     this.getList()
   },
   methods: {
+    getData(data){
+      if(!data || data.length == 0){
+        return ''
+      }
+      var message = data[0]
+      if(message['status'] == 3){
+        return message.handleResult
+      }
+      if(message['status'] == 2){
+        return '审核中'
+      }
+      if(message['status'] == 5){
+        return '取消审核'
+      }
+    },
     init(){
       this.queryParams.current = 1
       this.getList()