Compare commits
47 Commits
6f0d10b881
...
Breach
| Author | SHA1 | Date | |
|---|---|---|---|
| b2ce9d93db | |||
| 8260b345dc | |||
| 2cd59adfc9 | |||
| baa89001c8 | |||
| 9b3c5da105 | |||
| a4c0aca1c2 | |||
| 9f19b8fb66 | |||
| 14ddd2839b | |||
| 6d2d3bda67 | |||
| b48b7749f2 | |||
| 2ba88eff08 | |||
| 6cf6829334 | |||
| 9d52b99414 | |||
| b9f74dc810 | |||
| 1647970bed | |||
| e696f768e6 | |||
| 6b76d36946 | |||
| 8e5f7335d8 | |||
| 5ff42dbbad | |||
| b0c2f28d7f | |||
| 51091d097e | |||
| 86cf54b9de | |||
| 10fb9dd4f2 | |||
| 2979e7e216 | |||
| 288a525537 | |||
| db6433693a | |||
| 99efa8de75 | |||
| d75fd9beb8 | |||
| 094f655634 | |||
| 10c8c7b796 | |||
| ea32a16e5d | |||
| 57be345996 | |||
| 3ed490d6dc | |||
| 1fdd8fe12a | |||
| a6f4c96f1f | |||
| 73c84f7b8d | |||
| 3a529bafa8 | |||
| 822afb422c | |||
| 7e8f272dfe | |||
| 93febd0964 | |||
| 9555bb66fd | |||
| 575a08ed3a | |||
| b3f5178470 | |||
| 859821dfb3 | |||
| d661b77afa | |||
| 676b213a7d | |||
| 600684570a |
@@ -1,10 +1,11 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="zh">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" href="/NYC_logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Vite + Vue</title>
|
<title>暖洋葱家庭教育数据看板</title>
|
||||||
|
<script defer src="https://umami.nycjy.cn/script.js" data-website-id="0d851950-9420-4c3e-a12a-c221fcf039b5"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
2
my-vue-app/package-lock.json
generated
2
my-vue-app/package-lock.json
generated
@@ -4664,7 +4664,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/markdown-it": {
|
"node_modules/markdown-it": {
|
||||||
"version": "14.1.0",
|
"version": "14.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-14.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz",
|
||||||
"integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
|
"integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
BIN
my-vue-app/public/NYC_logo.png
Normal file
BIN
my-vue-app/public/NYC_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
@@ -7,7 +7,7 @@ export const getProblemDistribution = (params) => {
|
|||||||
|
|
||||||
// 今日通话 /api/v1/more_level_screening/today_call
|
// 今日通话 /api/v1/more_level_screening/today_call
|
||||||
export const getTodayCall = (params) => {
|
export const getTodayCall = (params) => {
|
||||||
return https.post('/api/v1/sales/today_call', params)
|
return https.post('/api/v1/sales/current_camp_call', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格填写率 /api/v1/more_level_screening/table_filling_rate
|
// 表格填写率 /api/v1/more_level_screening/table_filling_rate
|
||||||
@@ -81,3 +81,8 @@ export const getAvgCallTime = (params) => {
|
|||||||
export const getCallSuccessRate = (params) => {
|
export const getCallSuccessRate = (params) => {
|
||||||
return https.post('/api/v1/sales/get_call_success_rate', params)
|
return https.post('/api/v1/sales/get_call_success_rate', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 二阶分析报告
|
||||||
|
export const getSecondOrderAnalysisReport = (params) => {
|
||||||
|
return https.post('/api/v1/sales/get_second_analysis_report', params)
|
||||||
|
}
|
||||||
@@ -44,6 +44,22 @@ export const getGroupDetail = (params) => {
|
|||||||
export const getGroupCallDuration = (params) => {
|
export const getGroupCallDuration = (params) => {
|
||||||
return https.post('/api/v1/manager/group_call_duration', params)
|
return https.post('/api/v1/manager/group_call_duration', params)
|
||||||
}
|
}
|
||||||
|
// 二阶分析报告 /api/v1/sales/get_call_text
|
||||||
|
export const GetSecondOrderAnalysisReport = (params) => {
|
||||||
|
return https.post('/api/v1/manager/group_second_report', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通话分类数据 /api/v1/manager/get_member_call_classify
|
||||||
|
export const getMemberCallClassify = (params) => {
|
||||||
|
return https.post('/api/v1/manager/get_member_call_classify', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团队整体三阶分析报告 /api/v1/manager/group_entirety_third_report
|
||||||
|
export const getGroupEntiretyThirdReport = (params) => {
|
||||||
|
return https.post('/api/v1/manager/group_entirety_third_report', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取优秀录音文件 /api/v1/level_five/overview/get_excellent_record_file
|
||||||
|
export const getExcellentRecordFile = (params) => {
|
||||||
|
return https.post('/api/v1/level_five/overview/get_excellent_record_file', params)
|
||||||
|
}
|
||||||
@@ -66,7 +66,7 @@ export const getCampPeriodAdmin = (params) => {
|
|||||||
}
|
}
|
||||||
// 获取优秀录音文件 /api/v1/level_four/overview/get_excellent_record_file
|
// 获取优秀录音文件 /api/v1/level_four/overview/get_excellent_record_file
|
||||||
export const getExcellentRecordFile = (params) => {
|
export const getExcellentRecordFile = (params) => {
|
||||||
return https.post('/api/v1/common/get_excellent_record_file', params)
|
return https.post('/api/v1/level_four/overview/get_excellent_record_file', params)
|
||||||
}
|
}
|
||||||
// 修改营期 /api/v1/level_four/overview/change_camp_period
|
// 修改营期 /api/v1/level_four/overview/change_camp_period
|
||||||
export const changeCampPeriod = (params) => {
|
export const changeCampPeriod = (params) => {
|
||||||
@@ -87,7 +87,7 @@ export const cancelSwitchHistoryCampPeriod = (params) => {
|
|||||||
|
|
||||||
// 一键导出 api/v1/level_four/overview/export_customers
|
// 一键导出 api/v1/level_four/overview/export_customers
|
||||||
export const exportCustomers = (params) => {
|
export const exportCustomers = (params) => {
|
||||||
return https.post('/api/v1/level_four/overview/export_customers', params)
|
return https.post('/api/v1/level_four/overview/export_all_customers_under_sales', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,14 +45,18 @@ export const getTimeoutRate = (params) => {
|
|||||||
export const getTableFillingRate = (params) => {
|
export const getTableFillingRate = (params) => {
|
||||||
return https.post('/api/v1/level_three/overview/table_filling_rate', params)
|
return https.post('/api/v1/level_three/overview/table_filling_rate', params)
|
||||||
}
|
}
|
||||||
// 销售漏斗
|
|
||||||
|
// 销售漏斗 /api/v1/level_three/overview/team_sales_funnel
|
||||||
|
export const getTeamSalesFunnel = (params) => {
|
||||||
|
return https.post('/api/v1/level_three/overview/team_sales_funnel', params)
|
||||||
|
}
|
||||||
|
|
||||||
// 客户迫切解决的问题 /api/v1/level_three/overview/urgent_need_to_address
|
// 客户迫切解决的问题 /api/v1/level_three/overview/urgent_need_to_address
|
||||||
export const getUrgentNeedToAddress = (params) => {
|
export const getUrgentNeedToAddress = (params) => {
|
||||||
return https.post('/api/v1/level_three/overview/urgent_need_to_address', params)
|
return https.post('/api/v1/level_three/overview/urgent_need_to_address', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 团队业绩排名 /api/v1/level_three/overview/team_ranking
|
// 团队业绩排名 /api/v1/level_three/overview/team_ranking
|
||||||
export const getTeamRanking = (params) => {
|
export const getTeamRanking = (params) => {
|
||||||
return https.post('/api/v1/level_three/overview/team_ranking', params)
|
return https.post('/api/v1/level_three/overview/team_ranking', params)
|
||||||
}
|
}
|
||||||
@@ -66,8 +70,28 @@ export const getTeamRankingInfo = (params) => {
|
|||||||
export const getAbnormalResponseRate = (params) => {
|
export const getAbnormalResponseRate = (params) => {
|
||||||
return https.post('/api/v1/level_three/overview/abnormal_response_rate', params)
|
return https.post('/api/v1/level_three/overview/abnormal_response_rate', params)
|
||||||
}
|
}
|
||||||
|
// 历史营期 /api/v1/level_three/overview/get_history_camps
|
||||||
|
export const getHistoryCamps = (params) => {
|
||||||
|
return https.post('/api/v1/level_three/overview/get_history_camps', params)
|
||||||
|
}
|
||||||
|
// 数据对比 /api/v1/level_three/overview/get_team_many_target
|
||||||
|
export const getTeamManyTarget = (params) => {
|
||||||
|
return https.post('/api/v1/level_three/overview/get_team_many_target', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优秀录音 /api/v1/level_three/overview/get_current_center_excellent_record_file
|
||||||
|
export const getExcellentRecordFile = (params) => {
|
||||||
|
return https.post('/api/v1/level_three/overview/get_current_center_excellent_record_file', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团队下各组分析报告 /api/v1/level_three/overview/team_every_group_report
|
||||||
|
export const getTeamEveryGroupReport = (params) => {
|
||||||
|
return https.post('/api/v1/level_three/overview/team_every_group_report', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 部门整体分析报告 /api/v1/level_three/overview/team_entirety_report
|
||||||
|
export const getTeamEntiretyReport = (params) => {
|
||||||
|
return https.post('/api/v1/level_three/overview/team_entirety_report', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ export const getDetailedDataTable = (params) => {
|
|||||||
export const getPeriodStage = (params) => {
|
export const getPeriodStage = (params) => {
|
||||||
return https.get('/api/v1/level_five/overview/get_period_stage', params)
|
return https.get('/api/v1/level_five/overview/get_period_stage', params)
|
||||||
}
|
}
|
||||||
// 获取优秀录音文件 /api/v1/level_four/overview/get_excellent_record_file
|
// 获取优秀录音文件 /api/v1/level_five/overview/get_excellent_record_file
|
||||||
export const getExcellentRecordFile = (params) => {
|
export const getExcellentRecordFile = (params) => {
|
||||||
return https.post('/api/v1/common/get_excellent_record_file', params)
|
return https.post('/api/v1/level_five/overview/get_excellent_record_file', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
334
my-vue-app/src/components/FeedbackForm.vue
Normal file
334
my-vue-app/src/components/FeedbackForm.vue
Normal file
@@ -0,0 +1,334 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="isVisible" class="modal-overlay" @click="closeModal">
|
||||||
|
<div class="modal-container" @click.stop>
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3>意见反馈</h3>
|
||||||
|
<button class="modal-close-btn" @click="closeModal">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="feedback-form-container">
|
||||||
|
<h2>意见反馈</h2>
|
||||||
|
<p class="subtitle">我们期待听到您的声音,不断改进我们的产品。</p>
|
||||||
|
|
||||||
|
<!-- 提交成功或失败的提示信息 -->
|
||||||
|
<div v-if="submitStatus === 'success'" class="feedback-message success">
|
||||||
|
✓ 感谢您的反馈!我们已经收到您的宝贵意见。
|
||||||
|
</div>
|
||||||
|
<div v-if="submitStatus === 'error'" class="feedback-message error">
|
||||||
|
✗ 提交失败,请检查网络或稍后重试。
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form v-if="submitStatus !== 'success'" @submit.prevent="handleSubmit">
|
||||||
|
<!-- 反馈类型 -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="feedback-type">反馈类型</label>
|
||||||
|
<select id="feedback-type" v-model="formData.type">
|
||||||
|
<option>功能建议</option>
|
||||||
|
<option>界面优化</option>
|
||||||
|
<option>Bug 反馈</option>
|
||||||
|
<option>其他</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 反馈内容 -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="feedback-content">反馈内容 (必填)</label>
|
||||||
|
<textarea
|
||||||
|
id="feedback-content"
|
||||||
|
v-model="formData.content"
|
||||||
|
placeholder="请详细描述您的问题或建议..."
|
||||||
|
rows="6"
|
||||||
|
required
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
<!-- 提交按钮 -->
|
||||||
|
<div class="form-actions">
|
||||||
|
<button type="submit" :disabled="isSubmitting">
|
||||||
|
<span v-if="isSubmitting">正在提交...</span>
|
||||||
|
<span v-else>提交反馈</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import axios from 'axios';
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
|
||||||
|
// 定义组件的props
|
||||||
|
const props = defineProps({
|
||||||
|
isVisible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 定义组件要触发的事件
|
||||||
|
const emit = defineEmits(['submit-feedback', 'close']);
|
||||||
|
|
||||||
|
// 使用 reactive 创建响应式表单数据对象
|
||||||
|
const formData = reactive({
|
||||||
|
type: '功能建议', // 默认值
|
||||||
|
content: '',
|
||||||
|
contact: '',
|
||||||
|
screenshot: null, // 存储文件对象
|
||||||
|
});
|
||||||
|
|
||||||
|
// ref 用于独立的响应式值
|
||||||
|
const isSubmitting = ref(false); // 是否正在提交
|
||||||
|
const submitStatus = ref(null); // 'success', 'error', or null
|
||||||
|
const imagePreviewUrl = ref(null); // 图片预览 URL
|
||||||
|
const fileInputRef = ref(null); // 用于引用文件输入元素
|
||||||
|
|
||||||
|
// 文件选择变化时的处理函数
|
||||||
|
const handleFileChange = (event) => {
|
||||||
|
const file = event.target.files[0];
|
||||||
|
if (file) {
|
||||||
|
formData.screenshot = file;
|
||||||
|
// 创建一个临时的 URL 用于图片预览
|
||||||
|
imagePreviewUrl.value = URL.createObjectURL(file);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 移除已选图片
|
||||||
|
const removeImage = () => {
|
||||||
|
formData.screenshot = null;
|
||||||
|
imagePreviewUrl.value = null;
|
||||||
|
// 清空文件输入框的值,以便用户可以再次选择相同的文件
|
||||||
|
if (fileInputRef.value) {
|
||||||
|
fileInputRef.value.value = '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭模态框
|
||||||
|
const closeModal = () => {
|
||||||
|
emit('close');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单提交处理函数
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
// 简单验证
|
||||||
|
if (!formData.content.trim()) {
|
||||||
|
alert('反馈内容不能为空!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
isSubmitting.value = true;
|
||||||
|
submitStatus.value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 创建 FormData 对象
|
||||||
|
// 获取 token (假设存储在 localStorage 中)
|
||||||
|
const token = localStorage.getItem('token') || '';
|
||||||
|
|
||||||
|
// 发送 POST 请求到后端接口
|
||||||
|
const response = await axios.post('https://feedback.api.nycjy.cn/api/v1/feedback/submit_feedback', {project:'mldash',type: formData.type, content: formData.content}, {
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// console.log('响应状态8888:', response.data.message);
|
||||||
|
// 提交成功
|
||||||
|
submitStatus.value = 'success';
|
||||||
|
// 触发父组件的事件,并传递数据
|
||||||
|
emit('submit-feedback', { ...formData });
|
||||||
|
} catch (error) {
|
||||||
|
console.error('提交反馈失败:', error);
|
||||||
|
// 提交失败
|
||||||
|
submitStatus.value = 'error';
|
||||||
|
} finally {
|
||||||
|
// 请求结束
|
||||||
|
isSubmitting.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-container {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
max-width: 600px;
|
||||||
|
width: 90%;
|
||||||
|
max-height: 90vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 1rem 2rem;
|
||||||
|
border-bottom: 1px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
color: #1a202c;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-close-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #718096;
|
||||||
|
padding: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-close-btn:hover {
|
||||||
|
color: #1a202c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-form-container {
|
||||||
|
padding: 2rem;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
text-align: center;
|
||||||
|
color: #1a202c;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
text-align: center;
|
||||||
|
color: #718096;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #4a5568;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"],
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0.75rem;
|
||||||
|
border: 1px solid #cbd5e0;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 1rem;
|
||||||
|
color: #2d3748;
|
||||||
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"]:focus,
|
||||||
|
select:focus,
|
||||||
|
textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: #4299e1;
|
||||||
|
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-preview {
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
max-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-preview img {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove-image-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: -10px;
|
||||||
|
right: -10px;
|
||||||
|
background-color: #e53e3e;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-actions {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
button[type="submit"] {
|
||||||
|
padding: 0.75rem 2rem;
|
||||||
|
background-color: #4299e1;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
button[type="submit"]:hover:not(:disabled) {
|
||||||
|
background-color: #3182ce;
|
||||||
|
}
|
||||||
|
|
||||||
|
button[type="submit"]:disabled {
|
||||||
|
background-color: #a0aec0;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-message {
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 6px;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-message.success {
|
||||||
|
background-color: #c6f6d5;
|
||||||
|
color: #2f855a;
|
||||||
|
border: 1px solid #9ae6b4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-message.error {
|
||||||
|
background-color: #fed7d7;
|
||||||
|
color: #c53030;
|
||||||
|
border: 1px solid #feb2b2;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,7 +11,7 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
redirect: '/sale'
|
redirect: '/login'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useUserStore } from '@/stores/user'
|
|||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: 'https://mldash.nycjy.cn/' || '', // API基础路径,支持完整URL
|
baseURL: 'https://mldash.nycjy.cn/' || '', // API基础路径,支持完整URL
|
||||||
// baseURL: 'http://192.168.15.121:8890' || '', // API基础路径,支持完整URL
|
// baseURL: 'http://192.168.15.121:8890' || '', // API基础路径,支持完整URL
|
||||||
timeout: 100000, // 请求超时时间
|
timeout: 100000, // 请求超时时间
|
||||||
headers: {
|
headers: {
|
||||||
@@ -31,7 +31,6 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
// 显示加载状态
|
// 显示加载状态
|
||||||
if (config.showLoading !== false) {
|
if (config.showLoading !== false) {
|
||||||
console.log('显示加载中...')
|
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
|
|||||||
1144
my-vue-app/src/views/maneger/components/GoodMusic.vue
Normal file
1144
my-vue-app/src/views/maneger/components/GoodMusic.vue
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="team-report">
|
<div class="team-report">
|
||||||
<h2>今日团队实时战报</h2>
|
<div class="header-container">
|
||||||
|
<h2>今日团队实时战报</h2>
|
||||||
|
<button class="analysis-button" @click="showTeamAnalysis">团队分析</button>
|
||||||
|
</div>
|
||||||
<div class="report-grid">
|
<div class="report-grid">
|
||||||
<div class="report-card">
|
<div class="report-card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@@ -32,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="report-card">
|
<div class="report-card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">月度总业绩 <i class="info-icon" @mouseenter="showTooltip('monthlyRevenue', $event)" @mouseleave="hideTooltip">ⓘ</i></span>
|
<span class="card-title">本月成交单数 <i class="info-icon" @mouseenter="showTooltip('monthlyRevenue', $event)" @mouseleave="hideTooltip">ⓘ</i></span>
|
||||||
<span class="card-trend positive">+8% vs 上月</span>
|
<span class="card-trend positive">+8% vs 上月</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-value">{{ formatCurrency(weekTotalData.week_add_fee_total?.total_add_fee || 0) }} 元</div>
|
<div class="card-value">{{ formatCurrency(weekTotalData.week_add_fee_total?.total_add_fee || 0) }} 元</div>
|
||||||
@@ -76,6 +79,9 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 定义emit
|
||||||
|
const emit = defineEmits(['show-team-analysis'])
|
||||||
|
|
||||||
// 监听数据变化,用于调试
|
// 监听数据变化,用于调试
|
||||||
watch(() => props.weekTotalData, (newData) => {
|
watch(() => props.weekTotalData, (newData) => {
|
||||||
console.log('TeamReport 收到的数据:', newData)
|
console.log('TeamReport 收到的数据:', newData)
|
||||||
@@ -122,8 +128,8 @@ const metricDescriptions = {
|
|||||||
description: '本期新增的成交订单数量,已确认付款或签约的客户订单。'
|
description: '本期新增的成交订单数量,已确认付款或签约的客户订单。'
|
||||||
},
|
},
|
||||||
monthlyRevenue: {
|
monthlyRevenue: {
|
||||||
title: '月度总业绩',
|
title: '本月成交单数',
|
||||||
description: '本月团队累计完成的销售业绩总额,包括所有已确认的订单金额。'
|
description: '本月团队累计完成的销售订单数量,包括所有已确认的订单。'
|
||||||
},
|
},
|
||||||
conversionRate: {
|
conversionRate: {
|
||||||
title: '定金转化率',
|
title: '定金转化率',
|
||||||
@@ -146,6 +152,11 @@ const showTooltip = (metricType, event) => {
|
|||||||
const hideTooltip = () => {
|
const hideTooltip = () => {
|
||||||
tooltip.visible = false
|
tooltip.visible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 显示团队分析
|
||||||
|
const showTeamAnalysis = () => {
|
||||||
|
emit('show-team-analysis')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -156,11 +167,33 @@ const hideTooltip = () => {
|
|||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.header-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #1e293b;
|
color: #1e293b;
|
||||||
margin: 0 0 1.5rem 0;
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analysis-button {
|
||||||
|
background: #409eff;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #337ecc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.report-grid {
|
.report-grid {
|
||||||
|
|||||||
@@ -37,9 +37,11 @@
|
|||||||
<!-- Top Section - Team Alerts and Today's Report -->
|
<!-- Top Section - Team Alerts and Today's Report -->
|
||||||
<div class="top-section">
|
<div class="top-section">
|
||||||
<!-- Team Alerts -->
|
<!-- Team Alerts -->
|
||||||
<TeamAlerts :abnormalData="groupAbnormalResponse" />
|
<!-- <TeamAlerts :abnormalData="groupAbnormalResponse" /> -->
|
||||||
<!-- Today's Team Report -->
|
<GoodMusic :quality-calls="excellentRecord"
|
||||||
<TeamReport :weekTotalData="weekTotalData" />
|
/>
|
||||||
|
<!-- Today's Team Report -->
|
||||||
|
<TeamReport :weekTotalData="weekTotalData" @show-team-analysis="fetchTeamAnalysis" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Sales Funnel Section -->
|
<!-- Sales Funnel Section -->
|
||||||
@@ -65,23 +67,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 团队分析弹窗 -->
|
||||||
|
<div v-if="showTeamAnalysisModal" class="modal-overlay" @click="showTeamAnalysisModal = false">
|
||||||
|
<div class="modal-content" @click.stop>
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3>团队整体三阶分析报告</h3>
|
||||||
|
<button class="close-button" @click="showTeamAnalysisModal = false">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div v-for="(report, index) in teamAnalysisData" :key="index" class="report-item">
|
||||||
|
<div class="report-meta">
|
||||||
|
<span class="time-range">{{ report.start_time }} 至 {{ report.end_time }}</span>
|
||||||
|
<span class="created-at">生成时间: {{ report.created_at }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="report-content" v-html="formatReportContent(report.report)"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed } from "vue";
|
import { ref, onMounted, computed } from "vue";
|
||||||
import TeamAlerts from "./components/TeamAlerts.vue";
|
import TeamAlerts from "./components/TeamAlerts.vue";
|
||||||
|
import GoodMusic from "./components/GoodMusic.vue";
|
||||||
import TeamReport from "./components/TeamReport.vue";
|
import TeamReport from "./components/TeamReport.vue";
|
||||||
import SalesFunnel from "./components/SalesFunnel.vue";
|
import SalesFunnel from "./components/SalesFunnel.vue";
|
||||||
import PerformanceRanking from "./components/PerformanceRanking.vue";
|
import PerformanceRanking from "./components/PerformanceRanking.vue";
|
||||||
import MemberDetails from "./components/MemberDetails.vue";
|
import MemberDetails from "./components/MemberDetails.vue";
|
||||||
import Sale from "../person/Sale.vue";
|
import Sale from "../person/sale.vue";
|
||||||
import SalesTimelineWithTaskList from "../person/components/SalesTimelineWithTaskList.vue";
|
import SalesTimelineWithTaskList from "../person/components/SalesTimelineWithTaskList.vue";
|
||||||
import RawDataCards from "../person/components/RawDataCards.vue";
|
import RawDataCards from "../person/components/RawDataCards.vue";
|
||||||
import CustomerDetail from "../person/components/CustomerDetail.vue";
|
import CustomerDetail from "../person/components/CustomerDetail.vue";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import {getGroupAbnormalResponse, getWeekTotalCall, getWeekAddCustomerTotal, getWeekAddDealTotal,
|
import {getGroupAbnormalResponse, getWeekTotalCall, getWeekAddCustomerTotal, getWeekAddDealTotal,
|
||||||
getWeekAddFeeTotal, getGroupFunnel,getPayDepositToMoneyRate,getGroupRanking, getGroupCallDuration,getGroupDetail} from "@/api/manager.js";
|
getWeekAddFeeTotal, getGroupFunnel,getPayDepositToMoneyRate,getGroupRanking, getGroupCallDuration,getGroupDetail, getGroupEntiretyThirdReport,getExcellentRecordFile} from "@/api/manager.js";
|
||||||
|
|
||||||
// 团队成员数据
|
// 团队成员数据
|
||||||
const teamMembers = [
|
const teamMembers = [
|
||||||
@@ -108,9 +129,10 @@ const userStore = useUserStore();
|
|||||||
// 获取通用请求参数的函数
|
// 获取通用请求参数的函数
|
||||||
const getRequestParams = () => {
|
const getRequestParams = () => {
|
||||||
const params = {}
|
const params = {}
|
||||||
// 只从路由参数获取
|
// 从路由参数获取
|
||||||
const routeUserLevel = router.currentRoute.value.query.user_level || router.currentRoute.value.params.user_level
|
const routeUserLevel = router.currentRoute.value.query.user_level || router.currentRoute.value.params.user_level
|
||||||
const routeUserName = router.currentRoute.value.query.user_name || router.currentRoute.value.params.user_name
|
const routeUserName = router.currentRoute.value.query.user_name || router.currentRoute.value.params.user_name
|
||||||
|
|
||||||
// 如果路由有参数,使用路由参数
|
// 如果路由有参数,使用路由参数
|
||||||
if (routeUserLevel) {
|
if (routeUserLevel) {
|
||||||
params.user_level = routeUserLevel.toString()
|
params.user_level = routeUserLevel.toString()
|
||||||
@@ -118,6 +140,14 @@ const getRequestParams = () => {
|
|||||||
if (routeUserName) {
|
if (routeUserName) {
|
||||||
params.user_name = routeUserName
|
params.user_name = routeUserName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果没有路由参数,使用当前登录用户的信息
|
||||||
|
if (!params.user_level && userStore.userInfo?.user_level) {
|
||||||
|
params.user_level = userStore.userInfo.user_level.toString()
|
||||||
|
}
|
||||||
|
if (!params.user_name && userStore.userInfo?.username) {
|
||||||
|
params.user_name = userStore.userInfo.username
|
||||||
|
}
|
||||||
|
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
@@ -146,7 +176,7 @@ const weekTotalData = ref({
|
|||||||
pay_deposit_to_money_rate: {},
|
pay_deposit_to_money_rate: {},
|
||||||
group_funnel: {},
|
group_funnel: {},
|
||||||
group_call_duration: {},
|
group_call_duration: {},
|
||||||
});
|
})
|
||||||
// 团队异常预警
|
// 团队异常预警
|
||||||
const groupAbnormalResponse = ref({})
|
const groupAbnormalResponse = ref({})
|
||||||
async function TeamGetGroupAbnormalResponse() {
|
async function TeamGetGroupAbnormalResponse() {
|
||||||
@@ -161,9 +191,9 @@ async function TeamGetGroupAbnormalResponse() {
|
|||||||
let alertId = 1
|
let alertId = 1
|
||||||
|
|
||||||
// 处理严重超时异常人员
|
// 处理严重超时异常人员
|
||||||
const timeoutPersons = rawData.erious_timeout_rate_abnorma || []
|
const timeoutPersons = rawData?.serious_timeout_rate_abnorma || []
|
||||||
// 处理表格填写异常人员
|
// 处理表格填写异常人员
|
||||||
const fillingPersons = rawData.table_filling_abnormal || []
|
const fillingPersons = rawData?.table_filling_abnormal || []
|
||||||
|
|
||||||
// 为每个异常人员生成独立的预警消息
|
// 为每个异常人员生成独立的预警消息
|
||||||
|
|
||||||
@@ -234,7 +264,48 @@ async function TeamGetWeekAddDealTotal() {
|
|||||||
weekTotalData.value.week_add_deal_total = res.data
|
weekTotalData.value.week_add_deal_total = res.data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 月度总业绩
|
// 优秀录音
|
||||||
|
// 获取优秀录音
|
||||||
|
const excellentRecord = ref([]);
|
||||||
|
// 获取优秀录音文件
|
||||||
|
async function CentergetGoodRecord() {
|
||||||
|
console.log('CentergetGoodRecord 开始执行')
|
||||||
|
try {
|
||||||
|
const params = getRequestParams()
|
||||||
|
const params1 = {
|
||||||
|
user_level: userStore.userInfo?.user_level?.toString() || '',
|
||||||
|
user_name: userStore.userInfo?.username || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查参数是否有效
|
||||||
|
const hasParams = params.user_name && params.user_level
|
||||||
|
const requestParams = hasParams ? {
|
||||||
|
...params,
|
||||||
|
} : params1
|
||||||
|
|
||||||
|
console.log('CentergetGoodRecord request params:', requestParams)
|
||||||
|
|
||||||
|
// 验证必要参数是否存在
|
||||||
|
if (!requestParams.user_name || !requestParams.user_level) {
|
||||||
|
console.error("缺少必要的请求参数:", requestParams);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 直接发送请求,不使用缓存
|
||||||
|
const res = await getExcellentRecordFile(requestParams)
|
||||||
|
console.log(972872132,res)
|
||||||
|
if (res && res.code === 200 && res.data) {
|
||||||
|
excellentRecord.value = res.data || []
|
||||||
|
console.log('获取优秀录音成功:', res.data)
|
||||||
|
} else {
|
||||||
|
console.error("获取优秀录音失败,响应数据不完整:", res);
|
||||||
|
excellentRecord.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("获取优秀录音失败:", error);
|
||||||
|
excellentRecord.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 定金转化
|
// 定金转化
|
||||||
@@ -286,6 +357,10 @@ async function TeamGetGroupRanking() {
|
|||||||
const memberDetails = ref({})
|
const memberDetails = ref({})
|
||||||
|
|
||||||
|
|
||||||
|
// 团队分析数据
|
||||||
|
const teamAnalysisData = ref([])
|
||||||
|
const showTeamAnalysisModal = ref(false)
|
||||||
|
|
||||||
// 当前选中的成员,默认为空
|
// 当前选中的成员,默认为空
|
||||||
const selectedMember = ref(null);
|
const selectedMember = ref(null);
|
||||||
|
|
||||||
@@ -318,18 +393,85 @@ week_order_count
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取团队分析数据
|
||||||
|
const fetchTeamAnalysis = async () => {
|
||||||
|
try {
|
||||||
|
showTeamAnalysisModal.value = true
|
||||||
|
|
||||||
|
const params = getRequestParams()
|
||||||
|
const response = await getGroupEntiretyThirdReport(params)
|
||||||
|
|
||||||
|
// 根据API响应结构调整数据处理逻辑
|
||||||
|
if (response.data) {
|
||||||
|
if (Array.isArray(response.data)) {
|
||||||
|
// 如果response.data本身就是数组
|
||||||
|
teamAnalysisData.value = response.data
|
||||||
|
} else if (response.data.data && Array.isArray(response.data.data)) {
|
||||||
|
// 如果response.data.data是数组
|
||||||
|
teamAnalysisData.value = response.data.data
|
||||||
|
} else {
|
||||||
|
// 其他情况,可能是单个对象
|
||||||
|
teamAnalysisData.value = [response.data]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取团队分析数据失败:', error)
|
||||||
|
teamAnalysisData.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 格式化报告内容
|
||||||
|
const formatReportContent = (content) => {
|
||||||
|
if (!content || content === "None") {
|
||||||
|
return "<p>暂无分析报告内容</p>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理报告内容,保留换行和基本格式
|
||||||
|
let formattedContent = content
|
||||||
|
// 替换连续的换行符
|
||||||
|
.replace(/\n\s*\n/g, '</p><p>')
|
||||||
|
// 替换单个换行符为<br>
|
||||||
|
.replace(/\n/g, '<br>')
|
||||||
|
// 替换Markdown风格的标题为HTML标签
|
||||||
|
.replace(/^### (.*?)(<br>|$)/gim, '<h3>$1</h3>')
|
||||||
|
.replace(/^## (.*?)(<br>|$)/gim, '<h2>$1</h2>')
|
||||||
|
.replace(/^# (.*?)(<br>|$)/gim, '<h1>$1</h1>')
|
||||||
|
// 替换粗体
|
||||||
|
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
||||||
|
// 替换斜体
|
||||||
|
.replace(/\*(.*?)\*/g, '<em>$1</em>')
|
||||||
|
// 替换无序列表项
|
||||||
|
.replace(/^\* (.*?)(<br>|$)/gim, '<li>$1</li>');
|
||||||
|
|
||||||
|
// 包装列表项到<ul>标签中
|
||||||
|
formattedContent = formattedContent.replace(/(<li>.*?<\/li>)+/g, '<ul>$&</ul>');
|
||||||
|
|
||||||
|
// 处理段落
|
||||||
|
if (!formattedContent.startsWith('<p>')) {
|
||||||
|
formattedContent = '<p>' + formattedContent;
|
||||||
|
}
|
||||||
|
if (!formattedContent.endsWith('</p>')) {
|
||||||
|
formattedContent = formattedContent + '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理多余的<br>标签
|
||||||
|
formattedContent = formattedContent.replace(/<br><\/p>/g, '</p>');
|
||||||
|
|
||||||
|
return formattedContent;
|
||||||
|
}
|
||||||
|
|
||||||
// 团队异常预警
|
// 团队异常预警
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await TeamGetGroupAbnormalResponse()
|
CentergetGoodRecord()
|
||||||
await TeamGetWeekTotalCall()
|
TeamGetGroupAbnormalResponse()
|
||||||
await TeamGetGroupCallDuration()
|
TeamGetWeekTotalCall()
|
||||||
await TeamGetWeekAddCustomerTotal()
|
TeamGetGroupCallDuration()
|
||||||
await TeamGetWeekAddDealTotal()
|
TeamGetWeekAddCustomerTotal()
|
||||||
await TeamGetWeekAddFeeTotal()
|
TeamGetWeekAddDealTotal()
|
||||||
await TeamGetGroupFunnel()
|
TeamGetWeekAddFeeTotal()
|
||||||
await TeamGetGroupRanking()
|
TeamGetGroupFunnel()
|
||||||
|
TeamGetGroupRanking()
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -646,12 +788,12 @@ onMounted(async () => {
|
|||||||
.top-section {
|
.top-section {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 3fr;
|
grid-template-columns: 1fr 3fr;
|
||||||
gap: 1rem;
|
gap: 0.5rem;
|
||||||
|
|
||||||
// PC端保持一致布局
|
// PC端保持一致布局
|
||||||
@media (min-width: 1024px) {
|
@media (min-width: 1024px) {
|
||||||
grid-template-columns: 1fr 3fr;
|
grid-template-columns: 1fr 3fr;
|
||||||
gap: 1.5rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平板端适配
|
// 平板端适配
|
||||||
@@ -676,7 +818,7 @@ onMounted(async () => {
|
|||||||
.analytics-section {
|
.analytics-section {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 1rem;
|
gap: 0.5rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
// PC端保持一致布局
|
// PC端保持一致布局
|
||||||
@@ -1850,5 +1992,267 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 团队分析弹窗样式 */
|
||||||
|
.modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
max-width: 90vw;
|
||||||
|
max-height: 90vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #999;
|
||||||
|
padding: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button:hover {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
padding: 1.5rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: calc(90vh - 80px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-item {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-item:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-meta {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content {
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h1),
|
||||||
|
.report-content :deep(h2),
|
||||||
|
.report-content :deep(h3),
|
||||||
|
.report-content :deep(h4),
|
||||||
|
.report-content :deep(h5),
|
||||||
|
.report-content :deep(h6) {
|
||||||
|
margin: 1.5rem 0 1rem 0;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h1) {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
border-bottom: 2px solid #eee;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h2) {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h3) {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(p) {
|
||||||
|
margin: 0.75rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(ul),
|
||||||
|
.report-content :deep(ol) {
|
||||||
|
margin: 0.75rem 0;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(li) {
|
||||||
|
margin: 0.25rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(strong) {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(em) {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 团队分析弹窗 */
|
||||||
|
.modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
max-width: 90vw;
|
||||||
|
max-height: 90vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #999;
|
||||||
|
padding: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button:hover {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
padding: 1.5rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: calc(90vh - 80px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-item {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-item:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-meta {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content {
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h1),
|
||||||
|
.report-content :deep(h2),
|
||||||
|
.report-content :deep(h3),
|
||||||
|
.report-content :deep(h4),
|
||||||
|
.report-content :deep(h5),
|
||||||
|
.report-content :deep(h6) {
|
||||||
|
margin: 1.5rem 0 1rem 0;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h1) {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
border-bottom: 2px solid #eee;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h2) {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(h3) {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(p) {
|
||||||
|
margin: 0.75rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(ul),
|
||||||
|
.report-content :deep(ol) {
|
||||||
|
margin: 0.75rem 0;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(li) {
|
||||||
|
margin: 0.25rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(strong) {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-content :deep(em) {
|
||||||
|
font-style: italic;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="personal-dashboard">
|
<div class="personal-dashboard">
|
||||||
<!-- 头部标题 -->
|
<!-- 头部标题 -->
|
||||||
<div class="dashboard-header">
|
<div class="dashboard-header" style="display: flex; justify-content: space-between; align-items: center;">
|
||||||
<h2>个人工作仪表板</h2>
|
<h2>个人工作仪表板</h2>
|
||||||
|
<button @click="showSecondOrderAnalysisReport">阶段分析报告</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 核心KPI & 统计卡片 -->
|
<!-- 核心KPI & 统计卡片 -->
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
<div class="kpi-grid">
|
<div class="kpi-grid">
|
||||||
<div class="kpi-item">
|
<div class="kpi-item">
|
||||||
<div class="kpi-value">{{ props.kpiData.totalCalls }}</div>
|
<div class="kpi-value">{{ props.kpiData.totalCalls }}</div>
|
||||||
<p>今日通话 <i class="info-icon" @mouseenter="showTooltip('totalCalls', $event)" @mouseleave="hideTooltip">ⓘ</i></p>
|
<p>本期通话 <i class="info-icon" @mouseenter="showTooltip('totalCalls', $event)" @mouseleave="hideTooltip">ⓘ</i></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-item">
|
<div class="kpi-item">
|
||||||
<div class="kpi-value">{{ props.kpiData.successRate }}</div>
|
<div class="kpi-value">{{ props.kpiData.successRate }}</div>
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 统计指标 -->
|
<!-- 统计指标 -->
|
||||||
<StatisticData
|
<StatisticData
|
||||||
:customerCommunicationRate="props.statisticsData.customerCommunicationRate"
|
:customerCommunicationRate="props.statisticsData.customerCommunicationRate"
|
||||||
:averageResponseTime="props.statisticsData.averageResponseTime"
|
:averageResponseTime="props.statisticsData.averageResponseTime"
|
||||||
:timeoutResponseRate="props.statisticsData.timeoutResponseRate"
|
:timeoutResponseRate="props.statisticsData.timeoutResponseRate"
|
||||||
@@ -95,7 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 指标说明 Tooltip -->
|
<!-- 指标说明 Tooltip -->
|
||||||
<Tooltip
|
<Tooltip
|
||||||
:visible="tooltip.visible"
|
:visible="tooltip.visible"
|
||||||
@@ -104,7 +105,30 @@
|
|||||||
:title="tooltip.title"
|
:title="tooltip.title"
|
||||||
:description="tooltip.description"
|
:description="tooltip.description"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 阶段分析报告弹框 -->
|
||||||
|
<div v-if="showAnalysisModal" class="modal-overlay" @click.self="closeAnalysisModal">
|
||||||
|
<div class="modal-container">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-title">阶段分析报告</h3>
|
||||||
|
<button class="modal-close-btn" @click="closeAnalysisModal">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="analysis-content">
|
||||||
|
<div v-if="!analysisReport || Object.keys(analysisReport).length === 0" class="loading-message">正在生成分析报告...</div>
|
||||||
|
<div v-else-if="Array.isArray(analysisReport) && analysisReport.length === 0" class="error-message">数据为空</div>
|
||||||
|
<div v-else-if="Array.isArray(analysisReport)">
|
||||||
|
<div v-for="(report, index) in analysisReport" :key="index" class="report-section">
|
||||||
|
<h4>{{ report.name }} ({{ report.start_time }} 至 {{ report.end_time }})</h4>
|
||||||
|
<div v-html="report.report.replace(/\n/g, '<br>')"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="error-message">数据格式错误</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -114,11 +138,34 @@ import { ref, reactive, onMounted, onBeforeUnmount, computed, watch } from 'vue'
|
|||||||
import StatisticData from './StatisticData.vue';
|
import StatisticData from './StatisticData.vue';
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import Chart from 'chart.js/auto';
|
import Chart from 'chart.js/auto';
|
||||||
import {getTableFillingRate,getAverageResponseTime,getWeeklyActiveCommunicationRate,getTimeoutResponseRate} from "@/api/api.js"
|
import {getSecondOrderAnalysisReport} from "@/api/api.js"
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
import { SimpleChatService } from '@/utils/ChatService.js';
|
||||||
|
|
||||||
// 用户store
|
// 用户store
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
// 路由实例
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const Dify_API_Key_02 = 'app-MGaBOx5QFblsMZ7dSkxKJDKm'
|
||||||
|
const chatService_02= new SimpleChatService(Dify_API_Key_02)
|
||||||
|
|
||||||
|
// 获取通用请求参数的函数
|
||||||
|
const getRequestParams = () => {
|
||||||
|
const params = {}
|
||||||
|
// 只从路由参数获取
|
||||||
|
const routeUserLevel = router.currentRoute.value.query.user_level || router.currentRoute.value.params.user_level
|
||||||
|
const routeUserName = router.currentRoute.value.query.user_name || router.currentRoute.value.params.user_name
|
||||||
|
// 如果路由有参数,使用路由参数
|
||||||
|
if (routeUserLevel) {
|
||||||
|
params.user_level = routeUserLevel.toString()
|
||||||
|
}
|
||||||
|
if (routeUserName) {
|
||||||
|
params.user_name = routeUserName
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
}
|
||||||
// 定义props
|
// 定义props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
kpiData: {
|
kpiData: {
|
||||||
@@ -159,9 +206,20 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function CenterGetSecondOrderAnalysisReport() {
|
||||||
|
const params = getRequestParams()
|
||||||
|
const res = await getSecondOrderAnalysisReport(params)
|
||||||
|
if (res.code === 200) {
|
||||||
|
console.log(11111,res.data)
|
||||||
|
analysisReport.value = res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
// Chart.js 实例
|
// Chart.js 实例
|
||||||
const chartInstances = {};
|
const chartInstances = {};
|
||||||
|
|
||||||
|
// 添加组件挂载状态跟踪
|
||||||
|
const isComponentMounted = ref(true);
|
||||||
|
|
||||||
// DOM 元素引用
|
// DOM 元素引用
|
||||||
const personalFunnelChartCanvas = ref(null);
|
const personalFunnelChartCanvas = ref(null);
|
||||||
const contactTimeChartCanvas = ref(null);
|
const contactTimeChartCanvas = ref(null);
|
||||||
@@ -177,18 +235,26 @@ const tooltip = reactive({
|
|||||||
|
|
||||||
// 指标说明配置
|
// 指标说明配置
|
||||||
const kpiDescriptions = {
|
const kpiDescriptions = {
|
||||||
|
totalCalls: {
|
||||||
|
title: '本期通话',
|
||||||
|
description: '本期总共通话的次数。'
|
||||||
|
},
|
||||||
successRate: {
|
successRate: {
|
||||||
title: '电话接通率',
|
title: '电话接通率',
|
||||||
description: '拨通电话 ÷ 拨打的电话'
|
description: '拨通电话 ÷ 拨打的电话'
|
||||||
},
|
},
|
||||||
avgDuration: {
|
avgDuration: {
|
||||||
title: '平均通话时长',
|
title: '平均通话时长',
|
||||||
description: '所有通话总时长 ÷ 拨打电话次数。'
|
description: '所有通话总时长 ÷ 拨打的电话次数。'
|
||||||
},
|
},
|
||||||
conversionRate: {
|
conversionRate: {
|
||||||
title: '成交转化率',
|
title: '成交转化率',
|
||||||
description: '成交人数 ÷ 本期总数据。'
|
description: '成交人数 ÷ 本期总数据。'
|
||||||
},
|
},
|
||||||
|
assignedData: {
|
||||||
|
title: '本期分配数据',
|
||||||
|
description: '本期内分配到的数据总量。'
|
||||||
|
},
|
||||||
wechatAddRate: {
|
wechatAddRate: {
|
||||||
title: '加微率',
|
title: '加微率',
|
||||||
description: '加微人数 ÷ 本期数据总人数'
|
description: '加微人数 ÷ 本期数据总人数'
|
||||||
@@ -218,7 +284,8 @@ const createOrUpdateChart = (chartId, canvasRef, config) => {
|
|||||||
if (chartInstances[chartId]) {
|
if (chartInstances[chartId]) {
|
||||||
chartInstances[chartId].destroy();
|
chartInstances[chartId].destroy();
|
||||||
}
|
}
|
||||||
if (canvasRef.value) {
|
// 确保组件仍然挂载且canvas引用存在
|
||||||
|
if (isComponentMounted.value && canvasRef.value) {
|
||||||
const ctx = canvasRef.value.getContext('2d');
|
const ctx = canvasRef.value.getContext('2d');
|
||||||
chartInstances[chartId] = new Chart(ctx, config);
|
chartInstances[chartId] = new Chart(ctx, config);
|
||||||
}
|
}
|
||||||
@@ -226,6 +293,9 @@ const createOrUpdateChart = (chartId, canvasRef, config) => {
|
|||||||
|
|
||||||
// Chart.js: 渲染销售漏斗图
|
// Chart.js: 渲染销售漏斗图
|
||||||
const renderPersonalFunnelChart = () => {
|
const renderPersonalFunnelChart = () => {
|
||||||
|
// 确保组件仍然挂载
|
||||||
|
if (!isComponentMounted.value) return;
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
@@ -250,6 +320,9 @@ const renderPersonalFunnelChart = () => {
|
|||||||
|
|
||||||
// Chart.js: 渲染黄金联络时段图
|
// Chart.js: 渲染黄金联络时段图
|
||||||
const renderContactTimeChart = () => {
|
const renderContactTimeChart = () => {
|
||||||
|
// 确保组件仍然挂载
|
||||||
|
if (!isComponentMounted.value) return;
|
||||||
|
|
||||||
if (!props.contactTimeData || !props.contactTimeData.gold_contact_success_rate) {
|
if (!props.contactTimeData || !props.contactTimeData.gold_contact_success_rate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -306,7 +379,20 @@ const hideTooltip = () => {
|
|||||||
tooltip.visible = false;
|
tooltip.visible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 阶段分析报告模态框状态
|
||||||
|
const showAnalysisModal = ref(false);
|
||||||
|
// 阶段分析报告数据
|
||||||
|
const analysisReport = ref({});
|
||||||
|
// 显示阶段分析报告模态框
|
||||||
|
const showSecondOrderAnalysisReport = () => {
|
||||||
|
showAnalysisModal.value = true;
|
||||||
|
CenterGetSecondOrderAnalysisReport()
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭阶段分析报告模态框
|
||||||
|
const closeAnalysisModal = () => {
|
||||||
|
showAnalysisModal.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
watch(() => props.contactTimeData, () => {
|
watch(() => props.contactTimeData, () => {
|
||||||
renderContactTimeChart();
|
renderContactTimeChart();
|
||||||
@@ -315,11 +401,13 @@ watch(() => props.contactTimeData, () => {
|
|||||||
// --- 生命周期钩子 ---
|
// --- 生命周期钩子 ---
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
isComponentMounted.value = true;
|
||||||
renderPersonalFunnelChart();
|
renderPersonalFunnelChart();
|
||||||
renderContactTimeChart();
|
renderContactTimeChart();
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
isComponentMounted.value = false;
|
||||||
Object.values(chartInstances).forEach(chart => chart.destroy());
|
Object.values(chartInstances).forEach(chart => chart.destroy());
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -464,7 +552,7 @@ $white: #ffffff;
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
padding: 1rem 0.5rem;
|
padding: 1rem 0.5rem;
|
||||||
|
|
||||||
.stat-icon {
|
.stat-icon {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -475,14 +563,14 @@ $white: #ffffff;
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
color: $white;
|
color: $white;
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
|
|
||||||
&.customer-rate { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
|
&.customer-rate { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
|
||||||
&.response-time { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
|
&.response-time { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
|
||||||
&.timeout-rate { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
|
&.timeout-rate { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
|
||||||
&.form-rate { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
|
&.form-rate { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
|
||||||
&.severe-timeout-rate { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); }
|
&.severe-timeout-rate { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); }
|
||||||
}
|
}
|
||||||
|
|
||||||
.kpi-value {
|
.kpi-value {
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: 0.25rem;
|
||||||
}
|
}
|
||||||
@@ -511,7 +599,7 @@ $white: #ffffff;
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 16px;
|
padding: 10px 20px 10px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
h3 { margin: 0; color: $slate-900; font-size: 18px; font-weight: 600; }
|
h3 { margin: 0; color: $slate-900; font-size: 18px; font-weight: 600; }
|
||||||
}
|
}
|
||||||
@@ -586,19 +674,19 @@ $white: #ffffff;
|
|||||||
.personal-dashboard { padding: 15px; }
|
.personal-dashboard { padding: 15px; }
|
||||||
.stats-grid, .charts-section { grid-template-columns: 1fr; }
|
.stats-grid, .charts-section { grid-template-columns: 1fr; }
|
||||||
.stat-card { flex-direction: row; }
|
.stat-card { flex-direction: row; }
|
||||||
|
|
||||||
.dashboard-header {
|
.dashboard-header {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.kpi-grid {
|
.kpi-grid {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kpi-item {
|
.kpi-item {
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
.kpi-value {
|
.kpi-value {
|
||||||
@@ -608,49 +696,49 @@ $white: #ffffff;
|
|||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-grid-inner {
|
.stats-grid-inner {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-item {
|
.stat-item {
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
padding: 0.75rem 0.25rem;
|
padding: 0.75rem 0.25rem;
|
||||||
|
|
||||||
.stat-icon {
|
.stat-icon {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kpi-value {
|
.kpi-value {
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-header {
|
.chart-header {
|
||||||
padding: 16px 16px 12px;
|
padding: 16px 16px 12px;
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-content {
|
.chart-content {
|
||||||
padding-left: 16px;
|
padding-left: 16px;
|
||||||
padding-right: 16px;
|
padding-right: 16px;
|
||||||
padding-bottom: 16px;
|
padding-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -659,53 +747,60 @@ $white: #ffffff;
|
|||||||
.personal-dashboard {
|
.personal-dashboard {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-header {
|
.dashboard-header {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.kpi-grid {
|
.kpi-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kpi-item {
|
.kpi-item {
|
||||||
padding: 0.75rem;
|
padding: 0.75rem;
|
||||||
.kpi-value {
|
.kpi-value {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-grid-inner {
|
.stats-grid-inner {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-item {
|
.stat-item {
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
.stat-icon {
|
.stat-icon {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
margin-right: 0.75rem;
|
margin-right: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
min-height: 250px;
|
min-height: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.charts-section {
|
.charts-section {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-title {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -719,7 +814,7 @@ $white: #ffffff;
|
|||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
color: #007bff;
|
color: #007bff;
|
||||||
@@ -735,4 +830,163 @@ $white: #ffffff;
|
|||||||
position: relative;
|
position: relative;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 模态框样式 */
|
||||||
|
.modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-container {
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
width: 90%;
|
||||||
|
max-width: 600px;
|
||||||
|
max-height: 60vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px 20px;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
margin-right: auto; // 将标题推到最左边
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-close-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 24px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #909399;
|
||||||
|
padding: 0;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 16px; // 与按钮组保持间距
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
padding: 20px;
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.period-switcher {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0; // 防止按钮组在空间不足时被压缩
|
||||||
|
}
|
||||||
|
|
||||||
|
.period-switcher button {
|
||||||
|
padding: 6px 14px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
background: white;
|
||||||
|
border-radius: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
margin-left: -1px; // 让边框重叠,形成一体化效果
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-radius: 4px 0 0 4px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-radius: 0 4px 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: #a0cfff;
|
||||||
|
color: #409eff;
|
||||||
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background: #409eff;
|
||||||
|
border-color: #409eff;
|
||||||
|
color: white;
|
||||||
|
z-index: 2;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.analysis-content h4 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analysis-content p {
|
||||||
|
color: #606266;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
color: #f56c6c;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid #f56c6c;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #fef0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-message {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-section {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #f9fafc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-section:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-section h4 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 16px;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -29,10 +29,20 @@
|
|||||||
style="display: flex; align-items: center; gap: 30px"
|
style="display: flex; align-items: center; gap: 30px"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: flex; align-items: center; gap: 20px;">
|
||||||
|
<button @click="showFeedbackFormModal" class="feedback-btn">意见反馈</button>
|
||||||
|
<FeedbackForm
|
||||||
|
:is-visible="showFeedbackForm"
|
||||||
|
@close="closeFeedbackFormModal"
|
||||||
|
@submit-feedback="closeFeedbackFormModal"
|
||||||
|
/>
|
||||||
<UserDropdown
|
<UserDropdown
|
||||||
:card-visibility="cardVisibility"
|
:card-visibility="cardVisibility"
|
||||||
@update-card-visibility="updateCardVisibility"
|
@update-card-visibility="updateCardVisibility"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,9 +98,6 @@
|
|||||||
<main class="main-content">
|
<main class="main-content">
|
||||||
<!-- 客户详情区域 -->
|
<!-- 客户详情区域 -->
|
||||||
<section v-if="cardVisibility.customerDetail && selectedContact" class="detail-section">
|
<section v-if="cardVisibility.customerDetail && selectedContact" class="detail-section">
|
||||||
<div class="section-header">
|
|
||||||
<h2>客户详情</h2>
|
|
||||||
</div>
|
|
||||||
<div class="section-content">
|
<div class="section-content">
|
||||||
<CustomerDetail
|
<CustomerDetail
|
||||||
ref="customerDetailRef"
|
ref="customerDetailRef"
|
||||||
@@ -122,13 +129,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- 周期分析区域 -->
|
|
||||||
<section v-if="cardVisibility.weekAnalysis===false" class="week-analysis-section" style="width: 100%; margin-top: 24px;">
|
|
||||||
<div class="section-content">
|
|
||||||
<WeekAnalize :week-data="weekAnalysisData" />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<!-- 自定义弹框 -->
|
<!-- 自定义弹框 -->
|
||||||
<div v-if="showModal" class="modal-overlay" @click="closeModal" @wheel.prevent @touchmove.prevent>
|
<div v-if="showModal" class="modal-overlay" @click="closeModal" @wheel.prevent @touchmove.prevent>
|
||||||
<div class="modal-container" @click.stop @wheel.stop @touchmove.stop>
|
<div class="modal-container" @click.stop @wheel.stop @touchmove.stop>
|
||||||
@@ -182,10 +182,11 @@ import RawDataCards from "./components/RawDataCards.vue";
|
|||||||
import WeekAnalize from "./components/WeekAnalize.vue";
|
import WeekAnalize from "./components/WeekAnalize.vue";
|
||||||
import UserDropdown from "@/components/UserDropdown.vue";
|
import UserDropdown from "@/components/UserDropdown.vue";
|
||||||
import Loading from "@/components/Loading.vue";
|
import Loading from "@/components/Loading.vue";
|
||||||
|
import FeedbackForm from "@/components/FeedbackForm.vue";
|
||||||
import {getCustomerAttendance,getTodayCall,getProblemDistribution,getTableFillingRate,getAverageResponseTime,
|
import {getCustomerAttendance,getTodayCall,getProblemDistribution,getTableFillingRate,getAverageResponseTime,
|
||||||
getWeeklyActiveCommunicationRate,getTimeoutResponseRate,getCustomerCallInfo,getCustomerChatInfo,getCustomerFormInfo,
|
getWeeklyActiveCommunicationRate,getTimeoutResponseRate,getCustomerCallInfo,getCustomerChatInfo,getCustomerFormInfo,
|
||||||
getConversionRateAndAllocatedData,getCustomerAttendanceAfterClass4,getPayMoneyCustomers,getSalesFunnel,getGoldContactTime,
|
getConversionRateAndAllocatedData,getCustomerAttendanceAfterClass4,getPayMoneyCustomers,getSalesFunnel,getGoldContactTime,
|
||||||
getAvgCallTime,getCallSuccessRate} from "@/api/api.js"
|
getAvgCallTime,getCallSuccessRate,getSecondOrderAnalysisReport} from "@/api/api.js"
|
||||||
|
|
||||||
// 路由实例
|
// 路由实例
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -294,6 +295,9 @@ const showModal = ref(false)
|
|||||||
const modalContent = ref('')
|
const modalContent = ref('')
|
||||||
const modalTitle = ref('')
|
const modalTitle = ref('')
|
||||||
|
|
||||||
|
// FeedbackForm 弹框状态
|
||||||
|
const showFeedbackForm = ref(false)
|
||||||
|
|
||||||
// 下载弹框状态
|
// 下载弹框状态
|
||||||
const showDownloadModal = ref(false)
|
const showDownloadModal = ref(false)
|
||||||
const downloadModalContent = ref('')
|
const downloadModalContent = ref('')
|
||||||
@@ -319,7 +323,7 @@ const payMoneyCustomersList = ref([]);
|
|||||||
const payMoneyCustomersCount = ref(0);
|
const payMoneyCustomersCount = ref(0);
|
||||||
|
|
||||||
// 表单信息
|
// 表单信息
|
||||||
const formInfo = ref({});
|
const formInfo = ref([]);
|
||||||
// 通话记录
|
// 通话记录
|
||||||
const callRecords = ref([]);
|
const callRecords = ref([]);
|
||||||
// 聊天记录
|
// 聊天记录
|
||||||
@@ -361,26 +365,38 @@ async function getCoreKpi() {
|
|||||||
try {
|
try {
|
||||||
const params = getRequestParams()
|
const params = getRequestParams()
|
||||||
const hasParams = params.user_name
|
const hasParams = params.user_name
|
||||||
|
|
||||||
|
// 并发请求所有KPI接口
|
||||||
|
const [
|
||||||
|
todayCallRes,
|
||||||
|
conversionRes,
|
||||||
|
avgCallTimeRes,
|
||||||
|
callSuccessRateRes
|
||||||
|
] = await Promise.all([
|
||||||
|
getTodayCall(hasParams ? params : undefined),
|
||||||
|
getConversionRateAndAllocatedData(hasParams ? params : undefined),
|
||||||
|
getAvgCallTime(hasParams ? params : undefined),
|
||||||
|
getCallSuccessRate(hasParams ? params : undefined)
|
||||||
|
])
|
||||||
|
|
||||||
// 今日通话数据
|
// 今日通话数据
|
||||||
const res = await getTodayCall(hasParams ? params : undefined)
|
if (todayCallRes.code === 200) {
|
||||||
if (res.code === 200) {
|
kpiDataState.totalCalls = todayCallRes.data.call_count
|
||||||
kpiDataState.totalCalls = res.data.today_call
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转化率、分配数据量、加微率
|
// 转化率、分配数据量、加微率
|
||||||
const conversionRes = await getConversionRateAndAllocatedData(hasParams ? params : undefined)
|
|
||||||
if (conversionRes.code === 200) {
|
if (conversionRes.code === 200) {
|
||||||
kpiDataState.conversionRate = conversionRes.data.conversion_rate || 0
|
kpiDataState.conversionRate = conversionRes.data.conversion_rate || 0
|
||||||
kpiDataState.assignedData = conversionRes.data.all_count || 0
|
kpiDataState.assignedData = conversionRes.data.all_count || 0
|
||||||
kpiDataState.wechatAddRate = conversionRes.data.plus_v_conversion_rate || 0
|
kpiDataState.wechatAddRate = conversionRes.data.plus_v_conversion_rate || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平均通话时长
|
// 平均通话时长
|
||||||
const avgCallTimeRes = await getAvgCallTime(hasParams ? params : undefined)
|
|
||||||
if (avgCallTimeRes.code === 200) {
|
if (avgCallTimeRes.code === 200) {
|
||||||
kpiDataState.avgDuration = avgCallTimeRes.data.call_time || 0
|
kpiDataState.avgDuration = avgCallTimeRes.data.call_time || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 电话接通率
|
// 电话接通率
|
||||||
const callSuccessRateRes = await getCallSuccessRate(hasParams ? params : undefined)
|
|
||||||
if (callSuccessRateRes.code === 200) {
|
if (callSuccessRateRes.code === 200) {
|
||||||
kpiDataState.successRate = callSuccessRateRes.data.call_success_rate || 0
|
kpiDataState.successRate = callSuccessRateRes.data.call_success_rate || 0
|
||||||
}
|
}
|
||||||
@@ -397,26 +413,35 @@ async function getStatisticsData() {
|
|||||||
const params = getRequestParams()
|
const params = getRequestParams()
|
||||||
const hasParams = params.user_name
|
const hasParams = params.user_name
|
||||||
|
|
||||||
// 获取表单填写率
|
// 并发请求所有统计数据
|
||||||
const fillingRateRes = await getTableFillingRate(hasParams ? params : undefined)
|
const [
|
||||||
|
fillingRateRes,
|
||||||
|
avgResponseRes,
|
||||||
|
communicationRes,
|
||||||
|
timeoutRes
|
||||||
|
] = await Promise.all([
|
||||||
|
getTableFillingRate(hasParams ? params : undefined),
|
||||||
|
getAverageResponseTime(hasParams ? params : undefined),
|
||||||
|
getWeeklyActiveCommunicationRate(hasParams ? params : undefined),
|
||||||
|
getTimeoutResponseRate(hasParams ? params : undefined)
|
||||||
|
])
|
||||||
|
|
||||||
|
// 处理表单填写率
|
||||||
if (fillingRateRes.code === 200) {
|
if (fillingRateRes.code === 200) {
|
||||||
statisticsData.formCompletionRate = fillingRateRes.data.filling_rate
|
statisticsData.formCompletionRate = fillingRateRes.data.filling_rate
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取平均响应时间
|
// 处理平均响应时间
|
||||||
const avgResponseRes = await getAverageResponseTime(hasParams ? params : undefined)
|
|
||||||
if (avgResponseRes.code === 200) {
|
if (avgResponseRes.code === 200) {
|
||||||
statisticsData.averageResponseTime = avgResponseRes.data.average_minutes
|
statisticsData.averageResponseTime = avgResponseRes.data.average_minutes
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取客户沟通率
|
// 处理客户沟通率
|
||||||
const communicationRes = await getWeeklyActiveCommunicationRate(hasParams ? params : undefined)
|
|
||||||
if (communicationRes.code === 200) {
|
if (communicationRes.code === 200) {
|
||||||
statisticsData.customerCommunicationRate = communicationRes.data.communication_rate
|
statisticsData.customerCommunicationRate = communicationRes.data.communication_rate
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取超时响应率
|
// 处理超时响应率
|
||||||
const timeoutRes = await getTimeoutResponseRate(hasParams ? params : undefined)
|
|
||||||
if (timeoutRes.code === 200) {
|
if (timeoutRes.code === 200) {
|
||||||
statisticsData.timeoutResponseRate = timeoutRes.data.overtime_rate_600
|
statisticsData.timeoutResponseRate = timeoutRes.data.overtime_rate_600
|
||||||
statisticsData.severeTimeoutRate = timeoutRes.data.overtime_rate_800
|
statisticsData.severeTimeoutRate = timeoutRes.data.overtime_rate_800
|
||||||
@@ -574,12 +599,13 @@ async function getCustomerForm() {
|
|||||||
const routeParams = getRequestParams()
|
const routeParams = getRequestParams()
|
||||||
const params = {
|
const params = {
|
||||||
user_name: routeParams.user_name || userStore.userInfo.username,
|
user_name: routeParams.user_name || userStore.userInfo.username,
|
||||||
customer_name: selectedContact.value.name,
|
phone: selectedContact.value.phone,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await getCustomerFormInfo(params)
|
const res = await getCustomerFormInfo(params)
|
||||||
|
console.log('获取客户表单数据:', res)
|
||||||
if(res.code === 200) {
|
if(res.code === 200) {
|
||||||
formInfo.value = res.data
|
formInfo.value = res.data || []
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 静默处理错误
|
// 静默处理错误
|
||||||
@@ -593,7 +619,7 @@ async function getCustomerChat() {
|
|||||||
const routeParams = getRequestParams()
|
const routeParams = getRequestParams()
|
||||||
const params = {
|
const params = {
|
||||||
user_name: routeParams.user_name || userStore.userInfo.username,
|
user_name: routeParams.user_name || userStore.userInfo.username,
|
||||||
customer_name: selectedContact.value.name,
|
phone: selectedContact.value.phone,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await getCustomerChatInfo(params)
|
const res = await getCustomerChatInfo(params)
|
||||||
@@ -614,14 +640,12 @@ async function getCustomerCall() {
|
|||||||
const routeParams = getRequestParams()
|
const routeParams = getRequestParams()
|
||||||
const params = {
|
const params = {
|
||||||
user_name: routeParams.user_name || userStore.userInfo.username,
|
user_name: routeParams.user_name || userStore.userInfo.username,
|
||||||
customer_name: selectedContact.value.name,
|
phone: selectedContact.value.phone,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await getCustomerCallInfo(params)
|
const res = await getCustomerCallInfo(params)
|
||||||
if(res.code === 200) {
|
if(res.code === 200) {
|
||||||
callRecords.value = res.data
|
callRecords.value = res.data
|
||||||
console.log('Call Records Data from API:', res.data)
|
|
||||||
console.log('callRecords.value after assignment:', callRecords.value)
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 静默处理错误
|
// 静默处理错误
|
||||||
@@ -631,7 +655,6 @@ async function getCustomerCall() {
|
|||||||
const kpiData = computed(() => kpiDataState);
|
const kpiData = computed(() => kpiDataState);
|
||||||
// COMPUTED PROPERTIES
|
// COMPUTED PROPERTIES
|
||||||
const selectedContact = computed(() => {
|
const selectedContact = computed(() => {
|
||||||
console.log(999999999,formattedCustomersList.value);
|
|
||||||
// 优先从API数据中查找
|
// 优先从API数据中查找
|
||||||
if (formattedCustomersList.value.length > 0) {
|
if (formattedCustomersList.value.length > 0) {
|
||||||
return formattedCustomersList.value.find((c) => c.id === selectedContactId.value) || null;
|
return formattedCustomersList.value.find((c) => c.id === selectedContactId.value) || null;
|
||||||
@@ -891,6 +914,16 @@ const closeDownloadModal = () => {
|
|||||||
downloadModalTitle.value = ''
|
downloadModalTitle.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 显示 FeedbackForm
|
||||||
|
const showFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭 FeedbackForm
|
||||||
|
const closeFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = false
|
||||||
|
}
|
||||||
|
|
||||||
// // 处理SOP分析事件
|
// // 处理SOP分析事件
|
||||||
// const handleAnalyzeSop = (analyzeData) => {
|
// const handleAnalyzeSop = (analyzeData) => {
|
||||||
// console.log('handleAnalyzeSop', analyzeData)
|
// console.log('handleAnalyzeSop', analyzeData)
|
||||||
@@ -907,19 +940,6 @@ async function CenterGetSalesFunnel() {
|
|||||||
const res = await getSalesFunnel(hasParams ? params : undefined)
|
const res = await getSalesFunnel(hasParams ? params : undefined)
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
SalesFunnel.value = res.data
|
SalesFunnel.value = res.data
|
||||||
/**
|
|
||||||
* "data": {
|
|
||||||
"user_name": "常琳",
|
|
||||||
"user_level": 1,
|
|
||||||
"sale_funnel": {
|
|
||||||
"线索总数": 11,
|
|
||||||
"有效沟通": 9,
|
|
||||||
"到课数据": 8,
|
|
||||||
"预付定金": 0,
|
|
||||||
"成功签单": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 黄金联络时间段
|
// 黄金联络时间段
|
||||||
@@ -957,15 +977,15 @@ async function forceRefreshAllData() {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
isPageLoading.value = true
|
isPageLoading.value = true
|
||||||
await getStatisticsData()
|
getStatisticsData()
|
||||||
await getCoreKpi()
|
getCoreKpi()
|
||||||
await CenterGetGoldContactTime()
|
CenterGetGoldContactTime()
|
||||||
await CenterGetSalesFunnel()
|
CenterGetSalesFunnel()
|
||||||
await getCustomerForm()
|
getCustomerForm()
|
||||||
await getCustomerChat()
|
getCustomerChat()
|
||||||
await getUrgentProblem()
|
getUrgentProblem()
|
||||||
await getCustomerCall()
|
getCustomerCall()
|
||||||
await getTimeline()
|
getTimeline()
|
||||||
|
|
||||||
// 开发环境下暴露数据刷新函数到全局对象,方便调试
|
// 开发环境下暴露数据刷新函数到全局对象,方便调试
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
@@ -1060,9 +1080,9 @@ $primary: #3b82f6;
|
|||||||
}
|
}
|
||||||
// 主要布局
|
// 主要布局
|
||||||
.main-layout {
|
.main-layout {
|
||||||
width: 100vw;
|
width: 99vw;
|
||||||
margin: 0 auto;
|
margin-bottom: 1rem;
|
||||||
padding: 1rem;
|
// padding: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
@@ -1821,10 +1841,10 @@ $primary: #3b82f6;
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||||
max-width: 600px;
|
max-width: 1200px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
// 设置最大高度,防止弹窗超出屏幕
|
// 设置最大高度,防止弹窗超出屏幕
|
||||||
max-height: 35vh;
|
max-height: 80vh;
|
||||||
// 防止内容溢出容器,配合内部滚动
|
// 防止内容溢出容器,配合内部滚动
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
// 使用 Flexbox 布局,让 .modal-body 可以伸缩
|
// 使用 Flexbox 布局,让 .modal-body 可以伸缩
|
||||||
@@ -1944,6 +1964,22 @@ $primary: #3b82f6;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 意见反馈按钮样式
|
||||||
|
.feedback-btn {
|
||||||
|
background-color: #4299e1;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-btn:hover {
|
||||||
|
background-color: #3182ce;
|
||||||
|
}
|
||||||
|
|
||||||
// 弹框响应式样式
|
// 弹框响应式样式
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.modal-container {
|
.modal-container {
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ onBeforeUnmount(() => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 16px;
|
padding: 10px 20px 10px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
h3 { margin: 0; color: #303133; font-size: 18px; font-weight: 600; }
|
h3 { margin: 0; color: #303133; font-size: 18px; font-weight: 600; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
:class="{ active: selectedRecording === index }"
|
:class="{ active: selectedRecording === index }"
|
||||||
@click="selectRecording(index)"
|
@click="selectRecording(index)"
|
||||||
>
|
>
|
||||||
|
<span class="recording-index">{{ recording.score}}</span>
|
||||||
<div class="recording-info">
|
<div class="recording-info">
|
||||||
<div class="recording-name" :title="recording.name">{{ recording.name.length > 10 ? recording.name.substring(0, 10) + '...' : recording.name }}</div>
|
<div class="recording-name" :title="recording.name">{{ recording.name.length > 10 ? recording.name.substring(0, 10) + '...' : recording.name }}</div>
|
||||||
<div class="recording-meta">
|
<div class="recording-meta">
|
||||||
@@ -172,8 +173,8 @@ import MarkdownIt from 'markdown-it'
|
|||||||
// Props定义
|
// Props定义
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
qualityCalls: {
|
qualityCalls: {
|
||||||
type: Object,
|
type: Array,
|
||||||
default: () => ({})
|
default: () => []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -221,24 +222,22 @@ const recordings = computed(() => {
|
|||||||
if (!props.qualityCalls ) {
|
if (!props.qualityCalls ) {
|
||||||
return staticRecordings.value;
|
return staticRecordings.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
const recordingsList = [];
|
const recordingsList = [];
|
||||||
Object.keys(props.qualityCalls).forEach(userName => {
|
props.qualityCalls.forEach((record, index) => {
|
||||||
props.qualityCalls[userName].forEach((record, index) => {
|
|
||||||
recordingsList.push({
|
recordingsList.push({
|
||||||
id: recordingsList.length + 1,
|
id: recordingsList.length + 1,
|
||||||
name: record.obj_file_name ? record.obj_file_name.split('/').pop() : `${record.sale_name}-录音-${index + 1}`,
|
name: record.record_name ? record.record_name : `${record.sale_name}-录音-${index + 1}`,
|
||||||
date: new Date().toISOString().split('T')[0],
|
date: new Date().toISOString().split('T')[0],
|
||||||
url: record.obj_file_name,
|
url: record.record_file_addr,
|
||||||
transcription: record.context || null,
|
transcription: record.record_context || null,
|
||||||
score: record.score,
|
score: record.record_score,
|
||||||
sop: record.sop,
|
sop: record.record_report,
|
||||||
sale_name: record.sale_name,
|
sale_name: record.record_name,
|
||||||
size: 2048576, // 默认文件大小 2MB
|
size: 2048576, // 默认文件大小 2MB
|
||||||
uploadTime: new Date().toLocaleDateString('zh-CN')
|
uploadTime: record.created_at,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
return recordingsList;
|
return recordingsList;
|
||||||
})
|
})
|
||||||
@@ -505,14 +504,14 @@ const downloadRecording = (index) => {
|
|||||||
background: white;
|
background: white;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
height: 400px;
|
height: 420px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-header {
|
.chart-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 0;
|
padding: 10px 20px 0;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,7 +548,7 @@ const downloadRecording = (index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chart-content {
|
.chart-content {
|
||||||
padding: 20px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recording-section {
|
.recording-section {
|
||||||
@@ -562,7 +561,6 @@ const downloadRecording = (index) => {
|
|||||||
.recording-list {
|
.recording-list {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.recording-item {
|
.recording-item {
|
||||||
@@ -602,6 +600,39 @@ const downloadRecording = (index) => {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recording-index {
|
||||||
|
/* 基础分数样式 */
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
background-color: #e9ecef;
|
||||||
|
color: #495057;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第一名样式 */
|
||||||
|
.recording-item:first-child .recording-index {
|
||||||
|
background: linear-gradient(135deg, #FFD700, #FFA500);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第二名样式 */
|
||||||
|
.recording-item:nth-child(2) .recording-index {
|
||||||
|
background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第三名样式 */
|
||||||
|
.recording-item:nth-child(3) .recording-index {
|
||||||
|
background: linear-gradient(135deg, #CD7F32, #A0522D);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.recording-meta {
|
.recording-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|||||||
@@ -90,12 +90,14 @@ async function exportData() {
|
|||||||
try {
|
try {
|
||||||
ElMessage.info('正在导出数据,请稍候...')
|
ElMessage.info('正在导出数据,请稍候...')
|
||||||
console.log('导出参数:', params)
|
console.log('导出参数:', params)
|
||||||
const res = await exportCustomers(params)
|
const res = await exportCustomers()
|
||||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||||
|
ElMessage.success('数据导出成功')
|
||||||
// 处理数据,将复杂的嵌套对象展平
|
// 处理数据,将复杂的嵌套对象展平
|
||||||
const exportData = res.data.map(customer => {
|
const exportData = res.data.map(customer => {
|
||||||
const flatData = {
|
const flatData = {
|
||||||
'昵称': customer.nickname || '',
|
'昵称': customer.nickname || '',
|
||||||
|
'客户姓名': customer.customer_name || '',
|
||||||
'性别': customer.gender || '',
|
'性别': customer.gender || '',
|
||||||
'跟进人': customer.follow_up_name || '',
|
'跟进人': customer.follow_up_name || '',
|
||||||
'手机号': customer.phone || '',
|
'手机号': customer.phone || '',
|
||||||
@@ -103,18 +105,104 @@ async function exportData() {
|
|||||||
'用户ID': customer.mantis_user_id || '',
|
'用户ID': customer.mantis_user_id || '',
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理微信表单信息
|
const parseFormData = (formData) => {
|
||||||
if (customer.wechat_form) {
|
if (typeof formData === 'string') {
|
||||||
flatData['家长姓名'] = customer.wechat_form.name || ''
|
try {
|
||||||
flatData['孩子姓名'] = customer.wechat_form.child_name || ''
|
return JSON.parse(formData)
|
||||||
flatData['孩子性别'] = customer.wechat_form.child_gender || ''
|
} catch (e) {
|
||||||
flatData['职业'] = customer.wechat_form.occupation || ''
|
return null
|
||||||
flatData['孩子教育阶段'] = customer.wechat_form.child_education || ''
|
}
|
||||||
flatData['与孩子关系'] = customer.wechat_form.child_relation || ''
|
}
|
||||||
flatData['联系电话'] = customer.wechat_form.mobile || ''
|
return formData || null
|
||||||
flatData['地区'] = customer.wechat_form.territory || ''
|
}
|
||||||
flatData['创建时间'] = customer.wechat_form.created_at ? new Date(customer.wechat_form.created_at).toLocaleString() : ''
|
|
||||||
flatData['更新时间'] = customer.wechat_form.updated_at ? new Date(customer.wechat_form.updated_at).toLocaleString() : ''
|
const normalizeFormArray = (formData) => {
|
||||||
|
const data = parseFormData(formData)
|
||||||
|
console.log('解析后的表单数据:', data)
|
||||||
|
if (Array.isArray(data)) return data
|
||||||
|
if (data && Array.isArray(data.data)) return data.data
|
||||||
|
if (data && typeof data === 'object' && !data.answers) {
|
||||||
|
const numericKeys = Object.keys(data).filter(key => String(Number(key)) === key)
|
||||||
|
if (numericKeys.length > 0) {
|
||||||
|
return numericKeys
|
||||||
|
.sort((a, b) => Number(a) - Number(b))
|
||||||
|
.map(key => data[key])
|
||||||
|
.filter(Boolean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (data && data.answers) return [data]
|
||||||
|
return data ? [data] : []
|
||||||
|
}
|
||||||
|
|
||||||
|
const ensureUniqueKey = (key) => {
|
||||||
|
if (!flatData[key]) return key
|
||||||
|
let index = 2
|
||||||
|
while (flatData[`${key}(${index})`]) {
|
||||||
|
index += 1
|
||||||
|
}
|
||||||
|
return `${key}(${index})`
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsedFormData = parseFormData(customer.wechat_form)
|
||||||
|
const formArray = normalizeFormArray(parsedFormData)
|
||||||
|
if (formArray.length > 0) {
|
||||||
|
console.log('表单数组:', formArray)
|
||||||
|
const isAnswerList = formArray.every(item => item && item.question_label && Object.prototype.hasOwnProperty.call(item, 'answer'))
|
||||||
|
const isFormWithAnswers = formArray.every(item => item && Array.isArray(item.answers))
|
||||||
|
console.log('是否为答案列表:', isAnswerList)
|
||||||
|
console.log('是否为表单含 answers:', isFormWithAnswers)
|
||||||
|
if (isAnswerList) {
|
||||||
|
let formAnswerCount = 0
|
||||||
|
formArray.forEach((answerItem) => {
|
||||||
|
const label = String(answerItem.question_label || '').trim()
|
||||||
|
if (!label) return
|
||||||
|
const key = ensureUniqueKey(label)
|
||||||
|
flatData[key] = answerItem.answer ?? ''
|
||||||
|
formAnswerCount += 1
|
||||||
|
})
|
||||||
|
if (formAnswerCount === 0 && formArray.length > 0) {
|
||||||
|
const fallbackKey = ensureUniqueKey('表单答案')
|
||||||
|
flatData[fallbackKey] = formArray.map(item => `${item.question_label || ''}: ${item.answer || ''}`).join(' | ')
|
||||||
|
}
|
||||||
|
} else if (isFormWithAnswers) {
|
||||||
|
console.log('表单含 answers:', formArray)
|
||||||
|
formArray.forEach((formItem) => {
|
||||||
|
const formTitle = formItem.form_title || '表单'
|
||||||
|
if (Array.isArray(formItem.answers)) {
|
||||||
|
let formAnswerCount = 0
|
||||||
|
formItem.answers.forEach((answerItem) => {
|
||||||
|
const label = String(answerItem.question_label || '').trim()
|
||||||
|
if (!label) return
|
||||||
|
const key = ensureUniqueKey(`${formTitle}-${label}`)
|
||||||
|
flatData[key] = answerItem.answer ?? ''
|
||||||
|
formAnswerCount += 1
|
||||||
|
})
|
||||||
|
if (formAnswerCount === 0 && formItem.answers.length > 0) {
|
||||||
|
const fallbackKey = ensureUniqueKey(`${formTitle}-表单答案`)
|
||||||
|
flatData[fallbackKey] = formItem.answers.map(item => `${item.question_label || ''}: ${item.answer || ''}`).join(' | ')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (formItem.created_at) {
|
||||||
|
const key = ensureUniqueKey(`${formTitle}-创建时间`)
|
||||||
|
flatData[key] = new Date(formItem.created_at).toLocaleString()
|
||||||
|
}
|
||||||
|
if (formItem.updated_at) {
|
||||||
|
const key = ensureUniqueKey(`${formTitle}-更新时间`)
|
||||||
|
flatData[key] = new Date(formItem.updated_at).toLocaleString()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (parsedFormData && typeof parsedFormData === 'object') {
|
||||||
|
flatData['家长姓名'] = parsedFormData.name || ''
|
||||||
|
flatData['孩子姓名'] = parsedFormData.child_name || ''
|
||||||
|
flatData['孩子性别'] = parsedFormData.child_gender || ''
|
||||||
|
flatData['职业'] = parsedFormData.occupation || ''
|
||||||
|
flatData['孩子教育阶段'] = parsedFormData.child_education || ''
|
||||||
|
flatData['与孩子关系'] = parsedFormData.child_relation || ''
|
||||||
|
flatData['联系电话'] = parsedFormData.mobile || ''
|
||||||
|
flatData['地区'] = parsedFormData.territory || ''
|
||||||
|
flatData['创建时间'] = parsedFormData.created_at ? new Date(parsedFormData.created_at).toLocaleString() : ''
|
||||||
|
flatData['更新时间'] = parsedFormData.updated_at ? new Date(parsedFormData.updated_at).toLocaleString() : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理到课情况
|
// 处理到课情况
|
||||||
@@ -126,9 +214,12 @@ async function exportData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理问卷调查信息
|
// 处理问卷调查信息
|
||||||
if (customer.wechat_form && customer.wechat_form.additional_info) {
|
if (parsedFormData && parsedFormData.additional_info) {
|
||||||
customer.wechat_form.additional_info.forEach((item) => {
|
parsedFormData.additional_info.forEach((item) => {
|
||||||
flatData[item.topic || ''] = item.answer || ''
|
const key = ensureUniqueKey(item.topic || '')
|
||||||
|
if (key) {
|
||||||
|
flatData[key] = item.answer || ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,27 +228,18 @@ async function exportData() {
|
|||||||
|
|
||||||
// 创建工作簿
|
// 创建工作簿
|
||||||
const wb = XLSX.utils.book_new()
|
const wb = XLSX.utils.book_new()
|
||||||
const ws = XLSX.utils.json_to_sheet(exportData)
|
const allKeys = Array.from(new Set(exportData.flatMap(item => Object.keys(item))))
|
||||||
|
const ws = XLSX.utils.json_to_sheet(exportData, { header: allKeys })
|
||||||
|
|
||||||
// 设置列宽
|
// 设置列宽
|
||||||
const colWidths = [
|
const colWidths = allKeys.map(key => {
|
||||||
{ wch: 10 }, // 昵称
|
const maxCellLength = exportData.reduce((max, row) => {
|
||||||
{ wch: 6 }, // 性别
|
const value = row[key]
|
||||||
{ wch: 12 }, // 跟进人
|
const length = value === null || value === undefined ? 0 : String(value).length
|
||||||
{ wch: 15 }, // 手机号
|
return Math.max(max, length)
|
||||||
{ wch: 10 }, // 是否入群
|
}, 0)
|
||||||
{ wch: 20 }, // 用户ID
|
return { wch: Math.min(50, Math.max(10, key.length, maxCellLength)) }
|
||||||
{ wch: 12 }, // 家长姓名
|
})
|
||||||
{ wch: 12 }, // 孩子姓名
|
|
||||||
{ wch: 8 }, // 孩子性别
|
|
||||||
{ wch: 12 }, // 职业
|
|
||||||
{ wch: 12 }, // 孩子教育阶段
|
|
||||||
{ wch: 15 }, // 与孩子关系
|
|
||||||
{ wch: 15 }, // 联系电话
|
|
||||||
{ wch: 20 }, // 地区
|
|
||||||
{ wch: 20 }, // 创建时间
|
|
||||||
{ wch: 20 }, // 更新时间
|
|
||||||
]
|
|
||||||
ws['!cols'] = colWidths
|
ws['!cols'] = colWidths
|
||||||
|
|
||||||
// 添加工作表到工作簿
|
// 添加工作表到工作簿
|
||||||
@@ -196,7 +278,7 @@ async function exportData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chart-header {
|
.chart-header {
|
||||||
padding: 20px 20px 16px;
|
padding: 10px 20px 10px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -356,4 +438,4 @@ async function exportData() {
|
|||||||
color: #909399;
|
color: #909399;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -28,10 +28,18 @@
|
|||||||
|
|
||||||
<div v-if="!isRouteNavigation">
|
<div v-if="!isRouteNavigation">
|
||||||
<!-- 用户下拉菜单 -->
|
<!-- 用户下拉菜单 -->
|
||||||
|
<div style="display: flex; align-items: center; gap: 20px;">
|
||||||
|
<button @click="showFeedbackFormModal" class="feedback-btn">意见反馈</button>
|
||||||
|
<FeedbackForm
|
||||||
|
:is-visible="showFeedbackForm"
|
||||||
|
@close="closeFeedbackFormModal"
|
||||||
|
@submit-feedback="closeFeedbackFormModal"
|
||||||
|
/>
|
||||||
<UserDropdown
|
<UserDropdown
|
||||||
:card-visibility="cardVisibility"
|
:card-visibility="cardVisibility"
|
||||||
@update-card-visibility="updateCardVisibility"
|
@update-card-visibility="updateCardVisibility"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -104,6 +112,22 @@
|
|||||||
<span class="value">{{ selectedGroup.conversionRate }}%</span>
|
<span class="value">{{ selectedGroup.conversionRate }}%</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="group-performance">
|
||||||
|
<button @click="showTeamAnalysisModal">团队整体分析</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 团队整体分析弹窗 -->
|
||||||
|
<div v-if="showTeamAnalysis" class="team-analysis-modal" @click.self="closeTeamAnalysisModal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3>团队整体分析</h3>
|
||||||
|
<button class="close-btn" @click="closeTeamAnalysisModal">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>这里是团队整体分析的内容</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="members-grid">
|
<div class="members-grid">
|
||||||
@@ -170,13 +194,13 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Loading 组件 -->
|
<!-- Loading 组件 -->
|
||||||
<Loading :visible="isLoading" text="数据加载中..." />
|
<!-- <Loading :visible="isLoading" text="数据加载中..." /> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed,reactive } from 'vue'
|
import { ref, onMounted, computed,reactive } from 'vue'
|
||||||
|
import FeedbackForm from "@/components/FeedbackForm.vue";
|
||||||
// 30分钟数据缓存系统
|
// 30分钟数据缓存系统
|
||||||
const cache = new Map()
|
const cache = new Map()
|
||||||
const CACHE_DURATION = 30 * 60 * 1000 // 30分钟
|
const CACHE_DURATION = 30 * 60 * 1000 // 30分钟
|
||||||
@@ -261,22 +285,46 @@
|
|||||||
const CheckType = ref('month')
|
const CheckType = ref('month')
|
||||||
|
|
||||||
// 卡片显示状态
|
// 卡片显示状态
|
||||||
const cardVisibility = ref({
|
const cardVisibility = ref({
|
||||||
centerOverview: true,
|
centerOverview: true,
|
||||||
actionItems: true,
|
actionItems: true,
|
||||||
customerType: true,
|
customerType: true,
|
||||||
goodMusic: true,
|
goodMusic: true,
|
||||||
problemRanking: true,
|
problemRanking: true,
|
||||||
groupRanking: true,
|
groupRanking: true,
|
||||||
groupComparison: true,
|
groupComparison: true,
|
||||||
teamDetail: true
|
teamDetail: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// 更新卡片显示状态
|
// FeedbackForm 控制变量
|
||||||
const updateCardVisibility = (newVisibility) => {
|
const showFeedbackForm = ref(false)
|
||||||
Object.assign(cardVisibility.value, newVisibility)
|
|
||||||
console.log('卡片显示状态已更新:', cardVisibility.value)
|
// 团队整体分析弹窗控制变量
|
||||||
}
|
const showTeamAnalysis = ref(false)
|
||||||
|
|
||||||
|
// 更新卡片显示状态
|
||||||
|
const updateCardVisibility = (newVisibility) => {
|
||||||
|
Object.assign(cardVisibility.value, newVisibility)
|
||||||
|
console.log('卡片显示状态已更新:', cardVisibility.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FeedbackForm 控制方法
|
||||||
|
const showFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团队整体分析弹窗控制方法
|
||||||
|
const showTeamAnalysisModal = () => {
|
||||||
|
showTeamAnalysis.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeTeamAnalysisModal = () => {
|
||||||
|
showTeamAnalysis.value = false
|
||||||
|
}
|
||||||
// 营期调控逻辑
|
// 营期调控逻辑
|
||||||
// This would ideally come from a prop or API call based on the logged-in user
|
// This would ideally come from a prop or API call based on the logged-in user
|
||||||
const centerData = ref({
|
const centerData = ref({
|
||||||
@@ -840,31 +888,46 @@ const conversionRateVsAverage = ref({})
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取优秀录音
|
// 获取优秀录音
|
||||||
const excellentRecord = ref({});
|
const excellentRecord = ref([]);
|
||||||
// 获取优秀录音文件
|
// 获取优秀录音文件
|
||||||
// async function CentergetGoodRecord() {
|
async function CentergetGoodRecord() {
|
||||||
// const params = getRequestParams()
|
console.log('CentergetGoodRecord 开始执行')
|
||||||
// const params1 = {
|
try {
|
||||||
// user_level:userStore.userInfo.user_level.toString(),
|
const params = getRequestParams()
|
||||||
// user_name:userStore.userInfo.username
|
const params1 = {
|
||||||
// }
|
user_level: userStore.userInfo?.user_level?.toString() || '',
|
||||||
// const hasParams = params.user_name
|
user_name: userStore.userInfo?.username || ''
|
||||||
// const requestParams = hasParams ? {
|
}
|
||||||
// ...params,
|
|
||||||
// } : params1
|
// 检查参数是否有效
|
||||||
// console.log(188811111,requestParams)
|
const hasParams = params.user_name && params.user_level
|
||||||
|
const requestParams = hasParams ? {
|
||||||
// try {
|
...params,
|
||||||
// const res = await withCache('CentergetGoodRecord',
|
} : params1
|
||||||
// () => getExcellentRecordFile(requestParams),
|
|
||||||
// requestParams
|
console.log('CentergetGoodRecord request params:', requestParams)
|
||||||
// )
|
|
||||||
// excellentRecord.value = res.data.excellent_record_list
|
// 验证必要参数是否存在
|
||||||
// console.log(111111,res.data.excellent_record_list)
|
if (!requestParams.user_name || !requestParams.user_level) {
|
||||||
// } catch (error) {
|
console.error("缺少必要的请求参数:", requestParams);
|
||||||
// console.error("获取优秀录音失败:", error);
|
return;
|
||||||
// }
|
}
|
||||||
// }
|
|
||||||
|
// 直接发送请求,不使用缓存
|
||||||
|
const res = await getExcellentRecordFile(requestParams)
|
||||||
|
|
||||||
|
if (res && res.code === 200 && res.data) {
|
||||||
|
excellentRecord.value = res.data || []
|
||||||
|
console.log('获取优秀录音成功:', res.data)
|
||||||
|
} else {
|
||||||
|
console.error("获取优秀录音失败,响应数据不完整:", res);
|
||||||
|
excellentRecord.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("获取优秀录音失败:", error);
|
||||||
|
excellentRecord.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 缓存管理功能
|
// 缓存管理功能
|
||||||
// 清除所有缓存
|
// 清除所有缓存
|
||||||
@@ -919,20 +982,21 @@ const excellentRecord = ref({});
|
|||||||
(currentQuery.user_name && currentQuery.user_level)
|
(currentQuery.user_name && currentQuery.user_level)
|
||||||
|
|
||||||
if (!isFromRoute) {
|
if (!isFromRoute) {
|
||||||
await CenterCampPeriodAdmin()
|
CenterCampPeriodAdmin()
|
||||||
}
|
}
|
||||||
|
CentergetGoodRecord()
|
||||||
await CenterOverallCenterPerformance()
|
CenterOverallCenterPerformance()
|
||||||
await CenterTotalGroupCount()
|
CenterTotalGroupCount()
|
||||||
await CenterConversionRate()
|
CenterConversionRate()
|
||||||
await CenterTotalCallCount()
|
CenterTotalCallCount()
|
||||||
await CenterNewCustomer()
|
CenterNewCustomer()
|
||||||
await CenterDepositConversionRate()
|
CenterDepositConversionRate()
|
||||||
await CenterCustomerType()
|
CenterCustomerType()
|
||||||
await CenterUrgentNeedToAddress()
|
CenterUrgentNeedToAddress()
|
||||||
await CenterConversionRateVsAverage()
|
CenterConversionRateVsAverage()
|
||||||
await CenterSeniorManagerList()
|
|
||||||
await CenterGroupList('all')
|
CenterSeniorManagerList()
|
||||||
|
CenterGroupList('all')
|
||||||
|
|
||||||
console.log('[强制刷新] 所有数据已重新加载')
|
console.log('[强制刷新] 所有数据已重新加载')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -960,6 +1024,7 @@ const excellentRecord = ref({});
|
|||||||
await CenterTotalGroupCount()
|
await CenterTotalGroupCount()
|
||||||
await CenterConversionRate()
|
await CenterConversionRate()
|
||||||
await CenterTotalCallCount()
|
await CenterTotalCallCount()
|
||||||
|
await CentergetGoodRecord()
|
||||||
await CenterNewCustomer()
|
await CenterNewCustomer()
|
||||||
await CenterDepositConversionRate()
|
await CenterDepositConversionRate()
|
||||||
await CenterCustomerType()
|
await CenterCustomerType()
|
||||||
@@ -1598,7 +1663,77 @@ const hideTooltip = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 团队分析弹窗样式 */
|
||||||
|
.team-analysis-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-content {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
width: 80%;
|
||||||
|
max-width: 600px;
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 1rem;
|
||||||
|
border-bottom: 1px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
color: #1a202c;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .close-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #718096;
|
||||||
|
padding: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .close-btn:hover {
|
||||||
|
color: #1a202c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-body {
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-body p {
|
||||||
|
margin: 0;
|
||||||
|
color: #4a5568;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
// 路由导航顶栏样式
|
// 路由导航顶栏样式
|
||||||
.route-header {
|
.route-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1646,6 +1781,22 @@ const hideTooltip = () => {
|
|||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 意见反馈按钮样式 */
|
||||||
|
.feedback-btn {
|
||||||
|
background-color: #4299e1;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #3182ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.stage-control {
|
.stage-control {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
团队总业绩
|
团队总业绩
|
||||||
<span class="info-icon" @mouseenter="showTooltip($event, 'teamPerformance')" @mouseleave="hideTooltip">ⓘ</span>
|
<span class="info-icon" @mouseenter="showTooltip($event, 'teamPerformance')" @mouseleave="hideTooltip">ⓘ</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="card-trend positive">{{ totalPerformance.team_current_vs_previous_deals }} vs 上期</span>
|
<span class="card-trend positive">{{ totalPerformance.team_current_vs_previous_period_deals_comparison }} vs 上期</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-value">{{ totalPerformance.current_team_odd_numbers||0 }}</div>
|
<div class="card-value">{{ totalPerformance.current_team_odd_numbers||0 }}</div>
|
||||||
<div class="card-subtitle">月目标完成率: {{ totalPerformance.team_monthly_performance }}</div>
|
<div class="card-subtitle">月目标完成率: {{ totalPerformance.team_monthly_target_completion_rate }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="overview-card">
|
<div class="overview-card">
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
团队转化率
|
团队转化率
|
||||||
<span class="info-icon" @mouseenter="showTooltip($event, 'conversionRate')" @mouseleave="hideTooltip">ⓘ</span>
|
<span class="info-icon" @mouseenter="showTooltip($event, 'conversionRate')" @mouseleave="hideTooltip">ⓘ</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="card-trend positive">{{ conversionRate.team_current_vs_previous_deals }} vs 上期</span>
|
<span class="card-trend positive">{{ conversionRate.team_current_vs_previous_conversion_rate }} vs 上期</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-value">{{ conversionRate.center_conversion_rate }}</div>
|
<div class="card-value">{{ conversionRate.center_conversion_rate }}</div>
|
||||||
<div class="card-subtitle">团队平均转化率: {{ conversionRate.average_conversion_rate }}</div>
|
<div class="card-subtitle">团队平均转化率: {{ conversionRate.average_conversion_rate }}</div>
|
||||||
@@ -135,7 +135,6 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(99999,props.overallTeamPerformance)
|
|
||||||
// 计算属性
|
// 计算属性
|
||||||
const totalPerformance = computed(() => {
|
const totalPerformance = computed(() => {
|
||||||
return props.overallTeamPerformance.totalPerformance
|
return props.overallTeamPerformance.totalPerformance
|
||||||
@@ -158,7 +157,6 @@ const newCustomers = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const depositConversions = computed(() => {
|
const depositConversions = computed(() => {
|
||||||
console.log(999991111,props.overallTeamPerformance.depositConversions)
|
|
||||||
return props.overallTeamPerformance.depositConversions
|
return props.overallTeamPerformance.depositConversions
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -27,18 +27,25 @@ const contextPanelRef = ref(null);
|
|||||||
const sentimentChartCanvas = ref(null);
|
const sentimentChartCanvas = ref(null);
|
||||||
const chartInstances = {};
|
const chartInstances = {};
|
||||||
|
|
||||||
|
// 添加组件挂载状态跟踪
|
||||||
|
const isComponentMounted = ref(true);
|
||||||
|
|
||||||
// CHARTING
|
// CHARTING
|
||||||
const createOrUpdateChart = (chartId, canvasRef, config) => {
|
const createOrUpdateChart = (chartId, canvasRef, config) => {
|
||||||
if (chartInstances[chartId]) {
|
if (chartInstances[chartId]) {
|
||||||
chartInstances[chartId].destroy();
|
chartInstances[chartId].destroy();
|
||||||
}
|
}
|
||||||
if (canvasRef.value) {
|
// 确保组件仍然挂载且canvas引用存在
|
||||||
|
if (isComponentMounted.value && canvasRef.value) {
|
||||||
const ctx = canvasRef.value.getContext('2d');
|
const ctx = canvasRef.value.getContext('2d');
|
||||||
chartInstances[chartId] = new Chart(ctx, config);
|
chartInstances[chartId] = new Chart(ctx, config);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderSentimentChart = (history) => {
|
const renderSentimentChart = (history) => {
|
||||||
|
// 确保组件仍然挂载
|
||||||
|
if (!isComponentMounted.value) return;
|
||||||
|
|
||||||
if (!sentimentChartCanvas.value) return;
|
if (!sentimentChartCanvas.value) return;
|
||||||
const ctx = sentimentChartCanvas.value.getContext('2d');
|
const ctx = sentimentChartCanvas.value.getContext('2d');
|
||||||
const gradient = ctx.createLinearGradient(0, 0, 0, 120);
|
const gradient = ctx.createLinearGradient(0, 0, 0, 120);
|
||||||
@@ -126,6 +133,21 @@ watch(() => props.selectedContact, (newContact) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
|
// LIFECYCLE HOOKS
|
||||||
|
onMounted(() => {
|
||||||
|
isComponentMounted.value = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
isComponentMounted.value = false;
|
||||||
|
// 清理所有图表实例
|
||||||
|
Object.values(chartInstances).forEach(chart => {
|
||||||
|
if (chart) {
|
||||||
|
chart.destroy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
1144
my-vue-app/src/views/senorManger/components/GoodMusic.vue
Normal file
1144
my-vue-app/src/views/senorManger/components/GoodMusic.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -13,16 +13,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onBeforeUnmount } from 'vue'
|
import { ref, reactive, onMounted, onBeforeUnmount, watch, nextTick } from 'vue'
|
||||||
import Chart from 'chart.js/auto'
|
import Chart from 'chart.js/auto'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectedGroup: {
|
selectedGroup: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
teamSalesFunnel: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 组件状态跟踪
|
||||||
|
const isComponentMounted = ref(true)
|
||||||
|
|
||||||
// Chart.js 实例
|
// Chart.js 实例
|
||||||
const chartInstances = {}
|
const chartInstances = {}
|
||||||
|
|
||||||
@@ -35,6 +42,21 @@ const funnelData = reactive({
|
|||||||
data: [120, 90, 45, 18, 10],
|
data: [120, 90, 45, 18, 10],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 监听teamSalesFunnel变化并更新图表数据
|
||||||
|
watch(() => props.teamSalesFunnel, (newVal) => {
|
||||||
|
if (newVal && Object.keys(newVal).length > 0 && isComponentMounted.value) {
|
||||||
|
// 按照固定顺序提取数据
|
||||||
|
const order = ['线索', '加微', '到课', '定金', '成交']
|
||||||
|
funnelData.data = order.map(key => newVal[key] || 0)
|
||||||
|
// 确保在DOM更新后再更新图表
|
||||||
|
nextTick(() => {
|
||||||
|
if (isComponentMounted.value) {
|
||||||
|
renderPersonalFunnelChart()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, { deep: true })
|
||||||
|
|
||||||
// Chart.js: 创建或更新图表
|
// Chart.js: 创建或更新图表
|
||||||
const createOrUpdateChart = (chartId, canvasRef, config) => {
|
const createOrUpdateChart = (chartId, canvasRef, config) => {
|
||||||
if (chartInstances[chartId]) {
|
if (chartInstances[chartId]) {
|
||||||
@@ -72,10 +94,19 @@ const renderPersonalFunnelChart = () => {
|
|||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
renderPersonalFunnelChart()
|
isComponentMounted.value = true
|
||||||
|
// 处理初始传入的teamSalesFunnel数据
|
||||||
|
if (props.teamSalesFunnel && Object.keys(props.teamSalesFunnel).length > 0) {
|
||||||
|
const order = ['线索', '加微', '到课', '定金', '成交']
|
||||||
|
funnelData.data = order.map(key => props.teamSalesFunnel[key] || 0)
|
||||||
|
}
|
||||||
|
if (isComponentMounted.value) {
|
||||||
|
renderPersonalFunnelChart()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
isComponentMounted.value = false
|
||||||
Object.values(chartInstances).forEach(chart => chart.destroy())
|
Object.values(chartInstances).forEach(chart => chart.destroy())
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -120,7 +151,7 @@ $white: #ffffff;
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0px 20px 16px;
|
padding: 0px 20px 10px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
h3 {
|
h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -0,0 +1,445 @@
|
|||||||
|
<template>
|
||||||
|
<div class="performance-comparison">
|
||||||
|
<div class="comparison-header">
|
||||||
|
<h2>业绩周期对比</h2>
|
||||||
|
<div class="period-selector-wrapper">
|
||||||
|
<label for="period-select">对比周期:</label>
|
||||||
|
<select id="period-select" v-model="selectedPeriod" @change="fetchComparisonData" class="period-select">
|
||||||
|
<option value="last_week">与上周对比</option>
|
||||||
|
<option value="last_month">与上月对比</option>
|
||||||
|
<option value="last_quarter">与上季度对比</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="isLoading" class="loading-state">
|
||||||
|
<div class="loading-spinner"></div>
|
||||||
|
<p>正在加载对比数据...</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="!previousPeriodData" class="empty-state">
|
||||||
|
<p>暂无对比周期的数据。</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="comparison-table-wrapper">
|
||||||
|
<table class="comparison-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="metric-col">核心指标</th>
|
||||||
|
<th>本期数据</th>
|
||||||
|
<th>{{ selectedPeriodLabel }}数据</th>
|
||||||
|
<th class="change-col">变化情况</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="metric in comparedMetrics" :key="metric.key">
|
||||||
|
<td class="metric-col">
|
||||||
|
<span class="metric-label">{{ metric.label }}</span>
|
||||||
|
</td>
|
||||||
|
<td>{{ formatValue(metric.current, metric.unit) }}</td>
|
||||||
|
<td>{{ formatValue(metric.previous, metric.unit) }}</td>
|
||||||
|
<td class="change-col">
|
||||||
|
<div class="change-cell">
|
||||||
|
<span class="change-value" :class="getChangeClass(metric.change.trend)">
|
||||||
|
<span v-if="metric.change.trend === 'up'" class="trend-icon">↑</span>
|
||||||
|
<span v-if="metric.change.trend === 'down'" class="trend-icon">↓</span>
|
||||||
|
{{ metric.change.percentage }}
|
||||||
|
</span>
|
||||||
|
<span class="change-diff">{{ formatChange(metric.change.diff, metric.unit) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, onMounted, watch } from 'vue';
|
||||||
|
// 假设你有一个API服务来获取对比数据
|
||||||
|
// import { getPerformanceComparisonData } from '@/api/senorManger.js';
|
||||||
|
|
||||||
|
// **MODIFIED**: 更新模拟API以返回新的数据结构
|
||||||
|
const getPerformanceComparisonData = async (params) => {
|
||||||
|
console.log('模拟API请求 (新数据结构):', params);
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
let mockData;
|
||||||
|
if (params.period === 'last_week') {
|
||||||
|
mockData = {
|
||||||
|
"allocated_data_volume": 650,
|
||||||
|
"wechat_added_volume": 410,
|
||||||
|
"call_volume_after_classification": { "加微通话": 10, "20分钟通话": 50, "未分类": 150, "无效通话": 100, "促到课": 40 },
|
||||||
|
"call_avg_duration_after_classification": { "加微通话": 4.5, "20分钟通话": 15.0, "未分类": 1.5, "无效通话": 1.0, "促到课": 2.0 },
|
||||||
|
"deposit_volume": 40,
|
||||||
|
"transaction_volume": 52,
|
||||||
|
"conversion_rate": "8.00%"
|
||||||
|
};
|
||||||
|
} else if (params.period === 'last_month') {
|
||||||
|
mockData = {
|
||||||
|
"allocated_data_volume": 2800,
|
||||||
|
"wechat_added_volume": 1800,
|
||||||
|
"call_volume_after_classification": { "加微通话": 40, "20分钟通话": 220, "未分类": 600, "视频通话": 50, "无效通话": 450, "促到课": 180 },
|
||||||
|
"call_avg_duration_after_classification": { "加微通话": 5.0, "20分钟通话": 16.0, "未分类": 1.8, "视频通话": 6.0, "无效通话": 1.1, "促到课": 1.5 },
|
||||||
|
"deposit_volume": 180,
|
||||||
|
"transaction_volume": 230,
|
||||||
|
"conversion_rate": "8.21%"
|
||||||
|
};
|
||||||
|
} else { // last_quarter
|
||||||
|
mockData = {
|
||||||
|
"allocated_data_volume": 8500,
|
||||||
|
"wechat_added_volume": 5500,
|
||||||
|
"call_volume_after_classification": { "加微通话": 120, "20分钟通话": 650, "未分类": 1800, "视频通话": 150, "无效通话": 1200, "促到课": 500 },
|
||||||
|
"call_avg_duration_after_classification": { "加微通话": 4.8, "20分钟通话": 16.5, "未分类": 1.7, "视频通话": 5.5, "无效通话": 1.0, "促到课": 1.8 },
|
||||||
|
"deposit_volume": 550,
|
||||||
|
"transaction_volume": 700,
|
||||||
|
"conversion_rate": "8.24%"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
resolve({ code: 200, data: mockData });
|
||||||
|
}, 800);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
currentPeriodData: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const selectedPeriod = ref('last_month');
|
||||||
|
const previousPeriodData = ref(null);
|
||||||
|
const isLoading = ref(false);
|
||||||
|
|
||||||
|
const periodLabels = {
|
||||||
|
last_week: '上周',
|
||||||
|
last_month: '上月',
|
||||||
|
last_quarter: '上季度',
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectedPeriodLabel = computed(() => periodLabels[selectedPeriod.value]);
|
||||||
|
|
||||||
|
const fetchComparisonData = async () => {
|
||||||
|
isLoading.value = true;
|
||||||
|
try {
|
||||||
|
const res = await getPerformanceComparisonData({ period: selectedPeriod.value });
|
||||||
|
if (res.code === 200) {
|
||||||
|
previousPeriodData.value = res.data;
|
||||||
|
} else {
|
||||||
|
previousPeriodData.value = null;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取对比数据失败:', error);
|
||||||
|
previousPeriodData.value = null;
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchComparisonData();
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(() => props.currentPeriodData, () => {
|
||||||
|
fetchComparisonData();
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
// **NEW**: 新增一个工具函数,用于处理API返回的复杂数据结构
|
||||||
|
// 并将其转换为表格渲染所需的扁平化结构
|
||||||
|
const processRawData = (rawData) => {
|
||||||
|
if (!rawData) return null;
|
||||||
|
|
||||||
|
// 1. 计算通话总量
|
||||||
|
const totalCalls = Object.values(rawData.call_volume_after_classification || {})
|
||||||
|
.reduce((sum, count) => sum + count, 0);
|
||||||
|
|
||||||
|
// 2. 计算通话总时长 (分钟)
|
||||||
|
// 逻辑: (分类通话数 * 分类平均时长) 的总和
|
||||||
|
const callVolumes = rawData.call_volume_after_classification || {};
|
||||||
|
const avgDurations = rawData.call_avg_duration_after_classification || {};
|
||||||
|
const totalDurationInMinutes = Object.keys(callVolumes).reduce((sum, key) => {
|
||||||
|
const volume = callVolumes[key] || 0;
|
||||||
|
const avgDuration = avgDurations[key] || 0;
|
||||||
|
return sum + (volume * avgDuration);
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
// 3. 将转化率字符串 "7.98%" 转为数字 7.98
|
||||||
|
const conversionRateValue = parseFloat(rawData.conversion_rate) || 0;
|
||||||
|
|
||||||
|
// 4. 返回一个与旧版组件兼容的对象结构
|
||||||
|
return {
|
||||||
|
assignedLeads: rawData.allocated_data_volume,
|
||||||
|
wechatAdds: rawData.wechat_added_volume,
|
||||||
|
calls: totalCalls,
|
||||||
|
// 组件内部格式化时会除以60,因此这里需要乘以60,将分钟转为秒
|
||||||
|
callDuration: totalDurationInMinutes * 60,
|
||||||
|
deposits: rawData.deposit_volume,
|
||||||
|
deals: rawData.transaction_volume,
|
||||||
|
conversionRate: conversionRateValue,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const comparedMetrics = computed(() => {
|
||||||
|
// **MODIFIED**: 在计算前,先使用 processRawData 对数据进行处理
|
||||||
|
const processedCurrentData = processRawData(props.currentPeriodData);
|
||||||
|
const processedPreviousData = processRawData(previousPeriodData.value);
|
||||||
|
|
||||||
|
if (!processedCurrentData || !processedPreviousData) return [];
|
||||||
|
|
||||||
|
// 指标配置保持不变,因为数据已经被处理成它期望的格式
|
||||||
|
const metricsConfig = [
|
||||||
|
{ key: 'assignedLeads', label: '分配数据量', unit: '个' },
|
||||||
|
{ key: 'wechatAdds', label: '加微量', unit: '个' },
|
||||||
|
{ key: 'calls', label: '通话量', unit: '次' },
|
||||||
|
{ key: 'callDuration', label: '通话总时长', unit: '分钟' },
|
||||||
|
{ key: 'deposits', label: '定金量', unit: '单' },
|
||||||
|
{ key: 'deals', label: '成交量', unit: '单' },
|
||||||
|
{ key: 'conversionRate', label: '转化率', unit: '%' },
|
||||||
|
];
|
||||||
|
|
||||||
|
return metricsConfig.map(metric => {
|
||||||
|
const current = processedCurrentData[metric.key];
|
||||||
|
const previous = processedPreviousData[metric.key];
|
||||||
|
return {
|
||||||
|
...metric,
|
||||||
|
current,
|
||||||
|
previous,
|
||||||
|
change: calculateChange(current, previous),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const calculateChange = (current, previous) => {
|
||||||
|
if (previous === null || previous === undefined || isNaN(current) || isNaN(previous)) {
|
||||||
|
return { diff: 'N/A', percentage: 'N/A', trend: 'neutral' };
|
||||||
|
}
|
||||||
|
|
||||||
|
const diff = current - previous;
|
||||||
|
let percentage;
|
||||||
|
if (previous === 0) {
|
||||||
|
percentage = current > 0 ? '+100.0%' : '0.0%';
|
||||||
|
} else {
|
||||||
|
const percentageValue = (diff / previous) * 100;
|
||||||
|
percentage = `${percentageValue > 0 ? '+' : ''}${percentageValue.toFixed(1)}%`;
|
||||||
|
}
|
||||||
|
|
||||||
|
let trend = 'neutral';
|
||||||
|
if (diff > 0) trend = 'up';
|
||||||
|
if (diff < 0) trend = 'down';
|
||||||
|
|
||||||
|
return { diff, percentage, trend };
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatValue = (value, unit) => {
|
||||||
|
if (value === null || value === undefined) return '-';
|
||||||
|
if (unit === '分钟') {
|
||||||
|
// 假设传入的value是秒,转换为分钟显示
|
||||||
|
return `${Math.round(value / 60)} 分钟`;
|
||||||
|
}
|
||||||
|
if (unit === '%') {
|
||||||
|
return `${value.toFixed(1)}%`;
|
||||||
|
}
|
||||||
|
return value.toLocaleString();
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatChange = (diff, unit) => {
|
||||||
|
if (typeof diff !== 'number') return '';
|
||||||
|
const prefix = diff > 0 ? '+' : '-';
|
||||||
|
const absDiff = Math.abs(diff);
|
||||||
|
|
||||||
|
if (unit === '分钟') {
|
||||||
|
// 假设diff是秒,转换为分钟显示
|
||||||
|
return `${prefix}${Math.round(absDiff / 60)} 分钟`;
|
||||||
|
}
|
||||||
|
if (unit === '%') {
|
||||||
|
return `${prefix}${absDiff.toFixed(1)}%`;
|
||||||
|
}
|
||||||
|
return `${prefix}${absDiff.toLocaleString()}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getChangeClass = (trend) => {
|
||||||
|
if (trend === 'up') return 'positive';
|
||||||
|
if (trend === 'down') return 'negative';
|
||||||
|
return 'neutral';
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/* 样式部分无需改动,因此省略以保持简洁 */
|
||||||
|
.performance-comparison {
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 2rem;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comparison-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid #f1f5f9;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1a202c;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.period-selector-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
|
||||||
|
label {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: #718096;
|
||||||
|
}
|
||||||
|
|
||||||
|
.period-select {
|
||||||
|
padding: 0.6rem 1rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid #cbd5e0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: #a0aec0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: #4299e1;
|
||||||
|
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.comparison-table-wrapper {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comparison-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
padding: 1rem 1.25rem;
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
thead th {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #718096;
|
||||||
|
font-weight: 600;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background-color: #f7fafc;
|
||||||
|
border-bottom: 2px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr {
|
||||||
|
transition: background-color 0.15s ease-in-out;
|
||||||
|
&:nth-child(odd) {
|
||||||
|
background-color: #fdfdff;
|
||||||
|
}
|
||||||
|
&:not(:last-child) {
|
||||||
|
border-bottom: 1px solid #f1f5f9;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background-color: #f0f5ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody td {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
color: #2d3748;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-col {
|
||||||
|
min-width: 150px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-col {
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-cell {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.25rem;
|
||||||
|
|
||||||
|
.change-value {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.35rem;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0.25rem 0.6rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
|
||||||
|
&.positive {
|
||||||
|
background-color: #ecfdf5;
|
||||||
|
color: #065f46;
|
||||||
|
}
|
||||||
|
&.negative {
|
||||||
|
background-color: #fff1f2;
|
||||||
|
color: #9f1239;
|
||||||
|
}
|
||||||
|
&.neutral {
|
||||||
|
background-color: #f8fafc;
|
||||||
|
color: #475569;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trend-icon {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-diff {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #718096;
|
||||||
|
margin-left: 0.25rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.loading-state, .empty-state {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 4rem;
|
||||||
|
color: #a0aec0;
|
||||||
|
font-size: 1rem;
|
||||||
|
background-color: #f7fafc;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
.loading-spinner {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border: 4px solid #e2e8f0;
|
||||||
|
border-top: 4px solid #4299e1;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
0% { transform: rotate(0deg); }
|
||||||
|
100% { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -87,7 +87,7 @@ $white: #ffffff;
|
|||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 26rem !important;
|
height: 21.5rem !important;
|
||||||
max-height: 26rem;
|
max-height: 26rem;
|
||||||
// flex: 1;
|
// flex: 1;
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ $white: #ffffff;
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 16px;
|
padding: 10px 20px 10px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
|||||||
@@ -5,35 +5,35 @@
|
|||||||
<div class="stat-icon customer-rate">
|
<div class="stat-icon customer-rate">
|
||||||
<i class="el-icon-chat-dot-round"></i>
|
<i class="el-icon-chat-dot-round"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-value">{{ customerCommunicationRate.active_customer_communication_rate||0 }}</div>
|
<div class="kpi-value">{{ (customerCommunicationRate && customerCommunicationRate.active_customer_communication_rate) || 0 }}</div>
|
||||||
<p>活跃客户沟通率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'customerCommunicationRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
<p>活跃客户沟通率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'customerCommunicationRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-item stat-item">
|
<div class="kpi-item stat-item">
|
||||||
<div class="stat-icon response-time">
|
<div class="stat-icon response-time">
|
||||||
<i class="el-icon-timer"></i>
|
<i class="el-icon-timer"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-value">{{ averageResponseTime.average_answer_time||0 }}<span class="kpi-unit">分钟</span></div>
|
<div class="kpi-value">{{ (averageResponseTime && averageResponseTime.average_answer_time)||0 }}<span class="kpi-unit">分钟</span></div>
|
||||||
<p>平均应答时间 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'averageResponseTime')" @mouseleave="hideTooltip">ⓘ</i></p>
|
<p>平均应答时间 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'averageResponseTime')" @mouseleave="hideTooltip">ⓘ</i></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-item stat-item">
|
<div class="kpi-item stat-item">
|
||||||
<div class="stat-icon timeout-rate">
|
<div class="stat-icon timeout-rate">
|
||||||
<i class="el-icon-warning"></i>
|
<i class="el-icon-warning"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-value">{{ timeoutResponseRate.timeout_rate||0 }}</div>
|
<div class="kpi-value">{{ (timeoutResponseRate && timeoutResponseRate.timeout_rate)||0 }}</div>
|
||||||
<p>超时应答率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'timeoutResponseRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
<p>超时应答率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'timeoutResponseRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-item stat-item">
|
<div class="kpi-item stat-item">
|
||||||
<div class="stat-icon severe-timeout-rate">
|
<div class="stat-icon severe-timeout-rate">
|
||||||
<i class="el-icon-warning-outline"></i>
|
<i class="el-icon-warning-outline"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-value">{{ timeoutResponseRate.serious_timeout_rate||0 }}</div>
|
<div class="kpi-value">{{ (timeoutResponseRate && timeoutResponseRate.serious_timeout_rate)||0 }}</div>
|
||||||
<p>严重超时应答率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'severeTimeoutRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
<p>严重超时应答率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'severeTimeoutRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-item stat-item">
|
<div class="kpi-item stat-item">
|
||||||
<div class="stat-icon form-rate">
|
<div class="stat-icon form-rate">
|
||||||
<i class="el-icon-document"></i>
|
<i class="el-icon-document"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="kpi-value">{{ formCompletionRate.table_filling_rate||0 }}</div>
|
<div class="kpi-value">{{ (formCompletionRate && formCompletionRate.table_filling_rate)||0 }}</div>
|
||||||
<p>表格填写率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'formCompletionRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
<p>表格填写率 <i class="el-icon-warning info-icon" @mouseenter="showTooltip($event, 'formCompletionRate')" @mouseleave="hideTooltip">ⓘ</i></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,24 +53,24 @@ import Tooltip from '@/components/Tooltip.vue';
|
|||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
customerCommunicationRate: {
|
customerCommunicationRate: {
|
||||||
type: Number,
|
type: Object,
|
||||||
default: 0
|
default: () => ({})
|
||||||
},
|
},
|
||||||
averageResponseTime: {
|
averageResponseTime: {
|
||||||
type: Number,
|
type: Object,
|
||||||
default: 0
|
default: () => ({})
|
||||||
},
|
},
|
||||||
timeoutResponseRate: {
|
timeoutResponseRate: {
|
||||||
type: Number,
|
type: Object,
|
||||||
default: 0
|
default: () => ({})
|
||||||
},
|
},
|
||||||
severeTimeoutRate: {
|
severeTimeoutRate: {
|
||||||
type: Number,
|
type: Object,
|
||||||
default: 0
|
default: () => ({})
|
||||||
},
|
},
|
||||||
formCompletionRate: {
|
formCompletionRate: {
|
||||||
type: Number,
|
type: Object,
|
||||||
default: 0
|
default: () => ({})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,42 @@
|
|||||||
|
|
||||||
<div v-if="!isRouteNavigation">
|
<div v-if="!isRouteNavigation">
|
||||||
<!-- 用户下拉菜单 -->
|
<!-- 用户下拉菜单 -->
|
||||||
<UserDropdown
|
<div style="display: flex; align-items: center; gap: 20px;">
|
||||||
class="header-ringht"
|
<button @click="showDepartmentAnalysisModal" class="feedback-btn">部门分析</button>
|
||||||
style="margin-left: auto;"
|
<button @click="showFeedbackFormModal" class="feedback-btn">意见反馈</button>
|
||||||
:card-visibility="cardVisibility"
|
<FeedbackForm
|
||||||
@update-card-visibility="updateCardVisibility"
|
:is-visible="showFeedbackForm"
|
||||||
/>
|
@close="closeFeedbackFormModal"
|
||||||
|
@submit-feedback="closeFeedbackFormModal"
|
||||||
|
/>
|
||||||
|
<!-- 部门分析弹窗 -->
|
||||||
|
<div v-if="showDepartmentAnalysis" class="department-analysis-modal" @click.self="closeDepartmentAnalysisModal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3>部门分析</h3>
|
||||||
|
<button class="close-btn" @click="closeDepartmentAnalysisModal">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div v-if="departmentAnalysisData && departmentAnalysisData.length > 0">
|
||||||
|
<div v-for="(report, index) in departmentAnalysisData" :key="index" class="report-item">
|
||||||
|
<h4>报告时间: {{ report.start_time }} 至 {{ report.end_time }}</h4>
|
||||||
|
<div v-if="report.report && report.report !== 'None' && report.report.trim() !== ''" class="report-content" v-html="formatReportContent(report.report)"></div>
|
||||||
|
<div v-else class="no-report">
|
||||||
|
<p>暂无分析报告</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p>暂无部门分析数据</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<UserDropdown
|
||||||
|
:card-visibility="cardVisibility"
|
||||||
|
@update-card-visibility="updateCardVisibility"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +77,12 @@
|
|||||||
@update-check-type="updateCheckType"
|
@update-check-type="updateCheckType"
|
||||||
/>
|
/>
|
||||||
<div v-if="cardVisibility.teamAlerts" class="action-items-compact">
|
<div v-if="cardVisibility.teamAlerts" class="action-items-compact">
|
||||||
<TeamAlerts style="height: 300px;" :abnormalData="teamAlerts" />
|
<!-- <TeamAlerts style="height: 300px;" :abnormalData="teamAlerts" /> -->
|
||||||
|
<div v-if="cardVisibility.problemRanking" class="problem-ranking">
|
||||||
|
<!-- 客户迫切解决的问题 -->
|
||||||
|
<ProblemRanking :problemRanking="problemRanking" />
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<StatisticalIndicators
|
<StatisticalIndicators
|
||||||
@@ -58,20 +93,22 @@
|
|||||||
:severeTimeoutRate="statisticalIndicators.severeTimeoutRate"
|
:severeTimeoutRate="statisticalIndicators.severeTimeoutRate"
|
||||||
:formCompletionRate="statisticalIndicators.formCompletionRate"
|
:formCompletionRate="statisticalIndicators.formCompletionRate"
|
||||||
/>
|
/>
|
||||||
|
<!-- 新增:业绩周期对比组件 -->
|
||||||
|
<div v-if="false" class="performance-comparison-section">
|
||||||
|
<PerformanceComparison :current-period-data="currentPeriodMetrics" />
|
||||||
|
</div>
|
||||||
<!-- Bottom Section -->
|
<!-- Bottom Section -->
|
||||||
<div class="bottom-section">
|
<div class="bottom-section">
|
||||||
<!-- Left Section - Group Performance Ranking -->
|
<!-- Left Section - Group Performance Ranking -->
|
||||||
<div v-if="cardVisibility.groupRanking" class="left-section">
|
<div v-if="cardVisibility.groupRanking" class="left-section">
|
||||||
<GroupRanking
|
<GroupRanking
|
||||||
:groups="groups"
|
:groups="groups"
|
||||||
|
:teamSalesFunnel="teamSalesFunnel"
|
||||||
:selected-group="selectedGroup"
|
:selected-group="selectedGroup"
|
||||||
@select-group="selectGroup"
|
@select-group="selectGroup"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="cardVisibility.problemRanking" class="problem-ranking">
|
<GoodMusic style="height: 300px;" :qualityCalls="excellentRecord" />
|
||||||
<!-- 客户迫切解决的问题 -->
|
|
||||||
<ProblemRanking :problemRanking="problemRanking" />
|
|
||||||
</div>
|
|
||||||
<!-- Right Section - Group Comparison -->
|
<!-- Right Section - Group Comparison -->
|
||||||
<div v-if="cardVisibility.groupComparison" class="right-section">
|
<div v-if="cardVisibility.groupComparison" class="right-section">
|
||||||
<GroupComparison
|
<GroupComparison
|
||||||
@@ -82,6 +119,9 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Team Members Detail Section -->
|
<!-- Team Members Detail Section -->
|
||||||
<div class="team-detail-section" v-if="selectedGroup && cardVisibility.teamDetail">
|
<div class="team-detail-section" v-if="selectedGroup && cardVisibility.teamDetail">
|
||||||
<!-- 团队详情加载状态 -->
|
<!-- 团队详情加载状态 -->
|
||||||
@@ -92,7 +132,8 @@
|
|||||||
<!-- 团队详情内容 -->
|
<!-- 团队详情内容 -->
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="team-detail-header">
|
<div class="team-detail-header">
|
||||||
<h2>{{ selectedGroup.name }} - 团队成员详情</h2>
|
<div>
|
||||||
|
<h2>{{ selectedGroup.name }} - 团队成员详情</h2>
|
||||||
<div class="team-summary">
|
<div class="team-summary">
|
||||||
<div class="summary-item">
|
<div class="summary-item">
|
||||||
<span class="label">组长:</span>
|
<span class="label">组长:</span>
|
||||||
@@ -111,6 +152,35 @@
|
|||||||
<span class="value">{{ selectedGroup.conversionRate }}%</span>
|
<span class="value">{{ selectedGroup.conversionRate }}%</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="group-performance">
|
||||||
|
<button @click="showTeamAnalysisModal">团队整体分析</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 团队分析弹窗 -->
|
||||||
|
<div v-if="showTeamAnalysis" class="team-analysis-modal" @click.self="closeTeamAnalysisModal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3>团队整体分析</h3>
|
||||||
|
<button class="close-btn" @click="closeTeamAnalysisModal">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div v-if="teamAnalysisData && teamAnalysisData.length > 0">
|
||||||
|
<div v-for="(report, index) in teamAnalysisData" :key="index" class="report-item">
|
||||||
|
<h4>报告时间: {{ report.start_time }} 至 {{ report.end_time }}</h4>
|
||||||
|
<div v-if="report.report && report.report !== 'None' && report.report.trim() !== ''" class="report-content" v-html="formatReportContent(report.report)"></div>
|
||||||
|
<div v-else class="no-report">
|
||||||
|
<p>暂无分析报告</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p>暂无团队分析数据</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="members-grid">
|
<div class="members-grid">
|
||||||
@@ -181,23 +251,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted, computed, reactive } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { computed, reactive } from 'vue'
|
|
||||||
import Tooltip from '@/components/Tooltip.vue'
|
import Tooltip from '@/components/Tooltip.vue'
|
||||||
import CenterOverview from './components/CenterOverview.vue'
|
import CenterOverview from './components/CenterOverview.vue'
|
||||||
import GroupComparison from './components/GroupComparison.vue'
|
import GroupComparison from './components/GroupComparison.vue'
|
||||||
import GroupRanking from './components/GroupRanking.vue'
|
import GroupRanking from './components/GroupRanking.vue'
|
||||||
|
import GoodMusic from './components/GoodMusic.vue'
|
||||||
import TeamAlerts from '../maneger/components/TeamAlerts.vue'
|
import TeamAlerts from '../maneger/components/TeamAlerts.vue'
|
||||||
import ProblemRanking from './components/ProblemRanking.vue'
|
import ProblemRanking from './components/ProblemRanking.vue'
|
||||||
import StatisticalIndicators from './components/StatisticalIndicators.vue'
|
import StatisticalIndicators from './components/StatisticalIndicators.vue'
|
||||||
import UserDropdown from '@/components/UserDropdown.vue'
|
import UserDropdown from '@/components/UserDropdown.vue'
|
||||||
import Loading from '@/components/Loading.vue'
|
import Loading from '@/components/Loading.vue'
|
||||||
|
import PerformanceComparison from './components/PerformanceComparison.vue'; // 1. 导入新组件
|
||||||
import { getOverallTeamPerformance,getTotalGroupCount,getConversionRate,getTotalCallCount,
|
import { getOverallTeamPerformance,getTotalGroupCount,getConversionRate,getTotalCallCount,
|
||||||
getNewCustomer,getDepositConversionRate,getActiveCustomerCommunicationRate,getAverageAnswerTime,
|
getNewCustomer,getDepositConversionRate,getActiveCustomerCommunicationRate,getAverageAnswerTime,
|
||||||
getTimeoutRate,getTableFillingRate,getUrgentNeedToAddress,getTeamRanking,getTeamRankingInfo,getAbnormalResponseRate } from '@/api/senorManger.js'
|
getTimeoutRate,getTableFillingRate,getUrgentNeedToAddress,getTeamRanking,getTeamRankingInfo,
|
||||||
|
getAbnormalResponseRate,getTeamSalesFunnel,getExcellentRecordFile,getTeamEveryGroupReport,
|
||||||
|
getTeamEntiretyReport } from '@/api/senorManger.js'
|
||||||
import { useUserStore } from '@/stores/user.js'
|
import { useUserStore } from '@/stores/user.js'
|
||||||
|
import FeedbackForm from "@/components/FeedbackForm.vue";
|
||||||
|
|
||||||
// 缓存系统
|
// 缓存系统
|
||||||
const cache = new Map()
|
const cache = new Map()
|
||||||
@@ -233,7 +306,6 @@ const withCache = async (functionName, apiCall, params = {}) => {
|
|||||||
return cachedData
|
return cachedData
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`调用API获取数据: ${functionName}`, params)
|
|
||||||
const result = await apiCall()
|
const result = await apiCall()
|
||||||
setCache(cacheKey, result)
|
setCache(cacheKey, result)
|
||||||
return result
|
return result
|
||||||
@@ -245,6 +317,25 @@ const clearCache = () => {
|
|||||||
console.log('所有缓存已清除')
|
console.log('所有缓存已清除')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 优秀录音
|
||||||
|
const excellentRecord = ref([]);
|
||||||
|
async function CenterExcellentRecord() {
|
||||||
|
const params={
|
||||||
|
user_level:userStore.userInfo.user_level.toString(),
|
||||||
|
user_name:userStore.userInfo.username
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const cacheKey = getCacheKey('CenterExcellentRecord', params);
|
||||||
|
const result = await withCache(cacheKey, async () => {
|
||||||
|
const res = await getExcellentRecordFile(params);
|
||||||
|
return res.data;
|
||||||
|
});
|
||||||
|
excellentRecord.value = result;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("获取优秀录音失败:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const clearSpecificCache = (functionName, params = {}) => {
|
const clearSpecificCache = (functionName, params = {}) => {
|
||||||
const cacheKey = getCacheKey(functionName, params)
|
const cacheKey = getCacheKey(functionName, params)
|
||||||
cache.delete(cacheKey)
|
cache.delete(cacheKey)
|
||||||
@@ -280,19 +371,19 @@ const forceRefreshAllData = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
await fetchOverallTeamPerformance()
|
fetchOverallTeamPerformance()
|
||||||
await fetchActiveGroups()
|
fetchActiveGroups()
|
||||||
await fetchConversionRate()
|
fetchConversionRate()
|
||||||
await fetchTotalCallCount()
|
fetchTotalCallCount()
|
||||||
await fetchNewCustomers()
|
fetchNewCustomers()
|
||||||
await fetchDepositConversions()
|
fetchDepositConversions()
|
||||||
await fetchAbnormalResponseRate()
|
fetchAbnormalResponseRate()
|
||||||
await fetchCustomerCommunicationRate()
|
fetchCustomerCommunicationRate()
|
||||||
await fetchAverageResponseTime()
|
fetchAverageResponseTime()
|
||||||
await fetchTimeoutRate()
|
fetchTimeoutRate()
|
||||||
await fetchTableFillingRate()
|
fetchTableFillingRate()
|
||||||
await fetchUrgentNeedToAddress()
|
fetchUrgentNeedToAddress()
|
||||||
await fetchTeamRanking()
|
fetchTeamRanking()
|
||||||
console.log('所有数据已强制刷新完成')
|
console.log('所有数据已强制刷新完成')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('强制刷新数据失败:', error)
|
console.error('强制刷新数据失败:', error)
|
||||||
@@ -307,6 +398,16 @@ const timeoutResponseRate = ref(5)
|
|||||||
const severeTimeoutRate = ref(2)
|
const severeTimeoutRate = ref(2)
|
||||||
const formCompletionRate = ref(90)
|
const formCompletionRate = ref(90)
|
||||||
const CheckType = ref('month')
|
const CheckType = ref('month')
|
||||||
|
// FeedbackForm 控制变量
|
||||||
|
const showFeedbackForm = ref(false)
|
||||||
|
// 部门分析弹窗控制变量
|
||||||
|
const showDepartmentAnalysis = ref(false)
|
||||||
|
// 团队分析弹窗控制变量
|
||||||
|
const showTeamAnalysis = ref(false)
|
||||||
|
// 团队分析数据
|
||||||
|
const teamAnalysisData = ref([])
|
||||||
|
// 部门分析数据
|
||||||
|
const departmentAnalysisData = ref([])
|
||||||
|
|
||||||
// 更新CheckType的方法
|
// 更新CheckType的方法
|
||||||
const updateCheckType = async (newValue) => {
|
const updateCheckType = async (newValue) => {
|
||||||
@@ -318,6 +419,99 @@ const updateCheckType = async (newValue) => {
|
|||||||
console.log('数据已根据新的统计模式重新加载')
|
console.log('数据已根据新的统计模式重新加载')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FeedbackForm 控制方法
|
||||||
|
const showFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 部门分析弹窗控制方法
|
||||||
|
const showDepartmentAnalysisModal = async () => {
|
||||||
|
showDepartmentAnalysis.value = true
|
||||||
|
// 获取部门分析数据
|
||||||
|
try {
|
||||||
|
// 获取当前登录的高级经理信息
|
||||||
|
const currentUser = userStore.userInfo;
|
||||||
|
const params = {
|
||||||
|
user_name: currentUser.username,
|
||||||
|
user_level: currentUser.user_level.toString(),
|
||||||
|
part_count: 1 // 默认获取最近1份报告
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await getTeamEntiretyReport(params)
|
||||||
|
|
||||||
|
// 根据API响应结构调整数据处理逻辑
|
||||||
|
if (response.data) {
|
||||||
|
if (Array.isArray(response.data)) {
|
||||||
|
// 如果response.data本身就是数组
|
||||||
|
departmentAnalysisData.value = response.data
|
||||||
|
} else if (response.data.data && Array.isArray(response.data.data)) {
|
||||||
|
// 如果response.data.data是数组
|
||||||
|
departmentAnalysisData.value = response.data.data
|
||||||
|
} else {
|
||||||
|
// 其他情况,可能是单个对象
|
||||||
|
departmentAnalysisData.value = [response.data]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取部门分析数据失败:', error)
|
||||||
|
departmentAnalysisData.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeDepartmentAnalysisModal = () => {
|
||||||
|
showDepartmentAnalysis.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团队分析弹窗控制方法
|
||||||
|
const showTeamAnalysisModal = async () => {
|
||||||
|
showTeamAnalysis.value = true
|
||||||
|
// 获取团队分析数据
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
department_name: selectedGroup.value.name + '-' + selectedGroup.value.leader,
|
||||||
|
part_count: 1 // 默认获取最近1份报告
|
||||||
|
}
|
||||||
|
const response = await getTeamEveryGroupReport(params)
|
||||||
|
// 根据API响应结构调整数据处理逻辑
|
||||||
|
if (response.data) {
|
||||||
|
if (Array.isArray(response.data)) {
|
||||||
|
// 如果response.data本身就是数组
|
||||||
|
teamAnalysisData.value = response.data
|
||||||
|
} else if (response.data.data && Array.isArray(response.data.data)) {
|
||||||
|
// 如果response.data.data是数组
|
||||||
|
teamAnalysisData.value = response.data.data
|
||||||
|
} else {
|
||||||
|
// 其他情况,可能是单个对象
|
||||||
|
teamAnalysisData.value = [response.data]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取团队分析数据失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeTeamAnalysisModal = () => {
|
||||||
|
showTeamAnalysis.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 格式化报告内容
|
||||||
|
const formatReportContent = (content) => {
|
||||||
|
if (!content) return ''
|
||||||
|
// 将Markdown格式的标题转换为HTML标签
|
||||||
|
return content
|
||||||
|
.replace(/### (.*?)(?=\n|$)/g, '<h3>$1</h3>')
|
||||||
|
.replace(/## (.*?)(?=\n|$)/g, '<h2>$1</h2>')
|
||||||
|
.replace(/# (.*?)(?=\n|$)/g, '<h1>$1</h1>')
|
||||||
|
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
||||||
|
.replace(/\*(.*?)\*/g, '<em>$1</em>')
|
||||||
|
.replace(/\n\n/g, '</p><p>')
|
||||||
|
.replace(/\n/g, '<br>')
|
||||||
|
}
|
||||||
|
|
||||||
// 卡片显示状态
|
// 卡片显示状态
|
||||||
const cardVisibility = ref({
|
const cardVisibility = ref({
|
||||||
centerOverview: true,
|
centerOverview: true,
|
||||||
@@ -326,7 +520,8 @@ const cardVisibility = ref({
|
|||||||
groupRanking: true,
|
groupRanking: true,
|
||||||
problemRanking: true,
|
problemRanking: true,
|
||||||
groupComparison: true,
|
groupComparison: true,
|
||||||
teamDetail: true
|
teamDetail: true,
|
||||||
|
performanceComparison: true, // 2. 新增组件的可见性控制
|
||||||
})
|
})
|
||||||
|
|
||||||
// 更新卡片显示状态
|
// 更新卡片显示状态
|
||||||
@@ -421,7 +616,6 @@ async function fetchActiveGroups() {
|
|||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
overallTeamPerformance.value.activeGroups = response.data
|
overallTeamPerformance.value.activeGroups = response.data
|
||||||
console.log('活跃组数:', response.data)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取活跃组数失败:', error)
|
console.error('获取活跃组数失败:', error)
|
||||||
}
|
}
|
||||||
@@ -502,20 +696,34 @@ async function fetchDepositConversions() {
|
|||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
overallTeamPerformance.value.depositConversions = response.data
|
overallTeamPerformance.value.depositConversions = response.data
|
||||||
console.log(99888999,response.data)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取定金转化失败:', error)
|
console.error('获取定金转化失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const statisticalIndicators = ref({
|
const statisticalIndicators = ref({
|
||||||
customerCommunicationRate: 0,
|
customerCommunicationRate: {},
|
||||||
averageResponseTime: 0,
|
averageResponseTime: {},
|
||||||
timeoutResponseRate: 0,
|
timeoutResponseRate: {},
|
||||||
severeTimeoutRate: 0,
|
severeTimeoutRate: {},
|
||||||
formCompletionRate: 0,
|
formCompletionRate: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 销售漏斗
|
||||||
|
const teamSalesFunnel = ref({})
|
||||||
|
async function GetTeamSalesFunnel() {
|
||||||
|
const params = getRequestParams()
|
||||||
|
const hasParams = params.user_name
|
||||||
|
const requestParams = hasParams ? {
|
||||||
|
...params,
|
||||||
|
check_type: CheckType.value
|
||||||
|
} : {check_type: CheckType.value}
|
||||||
|
const res = await getTeamSalesFunnel(requestParams)
|
||||||
|
if (res.code === 200) {
|
||||||
|
teamSalesFunnel.value = res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 团队异常
|
// 团队异常
|
||||||
const teamAlerts = ref({})
|
const teamAlerts = ref({})
|
||||||
// 异常预警
|
// 异常预警
|
||||||
@@ -530,33 +738,30 @@ async function fetchAbnormalResponseRate() {
|
|||||||
() => getAbnormalResponseRate(hasParams ? params : undefined),
|
() => getAbnormalResponseRate(hasParams ? params : undefined),
|
||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
const rawData = response.data
|
const rawData = response.data || {} // 添加默认值防止null访问
|
||||||
|
|
||||||
// 转换数据格式,按团队分组生成预警消息
|
|
||||||
const processedAlerts = []
|
const processedAlerts = []
|
||||||
const teamData = new Map()
|
const teamData = new Map()
|
||||||
|
|
||||||
// 收集严重超时异常数据
|
// 添加安全检查防止访问null属性
|
||||||
if (rawData.team_serious_timeout_abnormal_counts_by_group) {
|
if (rawData.team_serious_timeout_abnormal_counts_by_group) {
|
||||||
Object.entries(rawData.team_serious_timeout_abnormal_counts_by_group).forEach(([teamName, data]) => {
|
Object.entries(rawData.team_serious_timeout_abnormal_counts_by_group).forEach(([teamName, data]) => {
|
||||||
if (!teamData.has(teamName)) {
|
if (!teamData.has(teamName)) {
|
||||||
teamData.set(teamName, { timeoutCount: 0, fillingCount: 0 })
|
teamData.set(teamName, { timeoutCount: 0, fillingCount: 0 })
|
||||||
}
|
}
|
||||||
teamData.get(teamName).timeoutCount = data.count
|
teamData.get(teamName).timeoutCount = data.count || 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 收集表格填写异常数据
|
|
||||||
if (rawData.team_table_filling_abnormal_counts_by_group) {
|
if (rawData.team_table_filling_abnormal_counts_by_group) {
|
||||||
Object.entries(rawData.team_table_filling_abnormal_counts_by_group).forEach(([teamName, data]) => {
|
Object.entries(rawData.team_table_filling_abnormal_counts_by_group).forEach(([teamName, data]) => {
|
||||||
if (!teamData.has(teamName)) {
|
if (!teamData.has(teamName)) {
|
||||||
teamData.set(teamName, { timeoutCount: 0, fillingCount: 0 })
|
teamData.set(teamName, { timeoutCount: 0, fillingCount: 0 })
|
||||||
}
|
}
|
||||||
teamData.get(teamName).fillingCount = data.count
|
teamData.get(teamName).fillingCount = data.count || 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成按团队分组的预警消息
|
|
||||||
let alertId = 1
|
let alertId = 1
|
||||||
teamData.forEach((counts, teamName) => {
|
teamData.forEach((counts, teamName) => {
|
||||||
const messages = []
|
const messages = []
|
||||||
@@ -577,7 +782,6 @@ async function fetchAbnormalResponseRate() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 设置处理后的数据
|
|
||||||
teamAlerts.value = { processedAlerts }
|
teamAlerts.value = { processedAlerts }
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -596,9 +800,12 @@ async function fetchCustomerCommunicationRate() {
|
|||||||
() => getActiveCustomerCommunicationRate(hasParams ? params : undefined),
|
() => getActiveCustomerCommunicationRate(hasParams ? params : undefined),
|
||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
statisticalIndicators.value.customerCommunicationRate = response.data
|
// 确保响应数据不为null
|
||||||
|
statisticalIndicators.value.customerCommunicationRate = response.data || {}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取活跃客户沟通率失败:', error)
|
console.error('获取活跃客户沟通率失败:', error)
|
||||||
|
// 出错时设置为空对象
|
||||||
|
statisticalIndicators.value.customerCommunicationRate = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 统计指标--平均应答时间
|
// 统计指标--平均应答时间
|
||||||
@@ -613,9 +820,12 @@ async function fetchAverageResponseTime() {
|
|||||||
() => getAverageAnswerTime(hasParams ? params : undefined),
|
() => getAverageAnswerTime(hasParams ? params : undefined),
|
||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
statisticalIndicators.value.averageResponseTime = response.data
|
// 确保响应数据不为null
|
||||||
|
statisticalIndicators.value.averageResponseTime = response.data || {}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取平均应答时间失败:', error)
|
console.error('获取平均应答时间失败:', error)
|
||||||
|
// 出错时设置为空对象
|
||||||
|
statisticalIndicators.value.averageResponseTime = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 统计指标--超时应答率、严重超时应答率
|
// 统计指标--超时应答率、严重超时应答率
|
||||||
@@ -630,9 +840,15 @@ async function fetchTimeoutRate() {
|
|||||||
() => getTimeoutRate(hasParams ? params : undefined),
|
() => getTimeoutRate(hasParams ? params : undefined),
|
||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
statisticalIndicators.value.timeoutResponseRate = response.data
|
// 确保响应数据不为null
|
||||||
|
statisticalIndicators.value.timeoutResponseRate = response.data || {}
|
||||||
|
// severeTimeoutRate使用相同的数据源
|
||||||
|
statisticalIndicators.value.severeTimeoutRate = response.data || {}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取超时应答率失败:', error)
|
console.error('获取超时应答率失败:', error)
|
||||||
|
// 出错时设置为空对象
|
||||||
|
statisticalIndicators.value.timeoutResponseRate = {}
|
||||||
|
statisticalIndicators.value.severeTimeoutRate = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 统计指标--表格填写率
|
// 统计指标--表格填写率
|
||||||
@@ -647,9 +863,12 @@ async function fetchTableFillingRate() {
|
|||||||
() => getTableFillingRate(hasParams ? params : undefined),
|
() => getTableFillingRate(hasParams ? params : undefined),
|
||||||
requestParams
|
requestParams
|
||||||
)
|
)
|
||||||
statisticalIndicators.value.formCompletionRate = response.data
|
// 确保响应数据不为null
|
||||||
|
statisticalIndicators.value.formCompletionRate = response.data || {}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取表格填写率失败:', error)
|
console.error('获取表格填写率失败:', error)
|
||||||
|
// 出错时设置为空对象
|
||||||
|
statisticalIndicators.value.formCompletionRate = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const problemRanking = ref({})
|
const problemRanking = ref({})
|
||||||
@@ -724,6 +943,7 @@ onMounted(async ()=>{
|
|||||||
await fetchOverallTeamPerformance()
|
await fetchOverallTeamPerformance()
|
||||||
await fetchActiveGroups()
|
await fetchActiveGroups()
|
||||||
await fetchConversionRate()
|
await fetchConversionRate()
|
||||||
|
await GetTeamSalesFunnel()
|
||||||
await fetchTotalCallCount()
|
await fetchTotalCallCount()
|
||||||
await fetchNewCustomers()
|
await fetchNewCustomers()
|
||||||
await fetchDepositConversions()
|
await fetchDepositConversions()
|
||||||
@@ -734,11 +954,10 @@ onMounted(async ()=>{
|
|||||||
await fetchTableFillingRate()
|
await fetchTableFillingRate()
|
||||||
await fetchUrgentNeedToAddress()
|
await fetchUrgentNeedToAddress()
|
||||||
await fetchTeamRanking()
|
await fetchTeamRanking()
|
||||||
|
await CenterExcellentRecord()
|
||||||
|
|
||||||
// 输出缓存信息
|
|
||||||
console.log('缓存状态:', getCacheInfo())
|
console.log('缓存状态:', getCacheInfo())
|
||||||
|
|
||||||
// 开发环境下暴露缓存管理函数到全局
|
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
window.seniorManagerCache = {
|
window.seniorManagerCache = {
|
||||||
clearCache,
|
clearCache,
|
||||||
@@ -756,6 +975,19 @@ onMounted(async ()=>{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 3. 新增计算属性,为新组件聚合本期数据
|
||||||
|
const currentPeriodMetrics = computed(() => {
|
||||||
|
return {
|
||||||
|
assignedLeads: overallTeamPerformance.value.newCustomers?.count_this_period || 0,
|
||||||
|
wechatAdds: teamSalesFunnel.value?.['加微'] || 0,
|
||||||
|
calls: overallTeamPerformance.value.totalCalls?.count_this_period || 0,
|
||||||
|
callDuration: 12580, // 假设数据来自API,这里使用模拟值
|
||||||
|
deposits: teamSalesFunnel.value?.['定金'] || 0,
|
||||||
|
deals: teamSalesFunnel.value?.['成交'] || 0,
|
||||||
|
conversionRate: parseFloat(overallTeamPerformance.value.conversionRate?.conversion_rate_this_period) || 0,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// 组别数据
|
// 组别数据
|
||||||
const groups=[]
|
const groups=[]
|
||||||
// 当前选中的组别,默认为第一个
|
// 当前选中的组别,默认为第一个
|
||||||
@@ -765,14 +997,10 @@ const selectedGroup = ref(groups[0])
|
|||||||
const selectGroup = async (group) => {
|
const selectGroup = async (group) => {
|
||||||
console.log('选择的组别:', group)
|
console.log('选择的组别:', group)
|
||||||
selectedGroup.value = group
|
selectedGroup.value = group
|
||||||
// 获取部门名称并调用团队业绩详情接口
|
|
||||||
// 从teamRanking数据中查找对应的原始部门名称
|
|
||||||
let department = group.name
|
let department = group.name
|
||||||
if (teamRanking.value && teamRanking.value.formal_plural) {
|
if (teamRanking.value && teamRanking.value.formal_plural) {
|
||||||
// 在formal_plural中查找匹配的部门名称
|
|
||||||
const departmentKeys = Object.keys(teamRanking.value.formal_plural)
|
const departmentKeys = Object.keys(teamRanking.value.formal_plural)
|
||||||
const matchedDepartment = departmentKeys.find(key => {
|
const matchedDepartment = departmentKeys.find(key => {
|
||||||
// 提取部门名称的主要部分进行匹配
|
|
||||||
const mainName = key.split('-')[0] || key
|
const mainName = key.split('-')[0] || key
|
||||||
return group.name.includes(mainName) || mainName.includes(group.name)
|
return group.name.includes(mainName) || mainName.includes(group.name)
|
||||||
})
|
})
|
||||||
@@ -782,7 +1010,6 @@ const selectGroup = async (group) => {
|
|||||||
}
|
}
|
||||||
console.log('选中的部门:', group.name, '-> 发送的部门名称:', department)
|
console.log('选中的部门:', group.name, '-> 发送的部门名称:', department)
|
||||||
|
|
||||||
// 设置团队详情加载状态
|
|
||||||
isTeamDetailLoading.value = true
|
isTeamDetailLoading.value = true
|
||||||
try {
|
try {
|
||||||
await fetchTeamPerformanceDetail(department)
|
await fetchTeamPerformanceDetail(department)
|
||||||
@@ -796,8 +1023,6 @@ const selectGroup = async (group) => {
|
|||||||
// 处理团队双击事件
|
// 处理团队双击事件
|
||||||
const handleTeamDoubleClick = (group) => {
|
const handleTeamDoubleClick = (group) => {
|
||||||
console.log('团队双击事件触发,团队数据:', group)
|
console.log('团队双击事件触发,团队数据:', group)
|
||||||
|
|
||||||
// 跳转到manager页面,携带团队负责人和用户等级
|
|
||||||
router.push({
|
router.push({
|
||||||
path: '/manager',
|
path: '/manager',
|
||||||
query: {
|
query: {
|
||||||
@@ -810,12 +1035,9 @@ const handleTeamDoubleClick = (group) => {
|
|||||||
// 处理成员双击事件
|
// 处理成员双击事件
|
||||||
const handleMemberDoubleClick = (member) => {
|
const handleMemberDoubleClick = (member) => {
|
||||||
console.log('双击事件触发,成员数据:', member)
|
console.log('双击事件触发,成员数据:', member)
|
||||||
|
|
||||||
// 将成员等级写死为1,所有成员都可以跳转
|
|
||||||
const memberLevel = 1
|
const memberLevel = 1
|
||||||
console.log('等级设置为1,准备跳转到Sale页面')
|
console.log('等级设置为1,准备跳转到Sale页面')
|
||||||
|
|
||||||
// 跳转到Sale页面,携带成员姓名和等级
|
|
||||||
router.push({
|
router.push({
|
||||||
name: 'Sale',
|
name: 'Sale',
|
||||||
query: {
|
query: {
|
||||||
@@ -850,7 +1072,6 @@ const getStatusText = (status) => {
|
|||||||
return statusMap[status] || '未知'
|
return statusMap[status] || '未知'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 工具提示状态
|
// 工具提示状态
|
||||||
const tooltip = reactive({
|
const tooltip = reactive({
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -960,7 +1181,6 @@ const hideTooltip = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.action-items-compact {
|
.action-items-compact {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@@ -1080,12 +1300,19 @@ const hideTooltip = () => {
|
|||||||
|
|
||||||
.team-detail-header {
|
.team-detail-header {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #1e293b;
|
color: #1e293b;
|
||||||
margin: 0 0 1rem 0;
|
margin: 0;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.team-summary {
|
.team-summary {
|
||||||
@@ -1111,6 +1338,32 @@ const hideTooltip = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.group-performance {
|
||||||
|
button {
|
||||||
|
background-color: #3b82f6;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
height: fit-content;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #2563eb;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.members-grid {
|
.members-grid {
|
||||||
@@ -1490,4 +1743,215 @@ const hideTooltip = () => {
|
|||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 意见反馈按钮样式
|
||||||
|
.feedback-btn {
|
||||||
|
background-color: #4299e1;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-btn:hover {
|
||||||
|
background-color: #3182ce;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 部门分析弹窗样式 */
|
||||||
|
.department-analysis-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
width: 80%;
|
||||||
|
max-width: 600px;
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 1rem;
|
||||||
|
border-bottom: 1px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
color: #1a202c;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #718096;
|
||||||
|
padding: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-btn:hover {
|
||||||
|
color: #1a202c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body p {
|
||||||
|
margin: 0;
|
||||||
|
color: #4a5568;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 团队分析弹窗样式 */
|
||||||
|
.team-analysis-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-content {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
width: 80%;
|
||||||
|
max-width: 600px;
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 1rem;
|
||||||
|
border-bottom: 1px solid #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
color: #1a202c;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .close-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #718096;
|
||||||
|
padding: 0;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .close-btn:hover {
|
||||||
|
color: #1a202c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-body {
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .modal-body p {
|
||||||
|
margin: 0;
|
||||||
|
color: #4a5568;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-item {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #f8fafc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-item h4 {
|
||||||
|
margin-top: 0;
|
||||||
|
color: #1a202c;
|
||||||
|
border-bottom: 1px solid #e2e8f0;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content {
|
||||||
|
margin-top: 10px;
|
||||||
|
color: #4a5568;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content h1,
|
||||||
|
.team-analysis-modal .report-content h2,
|
||||||
|
.team-analysis-modal .report-content h3 {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #1a202c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content h2 {
|
||||||
|
font-size: 1.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content h3 {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .report-content em {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-analysis-modal .no-report {
|
||||||
|
text-align: center;
|
||||||
|
color: #718096;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
:class="{ active: selectedRecording === index }"
|
:class="{ active: selectedRecording === index }"
|
||||||
@click="selectRecording(index)"
|
@click="selectRecording(index)"
|
||||||
>
|
>
|
||||||
|
<span class="recording-index">{{ recording.score}}</span>
|
||||||
<div class="recording-info">
|
<div class="recording-info">
|
||||||
<div class="recording-name" :title="recording.name">{{ recording.name.length > 10 ? recording.name.substring(0, 10) + '...' : recording.name }}</div>
|
<div class="recording-name" :title="recording.name">{{ recording.name.length > 10 ? recording.name.substring(0, 10) + '...' : recording.name }}</div>
|
||||||
<div class="recording-meta">
|
<div class="recording-meta">
|
||||||
@@ -172,8 +173,8 @@ import MarkdownIt from 'markdown-it'
|
|||||||
// Props定义
|
// Props定义
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
qualityCalls: {
|
qualityCalls: {
|
||||||
type: Object,
|
type: Array,
|
||||||
default: () => ({})
|
default: () => []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -221,24 +222,22 @@ const recordings = computed(() => {
|
|||||||
if (!props.qualityCalls ) {
|
if (!props.qualityCalls ) {
|
||||||
return staticRecordings.value;
|
return staticRecordings.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
const recordingsList = [];
|
const recordingsList = [];
|
||||||
Object.keys(props.qualityCalls).forEach(userName => {
|
props.qualityCalls.forEach((record, index) => {
|
||||||
props.qualityCalls[userName].forEach((record, index) => {
|
|
||||||
recordingsList.push({
|
recordingsList.push({
|
||||||
id: recordingsList.length + 1,
|
id: recordingsList.length + 1,
|
||||||
name: record.obj_file_name ? record.obj_file_name.split('/').pop() : `${record.sale_name}-录音-${index + 1}`,
|
name: record.record_name ? record.record_name : `${record.sale_name}-录音-${index + 1}`,
|
||||||
date: new Date().toISOString().split('T')[0],
|
date: new Date().toISOString().split('T')[0],
|
||||||
url: record.obj_file_name,
|
url: record.record_file_addr,
|
||||||
transcription: record.context || null,
|
transcription: record.record_context || null,
|
||||||
score: record.score,
|
score: record.record_score,
|
||||||
sop: record.sop,
|
sop: record.record_report,
|
||||||
sale_name: record.sale_name,
|
sale_name: record.record_name,
|
||||||
size: 2048576, // 默认文件大小 2MB
|
size: 2048576, // 默认文件大小 2MB
|
||||||
uploadTime: new Date().toLocaleDateString('zh-CN')
|
uploadTime: record.created_at,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
return recordingsList;
|
return recordingsList;
|
||||||
})
|
})
|
||||||
@@ -512,7 +511,7 @@ const downloadRecording = (index) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 0;
|
padding: 10px 20px 0;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,7 +548,7 @@ const downloadRecording = (index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chart-content {
|
.chart-content {
|
||||||
padding: 20px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recording-section {
|
.recording-section {
|
||||||
@@ -562,7 +561,6 @@ const downloadRecording = (index) => {
|
|||||||
.recording-list {
|
.recording-list {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.recording-item {
|
.recording-item {
|
||||||
@@ -602,6 +600,39 @@ const downloadRecording = (index) => {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recording-index {
|
||||||
|
/* 基础分数样式 */
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
background-color: #e9ecef;
|
||||||
|
color: #495057;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第一名样式 */
|
||||||
|
.recording-item:first-child .recording-index {
|
||||||
|
background: linear-gradient(135deg, #FFD700, #FFA500);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第二名样式 */
|
||||||
|
.recording-item:nth-child(2) .recording-index {
|
||||||
|
background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第三名样式 */
|
||||||
|
.recording-item:nth-child(3) .recording-index {
|
||||||
|
background: linear-gradient(135deg, #CD7F32, #A0522D);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.recording-meta {
|
.recording-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|||||||
@@ -4,10 +4,18 @@
|
|||||||
<div class="dashboard-header">
|
<div class="dashboard-header">
|
||||||
<h1>管理者数据看板</h1>
|
<h1>管理者数据看板</h1>
|
||||||
<!-- 头像 -->
|
<!-- 头像 -->
|
||||||
<UserDropdown
|
<div style="display: flex; align-items: center; gap: 20px;">
|
||||||
:card-visibility="cardVisibility"
|
<button @click="showFeedbackFormModal" class="feedback-btn">意见反馈</button>
|
||||||
@update-card-visibility="updateCardVisibility"
|
<FeedbackForm
|
||||||
/>
|
:is-visible="showFeedbackForm"
|
||||||
|
@close="closeFeedbackFormModal"
|
||||||
|
@submit-feedback="closeFeedbackFormModal"
|
||||||
|
/>
|
||||||
|
<UserDropdown
|
||||||
|
:card-visibility="cardVisibility"
|
||||||
|
@update-card-visibility="updateCardVisibility"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 第一行:核心业绩指标、销售实时进度 -->
|
<!-- 第一行:核心业绩指标、销售实时进度 -->
|
||||||
@@ -111,6 +119,7 @@ import PeriodStage from "./components/PeriodStage.vue";
|
|||||||
import { getOverallCompanyPerformance,getCompanyDepositConversionRate,getCompanyTotalCallCount,getCompanyNewCustomer,getCompanyConversionRate,getCompanyRealTimeProgress
|
import { getOverallCompanyPerformance,getCompanyDepositConversionRate,getCompanyTotalCallCount,getCompanyNewCustomer,getCompanyConversionRate,getCompanyRealTimeProgress
|
||||||
,getCompanyConversionRateVsLast,getSalesMonthlyPerformance,getCustomerTypeDistribution,getUrgentNeedToAddress,getLevelTree,getDetailedDataTable,getExcellentRecordFile } from "@/api/top";
|
,getCompanyConversionRateVsLast,getSalesMonthlyPerformance,getCustomerTypeDistribution,getUrgentNeedToAddress,getLevelTree,getDetailedDataTable,getExcellentRecordFile } from "@/api/top";
|
||||||
import { useUserStore } from "@/stores/user.js";
|
import { useUserStore } from "@/stores/user.js";
|
||||||
|
import FeedbackForm from "@/components/FeedbackForm.vue";
|
||||||
|
|
||||||
// 缓存系统
|
// 缓存系统
|
||||||
const cache = new Map();
|
const cache = new Map();
|
||||||
@@ -236,6 +245,18 @@ const cardVisibility = ref({
|
|||||||
detailedDataTable: true
|
detailedDataTable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// FeedbackForm 控制变量
|
||||||
|
const showFeedbackForm = ref(false);
|
||||||
|
|
||||||
|
// FeedbackForm 控制方法
|
||||||
|
const showFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeFeedbackFormModal = () => {
|
||||||
|
showFeedbackForm.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
// 更新卡片显示状态
|
// 更新卡片显示状态
|
||||||
const updateCardVisibility = (newVisibility) => {
|
const updateCardVisibility = (newVisibility) => {
|
||||||
Object.assign(cardVisibility.value, newVisibility);
|
Object.assign(cardVisibility.value, newVisibility);
|
||||||
@@ -504,7 +525,6 @@ async function getConversionComparison(data) {
|
|||||||
const res = await getCompanyConversionRateVsLast(params);
|
const res = await getCompanyConversionRateVsLast(params);
|
||||||
return res.data;
|
return res.data;
|
||||||
});
|
});
|
||||||
console.log(111111,result);
|
|
||||||
conversionComparison.value = result;
|
conversionComparison.value = result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取转化对比失败:", error);
|
console.error("获取转化对比失败:", error);
|
||||||
@@ -644,7 +664,7 @@ const handleFilterChange = (filterParams) => {
|
|||||||
getDetailData(filterParams)
|
getDetailData(filterParams)
|
||||||
}
|
}
|
||||||
// 优秀录音
|
// 优秀录音
|
||||||
const excellentRecord = ref({});
|
const excellentRecord = ref([]);
|
||||||
async function CenterExcellentRecord() {
|
async function CenterExcellentRecord() {
|
||||||
const params={
|
const params={
|
||||||
user_level:userStore.userInfo.user_level.toString(),
|
user_level:userStore.userInfo.user_level.toString(),
|
||||||
@@ -654,10 +674,9 @@ const params={
|
|||||||
const cacheKey = getCacheKey('CenterExcellentRecord', params);
|
const cacheKey = getCacheKey('CenterExcellentRecord', params);
|
||||||
const result = await withCache(cacheKey, async () => {
|
const result = await withCache(cacheKey, async () => {
|
||||||
const res = await getExcellentRecordFile(params);
|
const res = await getExcellentRecordFile(params);
|
||||||
return res.data.excellent_record_list;
|
return res.data;
|
||||||
});
|
});
|
||||||
excellentRecord.value = result;
|
excellentRecord.value = result;
|
||||||
console.log(111111,result);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取优秀录音失败:", error);
|
console.error("获取优秀录音失败:", error);
|
||||||
}
|
}
|
||||||
@@ -666,16 +685,16 @@ onMounted(async() => {
|
|||||||
// 页面初始化逻辑
|
// 页面初始化逻辑
|
||||||
console.log('页面初始化,开始加载数据...');
|
console.log('页面初始化,开始加载数据...');
|
||||||
|
|
||||||
await getRealTimeProgress()
|
getRealTimeProgress()
|
||||||
await getTotalDeals()
|
getTotalDeals()
|
||||||
await getConversionComparison('month')
|
getConversionComparison('month')
|
||||||
await getCompanySalesRank('red')
|
getCompanySalesRank('red')
|
||||||
await getCustomerTypeRatio('child_education')
|
getCustomerTypeRatio('child_education')
|
||||||
await getCustomerUrgency()
|
getCustomerUrgency()
|
||||||
await CusotomGetLevelTree()
|
CusotomGetLevelTree()
|
||||||
await getDetailData()
|
getDetailData()
|
||||||
await CenterExcellentRecord()
|
CenterExcellentRecord()
|
||||||
|
|
||||||
// 输出缓存状态信息
|
// 输出缓存状态信息
|
||||||
const cacheInfo = getCacheInfo();
|
const cacheInfo = getCacheInfo();
|
||||||
console.log('数据加载完成,缓存状态:', cacheInfo);
|
console.log('数据加载完成,缓存状态:', cacheInfo);
|
||||||
@@ -2164,4 +2183,20 @@ button {
|
|||||||
-ms-user-select: text;
|
-ms-user-select: text;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 意见反馈按钮样式 */
|
||||||
|
.feedback-btn {
|
||||||
|
background-color: #4299e1;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-btn:hover {
|
||||||
|
background-color: #3182ce;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user