Przeglądaj źródła

feat: 退出登录

sunxiao 2 miesięcy temu
rodzic
commit
2e5b713ae5

+ 3 - 0
src/components/CallView/index.vue

@@ -151,6 +151,9 @@ const onVoiceParsed = ({ parsedVoiceContent, id }) => {
           </div>
         </div>
       </el-descriptions-item>
+      <el-descriptions-item label="通话ID" label-class-name="custom-label" class-name="custom-colums">
+        {{ callDetails.sessionId }}
+      </el-descriptions-item>
     </el-descriptions>
     <custom-row-item label="备注">
       <div class="space-x-[14px] flex items-center">

+ 4 - 1
src/components/ResetPwdDialog/index.vue

@@ -45,7 +45,10 @@ const submit = () => {
     if (valid) {
       updateUserPwd(user.oldPassword, user.newPassword).then(response => {
         proxy.$modal.msgSuccess("修改成功");
-        userStore.avatar = res.data;
+        // userStore.avatar = res.data;
+        user.oldPassword = undefined;
+        user.newPassword = undefined;
+        user.confirmPassword = undefined;
       });
     }
   });

+ 17 - 2
src/layout/components/HeaderGroup/index.vue

@@ -45,8 +45,8 @@ const handlePopoverItem = async ({ state, label }) => {
       voiceStore.HS_CTI_INSTANCE(data.outId);
       setTimeout(async () => {
         await voiceStore.getAgentStatus();
-        console.log( "坐席状态", voiceStore.AGENTSTATUS );
-        console.log( "系统状态", voiceStore.HSCTIERRORCODE );
+        console.log( "坐席状态", voiceStore.AGENTSTATUS );
+        console.log( "系统状态", voiceStore.HSCTIERRORCODE );
         // if ( !([100001, 100002].includes( Number(voiceStore.HSCTIERRORCODE)) ) ) {
         if ( voiceStore.AGENTSTATUS != 0 ) {
           state ? await voiceStore.setIdle() : await voiceStore.setBusy();
@@ -55,6 +55,9 @@ const handlePopoverItem = async ({ state, label }) => {
       }, 3000);
     })
   } else {
+    // if () {
+      
+    // }
     state ? await voiceStore.setIdle() : await voiceStore.setBusy();
     proxy.$modal[state ? 'msgSuccess' : 'msgWarning']('当前坐席状态: ' + label);
   }
@@ -85,6 +88,18 @@ const logout = () => {
     type: 'warning'
   }).then(async () => {
     localStorage.removeItem('VOICE_STATUS')
+  /**
+     * HSCTIERRORCODE :
+     * 100001: SDK 状态不可用,CTIStatus 的状态为 Terminated
+     * 100002: 获取坐席媒体权限失败
+     * 
+     * AGENTSTATUS : 
+     * 0 未登录 1 置忙 2 置闲
+     * */ 
+     voiceStore.getAgentStatus();
+      console.log( "退出 坐席状态", voiceStore.AGENTSTATUS );
+      console.log( "退出 系统状态", voiceStore.HSCTIERRORCODE );
+      // && voiceStore.AGENTSTATUS != 0 && !([100001, 100002].includes(Number(voiceStore.HSCTIERRORCODE)))
     if ( voiceStore.isAuthPane ) {
       await voiceStore.unInit();
     }

+ 0 - 1
src/layout/index.vue

@@ -71,7 +71,6 @@ onMounted(() => {
       if (!sdkRegister && !useVoice.noiceBarVisibleState &&useVoice.AGENTSTATUS !=0) {
         await useVoice.unInit()
         useVoice.HS_CTI_INSTANCE(outId.value);
-        console.log(12)
       }
     }, 2000);
   }

+ 1 - 2
src/store/modules/voice.js

@@ -146,7 +146,6 @@ const useVoiceStore = defineStore('voice', () => {
 
   // 获取坐席状态
   const getAgentStatus = async () => {
-    console.log( "HS_CTI", HS_CTI );
     const res = await HS_CTI.getAgentStatus();
     AGENTSTATUS.value = res.data;
   }
@@ -167,7 +166,7 @@ const useVoiceStore = defineStore('voice', () => {
   // 卸载实例
   const unInit = async () => {
     await getAgentStatus();
-    AGENTSTATUS.value != 0 && await HS_CTI.unInit()
+    AGENTSTATUS.value != 0 && await HS_CTI.unInit();
   }
 
   // 下面开始事件监听

+ 12 - 7
src/views/voice/call/index.vue

@@ -4,6 +4,7 @@ import SearchItemWrapper from '@/components/SearchItemWrapper';
 import AudioPlayer from '@/components/AudioPlayer';
 import useTableHeight from '@/composables/useTableHeight';
 import CallView from '@/components/CallView';
+import dayjs from 'dayjs';
 
 const { proxy } = getCurrentInstance();
 const { tableContainer, tableMaxHeight } = useTableHeight();
@@ -75,14 +76,18 @@ const handleBatchDownload = () => {
   if ( !timeBegin ) {
     return proxy.$modal.msgError("请选择通话发起时间");
   }
+  const now = dayjs();
+  const formattedDateTime = now.format('YYYYMMDDHHmmss');
+  const milliseconds = now.millisecond();
+  const fullFormattedString = `jmsyy${formattedDateTime}${milliseconds}`;
   proxy.getDownload("/business/record/downloadBatchByCondition", {
     ...queryParams.value, timeBeginReq: timeBegin, timeEndReq: timeEnd
-  }, `${new Date().getTime()}.zip`);
+  }, `${fullFormattedString}.zip`);
 }
 
 // 单独下载
-const handleDownload = ({ id }) => {
-  proxy.getDownload("/business/record/downloadById", { id }, `${new Date().getTime()}.wav`);
+const handleDownload = ({ id, sessionId }) => {
+  proxy.getDownload("/business/record/downloadById", { id }, `${sessionId}.wav`);
 }
 
 const getList = () => {
@@ -191,7 +196,7 @@ onMounted(() => {
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="sessionId" label="通话ID" align="center" width="150" />
+          <el-table-column prop="sessionId" label="通话ID" align="center" width="200" />
           <el-table-column prop="timeBegin" label="通话发起时间" align="center" width="180" />
           <el-table-column prop="timeEnd" label="通话结束时间" align="center" width="180" />
           <el-table-column prop="times" label="通话时长" align="center" />
@@ -202,8 +207,8 @@ onMounted(() => {
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="serviceCategoryText" label="服务类型" align="center" width="120"/>
-          <el-table-column prop="userName" label="客服名称" align="center" />
+          <el-table-column prop="serviceCategoryText" label="服务类型" align="center" width="140"/>
+          <el-table-column prop="userName" label="客服名称" align="center" width="140"/>
           <el-table-column prop="handle" label="操作" align="center" fixed="right" width="150">
             <template #default="scope">
               <div class="flex justify-center space-x-[20px]">
@@ -224,7 +229,7 @@ onMounted(() => {
       direction="rtl"
       :before-close="handleClose"
       class="voice-drawer"
-      size="800"
+      size="900"
     >
       <div>
         <CallView :data="callDetails" noInit @on-end="handleVoiceParsed" v-model="isTransitionVoiceStatus"></CallView>