From 10fb9dd4f2dd8438b3b52885d7c735ef40dfa3e2 Mon Sep 17 00:00:00 2001
From: lbw_9527443 <780139497@qq.com>
Date: Thu, 23 Oct 2025 10:47:29 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E9=94=80=E5=94=AE=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E7=BA=BF):=20=E6=B7=BB=E5=8A=A0=E5=85=A8=E9=83=A8=E5=BD=95?=
=?UTF-8?q?=E9=9F=B3=E6=8C=89=E9=92=AE=E5=8F=8A=E5=A4=84=E7=90=86=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
新增全部录音按钮并实现其点击事件处理逻辑,同时将API端点从本地地址改为生产环境地址。处理函数结构与未归属录音类似,但调用不同的API接口获取数据。
---
.../components/SalesTimelineWithTaskList.vue | 64 ++++++++++++++++++-
1 file changed, 62 insertions(+), 2 deletions(-)
diff --git a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue
index ee5dfc1..946b6f3 100644
--- a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue
+++ b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue
@@ -6,7 +6,8 @@
客户转化全流程跟踪
-
+
+
@@ -432,7 +433,66 @@ const handleUnassignedRecordingsClick = async () => {
// 优先使用路由参数,其次是 Pinia store 中的用户信息,最后是备用值
const user_name = routeParams.user_name || userStore.userInfo?.username || 'example_user';
- const response = await axios.post('http://192.168.15.121:8890/api/v1/sales_timeline/get_sale_unassigned_call_info', {
+ const response = await axios.post('https://mldash.nycjy.cn/api/v1/sales_timeline/get_sale_unassigned_call_info', {
+ user_name: user_name
+ });
+
+ console.log('API Response:', response.data.data);
+
+ // --- 数据处理逻辑,以支持分类 ---
+ const apiData = response.data.data;
+ const tempCategorizedData = {}; // 临时对象
+ let uniqueId = 0;
+
+ for (const category in apiData) {
+ if (Object.prototype.hasOwnProperty.call(apiData, category)) {
+ const categoryData = apiData[category];
+ tempCategorizedData[category] = []; // 为每个分类创建一个空数组
+
+ if (categoryData && Array.isArray(categoryData.records)) {
+ categoryData.records.forEach(record => {
+ tempCategorizedData[category].push({ // 将记录添加到对应的分类数组中
+ id: uniqueId++,
+ name: `录音 ${uniqueId}`,
+ time: new Date(record.record_create_time).toLocaleString('zh-CN'),
+ type: record.record_tag,
+ downloadUrl: record.record_file_addr,
+ duration: record.call_duration ? `${record.call_duration} 分钟` : '未知',
+ score: record.score || '暂无',
+ details: record.report_content || '暂无详细报告内容。'
+ });
+ });
+ }
+ }
+ }
+
+ // 更新状态
+ categorizedRecordings.value = tempCategorizedData;
+ recordingCategories.value = Object.keys(tempCategorizedData);
+ // 默认选中第一个Tab
+ if (recordingCategories.value.length > 0) {
+ selectedCategory.value = recordingCategories.value[0];
+ } else {
+ selectedCategory.value = null;
+ }
+
+ showUnassignedRecordingsModal.value = true;
+ } catch (error) {
+ console.error('API请求失败:', error);
+ alert('获取录音列表失败,请稍后再试。');
+ }
+};
+
+// --- 新增:处理全部录音按钮点击事件 ---
+const handleAllRecordingsClick = async () => {
+ try {
+ const userStore = useUserStore();
+ const routeParams = getRequestParams(); // 获取路由参数
+
+ // 优先使用路由参数,其次是 Pinia store 中的用户信息,最后是备用值
+ const user_name = routeParams.user_name || userStore.userInfo?.username || 'example_user';
+
+ const response = await axios.post('https://mldash.nycjy.cn/api/v1/sales_timeline/get_sale_all_call_info', {
user_name: user_name
});