sunxiao 2 mesi fa
parent
commit
57154fe906

+ 1 - 1
.env.development

@@ -7,7 +7,7 @@ VITE_APP_ENV = 'development'
 # 管理系统/开发环境
 VITE_APP_BASE_API =  https://pbx.fuxicarbon.com/voiceServe/
 
-VITE_AUDIO_BASE_URL = https://192.168.100.159
+VITE_AUDIO_BASE_URL = https://pbx.fuxicarbon.com/
 
 # VITE_APP_BASE_API =  http://192.168.40.21:8001/
 

+ 1 - 1
.env.production

@@ -8,7 +8,7 @@ VITE_APP_ENV = 'production'
 VITE_APP_BASE_API = '/voiceServe/'
 # VITE_APP_BASE_API =  http://192.168.100.159:8001/
 
-VITE_AUDIO_BASE_URL = https://192.168.100.159
+VITE_AUDIO_BASE_URL = https://pbx.fuxicarbon.com/
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

+ 2 - 2
src/components/CallView/index.vue

@@ -79,7 +79,7 @@ const onDialogCancel = () => {
 
 // 拨打电话
 const onConfirm = () => {
-  voiceStore.onMakingCall("15810954324");
+  voiceStore.onMakingCall(callDetails.value.phone);
 }
 
 // 语音转换文字
@@ -132,7 +132,7 @@ const onVoiceParsed = ({ parsedVoiceContent, id }) => {
             <span>{{ callDetails.phone }}</span>
             <el-popconfirm width="250" icon-color="#626AEF" title="请确认,是否呼叫该电话号码?" @confirm="onConfirm">
               <template #reference>
-                <img src="@/assets/images/workbench/icon-call-square.svg" alt="" class="cursor-pointer">
+                <img src="@/assets/images/workbench/icon-call-square.svg" alt="" class="cursor-pointer" v-if="voiceStore.isAuthPane">
               </template>
               <template #actions="{ confirm, cancel }">
                 <el-button size="small" @click="cancel">否</el-button>

+ 11 - 1
src/layout/index.vue

@@ -11,6 +11,16 @@ import { workbenchApi } from '@/api/voice/workbench';
 const useVoice = useVoiceStore();
 const useUser = useUserStore();
 
+// window.addEventListener('onunload', function (e) {
+//     // 取消事件的默认行为(某些浏览器需要)
+//     e.preventDefault(); 
+
+//     e.returnValue = 'Are you sure you want to leave?';
+
+//     alert('请先关闭工作台')
+//     return 'Are you sure you want to leave?'; // 某些旧版本的浏览器需要这种写法
+// });
+
 onMounted(() => {
   if ( useVoice.isAuthPane ) {
     workbenchApi.getSeatsByUser({ userId: useUser.id }).then(({ data }) => {
@@ -22,7 +32,7 @@ onMounted(() => {
         } catch(error) {
           console.log(error);
         }
-      }, 1000);
+      }, 3000);
     })
   }
 })

+ 9 - 4
src/store/modules/voice.js

@@ -51,8 +51,10 @@ const useVoiceStore = defineStore('voice', () => {
   const reset = () => {
     noiceBarVisibleState.value = false;
     noiceBoxVisibleState.value = false;
-    callAnswered.value = false;
-    callDialing.value = false;
+    setTimeout(() => {
+      callAnswered.value = false;
+      callDialing.value = false;
+    }, 1500)
     // timer.resetTimer();
   }
 
@@ -73,6 +75,8 @@ const useVoiceStore = defineStore('voice', () => {
     }
 
 
+    isMakingCall.value = true;
+
     callAnswered.value = true;
 
     const { data } = await makeCall(phoneNum);
@@ -81,7 +85,6 @@ const useVoiceStore = defineStore('voice', () => {
 
     telephoneNumber.value = phoneNum;
 
-    isMakingCall.value = true;
 
     // noiceBarVisibleState.value = true;
   }
@@ -188,12 +191,14 @@ const useVoiceStore = defineStore('voice', () => {
 
         sessionId.value = callId;
 
-        telephoneNumber.value = phone;
+        !isMakingCall.value && (telephoneNumber.value = phone);
 
         isMakingCall.value = false;
 
         noiceBarVisibleState.value = true;
 
+        callAnswered.value = true
+
         // ElMessage({
         //   message: '来电话了',
         //   type: 'warning',

+ 4 - 4
src/views/system/user/index.vue

@@ -108,7 +108,7 @@
                      v-hasPermi="['system:user:remove']"
                   >删除</el-button>
                </el-col>
-               <el-col :span="1.5">
+               <!-- <el-col :span="1.5">
                   <el-button
                      type="info"
                      plain
@@ -125,7 +125,7 @@
                      @click="handleExport"
                      v-hasPermi="['system:user:export']"
                   >导出</el-button>
-               </el-col>
+               </el-col> -->
                <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
             </el-row>
 
@@ -614,13 +614,13 @@ function submitForm() {
   proxy.$refs["userRef"].validate(valid => {
     if (valid) {
       if (form.value.userId != undefined) {
-        updateUser(form.value).then(response => {
+        updateUser({...form.value, type: 1}).then(response => {
           proxy.$modal.msgSuccess("修改成功");
           open.value = false;
           getList();
         });
       } else {
-        addUser(form.value).then(response => {
+        addUser({...form.value, type: 1}).then(response => {
           proxy.$modal.msgSuccess("新增成功");
           open.value = false;
           getList();