Просмотр исходного кода

Merge branch 'product' into modelDesign

zhuliu 3 недель назад
Родитель
Сommit
1934cf2eb1

+ 24 - 2
src/api/newApi/file.js

@@ -1,8 +1,30 @@
 import axios from "@/utils/axios";
+import {showModal} from '@/utils/model/progress/index'
 // 新系统文件新接口
 export default {
-  uploadFile(data){
-    return axios.post('/fileManager/uploadNormalFile', data)
+  uploadFile(data,uploadProgress){
+    let ProgressModalControl = null
+    return axios.post('/fileManager/uploadNormalFile', data,{
+      onUploadProgress: progressEvent => { 
+        if (progressEvent.total) {  
+          const percent = Math.round((progressEvent.loaded * 100) / progressEvent.total);  
+          if (typeof uploadProgress === 'function') {  
+            uploadProgress(percent);  
+          }else{
+            if(percent == 0){
+              ProgressModalControl = showModal()
+            }
+            if(ProgressModalControl){
+              ProgressModalControl.update(percent)
+              if(percent == 100){
+                ProgressModalControl.hide()
+              }
+            }
+            
+          }
+        }  
+      } 
+    })
   },
   downLoadFile(params, prop = {}) {
     return axios.get('/fileManager/downloadFile', {params},prop)

+ 7 - 0
src/api/newApi/report.js

@@ -876,4 +876,11 @@ updateSupplyEvidence(data) {
   queryStatuesVOS(data) {
     return axios.post("/xiaoshi/invalidStatutes/queryStatuesVOS", data);
   },
+  /**
+    * 官方无效-韶音
+    * 导出报告清单
+  */
+  exportReportList(data) {
+    return axios.post("/xiaoshi/reportExport/exportReportList", data,{responseType:'blob'});
+  },
 };

+ 3 - 2
src/utils/axios.js

@@ -62,11 +62,12 @@ _axios.interceptors.response.use(
       loadingInstance.close()
     }
     let { code, message } = response.data
-    if(code != 0 && !code ){
+    
+    if (code === 200 || config.responseType === 'blob') {
       isRefreshing = false
       return response.data
     }
-    if (code === 200 || config.responseType === 'blob') {
+    if(code != 0 && !code ){
       isRefreshing = false
       return response.data
     }

+ 4 - 1
src/utils/index.js

@@ -22,7 +22,10 @@ export const downLoad = (data, fileName) => {
   element.setAttribute('download', fileName);
   document.body.appendChild(element);
   element.click();
-  document.body.removeChild(element);
+  setTimeout(() => {
+    document.body.removeChild(element);
+    URL.revokeObjectURL(objectUrl);
+  }, 100);
 }
 
 export const getFileName = (type) => {

+ 31 - 0
src/utils/model/progress/index.js

@@ -0,0 +1,31 @@
+import Vue from "vue";
+import ProgressModal from "./index.vue";
+
+// 创建弹窗的构造函数
+const ProgressModalConstructor = Vue.extend(ProgressModal);
+
+// 实例化弹窗
+let modalInstance = null;
+
+/**
+ * 打开弹窗
+ * @param {Object} options - 弹窗配置
+ */
+export function showModal(options = {}) {
+  // 创建实例
+  modalInstance = new ProgressModalConstructor({
+    propsData: {
+      fileName: options.fileName || ""
+    },
+  });
+ 
+  // 手动挂载到 DOM
+  modalInstance.$mount();
+  document.body.appendChild(modalInstance.$el);
+ 
+  // 显示弹窗
+  modalInstance.show();
+ 
+  // 返回实例,以便外部手动关闭
+  return modalInstance;
+}

+ 76 - 0
src/utils/model/progress/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <div class="myProgress_model" v-if="visible">
+    <div class="myProgress_model_content">
+      <el-progress type="circle" :percentage="percentage" text-color="#ffffff" :format="format()"></el-progress>  
+    </div>
+    
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    fileName:{
+        type:String,
+        default:''
+    }
+  },
+  data() {
+    return {
+        percentage:0,
+        visible:false,
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    format(){
+        return ()=>{return "文件上传中... "+ this.percentage + '%'}
+    },
+    show(){
+        this.visible = true
+    },
+    update(percent){
+        this.percentage = percent
+    },
+    hide(){
+        this.visible = false
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.myProgress_model {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 9999;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background: rgba(0,0,0,0.5);
+  .myProgress_model_content{
+    width: 150px;
+    height: 150px;
+    border-radius: 150px;
+    // background: white;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+}
+</style>
+<style lang="scss">
+    .myProgress_model{
+        .myProgress_model_content{
+            .el-progress__text{
+                color: white !important;
+            }
+        }
+    }
+</style>

+ 16 - 3
src/utils/model/upload/index.vue

@@ -44,7 +44,16 @@
                 }}</span>
               </div>
             </myTooltip>
-            <div class="type" v-if="autoUpload">{{ item.guid ? "已上传" : "待上传" }}</div>
+            <div class="type" v-if="autoUpload">
+              <div v-if="item.guid">
+                {{ item.guid ? "已上传" : "待上传" }}
+              </div>
+              <div v-else>
+                上传中... {{ percent }}%
+              </div>
+              
+              
+            </div>
             <div class="icon" @click="onRemove(item, fileList)">
               <i class="el-icon-close"></i>
             </div>
@@ -183,7 +192,8 @@ export default {
       exist2:[],
       showExist:false,
       dialogVisible:false,
-      show : false
+      show : false,
+      percent:''
     };
   },
   watch: {},
@@ -279,7 +289,10 @@ export default {
       let formData = new FormData()
       formData.append('sourceId',this.$constants.sourceId)
       formData.append('files',file.raw)
-      this.$api.uploadFile(formData).then(response=>{
+      this.percent = 0
+      this.$api.uploadFile(formData,(percent)=>{
+        this.percent = percent
+      }).then(response=>{
         if(response.code == 200){
           file.guid = response.data[0]
           file.raw.guid = response.data[0]

+ 29 - 1
src/views/report/components/index.vue

@@ -33,6 +33,7 @@
             </el-dropdown>
             <el-button type="primary" class="margin-left_10 margin-right_10" size="small" @click="showField">显示栏位管理</el-button>
             <el-button v-if="$permission.FunPermissions('xiaoshi/IPREmail')" type="primary" class="margin-right_10" size="small" @click="IPREmail">联系邮箱</el-button>
+            <el-button type="primary" v-if="componentType==2 && $permission.FunPermissions('xiaoshi/exportReportList')" class="margin-right_10" size="small" :loading="exportBtnLoading" @click="exportExcel">导 出</el-button>
           </div>
 
         </div>
@@ -82,6 +83,7 @@ import patentShare from '@/views/components/drawer/Share.vue';
 
 import IPREmailDialog from '../InvalidResponse/components/dialog/IPREmail.vue'
 import handlePersonDialog from './dialog/handlePerson.vue'
+import { formatDate,downLoad } from '@/utils';
 export default {
   components: {
     Table,
@@ -182,7 +184,8 @@ export default {
           label:'被动',
           value:0
         },
-      ]
+      ],
+      exportBtnLoading:false
     };
   },
   watch: {
@@ -290,6 +293,31 @@ export default {
     IPREmail(){
       this.$refs.IPREmailDialog.open()
     },
+    //导出报告成excel
+    exportExcel(){
+      let params = {
+        searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
+        orderDTOList: this.sort,//排序信息
+      }
+      params.ifInvalidReport = 0
+      if(this.fixedSearch.reportType){
+        params.ifInvalidReport = 1
+        if(params.searchQuery){
+          params.searchQuery = params.searchQuery + ' and reportType=(' + this.fixedSearch.reportType.join(' OR ') + ')'
+        }else{
+          params.searchQuery ='reportType=(' + this.fixedSearch.reportType.join(' OR ') + ')'
+        }
+      }
+      this.exportBtnLoading = true
+      this.$api.exportReportList(params).then(response=>{
+        this.exportBtnLoading = false
+        let now = formatDate(new Date(),"YYYY-MM-DD")
+        downLoad(response,now + '- 无效案件详情表.xlsx')
+      }).catch(error=>{
+        this.$message.error('导出失败')
+        this.exportBtnLoading = false
+      })
+    },
     //标签页点击
     async tabChange(name){
       var type = Number(name)