完善请求

This commit is contained in:
WUSIJIAN
2025-12-01 16:30:31 +08:00
parent 4128cd8c7b
commit 91ce6a597d
12 changed files with 402 additions and 225 deletions

View File

@@ -47,19 +47,23 @@
</div>
<el-table :data="tableData.data" style="width: 100%">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="日期" align="center" prop="loginTime" width="180" />
<el-table-column label="客服平台" align="center" prop="platform" />
<el-table-column label="客服ID" align="center" prop="infoId" />
<el-table-column label="客服姓名" align="center" prop="loginName" />
<el-table-column label="进线人数" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="开口人数" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="留资卡发送数量" align="center" prop="browser" />
<el-table-column label="名片发送数" align="center" prop="os" />
<el-table-column label="日期" align="center" prop="date" width="180">
<template #default="{ row }">
{{ formatTime(row.date) }}
</template>
</el-table-column>
<el-table-column label="客服平台" align="center" prop="customerServicePlatform" />
<el-table-column label="客服ID" align="center" prop="customerServiceId" />
<el-table-column label="客服姓名" align="center" prop="customerServiceName" />
<el-table-column label="进线人数" align="center" prop="inboundCount" width="130" :show-overflow-tooltip="true" />
<el-table-column label="开口人数" align="center" prop="activeCount" :show-overflow-tooltip="true" />
<el-table-column label="留资卡发送数量" align="center" prop="contactCardSentCount" />
<el-table-column label="名片发送数" align="center" prop="nameCardSentCount" />
<el-table-column label="留资人数" align="center" prop="status" />
<el-table-column label="接待人数" align="center" prop="msg" />
<el-table-column label="30秒回复率" align="center" prop="module" />
<el-table-column label="60秒回复率" align="center" prop="module" />
<el-table-column label="3分钟回复率" align="center" prop="module" />
<el-table-column label="接待人数" align="center" prop="servedCount" />
<el-table-column label="30秒回复率" align="center" prop="responseRate30s" />
<el-table-column label="60秒回复率" align="center" prop="responseRate60s" />
<el-table-column label="3分钟回复率" align="center" prop="responseRate360s" />
</el-table>
<pagination
v-show="tableData.total > 0"
@@ -108,9 +112,48 @@ interface TableData {
param: TableDataParam;
}
// ==================== 时间处理函数 ====================
/**
* 格式化时间显示
*/
const formatTime = (time: string | number | Date): string => {
if (!time) return '-';
try {
let date: Date;
if (time instanceof Date) {
date = time;
} else if (typeof time === 'string') {
date = new Date(time);
} else {
let timestamp = time;
if (timestamp > 1000000000000) {
// 已经是毫秒时间戳
} else if (timestamp > 1000000000) {
// 秒时间戳,转换为毫秒
timestamp = timestamp * 1000;
}
date = new Date(timestamp);
}
if (isNaN(date.getTime())) {
return String(time);
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
} catch (error) {
console.error('时间格式化错误:', error);
return String(time);
}
};
// 响应式数据
const queryRef = ref<FormInstance>();
const ids = ref<number[]>([]);
const tableData = reactive<TableData>({
data: [],
total: 0,