|
@@ -0,0 +1,250 @@
|
|
|
+<script setup>
|
|
|
+import { callApi, workbenchApi } from '@/api/voice/call';
|
|
|
+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();
|
|
|
+
|
|
|
+const dataPickerValue = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
+const tableData = ref([]);
|
|
|
+const total = ref(0);
|
|
|
+const agentList = ref([]);
|
|
|
+const drawer = ref(false);
|
|
|
+const callDetails = ref({});
|
|
|
+
|
|
|
+const isTransitionVoiceStatus = ref(false);
|
|
|
+
|
|
|
+const queryParams = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ userId: '',
|
|
|
+ status: '',
|
|
|
+ category: '',
|
|
|
+ phone: '',
|
|
|
+ serviceCategory: ''
|
|
|
+})
|
|
|
+
|
|
|
+const serviceCategoryOptions = [
|
|
|
+ { value: 0, label: '人工坐席' },
|
|
|
+ { value: 1, label: '机器人坐席' },
|
|
|
+ { value: 2, label: '机器人转人工' }
|
|
|
+]
|
|
|
+
|
|
|
+const callTypeOptions = [
|
|
|
+ { value: 0, label: '白名单' },
|
|
|
+ { value: 1, label: 'AI客服' },
|
|
|
+ { value: 2, label: '传统服务' }
|
|
|
+]
|
|
|
+
|
|
|
+
|
|
|
+// 清除检索条件
|
|
|
+const handleCleanOptions = () => {
|
|
|
+ queryParams.value = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ userId: '',
|
|
|
+ status: '',
|
|
|
+ category: '',
|
|
|
+ phone: '',
|
|
|
+ serviceCategory: ''
|
|
|
+ };
|
|
|
+ dataPickerValue.value = [];
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+// 语音转化完成
|
|
|
+const handleVoiceParsed = (item) => {
|
|
|
+ const { parsedVoiceContent } = item;
|
|
|
+ callDetails.value.parsedVoiceContent = parsedVoiceContent;
|
|
|
+}
|
|
|
+
|
|
|
+const jumpDetails = (item) => {
|
|
|
+ callDetails.value = item;
|
|
|
+ drawer.value = true;
|
|
|
+}
|
|
|
+
|
|
|
+// 音频加载完成
|
|
|
+const onAudioLoadDone = ({ durationTime, id }) => {
|
|
|
+ tableData.value.map(item => {
|
|
|
+ if (item.id == id) {
|
|
|
+ item.times = durationTime || ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const handleClose = (done) => {
|
|
|
+ if ( !isTransitionVoiceStatus.value ) {
|
|
|
+ done();
|
|
|
+ } else {
|
|
|
+ proxy.$modal.msgWarning("当前语音正在转换中,请稍后");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 批量下载
|
|
|
+const handleBatchDownload = () => {
|
|
|
+ const [timeBegin, timeEnd] = dataPickerValue.value;
|
|
|
+ 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
|
|
|
+ }, `${fullFormattedString}.zip`);
|
|
|
+}
|
|
|
+
|
|
|
+// 单独下载
|
|
|
+const handleDownload = ({ id, sessionId }) => {
|
|
|
+ proxy.getDownload("/business/record/downloadById", { id }, `${sessionId}.wav`);
|
|
|
+}
|
|
|
+
|
|
|
+const getList = () => {
|
|
|
+ const [timeBegin, timeEnd] = dataPickerValue.value || [];
|
|
|
+
|
|
|
+ loading.value = true;
|
|
|
+
|
|
|
+ workbenchApi.getCallRecordList({...queryParams.value, timeBeginReq:timeBegin, timeEndReq: timeEnd}).then(({ rows, total:t }) => {
|
|
|
+ const typeEnum = { 0: '白名单', 1: 'AI客服', 2: '传统服务' };
|
|
|
+ const statusEnum = { 0: '未接听', 1: '已接通' };
|
|
|
+ const serviceCategoryEnum = { 0: '人工坐席', 1: '机器人坐席', 2: '机器人转人工' };
|
|
|
+ tableData.value = rows.map(item => ({
|
|
|
+ ...item,
|
|
|
+ url: item.url ? item.url + '?timstamp=' + new Date().getTime() : '',
|
|
|
+ typeText: item.category == 1 ? '传统服务' : typeEnum[item.type],
|
|
|
+ statusText: statusEnum[item.status],
|
|
|
+ serviceCategoryText: serviceCategoryEnum[item.serviceCategory]
|
|
|
+ }));
|
|
|
+
|
|
|
+ loading.value = false;
|
|
|
+ total.value = t;
|
|
|
+ })
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ workbenchApi.getAgentList().then(({ data }) => {
|
|
|
+ agentList.value = data;
|
|
|
+ })
|
|
|
+ getList();
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="call-viewprot">
|
|
|
+ <div class="search-card">
|
|
|
+ <div class="grid grid-cols-4 gap-[24px]">
|
|
|
+ <SearchItemWrapper label="通话发起时间">
|
|
|
+ <el-date-picker v-model="dataPickerValue" type="daterange" range-separator="-" start-placeholder="起始日期"
|
|
|
+ end-placeholder="结束日期" style="width: 100%;" :editable="false" value-format="YYYY-MM-DD"/>
|
|
|
+ </SearchItemWrapper>
|
|
|
+ <div class="flex items-center justify-start space-x-[20px]">
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="getList">搜索</div>
|
|
|
+ <div class="custom-btn custom-btn_default" @click="handleBatchDownload">重置</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="table-card">
|
|
|
+ <div style="height: 100%;" ref="tableContainer">
|
|
|
+ <el-table :data="tableData" style="width: 100%" :max-height="tableMaxHeight" v-loading="loading">
|
|
|
+ <el-table-column prop="date" label="统计日期" align="center" width="130" fixed />
|
|
|
+ <el-table-column prop="inTotal" label="呼入总量" align="center" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ !scope.row.category && scope.row.category != 0 ? '' : scope.row.category == 0 ? '呼入' : '呼出' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="successTotal" label="接通总量" align="center" width="100" />
|
|
|
+ <el-table-column prop="failTotal" label="未接通总量" align="center" width="100" />
|
|
|
+ <el-table-column prop="robotHearTotal" label="机器人接听" align="center" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="flex items-center justify-center space-x-[6px]">
|
|
|
+ <span class="w-[6px] h-[6px] rounded-full" :class="[scope.row.status === 1 ? 'bg-[#65C734]': 'bg-[#c75134]']" ></span>
|
|
|
+ <span>{{ scope.row.statusText }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="transferTotal" label="机器人转人工" align="center" width="200" />
|
|
|
+ <el-table-column prop="humanTotal" label="人工接听" align="center" width="180" />
|
|
|
+ <el-table-column prop="robotHandleTotal" label="机器人处理量" align="center" width="180" />
|
|
|
+ <el-table-column prop="humanHandleTotal" label="人工处理量" align="center" width="90"/>
|
|
|
+ <el-table-column prop="robotRate" label="机器人处理率" align="center" width="350">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="flex justify-center" v-show="scope.row.url">
|
|
|
+ <AudioPlayer :audioUrl="scope.row.url" @loadDone="onAudioLoadDone" :id="scope.row.id"></AudioPlayer>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="humanRate" label="人工处理率" align="center" width="140"/>
|
|
|
+ <el-table-column prop="failRate" 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]">
|
|
|
+ <span class="text-[#165DFF] cursor-pointer" @click="jumpDetails(scope.row)">详情</span>
|
|
|
+ <span class="text-[#165DFF] cursor-pointer" @click="handleDownload(scope.row)">语音下载</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <pagination v-show="total >= 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-drawer
|
|
|
+ v-model="drawer"
|
|
|
+ title="通话详情"
|
|
|
+ direction="rtl"
|
|
|
+ :before-close="handleClose"
|
|
|
+ class="voice-drawer"
|
|
|
+ size="900"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <CallView :data="callDetails" noInit @on-end="handleVoiceParsed" v-model="isTransitionVoiceStatus"></CallView>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.call-viewprot {
|
|
|
+ display: flex;
|
|
|
+ flex-flow: column;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding: 28px 24px 18px 24px;
|
|
|
+ border-radius: 8px;
|
|
|
+ background: #fff;
|
|
|
+
|
|
|
+ .custom-btn {
|
|
|
+ word-break: keep-all;
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-card {
|
|
|
+ padding-bottom: 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ border-bottom: 1px dashed #E5E6EB;
|
|
|
+ overflow: hidden;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-card {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.voice-drawer {
|
|
|
+ .el-drawer__header {
|
|
|
+ margin-bottom: 0;
|
|
|
+ color: #333;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|