|
@@ -168,7 +168,6 @@
|
|
|
</template>
|
|
|
|
|
|
<!-- 三方会议 可用(两个通话 一个取消保持 一个保持 才能使用三方通话) -->
|
|
|
- <!-- && activeArr.includes('conference') -->
|
|
|
<template v-if="telStatusInfo.isDutyOn && activeArr.includes('conference')">
|
|
|
<div
|
|
|
class="item active"
|
|
@@ -209,27 +208,6 @@
|
|
|
<span>呼叫</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
- <!-- 评价 可用 来电才可以评价 callType === 3 -->
|
|
|
- <!-- <template v-if="telStatusInfo.isDutyOn && activeArr.includes('evaluate') && telStatusInfo.telType === 3">
|
|
|
- <div
|
|
|
- class="item active"
|
|
|
- @mouseenter="onHover('evaluateSrc', 'phoneControls/evaluate_white.png')"
|
|
|
- title="评价"
|
|
|
- @mouseleave="onHover('evaluateSrc', 'phoneControls/evaluate_blue.png')"
|
|
|
- @click="onControlClick('evaluate')"
|
|
|
- >
|
|
|
- <img :src="state.evaluateSrc" alt="" />
|
|
|
- <span>评价</span>
|
|
|
- </div>
|
|
|
- </template>-->
|
|
|
- <!-- 评价 不可用 -->
|
|
|
- <!-- <template v-else>
|
|
|
- <div class="item disabled" title="评价">
|
|
|
- <img :src="getImageUrl('phoneControls/evaluate_grey.png')" alt="" />
|
|
|
- <span>评价</span>
|
|
|
- </div>
|
|
|
- </template>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 占位标签 -->
|
|
@@ -408,29 +386,10 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
- <!-- 三方会议弹窗 -->
|
|
|
- <el-dialog v-model="state.metingDialogVisible" draggable title="三方会议" width="500px">
|
|
|
- <el-form :model="state.metingForm" label-width="120px" ref="metingFormRef">
|
|
|
- <el-form-item label="会议号码" prop="metingId" :rules="[{ required: true, message: '请输入会议号码', trigger: 'blur' }]">
|
|
|
- <el-input v-model="state.metingForm.metingId" placeholder="请输入会议号码" clearable></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="参加会议号码" prop="phoneNo" :rules="[{ required: true, message: '请输入会议号码', trigger: 'blur' }]">
|
|
|
- <el-input v-model="state.metingForm.phoneNo" placeholder="请输入转移号码以英文逗号隔开" clearable></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button @click="state.metingDialogVisible = false" class="default-button" :loading="state.loading">取 消</el-button>
|
|
|
- <el-button type="primary" @click="onMetingSubmit(metingFormRef)" :loading="state.loading">确 定</el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="telControl">
|
|
|
import { reactive, ref, computed, watch, defineAsyncComponent, onMounted, onBeforeMount } from 'vue';
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
import { ElMessageBox, ElNotification, ElMessage, FormInstance } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { useTelStatus, TelStates, RestStates } from '/@/stores/telStatus';
|
|
@@ -450,8 +409,6 @@ import { WebsocketInterface } from '/@/utils/websocket';
|
|
|
import signalR from '/@/utils/signalR';
|
|
|
import { Local } from '/@/utils/storage';
|
|
|
import {getGroup} from '/@/api/device/group';
|
|
|
-const storesUserInfo = useUserInfo();
|
|
|
-const { userInfos } = storeToRefs(storesUserInfo);
|
|
|
|
|
|
// 引入组件
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('/@/components/CommonAdvice/index.vue')); // 常用意见
|
|
@@ -517,17 +474,14 @@ const state = reactive<any>({
|
|
|
},
|
|
|
groupName:'', //坐席组名称
|
|
|
});
|
|
|
+
|
|
|
const useTelStatusStore = useTelStatus();
|
|
|
-const { telStatusInfo } = storeToRefs(useTelStatusStore);
|
|
|
+const { telStatusInfo } = storeToRefs(useTelStatusStore); // 电话状态
|
|
|
const appConfigStore = useAppConfig();
|
|
|
-const { AppConfigInfo } = storeToRefs(appConfigStore);
|
|
|
-const dutyFormRef = ref<RefType>(); //签入
|
|
|
-const restFormRef = ref<RefType>(); //小休
|
|
|
-const transferFormRef = ref<RefType>(); // 转接
|
|
|
-const outboundFormRef = ref<RefType>(); //外呼
|
|
|
-const dialogRestRef = ref<RefType>(); // 小休申请弹窗
|
|
|
-const metingFormRef = ref<RefType>(); // 三方会议表单
|
|
|
-const router = useRouter();
|
|
|
+const { AppConfigInfo } = storeToRefs(appConfigStore); // 系统配置信息
|
|
|
+const storesUserInfo = useUserInfo();
|
|
|
+const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
+
|
|
|
|
|
|
// 开始计时
|
|
|
const startTime = debounce(() => {
|
|
@@ -734,27 +688,16 @@ const onControlClick = (val: string) => {
|
|
|
if (!auth('public:seat:transfer')) ElMessage.error('抱歉,您没有转接权限!');
|
|
|
else onTransfer();
|
|
|
break;
|
|
|
- case 'conference': //三方会议
|
|
|
- if (!auth('public:seat:meeting')) ElMessage.error('抱歉,您没有三方会议权限!');
|
|
|
- else onConference();
|
|
|
- break;
|
|
|
- case 'conferenceEnd': //结束三方会议
|
|
|
- if (!auth('public:seat:meeting')) ElMessage.error('抱歉,您没有结束三方会议权限!');
|
|
|
- else onConferenceEnd();
|
|
|
- break;
|
|
|
- case 'outbound': //呼叫
|
|
|
+ case 'outbound': //外呼
|
|
|
if (!auth('public:seat:outbound')) ElMessage.error('抱歉,您没有呼叫权限!');
|
|
|
else onOutbound();
|
|
|
break;
|
|
|
- case 'evaluate': //评价
|
|
|
- if (!auth('public:seat:evaluate')) ElMessage.error('抱歉,您没有评价权限!');
|
|
|
- else onEvaluate();
|
|
|
- break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
};
|
|
|
//签入
|
|
|
+const dutyFormRef = ref<RefType>();
|
|
|
const onDutyFn = async () => {
|
|
|
dutyFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表(未签入的)
|
|
@@ -818,6 +761,7 @@ const onHangup = () => {
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
// 小休
|
|
|
+const restFormRef = ref<RefType>(); //小休表单
|
|
|
const onRest = async () => {
|
|
|
if (AppConfigInfo.value.IsRestApproval) {
|
|
|
// 如果小休需要审核
|
|
@@ -908,6 +852,7 @@ const clickOnRest = (formEl: FormInstance | undefined) => {
|
|
|
});
|
|
|
};
|
|
|
// 设置抽屉
|
|
|
+const dialogRestRef = ref<RefType>(); // 小休申请弹窗
|
|
|
const mouseup = () => {
|
|
|
state.transform = dialogRestRef.value.dialogContentRef.$el.style.transform;
|
|
|
};
|
|
@@ -1008,6 +953,7 @@ const unTalkingDeal = () => {
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
// 打开转接弹窗
|
|
|
+const transferFormRef = ref<RefType>(); // 转接表单
|
|
|
const onTransfer = () => {
|
|
|
// 重置表单
|
|
|
transferFormRef.value?.resetFields();
|
|
@@ -1040,43 +986,8 @@ const onConference = () => {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
-const onMetingSubmit = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- state.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- VoiceInterfaceObject.StartMeeting(state.metingForm.metingId, state.metingForm.phoneNo);
|
|
|
- state.metingDialogVisible = false;
|
|
|
- state.loading = false;
|
|
|
- }, 300);
|
|
|
- });
|
|
|
-};
|
|
|
-// 确定要结束三方会议
|
|
|
-const onConferenceEnd = () => {
|
|
|
- ElMessageBox.confirm(`确定确定要结束三方会议,是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- // // 设置三方会议状态
|
|
|
- // useTelStatusStore.setMetTing(false);
|
|
|
- // // 设置话机状态 取消静音修改为通话状态
|
|
|
- // useTelStatusStore.setPhoneControlState(TelStates.onCall);
|
|
|
- // // 循环挂断
|
|
|
- // for (let item of telStatusInfo.value.onCallArr) {
|
|
|
- // hangupApi(item)
|
|
|
- // .then(() => {})
|
|
|
- // .catch(() => {});
|
|
|
- // }
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
-};
|
|
|
// 外呼
|
|
|
+const outboundFormRef = ref<RefType>(); //外呼
|
|
|
const onOutbound = () => {
|
|
|
// 重置表单
|
|
|
outboundFormRef.value?.resetFields();
|
|
@@ -1098,22 +1009,6 @@ const clickOnOutbound = (formEl: FormInstance | undefined) => {
|
|
|
}, 300);
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
-// 评价
|
|
|
-const onEvaluate = () => {
|
|
|
- ElMessageBox.confirm(`确定确定要开始评价,是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- state.loading = true;
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
-};
|
|
|
// 监听电话状态变化
|
|
|
watch(
|
|
|
() => telStatusInfo.value.phoneControlState,
|
|
@@ -1218,17 +1113,17 @@ onMounted(() => {
|
|
|
// 有分机号
|
|
|
initWebsocket(); // 初始化websocket
|
|
|
}
|
|
|
- mittBus.on('startTalkTime', () => {
|
|
|
+ mittBus.on('startTalkTime', () => { // 开始计时
|
|
|
startTime();
|
|
|
});
|
|
|
- mittBus.on('endTalkTime', () => {
|
|
|
+ mittBus.on('endTalkTime', () => { // 结束计时
|
|
|
removeTimer();
|
|
|
});
|
|
|
});
|
|
|
onBeforeMount(() => {
|
|
|
- mittBus.off('startTalkTime');
|
|
|
- mittBus.off('endTalkTime');
|
|
|
- signalR.leaveGroup('CallCenter');
|
|
|
+ mittBus.off('startTalkTime'); // 移除监听
|
|
|
+ mittBus.off('endTalkTime'); // 移除监听
|
|
|
+ signalR.leaveGroup('CallCenter'); // 离开分组
|
|
|
});
|
|
|
</script>
|
|
|
|