|
@@ -1,134 +1,73 @@
|
|
|
<script setup>
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import { workbenchApi } from '@/api/voice/workbench';
|
|
|
import SearchItemWrapper from '@/components/SearchItemWrapper';
|
|
|
import AudioPlayer from '@/components/AudioPlayer';
|
|
|
import useTableHeight from '@/composables/useTableHeight';
|
|
|
|
|
|
+const router = useRouter();
|
|
|
const { tableContainer, tableMaxHeight } = useTableHeight();
|
|
|
|
|
|
+const value = ref('');
|
|
|
+
|
|
|
+const dataPickerValue = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
+const tableData = ref([]);
|
|
|
const total = ref(0);
|
|
|
-const value1 = ref('');
|
|
|
+const options = [];
|
|
|
|
|
|
const queryParams = ref({
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 10,
|
|
|
+ userName: '',
|
|
|
+ status: '',
|
|
|
+ phone: '',
|
|
|
})
|
|
|
-const options = [
|
|
|
- {
|
|
|
- value: 'Option1',
|
|
|
- label: 'Option1',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option2',
|
|
|
- label: 'Option2',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option3',
|
|
|
- label: 'Option3',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option4',
|
|
|
- label: 'Option4',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option5',
|
|
|
- label: 'Option5',
|
|
|
- },
|
|
|
-]
|
|
|
-
|
|
|
-const tableData = [
|
|
|
- {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
-]
|
|
|
|
|
|
+// 清除检索条件
|
|
|
const handleCleanOptions = () => {
|
|
|
- console.log(123123);
|
|
|
+ queryParams.value = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ userName: '',
|
|
|
+ status: '',
|
|
|
+ phone: '',
|
|
|
+ };
|
|
|
+ dataPickerValue.value = [];
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+const jumpDetails = ({ id }) => {
|
|
|
+ router.push({
|
|
|
+ path: '/voice/call/details',
|
|
|
+ query: { id }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-function getList() {
|
|
|
- console.log(queryParams.value);
|
|
|
- // loading.value = true;
|
|
|
- // listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
|
|
- // loading.value = false;
|
|
|
- // userList.value = res.rows;
|
|
|
- // total.value = res.total;
|
|
|
- // });
|
|
|
+const getList = () => {
|
|
|
+ const [timeBegin, timeEnd] = dataPickerValue.value;
|
|
|
+
|
|
|
+ loading.value = true;
|
|
|
+
|
|
|
+ workbenchApi.getCallRecordList({...queryParams.value, timeBegin, 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,
|
|
|
+ typeText: typeEnum[item.type],
|
|
|
+ statusText: statusEnum[item.status],
|
|
|
+ serviceCategoryText: serviceCategoryEnum[item.serviceCategory]
|
|
|
+ }));
|
|
|
+
|
|
|
+ loading.value = false;
|
|
|
+ total.value = t;
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
+onMounted(() => {
|
|
|
+ getList();
|
|
|
+})
|
|
|
|
|
|
</script>
|
|
|
|
|
@@ -138,27 +77,32 @@ function getList() {
|
|
|
<el-row :gutter="24" class="mb-[24px]">
|
|
|
<el-col :span="6">
|
|
|
<SearchItemWrapper>
|
|
|
- <el-input class="search-input" placeholder="用户电话号码"></el-input>
|
|
|
+ <el-input class="search-input" placeholder="用户电话号码" v-model="queryParams.phone"></el-input>
|
|
|
</SearchItemWrapper>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<SearchItemWrapper label="客服">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
+ <el-select v-model="queryParams.userName" placeholder="请选择" size="large" :empty-values="[null, undefined]">
|
|
|
+ <el-option label="全部" value="" />
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</SearchItemWrapper>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<SearchItemWrapper label="通话状态">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-select v-model="queryParams.status" placeholder="Select" size="large" :empty-values="[null, undefined]">
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option label="未接听" :value="0" />
|
|
|
+ <el-option label="已接通" :value="1" />
|
|
|
</el-select>
|
|
|
</SearchItemWrapper>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<SearchItemWrapper label="通话类型">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-select v-model="value" placeholder="Select" size="large" :empty-values="[null, undefined]">
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option label="呼入" :value="0" />
|
|
|
+ <el-option label="呼出" :value="1" />
|
|
|
</el-select>
|
|
|
</SearchItemWrapper>
|
|
|
</el-col>
|
|
@@ -166,13 +110,13 @@ function getList() {
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :span="6">
|
|
|
<SearchItemWrapper label="通话发起时间">
|
|
|
- <el-date-picker v-model="value1" type="daterange" range-separator="-" start-placeholder="起始日期"
|
|
|
- end-placeholder="结束日期" style="width: 100%;" :editable="false" />
|
|
|
+ <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>
|
|
|
</el-col>
|
|
|
<el-col :span="18">
|
|
|
<div class="flex items-center justify-start space-x-[30px]">
|
|
|
- <div class="custom-btn custom-btn_primary">搜索</div>
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="getList">搜索</div>
|
|
|
<div class="custom-btn custom-btn_default">批量下载语音</div>
|
|
|
<div class="custom-btn custom-btn_text space-x-[2px]" @click="handleCleanOptions">
|
|
|
<img src="@/assets/images/workbench/icon-clean.svg" alt="">
|
|
@@ -184,32 +128,33 @@ function getList() {
|
|
|
</div>
|
|
|
<div class="table-card">
|
|
|
<div style="height: 100%;" ref="tableContainer">
|
|
|
- <el-table :data="tableData" style="width: 100%" :max-height="tableMaxHeight">
|
|
|
- <el-table-column label="序号" align="center" type="index" width="50" fixed />
|
|
|
- <el-table-column prop="name" label="通话类型" align="center" width="100" />
|
|
|
- <el-table-column prop="address" label="通话状态" align="center" width="100">
|
|
|
+ <el-table :data="tableData" style="width: 100%" :max-height="tableMaxHeight" v-loading="loading">
|
|
|
+ <el-table-column prop="phone" label="用户电话" align="center" width="130" fixed />
|
|
|
+ <el-table-column prop="typeText" label="呼叫类型" align="center" width="100" />
|
|
|
+ <el-table-column prop="statusText" label="通话状态" align="center" width="100">
|
|
|
<template #default="scope">
|
|
|
<div class="flex items-center justify-center space-x-[6px]">
|
|
|
- <span class="w-[6px] h-[6px] bg-[#65C734] rounded-full"></span>
|
|
|
- <span>已接通</span>
|
|
|
+ <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="address" label="用户电话" align="center" />
|
|
|
- <el-table-column prop="address" label="客服" align="center" />
|
|
|
- <el-table-column prop="address" label="服务类型" align="center" />
|
|
|
+ <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" />
|
|
|
<el-table-column prop="address" label="通话录音" align="center" width="350">
|
|
|
<template #default="scope">
|
|
|
<div class="flex justify-center">
|
|
|
- <AudioPlayer></AudioPlayer>
|
|
|
+ <AudioPlayer :audioUrl="scope.row.url"></AudioPlayer>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="通话发起时间" align="center" />
|
|
|
- <el-table-column prop="address" label="操作" align="center" fixed="right" width="150">
|
|
|
+ <el-table-column prop="serviceCategoryText" label="服务类型" align="center" width="120"/>
|
|
|
+ <el-table-column prop="userName" label="客服" align="center" />
|
|
|
+ <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">详情</span>
|
|
|
+ <span class="text-[#165DFF] cursor-pointer" @click="jumpDetails(scope.row)">详情</span>
|
|
|
<span class="text-[#165DFF] cursor-pointer">语音下载</span>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -245,4 +190,4 @@ function getList() {
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|