Browse Source

reactor:话务统计和知识库统计表格重构完成;

zhangchong 5 tháng trước cách đây
mục cha
commit
ca259111a3

+ 1 - 1
.env.development

@@ -3,7 +3,7 @@ VITE_MODE_NAME=development
 # 防止部署多套系统到同一域名不同目录时,变量共用的问题 设置不同的前缀
 VITE_STORAGE_NAME=dev
 # 业务系统基础请求地址
-VITE_API_URL=http://110.188.24.28:50100
+VITE_API_URL=http://110.188.24.28:50300
 # 业务系统socket请求地址
 VITE_API_SOCKET_URL=http://110.188.24.28:50100/hubs/hotline
 # 业务系统文件上传上传请求地址

+ 0 - 120
src/views/statistics/call/detailIndexTime.vue

@@ -48,36 +48,6 @@
 					<vxe-column field="outConnectionRate" title="呼出接通率"></vxe-column>
 				</vxe-table>
 			</div>
-			<!--			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
-				:loading="state.loading"
-				:pagination="false"
-				:toolButton="['refresh', 'setting', 'exportAll']"
-				:exportMethod="callDetailListDateExport"
-				:exportParams="requestParams"
-				show-summary
-				:summary-method="getSummaries"
-				border
-			>
-				<template #table-search>
-					<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
-						<el-form-item label="热线号码" prop="Keyword">
-							<el-select v-model="state.queryParams.Keyword" placeholder="请选择热线号码" clearable @change="handleQuery">
-								<el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
-							</el-select>
-						</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>
-			</ProTable>-->
 		</div>
 	</div>
 </template>
@@ -88,96 +58,6 @@ import { callDateListDate, callDetailListDateExport, callPeriodBase } from '@/ap
 import { useRoute } from 'vue-router';
 import XEUtils from 'xe-utils';
 
-// 表格配置项
-const columns = ref<any[]>([
-	{
-		prop: 'hour',
-		label: '时间',
-		align: 'center',
-	},
-	{
-		prop: 'inTotal',
-		label: '呼入总量',
-		align: 'center',
-	},
-	{
-		prop: 'inConnectionQuantity',
-		label: '接通总量',
-		align: 'center',
-	},
-	{
-		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>({
 	queryParams: {
 		// 查询条件

+ 85 - 58
src/views/statistics/call/detailSeatDate.vue

@@ -1,41 +1,87 @@
 <template>
 	<div class="statistics-call-detail-seats-date-container layout-padding">
 		<div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
+			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
+				<el-form-item label="工单编码" prop="No">
+					<el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label="主叫号码" prop="FromNo">
+					<el-input v-model="state.queryParams.FromNo" placeholder="主叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</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="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
+				</el-form-item>
+			</el-form>
+			<vxe-toolbar
+				ref="toolbarRef"
 				:loading="state.loading"
+				custom
+				:refresh="{
+					queryMethod: queryList,
+				}"
+				:tools="[{ toolRender: { name: 'exportCurrent' } }, { 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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallDetailSeatsDate"
+					:custom-config="{ storage: true }"
+					:params="{ exportMethod: callDateSimpleDetailExport, exportParams: requestParams }"
+					showHeaderOverflow
+				>
+					<vxe-column field="orderNo" title="工单编码" width="140"></vxe-column>
+					<vxe-column field="title" title="工单标题" width="200">
+						<template #default="{ row }">
+							<order-detail :order="{ ...row, id: row.orderId }" @updateList="queryList">{{ row.orderTitle }}</order-detail>
+						</template>
+					</vxe-column>
+					<vxe-column field="fromNo" title="主叫号码" width="120"></vxe-column>
+					<vxe-column field="toNo" title="被叫号码" width="120"></vxe-column>
+					<vxe-column field="telNo" title="响应分机" width="120"></vxe-column>
+					<vxe-column field="endByTxt" title="挂断状态" width="120"></vxe-column>
+					<vxe-column field="userName" title="话务员" width="120"></vxe-column>
+					<vxe-column field="beginIvrTime" title="开始时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+					<vxe-column field="answeredTime" title="接通时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.answeredTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+					<vxe-column field="endTime" title="挂断时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.endTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+					<vxe-column field="duration" title="通话时间(秒)" width="120"></vxe-column>
+					<vxe-column title="操作" fixed="right" width="160" align="center" :show-overflow="false">
+						<template #default="{ row }">
+							<el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
+							<el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile">下载录音</el-button>
+						</template>
+					</vxe-column>
+				</vxe-table>
+			</div>
+			<pagination
+				@pagination="queryList"
 				:total="state.total"
-				v-model:page-index="state.queryParams.PageIndex"
+				v-model:current-page="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
-				:toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
-				:exportMethod="callDateSimpleDetailExport"
-				:exportParams="requestParams"
-			>
-				<template #table-search>
-					<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
-						<el-form-item label="工单编码" prop="No">
-							<el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
-						</el-form-item>
-						<el-form-item label="主叫号码" prop="FromNo">
-							<el-input v-model="state.queryParams.FromNo" placeholder="主叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
-						</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="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
-						</el-form-item>
-					</el-form>
-				</template>
-				<template #operation="{ row }">
-					<el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
-					<el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile">下载录音</el-button>
-				</template>
-				<template #orderTitle="{ row }">
-					<order-detail :order="{id:row.orderId,...row }" @updateList="queryList">{{ row.orderTitle }}</order-detail>
-				</template>
-			</ProTable>
+				:disabled="state.loading"
+			/>
 		</div>
 		<!-- 播放录音 -->
 		<play-record ref="playRecordRef" />
@@ -88,31 +134,7 @@ import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
 
 const PlayRecord = defineAsyncComponent(() => import('@/components/PlayRecord/index.vue')); // 播放录音
 const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'orderNo', label: '工单编码', minWidth: 140 },
-	{ prop: 'orderTitle', label: '工单标题', minWidth: 200 },
-	{ prop: 'fromNo', label: '主叫号码', minWidth: 120 },
-	{ prop: 'toNo', label: '被叫号码', minWidth: 120 },
-	{ prop: 'telNo', label: '响应分机' },
-	{ prop: 'endByTxt', label: '挂断状态', minWidth: 100 },
-	{ prop: 'userName', label: '话务员', minWidth: 120 },
-	{
-		prop: 'beginIvrTime',
-		label: '开始时间',
-		minWidth: 160,
-		render: (scope) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
-	},
-	{
-		prop: 'answeredTime',
-		label: '接通时间',
-		minWidth: 160,
-		render: (scope) => <span>{formatDate(scope.row.answeredTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
-	},
-	{ prop: 'endTime', label: '挂断时间', minWidth: 160, render: (scope) => <span>{formatDate(scope.row.endTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
-	{ prop: 'duration', label: '通话时间(秒)', minWidth: 110 },
-	{ prop: 'operation', label: '操作', fixed: 'right', width: 170, align: 'center' },
-]);
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -206,8 +228,13 @@ const getBaseData = async () => {
 		console.log(e)
 	}
 };
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
-	getBaseData();
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
+	getBaseData();
 });
 </script>

+ 70 - 55
src/views/statistics/call/detailTalkTime.vue

@@ -1,41 +1,68 @@
 <template>
 	<div class="statistics-call-detail-talk-time-container layout-padding">
-    <div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
+		<div class="layout-padding-auto layout-padding-view pd20">
+			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline v-if="showSearch">
+				<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 label="状态" prop="type">
+					<el-select v-model="state.queryParams.type" placeholder="请选择状态" clearable @change="handleQuery">
+						<el-option v-for="item in state.callForwardingType" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
+					</el-select>
+				</el-form-item>
+				<el-form-item label="来源" prop="source">
+					<el-select v-model="state.queryParams.source" placeholder="请选择来源" clearable @change="handleQuery">
+						<el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
+					</el-select>
+				</el-form-item>
+				<el-form-item label-width="0">
+					<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>
+			<vxe-toolbar
+				ref="toolbarRef"
 				:loading="state.loading"
+				custom
+				:refresh="{
+					queryMethod: queryList,
+				}"
+			>
+			</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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallDetailTalkTime"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+				>
+					<vxe-column field="cpn" title="主叫号码"></vxe-column>
+					<vxe-column field="cdpn" title="被叫号码"></vxe-column>
+					<vxe-column field="createdTime" title="来电时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.createdTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+				</vxe-table>
+			</div>
+			<pagination
+				@pagination="queryList"
 				:total="state.total"
-				v-model:page-index="state.queryParams.PageIndex"
+				v-model:current-page="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
-				border
-			>
-        <template #table-search>
-          <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline v-if="showSearch">
-						<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 label="状态" prop="type">
-              <el-select v-model="state.queryParams.type" placeholder="请选择状态" clearable @change="handleQuery">
-                <el-option v-for="item in state.callForwardingType" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="来源" prop="source">
-              <el-select v-model="state.queryParams.source" placeholder="请选择来源" clearable @change="handleQuery">
-                <el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
-              </el-select>
-            </el-form-item>
-            <el-form-item label-width="0">
-              <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>
-			</ProTable>
+				:disabled="state.loading"
+			/>
 		</div>
 	</div>
 </template>
@@ -49,23 +76,7 @@ import { useRoute } from 'vue-router';
 import Other from '@/utils/other';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'cpn', label: '主叫号码', align: 'center' },
-	{
-		prop: 'cdpn',
-		label: '被叫号码',
-		align: 'center',
-	},
-	{
-		prop: 'createdTime',
-		label: '来电时间',
-		align: 'center',
-		render: (scope) => {
-			return <span>{formatDate(scope.row.createdTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-		},
-	},
-]);
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -129,16 +140,20 @@ const getBaseInfo = async () => {
 	}
 };
 // 是否展示查询条件
-const historyParams = history.state;
 const route = useRoute();
 const showSearch = computed(() => {
 	return route.query.showSearch;
 });
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
-  if (route.query.StartTime) {
-    state.queryParams.crTime = [route.query.StartTime, route.query.EndTime];
-  }
-	getBaseInfo();
+	if (route.query.StartTime) {
+		state.queryParams.crTime = [route.query.StartTime, route.query.EndTime];
+	}
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
+	getBaseInfo();
 });
 </script>

+ 97 - 94
src/views/statistics/call/hotNumber.vue

@@ -1,42 +1,23 @@
 <template>
 	<div class="statistics-call-hot-number-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"
-				:pagination="false"
-				show-summary
-				border
-				:summary-method="getSummaries"
-				:toolButton="['refresh', 'setting', 'exportAll']"
-				:exportMethod="callHotlineExport"
-				:exportParams="requestParams"
-			>
-				<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 label="热线号码" prop="gateway">
-							<el-select v-model="state.queryParams.gateway" placeholder="请选择热线号码" clearable @change="handleQuery">
-								<el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
-							</el-select>
-						</el-form-item>
-						<el-form-item label-width="0">
-							<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 label="热线号码" prop="gateway">
+					<el-select v-model="state.queryParams.gateway" placeholder="请选择热线号码" clearable @change="handleQuery">
+						<el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
+					</el-select>
+				</el-form-item>
+				<el-form-item label-width="0">
+					<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" class="mr5" />口径说明</el-button>
 						</template>
 						<el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
 							<el-descriptions-item label="热线号码">热线中心号码</el-descriptions-item>
@@ -50,8 +31,57 @@
 							<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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					:scrollY="{ enabled: true, gt: 0 }"
+					show-overflow
+					id="statisticsCallHotNumber"
+					:custom-config="{ storage: true }"
+					show-footer
+					:footer-method="footerMethod"
+					:params="{ exportMethod: callHotlineExport, exportParams: requestParams }"
+				>
+					<vxe-column field="gateWay" title="热线号码"></vxe-column>
+					<vxe-colgroup title="电话呼入汇总" align="center">
+						<vxe-column title="呼入" field="callInCount" sortable></vxe-column>
+						<vxe-column title="接通" field="connectCount" sortable></vxe-column>
+						<vxe-column title="未接通秒挂" field="noConnectByeCount" sortable></vxe-column>
+						<vxe-column title="接通率" field="callInConnectRate" sortable>
+							<template #default="{ row }"> {{ row.callInConnectRate }}% </template>
+						</vxe-column>
+					</vxe-colgroup>
+					<vxe-colgroup title="接通话务分析" align="center">
+						<vxe-column title="有效接通" field="effectiveCount" sortable></vxe-column>
+						<vxe-column title="平均时长" field="aveDuration" sortable></vxe-column>
+						<vxe-column title="通话时总长" field="durationSum" sortable></vxe-column>
+						<vxe-column title="接通秒挂" field="connectByeCount" sortable></vxe-column>
+						<vxe-column title="及时应答数" field="timelyAnswerCount" sortable></vxe-column>
+						<vxe-column title="有效率" field="effectiveRate" sortable>
+							<template #default="{ row }"> {{ row.effectiveRate }}% </template>
+						</vxe-column>
+					</vxe-colgroup>
+				</vxe-table>
+			</div>
 		</div>
 	</div>
 </template>
@@ -61,36 +91,9 @@ import { FormInstance } from 'element-plus';
 import { callHotlineExport, callHotline, callPeriodBase } from '@/api/statistics/call';
 import { defaultDate } from '@/utils/constants';
 import Other from '@/utils/other';
+import XEUtils from 'xe-utils';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'gateWay', label: '热线号码', align: 'center' },
-	{
-		prop: 'allCall',
-		label: '电话呼入汇总',
-		align: 'center',
-		_children: [
-			{ prop: 'callInCount', label: '呼入', align: 'center', sortable: true },
-			{ prop: 'connectCount', label: '接通', align: 'center', sortable: true },
-			{ prop: 'noConnectByeCount', label: '未接通秒挂', align: 'center', sortable: true },
-			{ prop: 'callInConnectRate', label: '接通率', align: 'center', render: (scope) => <span>{scope.row.callInConnectRate}%</span> },
-		],
-	},
-	{
-		prop: 'effective',
-		label: '接通话务分析',
-		align: 'center',
-		_children: [
-			{ prop: 'effectiveCount', label: '有效接通', align: 'center', sortable: true },
-			{ prop: 'aveDuration', label: '平均时长', align: 'center', sortable: true },
-			{ prop: 'durationSum', label: '通话时总长', align: 'center', sortable: true },
-			{ prop: 'connectByeCount', label: '接通秒挂', align: 'center', sortable: true },
-			{ prop: 'timelyAnswerCount', label: '及时应答数', align: 'center', sortable: true },
-			{ prop: 'effectiveRate', label: '有效率', align: 'center', render: (scope) => <span>{'' + scope.row.effectiveRate}%</span> },
-		],
-	},
-]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -135,35 +138,6 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	statisticalTimeRef.value.reset();
 	queryList();
 };
-// 合计
-const getSummaries = (param: any) => {
-	const { columns, data } = param;
-	const sums: string[] = [];
-	columns.forEach((column: { property: string }, index: number) => {
-		if (index === 0) {
-			sums[index] = '合计';
-			return;
-		}
-		const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
-		if (['callInConnectRate', 'effectiveRate', 'gateWay'].includes(column.property)) {
-			//百分比不能计算
-			sums[index] = '';
-			return '';
-		} else if (!values.every((value: unknown) => Number.isNaN(value))) {
-			sums[index] = `${values.reduce((prev: any, curr: any) => {
-				const value = Number(curr);
-				if (!Number.isNaN(value)) {
-					return prev + curr;
-				} else {
-					return prev;
-				}
-			}, 0)}`;
-		} else {
-			sums[index] = ' ';
-		}
-	});
-	return sums;
-};
 // 获取基础信息
 const getBaseInfo = async () => {
 	try {
@@ -173,8 +147,37 @@ const getBaseInfo = async () => {
 		console.log(e);
 	}
 };
+// 计算合计
+const footerMethod = ({ columns, data }) => {
+	return [
+		columns.map((column: any, columnIndex: number) => {
+			if (columnIndex === 0) {
+				return '合计';
+			}
+			if (
+				[
+					'callInCount',
+					'connectCount',
+					'noConnectByeCount',
+					'effectiveCount',
+					'aveDuration',
+					'durationSum',
+					'connectByeCount',
+					'timelyAnswerCount',
+				].includes(column.property)
+			) {
+				return XEUtils.sum(data, column.property);
+			}
+		}),
+	];
+};
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
-	getBaseInfo();
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
+	getBaseInfo();
 });
 </script>

+ 113 - 169
src/views/statistics/call/seatsDate.vue

@@ -1,37 +1,18 @@
 <template>
 	<div class="statistics-call-seats-date-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="callDateSimpleExport"
-				: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" class="mr5"/>口径说明</el-button>
 						</template>
 						<el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
 							<el-descriptions-item label="呼入总量">呼入接通+挂机量+呼入队列挂断</el-descriptions-item>
@@ -44,8 +25,91 @@
 							<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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallTalkTime"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+					:params="{ exportMethod: callDateSimpleExport, exportParams: requestParams }"
+					show-footer
+					:footer-method="footerMethod"
+				>
+					<vxe-column field="date" title="日期"></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="inConnectionRate" title="接通率">
+					</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="inNotAnswered" title="挂机量">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.inNotAnswered}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="notAcceptedHang" title="呼入队列挂断">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.notAcceptedHang}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="ivrByeCount" title="呼入IVR挂断">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.ivrByeCount}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="outConnectionQuantity" title="呼出接通">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.outConnectionQuantity}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="outNotAnswered" title="呼出未接通">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.outNotAnswered}}
+							</el-button>
+						</template>
+					</vxe-column>
+				</vxe-table>
+			</div>
 		</div>
 	</div>
 </template>
@@ -57,105 +121,9 @@ import Other from '@/utils/other';
 import { callDateSimple, callDateSimpleExport } 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'
-	},
-	{
-		prop: 'inTotal',
-		label: '呼入总量',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.inTotal}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'inConnectionRate',
-		label: '接通率',
-		align: 'center',
-	},
-	{
-		prop: 'inConnectionQuantity',
-		label: '呼入接通',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.inConnectionQuantity}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'inNotAnswered',
-		label: '挂机量',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.inNotAnswered}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'notAcceptedHang',
-		label: '呼入队列挂断',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.notAcceptedHang}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'ivrByeCount',
-		label: '呼入IVR挂断',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.ivrByeCount}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'outConnectionQuantity',
-		label: '呼出接通',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.outConnectionQuantity}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'outNotAnswered',
-		label: '呼出未接通',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.outNotAnswered}
-				</el-button>
-			);
-		},
-	}
-]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -200,47 +168,6 @@ 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 'inConnectionRate':
-				sums[index] = state.totalCount?.inConnectionRate;
-				break;
-			case 'inConnectionQuantity':
-				sums[index] = state.totalCount?.inConnectionQuantity;
-				break;
-			case 'inNotAnswered':
-				sums[index] = state.totalCount?.inNotAnswered;
-				break;
-			case 'notAcceptedHang':
-				sums[index] = state.totalCount?.notAcceptedHang;
-				break;
-			case 'ivrByeCount':
-				sums[index] = state.totalCount?.ivrByeCount;
-				break;
-			case 'outConnectionQuantity':
-				sums[index] = state.totalCount?.outConnectionQuantity;
-				break;
-			case 'outNotAnswered':
-				sums[index] = state.totalCount?.outNotAnswered;
-				break;
-			default:
-				sums[index] = '';
-				break;
-		}
-	});
-	return sums;
-};
 // 查看详情
 const router = useRouter();
 const linkDetail = (scope: any) => {
@@ -253,7 +180,24 @@ const linkDetail = (scope: any) => {
 		},
 	});
 };
+// 计算合计
+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 toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
 });
 </script>

+ 75 - 58
src/views/statistics/call/seatsRecord.vue

@@ -1,42 +1,77 @@
 <template>
 	<div class="statistics-call-seats-record-out-container layout-padding">
     <div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
+			<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 label="分机号" prop="TelNo">
+					<el-input v-model="state.queryParams.TelNo" placeholder="分机号" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label="动作类型" prop="ActionTtype">
+					<el-select v-model="state.queryParams.ActionTtype" placeholder="请选择动作类型" clearable @change="handleQuery">
+						<el-option v-for="item in actionTypeOptions" :value="item.key" :key="item.key" :label="item.value" />
+					</el-select>
+				</el-form-item>
+				<el-form-item label="坐席" prop="UserName">
+					<el-input v-model="state.queryParams.UserName" placeholder="坐席" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label-width="0">
+					<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>
+			<vxe-toolbar
+				ref="toolbarRef"
 				:loading="state.loading"
+				custom
+				:refresh="{
+					queryMethod: queryList,
+				}"
+			>
+			</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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallSeatsRecord"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+				>
+					<vxe-column field="userName" title="坐席"></vxe-column>
+					<vxe-column field="telNo" title="分机号"></vxe-column>
+					<vxe-column field="queueId" title="分机组"></vxe-column>
+					<vxe-column field="actionTypeText" title="动作类型"></vxe-column>
+					<vxe-column field="startTime" title="开始时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.startTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+					<vxe-column field="endTime" title="结束时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.endTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+					<vxe-column field="duration" title="时长(秒)"></vxe-column>
+				</vxe-table>
+			</div>
+			<pagination
+				@pagination="queryList"
 				:total="state.total"
-				v-model:page-index="state.queryParams.PageIndex"
+				v-model:current-page="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
-				border
-			>
-        <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 label="分机号" prop="TelNo">
-              <el-input v-model="state.queryParams.TelNo" placeholder="分机号" clearable @keyup.enter="handleQuery" class="keyword-input" />
-            </el-form-item>
-            <el-form-item label="动作类型" prop="ActionTtype">
-              <el-select v-model="state.queryParams.ActionTtype" placeholder="请选择动作类型" clearable @change="handleQuery">
-                <el-option v-for="item in actionTypeOptions" :value="item.key" :key="item.key" :label="item.value" />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="坐席" prop="UserName">
-              <el-input v-model="state.queryParams.UserName" placeholder="坐席" clearable @keyup.enter="handleQuery" class="keyword-input" />
-            </el-form-item>
-            <el-form-item label-width="0">
-              <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>
-			</ProTable>
+				:disabled="state.loading"
+			/>
 		</div>
 	</div>
 </template>
@@ -49,30 +84,7 @@ import { formatDate } from "@/utils/formatTime";
 import Other from "@/utils/other";
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'userName', label: '坐席', align: 'center' },
-	{ prop: 'telNo', label: '分机号', align: 'center' },
-	{ prop: 'queueId', label: '分机组', align: 'center' },
-	{ prop: 'actionTypeText', label: '动作类型', align: 'center' },
-  {
-    prop: 'startTime',
-    label: '开始时间',
-    align: 'center',
-    render: (scope) => {
-      return <span>{formatDate(scope.row.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-    },
-  },
-  {
-    prop: 'endTime',
-    label: '结束时间',
-    align: 'center',
-    render: (scope) => {
-      return <span>{formatDate(scope.row.endTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-    },
-  },
-	{ prop: 'duration', label: '时长(秒)', align: 'center' },
-]);
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive({
@@ -130,8 +142,13 @@ const getBaseData = async () => {
     console.log(e);
   }
 }
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
-  getBaseData();
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
+	getBaseData();
 });
 </script>

+ 68 - 46
src/views/statistics/call/seatsRest.vue

@@ -1,36 +1,57 @@
 <template>
 	<div class="statistics-call-seats-rest-container layout-padding">
 		<div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
+			<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 label="工号" prop="StaffNo">
+					<el-input v-model="state.queryParams.StaffNo" placeholder="工号" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label="坐席名称" prop="UserName">
+					<el-input v-model="state.queryParams.UserName" placeholder="坐席名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label-width="0">
+					<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>
+			<vxe-toolbar
+				ref="toolbarRef"
 				:loading="state.loading"
-				:pagination="false"
-				border
-				@sort-change="sortChange"
+				custom
+				:refresh="{
+					queryMethod: handleQuery
+				}"
 			>
-				<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 label="工号" prop="StaffNo">
-							<el-input v-model="state.queryParams.StaffNo" placeholder="工号" clearable @keyup.enter="handleQuery" class="keyword-input" />
-						</el-form-item>
-						<el-form-item label="坐席名称" prop="UserName">
-							<el-input v-model="state.queryParams.UserName" placeholder="坐席名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
-						</el-form-item>
-						<el-form-item label-width="0">
-							<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>
-			</ProTable>
+			</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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallTransferOut"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+					show-footer
+					:footer-method="footerMethod"
+				>
+					<vxe-column field="staffNo" title="工号"></vxe-column>
+					<vxe-column field="userName" title="坐席名称"></vxe-column>
+					<vxe-column field="restCount" title="小休次数" sortable></vxe-column>
+					<vxe-column field="restDuration" title="小休平均时长(分)" sortable></vxe-column>
+					<vxe-column field="cumulativeDurationTxt" title="小休累计时长(分)" sortable></vxe-column>
+				</vxe-table>
+			</div>
 		</div>
 	</div>
 </template>
@@ -40,26 +61,9 @@ import { FormInstance } from 'element-plus';
 import { callRest } from '@/api/statistics/call';
 import { defaultDate } from '@/utils/constants';
 import Other from '@/utils/other';
+import XEUtils from 'xe-utils'
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'staffNo', label: '工号', align: 'center' },
-	{ prop: 'userName', label: '坐席名称', align: 'center' },
-	{ prop: 'restCount', label: '小休次数', align: 'center', sortable: 'custom' },
-	{
-		prop: 'restDuration',
-		label: '小休平均时长(分)',
-		align: 'center',
-		sortable: 'custom',
-		render: (scope) => <span>{Number(scope.row.restDuration).toFixed(2)}</span>,
-	},
-	{
-		prop: 'cumulativeDurationTxt',
-		label: '小休累计时长(分)',
-		align: 'center',
-	},
-]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -115,7 +119,25 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	statisticalTimeRef.value.reset();
 	queryList();
 };
+// 计算合计
+const footerMethod = ({ columns, data }) => {
+	return [
+		columns.map((column: any, columnIndex: number) => {
+			if (columnIndex === 0) {
+				return '合计';
+			}
+			if (['restCount', 'restDuration', 'cumulativeDurationTxt'].includes(column.property)) {
+				return XEUtils.sum(data, column.property);
+			}
+		}),
+	];
+};
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
 });
 </script>

+ 112 - 113
src/views/statistics/call/talkTime.vue

@@ -1,42 +1,23 @@
 <template>
 	<div class="statistics-call-talk-time-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"
-				:pagination="false"
-				border
-				show-summary
-				:toolButton="['refresh', 'setting', 'exportAll']"
-				:exportMethod="callPeriodExport"
-				:exportParams="requestParams"
-			>
-				<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 label="热线号码" prop="source">
-							<el-select v-model="state.queryParams.source" placeholder="请选择热线号码" clearable @change="handleQuery">
-								<el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
-							</el-select>
-						</el-form-item>
-						<el-form-item label-width="0">
-							<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-button type="primary" @click="onDetail" :loading="state.loading"> 通话时段分析 </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 label="热线号码" prop="source">
+					<el-select v-model="state.queryParams.source" placeholder="请选择热线号码" clearable @change="handleQuery">
+						<el-option v-for="item in state.callForwardingSource" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
+					</el-select>
+				</el-form-item>
+				<el-form-item label-width="0">
+					<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" class="mr5"/>口径说明</el-button>
 						</template>
 						<el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
 							<el-descriptions-item label="时间段">以每小时为时间段</el-descriptions-item>
@@ -48,8 +29,83 @@
 							<el-descriptions-item label="IVR挂断">语音提示等待中挂断</el-descriptions-item>
 						</el-descriptions>
 					</el-popover>
-				</template>
-			</ProTable>
+					<el-button type="primary" @click="onDetail" :loading="state.loading"> 通话时段分析 </el-button>
+				</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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallTalkTime"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+					:params="{ exportMethod: callPeriodExport, exportParams: requestParams }"
+					show-footer
+					:footer-method="footerMethod"
+				>
+					<vxe-column field="hourTo" title="时间段"></vxe-column>
+					<vxe-column field="count" title="呼入总量">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+							{{scope.row.count}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="effectiveCount" title="有效接通">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.effectiveCount}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="connectByeCount" title="接通秒挂">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.connectByeCount}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="noConnectByeCount" title="未接通秒挂">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.noConnectByeCount}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="queueByeCount" title="队列挂断">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.queueByeCount}}
+							</el-button>
+						</template>
+					</vxe-column>
+					<vxe-column field="ivrByeCount" title="IVR挂断">
+						<template #default="scope">
+							<el-button type="primary" link @click="linkDetail(scope)">
+								{{scope.row.ivrByeCount}}
+							</el-button>
+						</template>
+					</vxe-column>
+				</vxe-table>
+			</div>
 		</div>
 	</div>
 </template>
@@ -60,84 +116,9 @@ import { callPeriod, callPeriodBase, callPeriodExport } from '@/api/statistics/c
 import { defaultDate } from '@/utils/constants';
 import { useRouter } from 'vue-router';
 import Other from '@/utils/other';
+import XEUtils from 'xe-utils';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'hourTo', label: '时间段', align: 'center' },
-	{
-		prop: 'count',
-		label: '呼入总量',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.count}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'effectiveCount',
-		label: '有效接通',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.effectiveCount}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'connectByeCount',
-		label: '接通秒挂',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.connectByeCount}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'noConnectByeCount',
-		label: '未接通秒挂',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.noConnectByeCount}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'queueByeCount',
-		label: '队列挂断',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.queueByeCount}
-				</el-button>
-			);
-		},
-	},
-	{
-		prop: 'ivrByeCount',
-		label: 'IVR挂断',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<el-button type="primary" link onClick={() => linkDetail(scope)}>
-					{scope.row.ivrByeCount}
-				</el-button>
-			);
-		},
-	},
-]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -219,8 +200,26 @@ const getBaseInfo = async () => {
 		console.log(e);
 	}
 };
+// 计算合计
+const footerMethod = ({ columns, data }) => {
+	return [
+		columns.map((column: any, columnIndex: number) => {
+			if (columnIndex === 0) {
+				return '合计';
+			}
+			if (['count', 'effectiveCount', 'connectByeCount','noConnectByeCount','queueByeCount','ivrByeCount'].includes(column.property)) {
+				return XEUtils.sum(data, column.property);
+			}
+		}),
+	];
+};
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
-	getBaseInfo();
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
+	getBaseInfo();
 });
 </script>

+ 88 - 171
src/views/statistics/call/telephonist.vue

@@ -1,51 +1,80 @@
 <template>
 	<div class="statistics-call-telephonist-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"
-				:pagination="false"
-				show-summary
-				border
-				row-key="orgId"
-				@sort-change="sortChange"
-				:summary-method="getSummaries"
-				:toolButton="['refresh', 'setting', 'exportAll']"
-				:exportMethod="callAgentExport"
-				:exportParams="requestParams"
-			>
-        <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" class="mr5"/>口径说明</el-button>
 						</template>
 						<el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
 							<el-descriptions-item label="工作效率">(登录时长-小休摘机时长)/登录时长</el-descriptions-item>
 						</el-descriptions>
 					</el-popover>
-				</template>
-				<template #name="{ row }">
-					<span
-						>{{ row.name }} <span v-if="row.staffNo">({{ row.staffNo }})</span></span
-					>
-				</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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					:scrollY="{ enabled: true, gt: 0 }"
+					show-overflow
+					id="statisticsCallTelephonist"
+					:custom-config="{ storage: true }"
+					show-footer
+					:footer-method="footerMethod"
+					:params="{ exportMethod: callAgentExport, exportParams: requestParams }"
+				>
+					<vxe-column field="name" title="坐席工号" width="120"></vxe-column>
+					<vxe-column field="inTotal" title="呼入总量" sortable width="120"> </vxe-column>
+					<vxe-column field="inAnswered" title="接通总量" sortable width="120"></vxe-column>
+					<vxe-column field="inHangupImmediate" title="呼入秒挂" sortable width="120"></vxe-column>
+					<vxe-column field="inHanguped" title="呼入超时未接" sortable width="130"></vxe-column>
+					<vxe-column field="inAnsweredRateString" title="接通率" sortable width="120"></vxe-column>
+					<vxe-column field="inDurationAvg" title="呼入平均时长" sortable width="130"></vxe-column>
+					<vxe-column field="inAvailableAnswer" title="有效接通量" sortable width="120"></vxe-column>
+					<vxe-column field="inHangupImmediateWhenAnswered" title="接通秒挂" sortable width="120"></vxe-column>
+					<vxe-column field="availableAnswerRateString" title="有效接通率" sortable width="120"></vxe-column>
+					<vxe-column field="outTotal" title="呼出总量" sortable width="120"></vxe-column>
+					<vxe-column field="outAnswered" title="呼出接通量" sortable width="120"></vxe-column>
+					<vxe-column field="outAnsweredRateString" title="呼出接通率" sortable width="120"></vxe-column>
+					<vxe-column field="outDurationAvg" title="呼出平均时长" width="130" sortable></vxe-column>
+					<vxe-column field="loginDuration" title="登录时长" width="120" sortable>
+						<template #default="scope">
+							{{ formatDurationDay(scope.row.loginDuration) }}
+						</template>
+					</vxe-column>
+					<vxe-column field="restDuration" title="小休时长" width="120" sortable>
+						<template #default="scope">
+							{{ formatDurationDay(scope.row.restDuration) }}
+						</template>
+					</vxe-column>
+					<vxe-column field="workRateString" title="工作效率" width="120" sortable></vxe-column>
+				</vxe-table>
+			</div>
 		</div>
 	</div>
 </template>
@@ -56,74 +85,10 @@ import { callAgent, callAgentExport } from '@/api/statistics/call';
 import { defaultDate } from "@/utils/constants";
 import { formatDurationDay } from '@/utils/formatTime';
 import Other from "@/utils/other";
+import XEUtils from 'xe-utils';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
 
-const proTableRef = ref<RefType>(); // 表格ref
-// 表格配置项
-const columns = ref<any[]>([
-	{
-		prop: 'name',
-		label: '坐席工号',
-		align: 'center',
-		minWidth: 110,
-		render: (scope) => (
-			<span>
-				{scope.row.name} {scope.row.staffNo ? <span>({scope.row.telNo})</span> : ''}{' '}
-			</span>
-		),
-	},
-	{ prop: 'inTotal', label: '呼入总量', align: 'center', sortable: 'custom', minWidth: 120 },
-	{ prop: 'inAnswered', label: '接通总量', align: 'center', sortable: 'custom', minWidth: 120 },
-	{ prop: 'inHangupImmediate', label: '呼入秒挂', align: 'center', sortable: 'custom', minWidth: 120 },
-	{ prop: 'inHanguped', label: '呼入超时未接', align: 'center', sortable: 'custom', minWidth: 140 },
-	{
-		prop: 'inAnsweredRateString',
-		label: '接通率',
-		align: 'center',
-		sortable: 'custom',
-		minWidth: 120,
-	},
-	{ prop: 'inDurationAvg', label: '呼入平均时长', align: 'center', sortable: 'custom', minWidth: 140 },
-	{ prop: 'inAvailableAnswer', label: '有效接通量', align: 'center', sortable: 'custom', minWidth: 120 },
-	{ prop: 'inHangupImmediateWhenAnswered', label: '接通秒挂', align: 'center', sortable: 'custom', minWidth: 120 },
-	{
-		prop: 'availableAnswerRateString',
-		label: '有效接通率',
-		align: 'center',
-		sortable: 'custom',
-		minWidth: 120,
-	},
-	{ prop: 'outTotal', label: '呼出总量', align: 'center', sortable: 'custom', minWidth: 120 },
-	{ prop: 'outAnswered', label: '呼出接通量', align: 'center', sortable: 'custom', minWidth: 120 },
-	{
-		prop: 'outAnsweredRateString',
-		label: '呼出接通率',
-		align: 'center',
-		minWidth: 120,
-	},
-	{
-		prop: 'outDurationAvg',
-		label: '呼出平均时长',
-		align: 'center',
-		minWidth: 110,
-	},
-	{
-		prop: 'loginDuration',
-		label: '登录时长',
-		align: 'center',
-		minWidth: 150,
-		render: (scope) => <span>{formatDurationDay(scope.row.loginDuration)}</span>,
-	},
-	{
-		prop: 'restDuration',
-		label: '小休时长',
-		align: 'center',
-		minWidth: 100,
-		render: (scope) => <span>{formatDurationDay(scope.row.restDuration)}</span>,
-	},
-	{ prop: 'workRateString', label: '工作效率', align: 'center', minWidth: 100 },
-]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -160,13 +125,6 @@ const queryList = () => {
 			state.loading = false;
 		});
 };
-// 排序
-const sortChange = (val: any) => {
-	state.queryParams.SortField = val.prop;
-	// 0 升序 1 降序
-	state.queryParams.SortRule = val.order ? (val.order == 'descending' ? 1 : 0) : null;
-	queryList();
-};
 /** 重置按钮操作 */
 const statisticalTimeRef = ref<RefType>();
 const resetQuery = (formEl: FormInstance | undefined) => {
@@ -175,69 +133,28 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	statisticalTimeRef.value.reset();
 	queryList();
 };
-// 合计
-const getSummaries = (param: any) => {
-	const { columns, data } = param;
-	const sums: string[] = [];
-	columns.forEach((column: { property: string }, index: number) => {
-		if (index === 0) {
-			sums[index] = '合计';
-			return;
-		}
-		const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
-		if (['inAnsweredRate', 'outAnsweredRate', 'workRate'].includes(column.property)) {
-			//百分比不能计算
-			sums[index] = '';
-			return '';
-		} else if (['loginDuration', 'restDuration'].includes(column.property)) {
-			sums[index] = formatDurationDay(
-				values.reduce((prev: any, curr: any) => {
-					const value = Number(curr);
-					if (!Number.isNaN(value)) {
-						return prev + curr;
-					} else {
-						return prev;
-					}
-				}, 0)
-			);
-		} else if (!values.every((value: unknown) => Number.isNaN(value))) {
-			sums[index] = `${values.reduce((prev: any, curr: any) => {
-				const value = Number(curr);
-				if (!Number.isNaN(value)) {
-					return prev + curr;
-				} else {
-					return prev;
-				}
-			}, 0)}`;
-		} else {
-			sums[index] = ' ';
-		}
-	});
-	return sums;
-	/*const { columns } = param;
-  const sums: string[] = [];
-  columns.forEach((column: { property: string }, index: number) => {
-    switch (column.property) {
-      case 'name':
-        sums[index] = state.totalCount?.name;
-        break;
-      case 'num':
-        sums[index] = state.totalCount?.num;
-        break;
-      case 'chainNum':
-        sums[index] = state.totalCount?.chainNum;
-        break;
-      case 'chainRate':
-        sums[index] = state.totalCount?.chainRate;
-        break;
-      default:
-        sums[index] = '';
-        break;
-    }
-  });
-  return sums;*/
+// 计算合计
+const footerMethod = ({ columns, data }) => {
+	return [
+		columns.map((column: any, columnIndex: number) => {
+			if (columnIndex === 0) {
+				return '合计';
+			}
+			if (['inTotal', 'inAnswered', 'inHangupImmediate','inHanguped','inDurationAvg','inAvailableAnswer','inHangupImmediateWhenAnswered','outTotal','outAnswered'].includes(column.property)) {
+				return XEUtils.sum(data, column.property);
+			}
+			if(['loginDuration', 'restDuration'].includes(column.property)){
+				return formatDurationDay(XEUtils.sum(data, column.property))
+			}
+		}),
+	];
 };
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
 });
 </script>

+ 63 - 43
src/views/statistics/call/transferOut.vue

@@ -1,37 +1,66 @@
 <template>
 	<div class="statistics-call-transfer-out-container layout-padding">
     <div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
+			<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 label="外线号码" prop="CDPN">
+					<el-input v-model="state.queryParams.CDPN" placeholder="外线号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label="受理人" prop="UserName">
+					<el-input v-model="state.queryParams.UserName" placeholder="受理人" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label-width="0">
+					<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>
+			<vxe-toolbar
+				ref="toolbarRef"
 				:loading="state.loading"
+				custom
+				:refresh="{
+					queryMethod: handleQuery
+				}"
+			>
+			</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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsCallTransferOut"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+				>
+					<vxe-column field="cdpn" title="外线号码"></vxe-column>
+					<vxe-column field="cpn" title="来电号码"></vxe-column>
+					<vxe-column field="telNo" title="转接分机号"></vxe-column>
+					<vxe-column field="userName" title="受理人"></vxe-column>
+					<vxe-column field="createdTime" title="转外线时间" width="160">
+						<template #default="{ row }">
+							{{ formatDate(row.createdTime, 'YYYY-mm-dd HH:MM:SS') }}
+						</template>
+					</vxe-column>
+				</vxe-table>
+			</div>
+			<pagination
+				@pagination="queryList"
 				:total="state.total"
-				v-model:page-index="state.queryParams.PageIndex"
+				v-model:current-page="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
-				border
-			>
-        <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 label="外线号码" prop="CDPN">
-              <el-input v-model="state.queryParams.CDPN" placeholder="外线号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
-            </el-form-item>
-            <el-form-item label="受理人" prop="UserName">
-              <el-input v-model="state.queryParams.UserName" placeholder="受理人" clearable @keyup.enter="handleQuery" class="keyword-input" />
-            </el-form-item>
-            <el-form-item label-width="0">
-              <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>
-			</ProTable>
+				:disabled="state.loading"
+			/>
 		</div>
 	</div>
 </template>
@@ -44,22 +73,8 @@ import { formatDate } from '@/utils/formatTime';
 import Other from "@/utils/other";
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 
-const proTableRef = ref<RefType>(); // 表格ref
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'cdpn', label: '外线号码', align: 'center' },
-	{ prop: 'cpn', label: '来电号码', align: 'center' },
-	{ prop: 'telNo', label: '转接分机号', align: 'center' },
-	{
-		prop: 'createdTime',
-		label: '转外线时间',
-		align: 'center',
-    width: 160,
-		render: (scope) => <span>{formatDate(scope.row.createdTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
-	},
-	{ prop: 'userName', label: '受理人', align: 'center' },
-]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -109,7 +124,12 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	statisticalTimeRef.value.reset();
 	queryList();
 };
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
 });
 </script>

+ 73 - 39
src/views/statistics/knowledge/data.vue

@@ -1,38 +1,67 @@
 <template>
 	<div class="statistics-knowledge-data-container layout-padding">
-    <div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
+		<div class="layout-padding-auto layout-padding-view pd20">
+			<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 label="部门名称" prop="Keyword">
+					<el-input v-model="state.queryParams.Keyword" placeholder="部门名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</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>
+			<vxe-toolbar
+				ref="toolbarRef"
 				:loading="state.loading"
-				row-key="orgId"
-				@sort-change="sortChange"
+				custom
+				:refresh="{
+					queryMethod: handleQuery,
+				}"
+				:tools="[{ toolRender: { name: 'exportCurrent' } }, { 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 }"
+					ref="tableRef"
+					height="auto"
+					auto-resize
+					show-overflow
+					:scrollY="{ enabled: true, gt: 0 }"
+					id="statisticsKnowledgeData"
+					:custom-config="{ storage: true }"
+					showHeaderOverflow
+					:params="{ exportMethod: knowledgeExport, exportParams: requestParams }"
+					:sort-config="{ remote: true }"
+					@sort-change="sortChange"
+				>
+					<vxe-column field="orgName" title="部门名称"></vxe-column>
+					<vxe-column field="orgTypeText" title="部门类型"></vxe-column>
+					<vxe-column field="addNum" title="新增数量" sortable></vxe-column>
+					<vxe-column field="deleteNum" title="删除数量" sortable></vxe-column>
+					<vxe-column field="publicNum" title="公开数量" sortable></vxe-column>
+					<vxe-colgroup title="修改">
+						<vxe-column title="退回数量" field="sendBackNum" sortable></vxe-column>
+						<vxe-column title="通过数量" field="passNum" sortable></vxe-column>
+					</vxe-colgroup>
+				</vxe-table>
+			</div>
+			<pagination
+				@pagination="queryList"
 				:total="state.total"
-				v-model:page-index="state.queryParams.PageIndex"
+				v-model:current-page="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
-				:toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
-        :exportMethod="knowledgeExport"
-        :exportParams="requestParams"
-			>
-        <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 label="部门名称" prop="Keyword">
-              <el-input v-model="state.queryParams.Keyword" placeholder="部门名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
-            </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>
-			</ProTable>
+				:disabled="state.loading"
+			/>
 		</div>
 	</div>
 </template>
@@ -41,10 +70,10 @@ import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
 import { knowledgeExport, knowledgeList } from '@/api/statistics/knowledge';
 import { defaultDate } from '@/utils/constants';
-import Other from "@/utils/other";
-
+import Other from '@/utils/other';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 // 表格配置项
 const columns = ref<any[]>([
 	{ prop: 'orgName', label: '部门名称', align: 'center' },
@@ -87,10 +116,10 @@ const handleQuery = () => {
 const requestParams = ref<EmptyObjectType>({});
 const queryList = () => {
 	state.loading = true;
-  requestParams.value = Other.deepClone(state.queryParams);
-  requestParams.value.CreationTimeStart = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
-  requestParams.value.CreationTimeEnd = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
-  Reflect.deleteProperty(requestParams.value, 'crTime');
+	requestParams.value = Other.deepClone(state.queryParams);
+	requestParams.value.CreationTimeStart = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
+	requestParams.value.CreationTimeEnd = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
+	Reflect.deleteProperty(requestParams.value, 'crTime');
 	knowledgeList(requestParams.value)
 		.then((res: any) => {
 			state.tableData = res.result?.items ?? [];
@@ -103,10 +132,10 @@ const queryList = () => {
 };
 // 排序
 const sortChange = (val: any) => {
-	state.queryParams.SortField = val.order ? val.prop : null;
+	state.queryParams.SortField = val.order ? val.field : null;
 	// 0 升序 1 降序
-	state.queryParams.SortRule = val.order ? (val.order == 'descending' ? 1 : 0) : null as number;
-	queryList();
+	state.queryParams.SortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
+	handleQuery();
 };
 /** 重置按钮操作 */
 const statisticalTimeRef = ref<RefType>();
@@ -116,7 +145,12 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	statisticalTimeRef.value.reset();
 	queryList();
 };
+const toolbarRef = ref<RefType>();
+const tableRef = ref<RefType>();
 onMounted(() => {
 	queryList();
+	if (tableRef.value && toolbarRef.value) {
+		tableRef.value.connect(toolbarRef.value);
+	}
 });
 </script>