|
@@ -1,23 +1,7 @@
|
|
|
<template>
|
|
|
<div class="tels-callLog-container layout-pd">
|
|
|
<el-card shadow="never">
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent class="mt10" inline label-width="100px">
|
|
|
- <el-form-item label="分机号" prop="CDPN">
|
|
|
- <el-input v-model="state.queryParams.CDPN" placeholder="请输入被叫号码" clearable @keyup.enter="queryList" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="中继号" prop="Gateway">
|
|
|
- <el-input v-model="state.queryParams.Gateway" placeholder="请输入中继号" clearable @keyup.enter="queryList" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
- <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
|
|
|
- <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-card>
|
|
|
- <el-card shadow="never">
|
|
|
- <el-radio-group v-model="state.queryParams.state" class="mb10" @change="queryList">
|
|
|
+ <el-radio-group v-model="telState" class="mb10" @change="queryList">
|
|
|
<el-radio label=" "
|
|
|
>总数:<el-tag type="">{{ state.tableList.length }}</el-tag></el-radio
|
|
|
>
|
|
@@ -41,28 +25,30 @@
|
|
|
>
|
|
|
</el-radio-group>
|
|
|
<!-- 表格 -->
|
|
|
- <el-table :data="state.tableList" v-loading="state.loading">
|
|
|
- <el-table-column prop="cpn" label="分机号" show-overflow-tooltip width="200"></el-table-column>
|
|
|
- <el-table-column prop="cdpn" label="是否注册" show-overflow-tooltip width="200">
|
|
|
+ <el-table :data="state.showTableList" v-loading="state.loading">
|
|
|
+ <el-table-column prop="telNo" label="分机号" show-overflow-tooltip width="200"></el-table-column>
|
|
|
+ <el-table-column label="是否注册" show-overflow-tooltip width="200">
|
|
|
<template #default="{ row }">
|
|
|
- <el-tag v-if="row.cdpn" type="success">已注册</el-tag>
|
|
|
+ <el-tag v-if="row.sipState === 'true'" type="success">已注册</el-tag>
|
|
|
<el-tag v-else type="danger">未注册</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="ringTimes" label="注册信息" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="device" label="注册信息" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column label="状态" show-overflow-tooltip width="200">
|
|
|
<template #default="{ row }">
|
|
|
- <el-tag v-if="row.state === 'login'" type="danger">签入</el-tag>
|
|
|
+ <el-tag v-if="row.state === 'login'" type="success">签入</el-tag>
|
|
|
<el-tag v-else-if="row.state === 'ready'" type="info">示闲</el-tag>
|
|
|
- <el-tag v-else-if="row.state === 'unready'" type="success">示忙</el-tag>
|
|
|
- <el-tag v-else-if="row.state === 'busy'" type="danger">通话</el-tag>
|
|
|
+ <el-tag v-else-if="row.state === 'unready'" type="warning">示忙</el-tag>
|
|
|
+ <el-tag v-else-if="row.state === 'busy'">通话</el-tag>
|
|
|
<el-tag v-else-if="row.state === 'acw'" type="info">整理</el-tag>
|
|
|
<el-tag v-else-if="row.state === 'logout'" type="danger">签出</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="100" fixed="right" align="center">
|
|
|
<template #default="{ row }">
|
|
|
- <el-button link type="primary" @click="onListen(row)" title="监听分机" v-auth="'tels:extension:listen'"> 监听分机 </el-button>
|
|
|
+ <el-button link type="primary" @click="onListen(row)" title="监听分机" v-auth="'tels:extension:listen'" v-if="row.state === 'busy'">
|
|
|
+ 监听分机
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<template #empty>
|
|
@@ -77,26 +63,20 @@
|
|
|
import { computed, onActivated, onDeactivated, onMounted, reactive, ref } from 'vue';
|
|
|
import type { FormInstance } from 'element-plus';
|
|
|
import { ElButton } from 'element-plus';
|
|
|
-import { callLogPaged } from '@/api/tels/callLog';
|
|
|
import signalR from '@/utils/signalR';
|
|
|
import { ola } from '@/utils/ola_api';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { useTelStatus } from '@/stores/telStatus';
|
|
|
+import { extensionPaged } from '@/api/tels/extension';
|
|
|
|
|
|
// 定义变量内容
|
|
|
const state = reactive(<any>{
|
|
|
- queryParams: {
|
|
|
- state: ' ',
|
|
|
- StaffNo: null, // 分机号
|
|
|
- CPN: null, // 中继号码
|
|
|
- CDPN: null, // 分机号
|
|
|
- Direction: null, // 呼叫类型
|
|
|
- OnState: null, // 结果
|
|
|
- },
|
|
|
tableList: [], // 列表数据
|
|
|
+ showTableList: [], // 显示的列表数据
|
|
|
loading: false, // 加载
|
|
|
total: 0, // 总条数
|
|
|
});
|
|
|
+const telState = ref<string>(' ');
|
|
|
const useTelStatusStore = useTelStatus();
|
|
|
const { telStatusInfo } = storeToRefs(useTelStatusStore); // 电话状态
|
|
|
const ruleFormRef = ref<FormInstance>(); // 表单ref
|
|
@@ -104,21 +84,15 @@ const ruleFormRef = ref<FormInstance>(); // 表单ref
|
|
|
const queryList = async () => {
|
|
|
state.loading = true;
|
|
|
try {
|
|
|
- const request = {
|
|
|
- CPN: state.queryParams.CPN,
|
|
|
- CDPN: state.queryParams.CDPN,
|
|
|
- Direction: state.queryParams.Direction,
|
|
|
- OnState: state.queryParams.OnState,
|
|
|
- StaffNo: state.queryParams.StaffNo,
|
|
|
- Gateway: state.queryParams.Gateway,
|
|
|
- };
|
|
|
- const response = await callLogPaged(request);
|
|
|
- state.tableList = response.result?.items ?? [];
|
|
|
- state.total = response.result?.total ?? 0;
|
|
|
+ const response = await extensionPaged();
|
|
|
+ state.tableList = response.result;
|
|
|
+ state.showTableList = state.tableList;
|
|
|
+ if (telState.value !== ' ') {
|
|
|
+ state.showTableList = state.tableList.filter((item: any) => item.state === telState.value);
|
|
|
+ }
|
|
|
state.loading = false;
|
|
|
} catch (e) {
|
|
|
state.loading = false;
|
|
|
- console.log(e);
|
|
|
}
|
|
|
};
|
|
|
/** 重置按钮操作 */
|
|
@@ -153,26 +127,18 @@ const acwCount = computed(() => {
|
|
|
});
|
|
|
// 监听分机
|
|
|
const onListen = (row: any) => {
|
|
|
- console.log(row, '121');
|
|
|
- ola.monitor(row.cdpn, telStatusInfo.value.telsNo);
|
|
|
+ ola.monitor(row.telNo, telStatusInfo.value.telsNo);
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
queryList();
|
|
|
signalR.joinGroup('BigScreen-SeatState');
|
|
|
signalR.SR.on('SeatState', (data: any) => {
|
|
|
- console.log(data, '分机状态改变');
|
|
|
- const item = state.tableList.find((item: any) => item.cdpn === data.cdpn);
|
|
|
+ const item = state.tableList.find((item: any) => item.telNo === data.telNo);
|
|
|
if (item) {
|
|
|
item.state = data.state;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
-onDeactivated(() => {
|
|
|
- signalR.leaveGroup('BigScreen-SeatState');
|
|
|
-});
|
|
|
-onActivated(() => {
|
|
|
- signalR.joinGroup('BigScreen-SeatState');
|
|
|
-});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.arrow {
|