Selaa lähdekoodia

feat: 问题修改

sunxiao 3 kuukautta sitten
vanhempi
commit
96eba03292

+ 8 - 1
src/components/AudioPlayer/index.vue

@@ -1,10 +1,16 @@
 <script setup>
 import { ElMessage } from 'element-plus';
 
+const emit = defineEmits(['loadDone']);
+
 const props = defineProps({
   audioUrl: {
     type: String,
     default: ''
+  },
+  id: {
+    type: Number,
+    default: ''
   }
 })
 
@@ -18,7 +24,7 @@ const durationTime = ref("00:00");
 const duration = ref(0);
 const currentProgress = ref(0);
 
-watch(() => props.audioUrl, (val) => {
+watch(() => props.audioUrl, () => {
   audioIsPlay.value = true;
   currentProgress.value = 0;
 
@@ -95,6 +101,7 @@ const calculateDuration = () => {
     myVid.oncanplay = () => {
       duration.value = myVid.duration;
       durationTime.value = transTime(myVid.duration);
+      emit('loadDone', {durationTime: durationTime.value, id: props.id});
     };
     myVid.volume = 1;
   }

+ 0 - 1
src/layout/components/HeaderGroup/TelCallBoard.vue

@@ -101,7 +101,6 @@ const handleCleanNums = () => {
             <img src="@/assets/images/header/icon-call-on.svg" alt=""  class="w-[50px] h-[50px] cursor-pointer" @click="handleMakingCall">
           </div>
         </div>
-
       </el-popover>
 
       <div class="line"></div>

+ 6 - 6
src/store/modules/voice.js

@@ -52,9 +52,10 @@ const useVoiceStore = defineStore('voice', () => {
     noiceBarVisibleState.value = false;
     noiceBoxVisibleState.value = false;
     setTimeout(() => {
+      isMakingCall.value = false;
       callAnswered.value = false;
       callDialing.value = false;
-    }, 1500)
+    }, 2000)
     // timer.resetTimer();
   }
 
@@ -74,7 +75,6 @@ const useVoiceStore = defineStore('voice', () => {
       })
     }
 
-
     isMakingCall.value = true;
 
     callAnswered.value = true;
@@ -85,7 +85,6 @@ const useVoiceStore = defineStore('voice', () => {
 
     telephoneNumber.value = phoneNum;
 
-
     // noiceBarVisibleState.value = true;
   }
 
@@ -163,8 +162,6 @@ const useVoiceStore = defineStore('voice', () => {
       console.log( "-----------------------" );
       console.log( "-----------------------" );
 
-
-
       // 销毁实例调用签出接口成功后 - 坐席签出
       if ( workStatus === -1 ) {
         ElMessage({
@@ -202,7 +199,10 @@ const useVoiceStore = defineStore('voice', () => {
 
         !isMakingCall.value && (telephoneNumber.value = phone);
 
-        isMakingCall.value = false;
+        if (!isMakingCall.value) {
+          isMakingCall.value = false;
+        }
+        // isMakingCall.value = false;
 
         noiceBarVisibleState.value = true;
 

+ 1 - 1
src/views/voice/analyse/index.vue

@@ -115,7 +115,7 @@ onMounted(() => {
                     <li class="line"></li>
                     <li class="card-label">
                       <span class="text">呼出量</span>
-                      <span class="num">{{ callRecordCountInfo.traditionTotal }}</span>
+                      <span class="num">{{ callRecordCountInfo.traditionOutTotal }}</span>
                     </li>
                     <li class="line"></li>
                     <li class="card-label">

+ 11 - 1
src/views/voice/call/index.vue

@@ -45,6 +45,15 @@ const jumpDetails = ({ id }) => {
   })
 }
 
+// 音频加载完成
+const onAudioLoadDone = ({ durationTime, id }) => {
+  tableData.value.map(item => {
+    if (item.id == id) {
+      item.times = durationTime || ''
+    }
+  })
+}
+
 // 批量下载
 const handleBatchDownload = () => {
   const [timeBegin, timeEnd] = dataPickerValue.value;
@@ -69,6 +78,7 @@ const getList = () => {
     const serviceCategoryEnum = { 0: '人工坐席', 1: '机器人坐席', 2: '机器人转人工' };
     tableData.value = rows.map(item => ({
       ...item,
+      url: item.url + '?timstamp=' + new Date().getTime(),
       typeText: typeEnum[item.type],
       statusText: statusEnum[item.status],
       serviceCategoryText: serviceCategoryEnum[item.serviceCategory]
@@ -164,7 +174,7 @@ onMounted(() => {
           <el-table-column prop="address" label="通话录音" align="center" width="350">
             <template #default="scope">
               <div class="flex justify-center">
-                <AudioPlayer :audioUrl="scope.row.url"></AudioPlayer>
+                <AudioPlayer :audioUrl="scope.row.url" @loadDone="onAudioLoadDone" :id="scope.row.id"></AudioPlayer>
               </div>
             </template>
           </el-table-column>