Browse Source

zzy 图片查看修改

zhiyuan-007 8 months ago
parent
commit
0c601a7068

+ 3 - 3
src/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet.js

@@ -1,11 +1,11 @@
 import {requestInstance, requestInstance_Get} from "@/service";
 
 
-export function getExportFile(){
+export function getExportFile(params){
  return requestInstance_Get({
-  url:'/LogVisualization/ExcelDownload',
+  url:params.url,
   params:{
-
+   ...params
   },
  })
 }

+ 1 - 2
src/view/login/Login.vue

@@ -28,7 +28,7 @@ export default {
   },
   mounted(){
     let _this = this;
-    //window.location.href='https://datamidplat.zjw.sh.cegn.cn:2011/data-midplat-home/#/login';
+    window.location.href='https://datamidplat.zjw.sh.cegn.cn:2011/data-midplat-home/#/login';
     this.timer = setInterval(()=>{
       _this.dateTime = new Date();
     },1000)
@@ -46,7 +46,6 @@ export default {
       let weeks = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六",];
       let week = weeks[wk];
       return year + "年" + month + "月" + day + "日" + " " + hours + ":" + minutes + "  " +week;
-
     }
   },
   beforeCreate() {

+ 31 - 2
src/view/other/c-views/data-handle/data-quelity-check/qiality-check-report/QualityCheckReportHome.vue

@@ -63,6 +63,7 @@ import {baseUrl} from "@/service/config";
 import {useRootStore} from "@/stores/useStore";
 import {elAlert, showMessage} from "@/unit/element-ui/tip";
 import {useActiveGetTableData} from "@/unit/use-method/usePagination";
+import {getExportFile} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
 
 export default {
   name: "QualityCheckReportHome",
@@ -89,7 +90,21 @@ export default {
              const data = res.msg[0].Rows
              if (data.length > 0){
                let paths = data.join(',')
-               window.location.href = baseUrl + "/ptjkInterface/exportTemplateWords?appkey="+useRootStore().userInfo.ptjk_userkeycode+"&paths=" + paths;
+               //window.location.href = baseUrl + "/ptjkInterface/exportTemplateWords?appkey="+useRootStore().userInfo.ptjk_userkeycode+"&paths=" + paths;
+               getExportFile({
+                 url:"/ptjkInterface/exportTemplateWords",
+                 paths:paths
+               }).then(response =>{
+                 debugger
+                 const url = window.URL.createObjectURL(new Blob([response]));
+                 const link = document.createElement('a');
+                 link.href = url;
+                 link.setAttribute('download', 'file.xls'); // 替换为实际的文件名
+                 document.body.appendChild(link);
+                 link.click();
+                 link.remove();
+
+               })
              }
            }catch{
              showMessage({
@@ -101,7 +116,21 @@ export default {
       }
     }
     function singleExport(uuid){
-      window.location.href = baseUrl + "/ptjkInterface/exportTemplateWord?appkey="+useRootStore().userInfo.ptjk_userkeycode+"&UUID=" + uuid;
+      //window.location.href = baseUrl + "/ptjkInterface/exportTemplateWord?appkey="+useRootStore().userInfo.ptjk_userkeycode+"&UUID=" + uuid;
+      getExportFile({
+        url:"/ptjkInterface/exportTemplateWord",
+        UUID:uuid
+      }).then(response =>{
+        debugger
+        const url = window.URL.createObjectURL(new Blob([response]));
+        const link = document.createElement('a');
+        link.href = url;
+        link.setAttribute('download', 'file.xls'); // 替换为实际的文件名
+        document.body.appendChild(link);
+        link.click();
+        link.remove();
+
+      })
     }
     const layoutRef = ref(null)
     function getReportType(value) {

+ 17 - 2
src/view/other/c-views/data-watch/data-sync-handle-watch/data-sync-handle-table/DataSyncHandleTableHome.vue

@@ -85,7 +85,10 @@ import MyTable from "@/components/common/MyTable.vue";
 import {useActiveGetTableData, usePagination} from "@/unit/use-method/usePagination";
 import {dataSyncHandleSyncTabTableHeader} from "@/data/all-table-header";
 import ElePagination from "@/components/common/ElePagination.vue";
-import {getDataSyncHandleWatchSheet} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
+import {
+  getDataSyncHandleWatchSheet,
+  getExportFile
+} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
 import {baseUrl, baseUrl_Address, withCredentials} from "@/service/config";
 import {useRootStore} from "@/stores/useStore";
 import {UserInfo} from "@/unit/UserInfo";
@@ -114,8 +117,20 @@ export default {
     useActiveGetTableData(getSyncTableData)
     function clickOperationBtn(item) {
       if (item.type === '导出'){
-        window.location.href = baseUrl + "/LogVisualization/ExcelDownload?appkey="+useRootStore().userInfo.ptjk_userkeycode
+        getExportFile({
+          url:"/LogVisualization/ExcelDownload"
+        }).then(response =>{
+          debugger
+          const url = window.URL.createObjectURL(new Blob([response]));
+          const link = document.createElement('a');
+          link.href = url;
+          link.setAttribute('download', 'file.xls'); // 替换为实际的文件名
+          document.body.appendChild(link);
+          link.click();
+          link.remove();
 
+        })
+        //window.location.href = baseUrl + "/LogVisualization/ExcelDownload?appkey="+useRootStore().userInfo.ptjk_userkeycode
       }
     }
     function getSyncTableData() {

+ 2 - 2
vite.config.js

@@ -16,8 +16,8 @@ export default defineConfig({
       // 代理所有 /api 的请求,该求情将被代理到 target 中
       '/api': {
         // 代理请求之后的请求地址(你的真实接口地址)
-        //target: 'https://datamidplat.zjw.sh.cegn.cn:2011/data-business-prod/',
-        target: 'http://localhost:9250',
+        target: 'https://datamidplat.zjw.sh.cegn.cn:2011/data-business-prod/',
+        //target: 'http://localhost:9250',
         secure: false,
         ws: true,
         // 跨域