|
@@ -1,37 +1,18 @@
|
|
|
<template>
|
|
|
<div class="statistics-call-detail-index-container layout-padding">
|
|
|
<div class="layout-padding-auto layout-padding-view pd20">
|
|
|
- <ProTable
|
|
|
- ref="proTableRef"
|
|
|
- :columns="columns"
|
|
|
- :data="state.tableData"
|
|
|
- @updateTable="queryList"
|
|
|
- :loading="state.loading"
|
|
|
- border
|
|
|
- :pagination="false"
|
|
|
- :toolButton="['refresh', 'setting', 'exportAll']"
|
|
|
- :exportMethod="callDetailListExport"
|
|
|
- :exportParams="requestParams"
|
|
|
- show-summary
|
|
|
- :summary-method="getSummaries"
|
|
|
- >
|
|
|
- <template #table-search>
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
|
|
|
- <el-form-item prop="crTime">
|
|
|
- <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="handleQuery" :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>
|
|
|
- </template>
|
|
|
- <template #description>
|
|
|
+ <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
|
|
|
+ <el-form-item prop="crTime">
|
|
|
+ <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handleQuery" :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-popover :width="500" trigger="click">
|
|
|
<template #reference>
|
|
|
- <el-button circle title="口径说明"><SvgIcon name="ele-QuestionFilled" /></el-button>
|
|
|
+ <el-button type="primary" title="口径说明">口径说明<SvgIcon name="ele-QuestionFilled" /></el-button>
|
|
|
</template>
|
|
|
<el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
|
|
|
<el-descriptions-item label="呼入总量">呼入接通量+呼入未接通量</el-descriptions-item>
|
|
@@ -52,8 +33,73 @@
|
|
|
<el-descriptions-item label="呼出接通率"> 呼出接通量/呼出总量 </el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</el-popover>
|
|
|
- </template>
|
|
|
- </ProTable>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <vxe-toolbar
|
|
|
+ ref="toolbarRef"
|
|
|
+ :loading="state.loading"
|
|
|
+ custom
|
|
|
+ :refresh="{
|
|
|
+ queryMethod: handleQuery,
|
|
|
+ }"
|
|
|
+ :tools="[{ toolRender: { name: 'exportAll' } }]"
|
|
|
+ >
|
|
|
+ </vxe-toolbar>
|
|
|
+ <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ :loading="state.loading"
|
|
|
+ :data="state.tableData"
|
|
|
+ :column-config="{ resizable: true }"
|
|
|
+ :row-config="{ isCurrent: true, isHover: true, height: 30, keyField: 'id' }"
|
|
|
+ ref="tableRef"
|
|
|
+ height="auto"
|
|
|
+ auto-resize
|
|
|
+ :scrollY="{ enabled: true, gt: 0 }"
|
|
|
+ show-overflow
|
|
|
+ id="statisticsCallDetailIndex"
|
|
|
+ :custom-config="{ storage: true }"
|
|
|
+ show-footer
|
|
|
+ :footer-method="footerMethod"
|
|
|
+ :params="{ exportMethod: callDetailListExport, exportParams: requestParams }"
|
|
|
+ >
|
|
|
+ <vxe-column field="date" title="日期" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" link @click="linkDetail(scope, 'date')">
|
|
|
+ {{ scope.row.date }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="inTotal" title="呼入总量">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" link @click="linkDetail(scope)">
|
|
|
+ {{ scope.row.inTotal }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="inConnectionQuantity" title="接通总量">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" link @click="linkDetail(scope)">
|
|
|
+ {{ scope.row.inConnectionQuantity }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="notAcceptedHang" title="未接通秒挂"></vxe-column>
|
|
|
+ <vxe-column field="inConnectionRate" title="接通率"></vxe-column>
|
|
|
+ <vxe-column field="averageDuration" title="平均时长"></vxe-column>
|
|
|
+ <vxe-column field="inAvailableAnswer" title="有效接通量"></vxe-column>
|
|
|
+ <vxe-column field="inHangupImmediateWhenAnswered" title="接通秒挂"></vxe-column>
|
|
|
+ <vxe-column field="effectiveConnectionRate" title="有效接通率"></vxe-column>
|
|
|
+ <vxe-column field="timeoutConnection" title="超时接通量"></vxe-column>
|
|
|
+ <vxe-column field="timeoutSuspension" title="超时挂断量"></vxe-column>
|
|
|
+ <vxe-column field="onTimeConnectionRate" title="按时接通率"></vxe-column>
|
|
|
+ <vxe-column field="queueByeCount" title="队列挂断"></vxe-column>
|
|
|
+ <vxe-column field="ivrByeCount" title="IVR挂断"></vxe-column>
|
|
|
+ <vxe-column field="outTotal" title="呼出总量"></vxe-column>
|
|
|
+ <vxe-column field="outConnectionQuantity" title="呼出接通量"></vxe-column>
|
|
|
+ <vxe-column field="outConnectionRate" title="呼出接通率"></vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -65,117 +111,9 @@ import Other from '@/utils/other';
|
|
|
import { callDetailList, callDetailListExport } from '@/api/statistics/call';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import dayjs from 'dayjs';
|
|
|
+import XEUtils from 'xe-utils';
|
|
|
|
|
|
const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
|
|
|
-// 表格配置项
|
|
|
-const columns = ref<any[]>([
|
|
|
- {
|
|
|
- prop: 'date',
|
|
|
- label: '日期',
|
|
|
- align: 'center',
|
|
|
- render: (scope) => {
|
|
|
- return (
|
|
|
- <el-button type="primary" link onClick={() => linkDetail(scope, 'date')}>
|
|
|
- {scope.row.date}
|
|
|
- </el-button>
|
|
|
- );
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'inTotal',
|
|
|
- label: '呼入总量',
|
|
|
- align: 'center',
|
|
|
- render: (scope) => {
|
|
|
- return (
|
|
|
- <el-button type="primary" link onClick={() => linkDetail(scope)}>
|
|
|
- {scope.row.inTotal}
|
|
|
- </el-button>
|
|
|
- );
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'inConnectionQuantity',
|
|
|
- label: '接通总量',
|
|
|
- align: 'center',
|
|
|
- render: (scope) => {
|
|
|
- return (
|
|
|
- <el-button type="primary" link onClick={() => linkDetail(scope)}>
|
|
|
- {scope.row.inConnectionQuantity}
|
|
|
- </el-button>
|
|
|
- );
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'notAcceptedHang',
|
|
|
- label: '未接通秒挂',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'inConnectionRate',
|
|
|
- label: '接通率',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'averageDuration',
|
|
|
- label: '平均时长',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'inAvailableAnswer',
|
|
|
- label: '有效接通量',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'inHangupImmediateWhenAnswered',
|
|
|
- label: '接通秒挂',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'effectiveConnectionRate',
|
|
|
- label: '有效接通率',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'timeoutConnection',
|
|
|
- label: '超时接通量',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'timeoutSuspension',
|
|
|
- label: '超时挂断量',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'onTimeConnectionRate',
|
|
|
- label: '按时接通率',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'queueByeCount',
|
|
|
- label: '队列挂断',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'ivrByeCount',
|
|
|
- label: 'IVR挂断',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'outTotal',
|
|
|
- label: '呼出总量',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'outConnectionQuantity',
|
|
|
- label: '呼出接通量',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'outConnectionRate',
|
|
|
- label: '呼出接通率',
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
-]);
|
|
|
// 定义变量内容
|
|
|
const ruleFormRef = ref<RefType>(); // 表单ref
|
|
|
const state = reactive<any>({
|
|
@@ -219,70 +157,17 @@ const resetQuery = (formEl: FormInstance | undefined) => {
|
|
|
statisticalTimeRef.value.reset();
|
|
|
queryList();
|
|
|
};
|
|
|
-// 合计
|
|
|
-const getSummaries = (param: any) => {
|
|
|
- const { columns } = param;
|
|
|
- const sums: string[] = [];
|
|
|
- columns.forEach((column: { property: string }, index: number) => {
|
|
|
- if (index === 0) {
|
|
|
- sums[index] = '合计';
|
|
|
- return;
|
|
|
- }
|
|
|
- switch (column.property) {
|
|
|
- case 'inTotal':
|
|
|
- sums[index] = state.totalCount?.inTotal;
|
|
|
- break;
|
|
|
- case 'inConnectionQuantity':
|
|
|
- sums[index] = state.totalCount?.inConnectionQuantity;
|
|
|
- break;
|
|
|
- case 'notAcceptedHang':
|
|
|
- sums[index] = state.totalCount?.notAcceptedHang;
|
|
|
- break;
|
|
|
- case 'inConnectionRate':
|
|
|
- sums[index] = state.totalCount?.inConnectionRate;
|
|
|
- break;
|
|
|
- case 'averageDuration':
|
|
|
- sums[index] = state.totalCount?.averageDuration;
|
|
|
- break;
|
|
|
- case 'inAvailableAnswer':
|
|
|
- sums[index] = state.totalCount?.inAvailableAnswer;
|
|
|
- break;
|
|
|
- case 'inHangupImmediateWhenAnswered':
|
|
|
- sums[index] = state.totalCount?.inHangupImmediateWhenAnswered;
|
|
|
- break;
|
|
|
- case 'effectiveConnectionRate':
|
|
|
- sums[index] = state.totalCount?.effectiveConnectionRate;
|
|
|
- break;
|
|
|
- case 'timeoutConnection':
|
|
|
- sums[index] = state.totalCount?.timeoutConnection;
|
|
|
- break;
|
|
|
- case 'timeoutSuspension':
|
|
|
- sums[index] = state.totalCount?.timeoutSuspension;
|
|
|
- break;
|
|
|
- case 'onTimeConnectionRate':
|
|
|
- sums[index] = state.totalCount?.onTimeConnectionRate;
|
|
|
- break;
|
|
|
- case 'queueByeCount':
|
|
|
- sums[index] = state.totalCount?.queueByeCount;
|
|
|
- break;
|
|
|
- case 'ivrByeCount':
|
|
|
- sums[index] = state.totalCount?.ivrByeCount;
|
|
|
- break;
|
|
|
- case 'outTotal':
|
|
|
- sums[index] = state.totalCount?.outTotal;
|
|
|
- break;
|
|
|
- case 'outConnectionQuantity':
|
|
|
- sums[index] = state.totalCount?.outConnectionQuantity;
|
|
|
- break;
|
|
|
- case 'outConnectionRate':
|
|
|
- sums[index] = state.totalCount?.outConnectionRate;
|
|
|
- break;
|
|
|
- default:
|
|
|
- sums[index] = '';
|
|
|
- break;
|
|
|
- }
|
|
|
- });
|
|
|
- return sums;
|
|
|
+// 计算合计
|
|
|
+const footerMethod = ({ columns, data }) => {
|
|
|
+ return [
|
|
|
+ columns.map((column: any, columnIndex: number) => {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return '合计';
|
|
|
+ }
|
|
|
+ // 后端返回了数据集合 state.totalCount 所以不需要计算 直接进行赋值
|
|
|
+ return XEUtils.get(state.totalCount, column.property);
|
|
|
+ }),
|
|
|
+ ];
|
|
|
};
|
|
|
// 查看详情
|
|
|
const router = useRouter();
|
|
@@ -307,7 +192,12 @@ const linkDetail = (scope: any, type?: string) => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+const toolbarRef = ref<RefType>();
|
|
|
+const tableRef = ref<RefType>();
|
|
|
onMounted(() => {
|
|
|
queryList();
|
|
|
+ if (tableRef.value && toolbarRef.value) {
|
|
|
+ tableRef.value.connect(toolbarRef.value);
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|