2 Commits f3932b54cd ... 9b7ae49680

Author SHA1 Message Date
  liangluogis 9b7ae49680 调整 1 year ago
  liangluogis f9f3bc0fa4 录音下载调整 1 year ago

+ 9 - 0
src/api/xjWorkSiteCheckApi.js

@@ -97,6 +97,15 @@ export function getFileAudio(token, path) {
   })
 }
 
+// 工地监护 => 获取音频
+export function getFileAudio2(token, path) {
+  return request({
+    url: '/callfile/calllist'+ path,
+    method: 'get',
+    responseType: 'blob'
+  })
+}
+
 // 工地派工审核 => 获取巡检组、巡检人员
 export function queryGroupUserMap(params) {
   return request({

+ 2 - 19
src/views/currentSystem/waterHotline/statisticalReport/callLogStatistics.vue

@@ -86,7 +86,7 @@ import { IP } from '@/utils/request'
 import { client } from '@/utils/index'
 import { getCallRecord } from '@/api/hotline'
 import { parseTime } from '@/utils/index'
-import { getFileAudio } from '@/api/xjWorkSiteCheckApi'
+import { getFileAudio2 } from '@/api/xjWorkSiteCheckApi'
 export default {
   components: { TableItem },
   data() {
@@ -309,24 +309,7 @@ export default {
         this.$message.info('暂无音频')
         return
       }
-      // getFileAudio(
-      //   this.$store.state.user.token,
-      //   this.multipleSelection[0].recordFile).then(src => {
-      //   console.log('路径:' + src)
-      //   var reader = new FileReader()
-      //   reader.readAsDataURL(src)
-      //   reader.onload = (e) => {
-      //     const a = document.createElement('a')
-      //     a.download = '录音文件'
-      //     // 后端设置的文件名称在res.headers的 "content-disposition": "form-data; name=\"attachment\"; filename=\"20181211191944.zip\"",
-      //     a.href = e.target.result
-      //     console.log(a.href,'href')
-      //     document.body.appendChild(a)
-      //     a.click()
-      //     document.body.removeChild(a)
-      //   }
-      // })
-      getFileAudio(
+      getFileAudio2(
         this.$store.state.user.token,
         this.multipleSelection[0].recordFile).then(src => {
           console.log(src,'src')

+ 4 - 0
vue.config.js

@@ -126,6 +126,10 @@ module.exports = {
         'staticPub': resolve('public')
       }
     },
+    output:{
+      filename:'js/[name].[hash:8].js',
+      chunkFilename:'js/[name].[hash:8].js',
+    },
     // devtool: '#eval-source-map',
     plugins: [// 压缩代码
       new CompressionWebpackPlugin(