qinzhipeng_v 5 years ago
parent
commit
b043de3602
4 changed files with 29 additions and 21 deletions
  1. 5 5
      src/apiConfig/api.js
  2. 2 2
      src/apiConfig/mock.js
  3. 2 2
      src/apiConfig/virtualDevices.js
  4. 20 12
      src/views/Platform/useCasePage.vue

+ 5 - 5
src/apiConfig/api.js

@@ -1,10 +1,10 @@
 /*eslint-disable*/   //规避eslint的检查,如没有eslint可不写
-// export const mockUrl = 'http://10.179.24.176:8980' // 线下
-export const mockUrl = 'http://10.179.24.123:8980' // 线上
+export const mockUrl = 'http://10.179.24.176:8980' // 线下
+// export const mockUrl = 'http://10.179.24.123:8980' // 线上
 
-// export const mockUrl = 'http://172.23.164.60:8980' // 舒宁本地
+// export const mockUrl = 'http://172.23.162.226:8980' // 舒宁本地
 
 export const qualityUrl = 'http://10.179.209.19:8898' // 质量度量
 
-// export const HMvehicleUrl = 'http://10.96.113.197:9999' // 电单车 线下
-export const HMvehicleUrl = 'http://10.179.91.236:9999' // 电单车 线上
+export const HMvehicleUrl = 'http://10.96.113.197:9999' // 电单车 线下
+// export const HMvehicleUrl = 'http://10.179.91.236:9999' // 电单车 线上

+ 2 - 2
src/apiConfig/mock.js

@@ -1,4 +1,4 @@
 /*eslint-disable*/   //规避eslint的检查,如没有eslint可不写
-// export const mockUrl = 'http://10.179.88.110:8089' // stable
-export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
+export const mockUrl = 'http://10.179.88.110:8089' // stable
+// export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
 // export const mockUrl = 'http://10.179.101.226:8089' // test

+ 2 - 2
src/apiConfig/virtualDevices.js

@@ -1,3 +1,3 @@
 /*eslint-disable*/ //规避eslint的检查,如没有eslint可不写
-export const mockUrl = 'http://10.179.91.236:9999/virtual-devices' // 线上
-// export const mockUrl = 'http://10.96.113.197:9999/virtual-devices' // 线下
+// export const mockUrl = 'http://10.179.91.236:9999/virtual-devices' // 线上
+export const mockUrl = 'http://10.96.113.197:9999/virtual-devices' // 线下

+ 20 - 12
src/views/Platform/useCasePage.vue

@@ -563,18 +563,26 @@ export default {
         responseType: 'blob' // 表明返回服务器返回的数据类型
       })
         .then((res) => {
-          const content = res
-          const blob = new Blob([content])
-          if ('download' in document.createElement('a')) { // 非IE下载
-            const elink = document.createElement('a')
-            elink.download = '导出信息.xls'
-            elink.style.display = 'none'
-            elink.href = URL.createObjectURL(blob)
-            document.body.appendChild(elink)
-            elink.click()
-            URL.revokeObjectURL(elink.href) // 释放URL 对象
-            document.body.removeChild(elink)
-          }
+          const aLink = document.createElement('a')
+          const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
+          aLink.href = URL.createObjectURL(blob)
+          aLink.download = '导出信息.xlsx'
+          // aLink.style.display = 'none'
+          aLink.click()
+          document.body.appendChild(aLink)
+          // document.body.removeChild(aLink)
+
+        //   const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
+        //   if ('download' in document.createElement('a')) { // 非IE下载
+        //     const elink = document.createElement('a')
+        //     elink.download = '导出信息.xls'
+        //     elink.style.display = 'none'
+        //     elink.href = URL.createObjectURL(blob)
+        //     document.body.appendChild(elink)
+        //     elink.click()
+        //     URL.revokeObjectURL(elink.href) // 释放URL 对象
+        //     document.body.removeChild(elink)
+        //   }
         })
       // if (this.startId === '') {
       //   this.$message({ message: '提示,👈请选择目录', type: 'success', duration: 1000, offset: 150 })